Update app.py
Browse files
app.py
CHANGED
@@ -210,16 +210,16 @@ def create_agent():
|
|
210 |
raise
|
211 |
|
212 |
def handle_chat_response(history, message, temperature, max_new_tokens, max_tokens, multi_agent, conversation, max_round):
|
213 |
-
"""Convert generator output to Gradio-compatible format"""
|
214 |
full_response = ""
|
215 |
for chunk in message:
|
216 |
if isinstance(chunk, dict):
|
217 |
full_response += chunk.get("content", "")
|
218 |
else:
|
219 |
full_response += str(chunk)
|
220 |
-
history.append(
|
221 |
return history
|
222 |
|
|
|
223 |
def update_model_parameters(agent, enable_finish, enable_rag, enable_summary,
|
224 |
init_rag_num, step_rag_num, skip_last_k,
|
225 |
summary_mode, summary_skip_last_k, summary_context_length,
|
|
|
210 |
raise
|
211 |
|
212 |
def handle_chat_response(history, message, temperature, max_new_tokens, max_tokens, multi_agent, conversation, max_round):
|
|
|
213 |
full_response = ""
|
214 |
for chunk in message:
|
215 |
if isinstance(chunk, dict):
|
216 |
full_response += chunk.get("content", "")
|
217 |
else:
|
218 |
full_response += str(chunk)
|
219 |
+
history.append({"role": "assistant", "content": full_response})
|
220 |
return history
|
221 |
|
222 |
+
|
223 |
def update_model_parameters(agent, enable_finish, enable_rag, enable_summary,
|
224 |
init_rag_num, step_rag_num, skip_last_k,
|
225 |
summary_mode, summary_skip_last_k, summary_context_length,
|