kuro223 commited on
Commit
938aa20
·
1 Parent(s): bd93f15
Files changed (2) hide show
  1. app.log +10 -0
  2. app.py +6 -4
app.log ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ 2025-11-02 21:12:03,099 - __main__ - INFO - Client Gemini initialisé avec succès
2
+ 2025-11-02 21:12:03,193 - werkzeug - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
3
+ * Running on all addresses (0.0.0.0)
4
+ * Running on http://127.0.0.1:7860
5
+ * Running on http://192.168.1.72:7860
6
+ 2025-11-02 21:12:03,193 - werkzeug - INFO - Press CTRL+C to quit
7
+ 2025-11-02 21:12:03,201 - werkzeug - INFO - * Restarting with stat
8
+ 2025-11-02 21:12:05,574 - __main__ - INFO - Client Gemini initialisé avec succès
9
+ 2025-11-02 21:12:05,607 - werkzeug - WARNING - * Debugger is active!
10
+ 2025-11-02 21:12:05,665 - werkzeug - INFO - * Debugger PIN: 100-376-928
app.py CHANGED
@@ -208,8 +208,9 @@ def chat():
208
  if part.thought and thinking_enabled:
209
  thoughts += part.text
210
  yield f"data: {json.dumps({'type': 'thought', 'content': part.text})}\n\n"
211
- full_response += part.text
212
- yield f"data: {json.dumps({'type': 'text', 'content': part.text})}\n\n"
 
213
 
214
  logger.info(f"Streaming terminé, réponse complète: {len(full_response)} caractères")
215
 
@@ -344,8 +345,9 @@ def chat_with_file():
344
  if part.thought and thinking_enabled:
345
  thoughts += part.text
346
  yield f"data: {json.dumps({'type': 'thought', 'content': part.text})}\n\n"
347
- full_response += part.text
348
- yield f"data: {json.dumps({'type': 'text', 'content': part.text})}\n\n"
 
349
 
350
  logger.info(f"Streaming avec fichiers terminé, réponse complète: {len(full_response)} caractères")
351
 
 
208
  if part.thought and thinking_enabled:
209
  thoughts += part.text
210
  yield f"data: {json.dumps({'type': 'thought', 'content': part.text})}\n\n"
211
+ else:
212
+ full_response += part.text
213
+ yield f"data: {json.dumps({'type': 'text', 'content': part.text})}\n\n"
214
 
215
  logger.info(f"Streaming terminé, réponse complète: {len(full_response)} caractères")
216
 
 
345
  if part.thought and thinking_enabled:
346
  thoughts += part.text
347
  yield f"data: {json.dumps({'type': 'thought', 'content': part.text})}\n\n"
348
+ else:
349
+ full_response += part.text
350
+ yield f"data: {json.dumps({'type': 'text', 'content': part.text})}\n\n"
351
 
352
  logger.info(f"Streaming avec fichiers terminé, réponse complète: {len(full_response)} caractères")
353