danicafisher commited on
Commit
b179830
·
verified ·
1 Parent(s): 9881234

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -45,17 +45,20 @@ async def main(message: cl.Message):
45
  await asyncio.to_thread(qdrant_store.add_documents, splits)
46
 
47
  await cl.Message(f"Processing `{message.content}` done. You can now ask questions!").send()
 
48
 
49
  except Exception as e:
50
  await cl.Message(f"Error processing the document: {e}").send()
 
 
 
51
  else:
52
  # Handle the question as usual
53
  await cl.Message(content="Thinking about it, give me a second...", disable_human_feedback=True).send()
54
  response = await asyncio.to_thread(retrieval_augmented_qa_chain.invoke, {"question": message.content})
55
  await cl.Message(content=response.content).send()
56
-
57
- res = await ask_action()
58
- await handle_response(res)
59
 
60
 
61
  ## Chainlit helper functions
 
45
  await asyncio.to_thread(qdrant_store.add_documents, splits)
46
 
47
  await cl.Message(f"Processing `{message.content}` done. You can now ask questions!").send()
48
+
49
 
50
  except Exception as e:
51
  await cl.Message(f"Error processing the document: {e}").send()
52
+
53
+ res = await ask_action()
54
+ await handle_response(res)
55
  else:
56
  # Handle the question as usual
57
  await cl.Message(content="Thinking about it, give me a second...", disable_human_feedback=True).send()
58
  response = await asyncio.to_thread(retrieval_augmented_qa_chain.invoke, {"question": message.content})
59
  await cl.Message(content=response.content).send()
60
+ res = await ask_action()
61
+ await handle_response(res)
 
62
 
63
 
64
  ## Chainlit helper functions