Skip to content

Conversation

@iBotPeaches
Copy link
Collaborator

What:

  • Bug Fix
  • New Feature

Description:

Adds support for actions under web_search_call. Commonly returned when you include sources. Something like this:

        $response = OpenAI::responses()->create([
            'model' => 'gpt-5',
            'tools' => [
                [
                    'type' => 'web_search_preview',
                ],
            ],
            'include' => [
                'web_search_call.action.sources',
            ],
            'input' => 'What is last blog from Connor Tumbleson?',
        ]);

Related:

fixes: #697

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the action field on web_search_call responses, which is returned when including sources in web search operations. The implementation includes new data structures for web search actions and their sources, along with comprehensive test coverage.

Key Changes:

  • Introduces OutputWebSearchAction and OutputWebSearchActionSources classes to represent web search action data
  • Updates OutputWebSearchToolCall to include an optional action property
  • Adds comprehensive test coverage for various action scenarios (with/without query, with/without sources)

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Responses/Responses/Output/OutputWebSearchToolCall.php Added optional action property and updated serialization logic
src/Responses/Responses/Output/WebSearch/OutputWebSearchAction.php New class to represent web search actions with query and sources
src/Responses/Responses/Output/WebSearch/OutputWebSearchActionSources.php New class to represent individual source URLs in web search actions
tests/Responses/Responses/Output/OutputWebSearchToolCall.php Comprehensive test suite covering various action presence/absence scenarios
tests/Fixtures/Responses.php Updated fixture to include action data
tests/Fixtures/Streams/ResponseCompletionCreate.txt Updated stream fixture with action data in response events
src/Testing/Responses/Fixtures/Responses/CreateResponseFixture.php Updated test fixture with action data
src/Testing/Responses/Fixtures/Responses/CancelResponseFixture.php Updated test fixture with action data
src/Testing/Responses/Fixtures/Responses/ResponseObjectFixture.php Updated test fixture with action data
src/Testing/Responses/Fixtures/Responses/RetrieveResponseFixture.php Updated test fixture with action data

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@iBotPeaches iBotPeaches merged commit d9d0e7a into main Oct 23, 2025
24 checks passed
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.

[Bug]: Missing action field in OutputWebSearchToolCall

2 participants