-
Notifications
You must be signed in to change notification settings - Fork 581
FEAT: Add tool call to OpenAI Response Target #1006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT: Add tool call to OpenAI Response Target #1006
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one main comment, will take a very detailed look after we resolve that. I did try out tool calling with the OpenAI SDK last night actually so I'm familiar with the pattern 🤣 see #1005.
So your approach is exactly what I'd do except for the comment
Hi @romanlutz, After recent updates to support the OpenAI Response API with function calling in Interestingly, the When I comment out the agentic loop (the custom
But once I re-enable the agentic loop to handle the function call and return a follow-up message (via Do you happen to have any quick pointers on how the follow-up message should be structured for the response API? Maybe I’m mislabeling the response piece or missing something in the tool return format. If not, no worries. I’ll dig in further over the weekend. |
I will have to check the responses API. You may be faster than me 🙂 |
Hello Team, I haven’t had time to work on it yet, but I’ll try to finish it by 31.08.2025, at least the functionality. Pytest will depend on available time. The web search, as described, is working, but function calling has somehow broken. I’ll figure it out. ;) |
Hello Team, I refactored OpenAIResponseTarget to use the proper Responses API schema. Tool calls are now top-level, the body uses response_format, and I extended piece types + fixed the agentic loop so outputs pair with their call_id. This removed the 400s and function + web search now work end-to-end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just the one comment :)
Overview
/v1/responses
API with full agentic (function/tool) calling in PyRIT.extra_body_parameters
.Testing / Validation
Pytest included yet.
Manually tested:
get_current_weather
tool)web_search_preview
)