Update main.py
Browse files
main.py
CHANGED
@@ -108,7 +108,7 @@ def query_agent(agent, query):
|
|
108 |
)
|
109 |
|
110 |
# Run the prompt through the agent.
|
111 |
-
response = agent.
|
112 |
|
113 |
# Convert the response to a string.
|
114 |
return response.__str__()
|
@@ -161,10 +161,9 @@ async def on_message(message: cl.Message):
|
|
161 |
|
162 |
# Query the agent.
|
163 |
response = query_agent(agent=agent, query=message.content)
|
164 |
-
print(response)
|
165 |
# Decode the response.
|
166 |
#decoded_response = decode_response(response)
|
167 |
|
168 |
# Write the response to the Streamlit app.
|
169 |
#result = write_response(decoded_response)
|
170 |
-
|
|
|
108 |
)
|
109 |
|
110 |
# Run the prompt through the agent.
|
111 |
+
response = agent.invoke(prompt)
|
112 |
|
113 |
# Convert the response to a string.
|
114 |
return response.__str__()
|
|
|
161 |
|
162 |
# Query the agent.
|
163 |
response = query_agent(agent=agent, query=message.content)
|
|
|
164 |
# Decode the response.
|
165 |
#decoded_response = decode_response(response)
|
166 |
|
167 |
# Write the response to the Streamlit app.
|
168 |
#result = write_response(decoded_response)
|
169 |
+
await cl.Message(author="COPILOT",content=GoogleTranslator(source='auto', target='fr').translate(response)).send()
|