datacipen commited on
Commit
3323043
1 Parent(s): b1928ac

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -136,7 +136,7 @@ def write_response(response_dict: dict):
136
  """
137
 
138
  # Check if the response is an answer.
139
- await cl.Message(author="COPILOT",content=GoogleTranslator(source='auto', target='fr').translate(response_dict["answer"])).send()
140
 
141
  @cl.set_chat_profiles
142
  async def chat_profile():
@@ -166,4 +166,5 @@ async def on_message(message: cl.Message):
166
  decoded_response = decode_response(response)
167
 
168
  # Write the response to the Streamlit app.
169
- write_response(decoded_response)
 
 
136
  """
137
 
138
  # Check if the response is an answer.
139
+ return response_dict["answer"]
140
 
141
  @cl.set_chat_profiles
142
  async def chat_profile():
 
166
  decoded_response = decode_response(response)
167
 
168
  # Write the response to the Streamlit app.
169
+ result = write_response(decoded_response)
170
+ await cl.Message(author="COPILOT",content=GoogleTranslator(source='auto', target='fr').translate(result)).send()