add image search support in agents sdk#3474
Conversation
3462d7b to
1bf3338
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1bf3338896
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if tool.search_content_types is not None: | ||
| web_search_tool["search_content_types"] = list(tool.search_content_types) |
There was a problem hiding this comment.
Use the preview web-search tool for content types
When WebSearchTool(search_content_types=...) is used, this still serializes the tool as type: "web_search" and adds search_content_types to that GA payload. I checked the generated OpenAI Responses types: search_content_types is defined on WebSearchPreviewToolParam (web_search_preview...), not on the GA WebSearchToolParam, so callers exercising the new option send a tool shape the API rejects instead of enabling image search.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@yuning-oai Can you resolve all the Codex review comments? This repo runs reviews per push.
There was a problem hiding this comment.
Good catch. The backend accepts search_content_types on web_search, but the field is intentionally still hidden from public OpenAPI for now, so openai-python does not expose it on WebSearchToolParam yet.
I’m going to keep the Agents SDK payload as web_search rather than switch to preview; this is relying on the Responses API hidden field until we’re ready to expose it publicly.
seratch
left a comment
There was a problem hiding this comment.
Once all Codex reviews are cleared, we can merge this
Thanks! shall we merge now or wait for the GA to happen first? |
|
We can merge at the timing of either public beta or GA. |
This pull request adds Agent SDK support for Responses API image search through the existing
WebSearchTool.Summary
search_content_typestoWebSearchToolwhile preserving existing default payloads.search_content_typesto Responses API tool payloads.web_search_call.resultswhenever image results are requested.Test plan
Full repo verification was attempted with
.agents/skills/code-change-verification/scripts/run.sh; it passed formatting and linting, then failed on missing optional extras/imports in the temporary clone environment (Runloop, voice/numpy, litellm, SQLAlchemy), not on this converter change.