camparchimedes commited on
Commit
0dc2f2a
ยท
verified ยท
1 Parent(s): c80f584

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -45,22 +45,23 @@ Question: {question}
45
  api_url_prompt = PromptTemplate(input_variables=['api_docs', 'question'],
46
  template=api_url_template)
47
 
48
- api_response_template = """"
49
  With the API Documentation for Daysoff's official API: {api_docs}
50
  and the specific user question: {question} in mind,
51
- and given this API URL: {base_url} for querying, here is the
52
- response from Daysoff's API: {response}.
53
  Please provide user with their booking information,
54
  focusing on delivering the answer with clarity and conciseness,
55
  as if a human customer service agent is providing this information.
56
  Adapt to user's language. By default, you speak Norwegian.
57
- Booking information:
58
  """
59
- api_response_prompt = PromptTemplate(input_variables=['question',
60
- 'api_docs',
61
- 'base_url',
62
- 'response'],
63
- template=api_response_template)
 
64
 
65
  @cl.on_chat_start
66
  def setup_multiple_chains():
@@ -91,7 +92,9 @@ def setup_multiple_chains():
91
  api_url_prompt=api_url_prompt,
92
  api_response_prompt=api_response_prompt,
93
  verbose=True,
94
- limit_to_domains=None)
 
 
95
 
96
  cl.user_session.set("api_chain", api_chain)
97
 
 
45
  api_url_prompt = PromptTemplate(input_variables=['api_docs', 'question'],
46
  template=api_url_template)
47
 
48
+ api_response_template = """
49
  With the API Documentation for Daysoff's official API: {api_docs}
50
  and the specific user question: {question} in mind,
51
+ and given this API URL: {api_url} for querying, here is the
52
+ response from Daysoff's API: {api_response}.
53
  Please provide user with their booking information,
54
  focusing on delivering the answer with clarity and conciseness,
55
  as if a human customer service agent is providing this information.
56
  Adapt to user's language. By default, you speak Norwegian.
57
+ Booking Info:
58
  """
59
+
60
+ api_response_prompt = PromptTemplate(
61
+ input_variables=['api_docs', 'question', 'api_url', 'api_response'],
62
+ template=api_response_template
63
+ )
64
+
65
 
66
  @cl.on_chat_start
67
  def setup_multiple_chains():
 
92
  api_url_prompt=api_url_prompt,
93
  api_response_prompt=api_response_prompt,
94
  verbose=True,
95
+ limit_to_domains=None
96
+ )
97
+
98
 
99
  cl.user_session.set("api_chain", api_chain)
100