Ali2206 commited on
Commit
9f5f555
·
verified ·
1 Parent(s): 11fdfd1

Update src/txagent/txagent.py

Browse files
Files changed (1) hide show
  1. src/txagent/txagent.py +5 -2
src/txagent/txagent.py CHANGED
@@ -325,8 +325,10 @@ class TxAgent:
325
  conversation=None,
326
  sub_agent_task=sub_agent_task)
327
 
328
- call_result = call_result.split(
329
- '[FinalAnswer]')[-1]
 
 
330
  else:
331
  call_result = "Error: The CallAgent has been disabled. Please proceed with your reasoning process to solve this question."
332
  else:
@@ -365,6 +367,7 @@ class TxAgent:
365
  else:
366
  return revised_messages, existing_tools_prompt, special_tool_call
367
 
 
368
  def get_answer_based_on_unfinished_reasoning(self, conversation, temperature, max_new_tokens, max_token, outputs=None):
369
  if conversation[-1]['role'] == 'assisant':
370
  conversation.append(
 
325
  conversation=None,
326
  sub_agent_task=sub_agent_task)
327
 
328
+ if call_result is not None:
329
+ call_result = call_result.split('[FinalAnswer]')[-1]
330
+ else:
331
+ call_result = "⚠️ No content returned from sub-agent."
332
  else:
333
  call_result = "Error: The CallAgent has been disabled. Please proceed with your reasoning process to solve this question."
334
  else:
 
367
  else:
368
  return revised_messages, existing_tools_prompt, special_tool_call
369
 
370
+
371
  def get_answer_based_on_unfinished_reasoning(self, conversation, temperature, max_new_tokens, max_token, outputs=None):
372
  if conversation[-1]['role'] == 'assisant':
373
  conversation.append(