You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
llama_index.core.workflow.errors.WorkflowRuntimeError: Error in step 'run_agent_step': the JSON object must be str, bytes or bytearray, not NoneType
the function not need arguments,gpt-4o return is ''(empty string),some llms return None,When this happens, the workflow ends abnormally.
Although exception is used here, but the err is json.JSONDecodeError not ValueError
@wangligen1995 Greetings! I'm here to help you with any bugs, questions, or contributions.
I found a similar issue that was previously reported and resolved. The issue was titled "[Bug]: SlackToolSpec.get_fn_schema_from_fn_name needs to return a schema" and was closed by a pull request that fixed the "fn_schema is None" issue [1].
To address the current issue you're facing with NoneType responses leading to a WorkflowRuntimeError, you can adjust the error handling in the base.py file of the llama_index library. Specifically, you can modify the _parse_tool method to check for None before attempting to parse the JSON. Here's a suggested modification:
This change ensures that if tool_call.function.arguments is None, it initializes argument_dict as an empty dictionary, thus preventing any NoneType related errors during JSON parsing [2].
Bug Description
llama_index.core.workflow.errors.WorkflowRuntimeError: Error in step 'run_agent_step': the JSON object must be str, bytes or bytearray, not NoneType
the function not need arguments,gpt-4o return is ''(empty string),some llms return None,When this happens, the workflow ends abnormally.
Although exception is used here, but the err is json.JSONDecodeError not ValueError
filepath:https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/base.py
Version
0.12.23
Steps to Reproduce
this demo
https://github.com/run-llama/python-agents-tutorial/blob/main/6_multi_agent.py
with other llms
Relevant Logs/Tracbacks
The text was updated successfully, but these errors were encountered: