camparchimedes commited on
Commit
e356eb8
·
verified ·
1 Parent(s): 2edb71c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -203,7 +203,7 @@ async def handle_message(message: cl.Message):
203
  bestillingskode = re.search(booking_pattern, user_message).group(0)
204
  question = f"Retrieve information for booking ID {bestillingskode}"
205
 
206
- response = await api_chain.ainvoke(
207
  {
208
  "url": endpoint_url,
209
  "method": "POST",
@@ -219,7 +219,7 @@ async def handle_message(message: cl.Message):
219
  callbacks=[cl.AsyncLangchainCallbackHandler()],
220
  )
221
  else:
222
- response = await llm_chain.ainvoke(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
223
 
224
  response_key = "output" if "output" in response else "text"
225
  await cl.Message(response.get(response_key, "")).send()
 
203
  bestillingskode = re.search(booking_pattern, user_message).group(0)
204
  question = f"Retrieve information for booking ID {bestillingskode}"
205
 
206
+ response = await api_chain.acall( # ~ainvoke
207
  {
208
  "url": endpoint_url,
209
  "method": "POST",
 
219
  callbacks=[cl.AsyncLangchainCallbackHandler()],
220
  )
221
  else:
222
+ response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
223
 
224
  response_key = "output" if "output" in response else "text"
225
  await cl.Message(response.get(response_key, "")).send()