Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ from langchain.memory.buffer import ConversationBufferMemory
|
|
23 |
|
24 |
|
25 |
HUGGINGFACEHUB_API_TOKEN = os.environ.get("HUGGINGFACEHUB_API_TOKEN")
|
26 |
-
BOOKING_ID = r'\b[A-Z]{6}\d{6}\b'
|
27 |
BOOKING_KEYWORDS = [
|
28 |
"booking",
|
29 |
"bestillingsnummer",
|
@@ -41,19 +41,19 @@ BOOKING_KEYWORDS = [
|
|
41 |
"identyfikacyjny pลatnoลci"
|
42 |
]
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
Chat History: {chat_history}
|
51 |
Question: {question}
|
52 |
Answer:
|
53 |
"""
|
54 |
-
|
55 |
-
input_variables=["chat_history", "question"],
|
56 |
-
template=
|
57 |
)
|
58 |
|
59 |
api_url_template = """
|
@@ -101,7 +101,7 @@ def setup_multiple_chains():
|
|
101 |
return_messages=True,
|
102 |
)
|
103 |
llm_chain = LLMChain(llm=llm,
|
104 |
-
prompt=
|
105 |
memory=conversation_memory
|
106 |
)
|
107 |
|
|
|
23 |
|
24 |
|
25 |
HUGGINGFACEHUB_API_TOKEN = os.environ.get("HUGGINGFACEHUB_API_TOKEN")
|
26 |
+
BOOKING_ID = re.compile(r'\b[A-Z]{6}\d{6}\b')
|
27 |
BOOKING_KEYWORDS = [
|
28 |
"booking",
|
29 |
"bestillingsnummer",
|
|
|
41 |
"identyfikacyjny pลatnoลci"
|
42 |
]
|
43 |
|
44 |
+
|
45 |
+
daysoff_assistant_template = """
|
46 |
+
You are a customer support assistant for Daysoff named "Agrippa". Your expertise is in retrieving
|
47 |
+
booking details for a given booking ID and answering questions about
|
48 |
+
Daysoff's personvernspolicy and firmahytteordning. You do not provide information outside of this
|
49 |
+
scope. By default, you respond in Norwegian language.
|
50 |
Chat History: {chat_history}
|
51 |
Question: {question}
|
52 |
Answer:
|
53 |
"""
|
54 |
+
daysoff_assistant_prompt= PromptTemplate(
|
55 |
+
input_variables=["chat_history", "question"],
|
56 |
+
template=daysoff_assistant_template
|
57 |
)
|
58 |
|
59 |
api_url_template = """
|
|
|
101 |
return_messages=True,
|
102 |
)
|
103 |
llm_chain = LLMChain(llm=llm,
|
104 |
+
prompt=daysoff_assistant_prompt,
|
105 |
memory=conversation_memory
|
106 |
)
|
107 |
|