Update app.py
Browse files
app.py
CHANGED
@@ -122,13 +122,14 @@ def setup_multiple_chains():
|
|
122 |
|
123 |
cl.user_session.set("api_chain", api_chain)
|
124 |
|
125 |
-
requests_wrapper =
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
}
|
130 |
)
|
131 |
|
|
|
132 |
post_tool = RequestsPostTool(
|
133 |
requests_wrapper=requests_wrapper,
|
134 |
allow_dangerous_requests=True
|
@@ -146,8 +147,7 @@ async def handle_message(message: cl.Message):
|
|
146 |
|
147 |
booking_pattern = r'\b[A-Z]{6}\d{6}\b'
|
148 |
endpoint_url = "https://aivisions.no/data/daysoff/api/v1/booking/"
|
149 |
-
|
150 |
-
|
151 |
match = re.search(booking_pattern, user_message)
|
152 |
|
153 |
if match:
|
|
|
122 |
|
123 |
cl.user_session.set("api_chain", api_chain)
|
124 |
|
125 |
+
requests_wrapper = JsonRequestsWrapper(
|
126 |
+
headers={
|
127 |
+
"Authorization": auth_token,
|
128 |
+
"Content-Type": "application/json"
|
129 |
}
|
130 |
)
|
131 |
|
132 |
+
|
133 |
post_tool = RequestsPostTool(
|
134 |
requests_wrapper=requests_wrapper,
|
135 |
allow_dangerous_requests=True
|
|
|
147 |
|
148 |
booking_pattern = r'\b[A-Z]{6}\d{6}\b'
|
149 |
endpoint_url = "https://aivisions.no/data/daysoff/api/v1/booking/"
|
150 |
+
|
|
|
151 |
match = re.search(booking_pattern, user_message)
|
152 |
|
153 |
if match:
|