camparchimedes commited on
Commit
84273a3
·
verified ·
1 Parent(s): 352cce7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -4
app.py CHANGED
@@ -11,7 +11,7 @@ import json
11
 
12
  import chainlit as cl
13
 
14
- from pydantic import BaseModel, ConfigDict
15
 
16
  from langchain import hub
17
  from langchain_openai import OpenAI
@@ -35,11 +35,12 @@ OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
35
  #instruction_text_priv: str = instruction_text_priv
36
  #personvernspolicy_data: dict = personvernspolicy_data
37
 
38
- faq_combined = f"{instruction_text_faq}\n\n{faq}"
39
- privacy_combined = f"{instruction_text_priv}\n\n{personvernspolicy_data}"
40
 
41
  # {faq_combined}, {privacy_combined}
42
- daysoff_assistant_template = """
 
43
  You are a customer support assistant (’kundeservice AI assistent’) for Daysoff.
44
  By default, you respond in Norwegian language, using a warm, direct, and professional tone.
45
  Your expertise is exclusively in retrieving booking information for a given booking id and answering
@@ -55,6 +56,21 @@ Chat History: {chat_history}
55
  Question: {question}
56
  Answer:
57
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  daysoff_assistant_prompt = PromptTemplate(
59
  input_variables=['chat_history', 'question'],
60
  template=daysoff_assistant_template
 
11
 
12
  import chainlit as cl
13
 
14
+ 3from pydantic import BaseModel, ConfigDict
15
 
16
  from langchain import hub
17
  from langchain_openai import OpenAI
 
35
  #instruction_text_priv: str = instruction_text_priv
36
  #personvernspolicy_data: dict = personvernspolicy_data
37
 
38
+ #faq_combined = f"{instruction_text_faq}\n\n{faq}"
39
+ #privacy_combined = f"{instruction_text_priv}\n\n{personvernspolicy_data}"
40
 
41
  # {faq_combined}, {privacy_combined}
42
+ """
43
+ daysoff_assistant_template =
44
  You are a customer support assistant (’kundeservice AI assistent’) for Daysoff.
45
  By default, you respond in Norwegian language, using a warm, direct, and professional tone.
46
  Your expertise is exclusively in retrieving booking information for a given booking id and answering
 
56
  Question: {question}
57
  Answer:
58
  """
59
+
60
+
61
+
62
+ daysoff_assistant_template = """
63
+ #You are a customer support assistant (’kundeservice AI assistent’) for Daysoff.
64
+ By default, you respond in Norwegian language, using a warm, direct, and professional tone.
65
+ Your expertise is exclusively in retrieving booking information for a given booking ID assistance related to
66
+ to this.
67
+ You do not provide information outside of this scope. If a question is not about this topic, respond with
68
+ "Jeg driver faktisk kun med henvendelser omkring bestillingsinformasjon. Gjelder det andre henvendelser
69
+ må du nok kontakte kundeservice på [email protected]😊"
70
+ Chat History: {chat_history}
71
+ Question: {question}
72
+ Answer:
73
+ """
74
  daysoff_assistant_prompt = PromptTemplate(
75
  input_variables=['chat_history', 'question'],
76
  template=daysoff_assistant_template