Update main.py
Browse files
main.py
CHANGED
@@ -186,12 +186,12 @@ async def chat_profile():
|
|
186 |
async def on_chat_start():
|
187 |
await cl.Message(f"> SURVEYIA").send()
|
188 |
fileSurvey = await surveyCaa()
|
189 |
-
|
190 |
|
191 |
@cl.on_message
|
192 |
async def on_message(message: cl.Message):
|
193 |
await cl.Message(f"> SURVEYIA").send()
|
194 |
-
agent = create_agent(fileSurvey)
|
195 |
cb = cl.AsyncLangchainCallbackHandler()
|
196 |
try:
|
197 |
#res = await agent.acall("Réponds en langue française à la question suivante : " + message.content, callbacks=[cb])
|
|
|
186 |
async def on_chat_start():
|
187 |
await cl.Message(f"> SURVEYIA").send()
|
188 |
fileSurvey = await surveyCaa()
|
189 |
+
cl.user_session.set("fileSurvey", fileSurvey)
|
190 |
|
191 |
@cl.on_message
|
192 |
async def on_message(message: cl.Message):
|
193 |
await cl.Message(f"> SURVEYIA").send()
|
194 |
+
agent = create_agent(cl.user_session.get("fileSurvey"))
|
195 |
cb = cl.AsyncLangchainCallbackHandler()
|
196 |
try:
|
197 |
#res = await agent.acall("Réponds en langue française à la question suivante : " + message.content, callbacks=[cb])
|