Update main.py
Browse files
main.py
CHANGED
@@ -122,7 +122,7 @@ def decode_response(response: str) -> dict:
|
|
122 |
Returns:
|
123 |
dict: dictionary with response data
|
124 |
"""
|
125 |
-
return json.loads(response)
|
126 |
|
127 |
def write_response(response_dict: dict):
|
128 |
"""
|
@@ -162,8 +162,8 @@ async def on_message(message: cl.Message):
|
|
162 |
# Query the agent.
|
163 |
response = query_agent(agent=agent, query=message.content)
|
164 |
# Decode the response.
|
165 |
-
|
166 |
|
167 |
# Write the response to the Streamlit app.
|
168 |
-
|
169 |
-
await cl.Message(author="COPILOT",content=GoogleTranslator(source='auto', target='fr').translate(
|
|
|
122 |
Returns:
|
123 |
dict: dictionary with response data
|
124 |
"""
|
125 |
+
return json.loads([response])
|
126 |
|
127 |
def write_response(response_dict: dict):
|
128 |
"""
|
|
|
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(result)).send()
|