Update app.py
Browse files
app.py
CHANGED
@@ -143,15 +143,18 @@ def create_agent():
|
|
143 |
|
144 |
def respond(message, history, temperature, max_new_tokens, max_tokens, multi_agent, conversation, max_round):
|
145 |
updated_history = history + [{"role": "user", "content": message}]
|
146 |
-
response_generator = agent.run_gradio_chat(
|
|
|
|
|
|
|
147 |
collected = ""
|
148 |
for chunk in response_generator:
|
149 |
if isinstance(chunk, dict):
|
150 |
collected += chunk.get("content", "")
|
151 |
else:
|
152 |
collected += str(chunk)
|
153 |
-
|
154 |
-
return
|
155 |
|
156 |
def create_demo(agent):
|
157 |
with gr.Blocks(css=chat_css) as demo:
|
|
|
143 |
|
144 |
def respond(message, history, temperature, max_new_tokens, max_tokens, multi_agent, conversation, max_round):
|
145 |
updated_history = history + [{"role": "user", "content": message}]
|
146 |
+
response_generator = agent.run_gradio_chat(
|
147 |
+
updated_history, temperature, max_new_tokens, max_tokens, multi_agent, conversation, max_round
|
148 |
+
)
|
149 |
+
|
150 |
collected = ""
|
151 |
for chunk in response_generator:
|
152 |
if isinstance(chunk, dict):
|
153 |
collected += chunk.get("content", "")
|
154 |
else:
|
155 |
collected += str(chunk)
|
156 |
+
|
157 |
+
return history + [{"role": "user", "content": message}, {"role": "assistant", "content": collected}]
|
158 |
|
159 |
def create_demo(agent):
|
160 |
with gr.Blocks(css=chat_css) as demo:
|