camparchimedes commited on
Commit
f74d64c
ยท
verified ยท
1 Parent(s): 0975922

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
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
- daysoff_assistant_system_template = """
45
- You are an AI customer support assistant for Daysoff. By default,
46
- you respond in Norwegian to {question}. In all other cases,
47
- adapt to user's language and respond accordingly.
48
- You can retrieve booking information for a given booking ID as well as
49
- inform on Daysoff's personvernspolicy and verticals."
50
  Chat History: {chat_history}
51
  Question: {question}
52
  Answer:
53
  """
54
- daysoff_assistant_system_prompt= PromptTemplate(
55
- input_variables=["chat_history", "question"],
56
- template=daysoff_assistant_system_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=daysoff_assistant_system_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