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
{{ message }}
Repository navigation
BUG: OpenAIResponseTarget passes non-object tool arguments to custom functions #3516
In OpenAIResponseTarget._execute_call_section_async, a registered Tool gets a malformed_arguments result (or a ValueError with fail_on_missing_function=True) when the model sends arguments that parse as JSON but are not an object, such as null, [1, 2] or "text". Functions passed through custom_functions skip that check and are called with the raw None, list or string, so a function that reads args["x"] or args.get("x") raises and the whole send fails instead of the model getting an error it can recover from.
Steps to Reproduce
Register custom_functions={"lookup": fn} where fn does args.get("q"), and have the model return a function_call for lookup with "arguments": "null".
Expected Results
Same as a registered Tool: the model receives a malformed_arguments function output and the loop continues.
Actual Results
AttributeError: 'NoneType' object has no attribute 'get' is raised out of send_prompt_async.
Versions
Linux, Python 3.13.16, PyRIT 1.2.0.dev0 from main (96de757)
Activity