Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,8 @@ from langchain_core.prompts import PromptTemplate
|
|
18 |
from langchain.memory.buffer import ConversationBufferMemory
|
19 |
|
20 |
from api_docs_mck import api_docs_str
|
|
|
|
|
21 |
|
22 |
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
|
23 |
|
@@ -63,10 +65,8 @@ PERSONVERNSPOLICY_QUESTIONS = [
|
|
63 |
daysoff_assistant_template = """
|
64 |
You are a customer support assistant (โkundeservice AI assistentโ) for Daysoff.no
|
65 |
By default, you respond in Norwegian language, using a warm, direct and professional tone.
|
66 |
-
You
|
67 |
-
|
68 |
-
questions related to the company's privacy policy (personvernspolicy), and answering frequently
|
69 |
-
asked questions about DaysOff's firmahytteordning.
|
70 |
Chat History: {chat_history}
|
71 |
Question: {question}
|
72 |
Answer:
|
@@ -160,7 +160,7 @@ async def handle_message(message: cl.Message):
|
|
160 |
},
|
161 |
callbacks=[cl.AsyncLangchainCallbackHandler()])
|
162 |
|
163 |
-
elif any(keyword in user_message for keyword in (
|
164 |
|
165 |
response = await api_chain.acall(user_message,
|
166 |
callbacks=[cl.AsyncLangchainCallbackHandler()])
|
|
|
18 |
from langchain.memory.buffer import ConversationBufferMemory
|
19 |
|
20 |
from api_docs_mck import api_docs_str
|
21 |
+
from faq_data import ansatte_faq_data, utleiere_faq_data
|
22 |
+
from personvernspolicy.py import personvernspolicy_data
|
23 |
|
24 |
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
|
25 |
|
|
|
65 |
daysoff_assistant_template = """
|
66 |
You are a customer support assistant (โkundeservice AI assistentโ) for Daysoff.no
|
67 |
By default, you respond in Norwegian language, using a warm, direct and professional tone.
|
68 |
+
You can look up booking information for a booking ID (bestillingskode)
|
69 |
+
and answer frequently-asked-questions about Daysoff'
|
|
|
|
|
70 |
Chat History: {chat_history}
|
71 |
Question: {question}
|
72 |
Answer:
|
|
|
160 |
},
|
161 |
callbacks=[cl.AsyncLangchainCallbackHandler()])
|
162 |
|
163 |
+
elif any(keyword in user_message for keyword in (["personvernspolicy_data", "ansatte_faq_data", "utleiere_faq_data"])):
|
164 |
|
165 |
response = await api_chain.acall(user_message,
|
166 |
callbacks=[cl.AsyncLangchainCallbackHandler()])
|