redfernstech commited on
Commit
fab4b1c
·
verified ·
1 Parent(s): ab372d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -192,7 +192,7 @@ async def chat(request: MessageRequest):
192
  return {"response": "Unsupported language selected."}
193
  response = handle_query(message) # Process the message
194
  try:
195
- response = translator.translate(response, dest=language_code).text
196
  except Exception as e:
197
  # Handle translation errors
198
  print(f"Translation error: {e}")
@@ -205,7 +205,7 @@ async def chat(request: MessageRequest):
205
  "timestamp": datetime.datetime.now().isoformat()
206
  }
207
  chat_history.append(message_data)
208
- return {"response": response}
209
 
210
  @app.get("/")
211
  def read_root(request: Request):
 
192
  return {"response": "Unsupported language selected."}
193
  response = handle_query(message) # Process the message
194
  try:
195
+ response1 = translator.translate(response, dest=language_code).text
196
  except Exception as e:
197
  # Handle translation errors
198
  print(f"Translation error: {e}")
 
205
  "timestamp": datetime.datetime.now().isoformat()
206
  }
207
  chat_history.append(message_data)
208
+ return {"response": response1}
209
 
210
  @app.get("/")
211
  def read_root(request: Request):