Skip to content

pydantic_core._pydantic_core.ValidationError: 1 validation error for ResponseFunctionWebSearch action #968

Open
@medaminezghal

Description

@medaminezghal

Using openai>=1.92.0 I got those errors in tests:

___________________ test_to_input_items_for_web_search_call ____________________

    def test_to_input_items_for_web_search_call() -> None:
        """A web search tool call output should produce the same dict as a web search input."""
>       ws_call = ResponseFunctionWebSearch(id="w1", status="completed", type="web_search_call")
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       pydantic_core._pydantic_core.ValidationError: 1 validation error for ResponseFunctionWebSearch
E       action
E         Field required [type=missing, input_value={'id': 'w1', 'status': 'c...ype': 'web_search_call'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.11/v/missing

tests/test_items_helpers.py:228: ValidationError
_____________ test_function_web_search_tool_call_parsed_correctly ______________

    @pytest.mark.asyncio
    async def test_function_web_search_tool_call_parsed_correctly():
        agent = Agent(name="test")
>       web_search_call = ResponseFunctionWebSearch(id="w1", status="completed", type="web_search_call")
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       pydantic_core._pydantic_core.ValidationError: 1 validation error for ResponseFunctionWebSearch
E       action
E         Field required [type=missing, input_value={'id': 'w1', 'status': 'c...ype': 'web_search_call'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.11/v/missing

tests/test_run_step_processing.py:309: ValidationError

This due to change in ResponseFunctionWebSearch in this file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions