Skip to content

Conversation

mattcorey
Copy link
Contributor

@mattcorey mattcorey commented Sep 8, 2025

Added support for the newer version of the built-in OpenAI Web Search tool:

  • Updated .webSearch tooling to send the newer web_search tool
  • Created .webSearchPreview (deprecated) to support older models. Still uses web_search_preview

The new tooling returns search results in a different way (at least in the GPT-5 models):

  • Added support for the include parameter on OpenAICreateResponseRequestBody, to inform the tool to return search results
  • New This also enables the search query to be retrieved 👍

This PR addresses issue #212

- Add Include enum with 7 output options for OpenAI responses API
- Add include parameter to OpenAICreateResponseRequestBody with proper alphabetical ordering
- Add support for stable web_search tool alongside web_search_preview
- Use typealias WebSearchPreviewTool = WebSearchTool to avoid code duplication
- Deprecate webSearchPreview in favor of webSearch for modern GPT models
- Add WebSearchAction and WebSearchSource support in OpenAIResponse
- Add comprehensive test coverage for web search sources parsing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant