Spaces:
Paused
Paused
Commit
·
47fd3ad
1
Parent(s):
f681159
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,14 +24,13 @@ openai.api_key = os.environ.get("OPENAI_KEY")
|
|
| 24 |
# Set up the LangChain
|
| 25 |
|
| 26 |
template = """Answer the question based on the context below.
|
| 27 |
-
|
| 28 |
Context: You are Lisa, a loyal helpful service agent, appointed for SuperFoods Petcare Company.
|
| 29 |
-
Your goal ask one question at a time and provide a friendly conversational responses to the customer.
|
| 30 |
For Product Complaint: Ask questions about the product they have purchased, when they bought it, what issue occured with it.
|
| 31 |
For Returns: Ask for the cause of return, if not asked aready, then tell him about the 10-day return policy, after which it's non-returnable.
|
| 32 |
For Refunds: Ask about the product issues and the mode of refund he wants, clarify him the refunds will happen within 2-3 business days.
|
| 33 |
A case for will be created for all scenarios, and the caller will be notified over Email or WhatsApp.
|
| 34 |
-
Do not answer anything outside your role, and apologize for any unknown questions.
|
| 35 |
|
| 36 |
Past Conversations: {chat_history}
|
| 37 |
Human: {input}
|
|
@@ -47,20 +46,20 @@ prompt = PromptTemplate(
|
|
| 47 |
llm35 = ChatOpenAI(
|
| 48 |
temperature=0,
|
| 49 |
model_name='gpt-3.5-turbo',
|
| 50 |
-
max_tokens=
|
| 51 |
)
|
| 52 |
|
| 53 |
llm30 = OpenAI(
|
| 54 |
temperature=0,
|
| 55 |
max_tokens=256,
|
| 56 |
-
frequency_penalty=
|
| 57 |
)
|
| 58 |
|
| 59 |
memory = ConversationBufferMemory(memory_key="chat_history")
|
| 60 |
|
| 61 |
conversations = ConversationChain(
|
| 62 |
prompt=prompt,
|
| 63 |
-
llm=
|
| 64 |
memory=memory,
|
| 65 |
verbose=False
|
| 66 |
)
|
|
|
|
| 24 |
# Set up the LangChain
|
| 25 |
|
| 26 |
template = """Answer the question based on the context below.
|
|
|
|
| 27 |
Context: You are Lisa, a loyal helpful service agent, appointed for SuperFoods Petcare Company.
|
| 28 |
+
Your goal is to ask one question at a time and provide a friendly conversational responses to the customer.
|
| 29 |
For Product Complaint: Ask questions about the product they have purchased, when they bought it, what issue occured with it.
|
| 30 |
For Returns: Ask for the cause of return, if not asked aready, then tell him about the 10-day return policy, after which it's non-returnable.
|
| 31 |
For Refunds: Ask about the product issues and the mode of refund he wants, clarify him the refunds will happen within 2-3 business days.
|
| 32 |
A case for will be created for all scenarios, and the caller will be notified over Email or WhatsApp.
|
| 33 |
+
Do not answer anything outside your role or context, and apologize for any unknown questions.
|
| 34 |
|
| 35 |
Past Conversations: {chat_history}
|
| 36 |
Human: {input}
|
|
|
|
| 46 |
llm35 = ChatOpenAI(
|
| 47 |
temperature=0,
|
| 48 |
model_name='gpt-3.5-turbo',
|
| 49 |
+
max_tokens=256
|
| 50 |
)
|
| 51 |
|
| 52 |
llm30 = OpenAI(
|
| 53 |
temperature=0,
|
| 54 |
max_tokens=256,
|
| 55 |
+
frequency_penalty=0
|
| 56 |
)
|
| 57 |
|
| 58 |
memory = ConversationBufferMemory(memory_key="chat_history")
|
| 59 |
|
| 60 |
conversations = ConversationChain(
|
| 61 |
prompt=prompt,
|
| 62 |
+
llm=llm35,
|
| 63 |
memory=memory,
|
| 64 |
verbose=False
|
| 65 |
)
|