Update src/txagent/txagent.py
Browse files- src/txagent/txagent.py +2 -1
src/txagent/txagent.py
CHANGED
@@ -613,6 +613,7 @@ Summarize the function calls' responses in one sentence with all necessary infor
|
|
613 |
conversation = self.initialize_conversation(
|
614 |
message, conversation, history)
|
615 |
history = []
|
|
|
616 |
|
617 |
next_round = True
|
618 |
current_round = 0
|
@@ -623,7 +624,7 @@ Summarize the function calls' responses in one sentence with all necessary infor
|
|
623 |
try:
|
624 |
while next_round and current_round < max_round:
|
625 |
current_round += 1
|
626 |
-
if last_outputs:
|
627 |
function_call_messages, picked_tools_prompt, special_tool_call, current_gradio_history = yield from self.run_function_call_stream(
|
628 |
last_outputs, return_message=True,
|
629 |
existing_tools_prompt=picked_tools_prompt,
|
|
|
613 |
conversation = self.initialize_conversation(
|
614 |
message, conversation, history)
|
615 |
history = []
|
616 |
+
last_outputs = [] # Initialize last_outputs to avoid UnboundLocalError
|
617 |
|
618 |
next_round = True
|
619 |
current_round = 0
|
|
|
624 |
try:
|
625 |
while next_round and current_round < max_round:
|
626 |
current_round += 1
|
627 |
+
if last_outputs: # Process previous outputs if any
|
628 |
function_call_messages, picked_tools_prompt, special_tool_call, current_gradio_history = yield from self.run_function_call_stream(
|
629 |
last_outputs, return_message=True,
|
630 |
existing_tools_prompt=picked_tools_prompt,
|