datacipen commited on
Commit
5c7323d
·
verified ·
1 Parent(s): 86984f1

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -4
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
- #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()
 
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()