-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
If there are no tool calls, this checks if there is parsable JSON:
- If parsable json AND looks like tool call, record as tool call
- If NOT not parsable JSON, record as final answer
But .. if parsable json AND doesn't look like tool call, then nothing happens and the loop continues.
https://github.com/jataware/archytas/blob/main/archytas/react.py#L282
I think needs to be changed to:
try:
# Check to ensure the content isn't an tool call in the wrong place.
action_json = json.loads(action.text)
if isinstance(action_json, dict) and "id" in action_json and "name" in action_json and "args" in action_json:
action.tool_calls.append(action_json)
else:
action.tool_calls.append({
"id": uuid.uuid4().hex,
"name": "final_answer",
"args": {
"response": action.text
}
})
except json.JSONDecodeError:
# Presume content to be a final answer
action.tool_calls.append({
"id": uuid.uuid4().hex,
"name": "final_answer",
"args": {
"response": action.text
}
})
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels