Update app.py
Browse files
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: {
|
52 |
-
response from Daysoff's API: {
|
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
|
58 |
"""
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
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 |
|