From 066be383e3d88c75d33268b691cfe8f25e0a646c Mon Sep 17 00:00:00 2001 From: ccurme Date: Thu, 26 Jun 2025 14:22:58 -0400 Subject: [PATCH] openai[patch]: update test following release of openai 1.92 (#31751) Added new required fields for `ResponseFunctionWebSearch` --- .../tests/unit_tests/chat_models/test_base.py | 25 ++++++++++++++++--- libs/partners/openai/uv.lock | 6 ++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/libs/partners/openai/tests/unit_tests/chat_models/test_base.py b/libs/partners/openai/tests/unit_tests/chat_models/test_base.py index 3bd822187c4..d20d9479bb6 100644 --- a/libs/partners/openai/tests/unit_tests/chat_models/test_base.py +++ b/libs/partners/openai/tests/unit_tests/chat_models/test_base.py @@ -34,6 +34,7 @@ from openai.types.responses.response_file_search_tool_call import ( ) from openai.types.responses.response_function_tool_call import ResponseFunctionToolCall from openai.types.responses.response_function_web_search import ( + ActionSearch, ResponseFunctionWebSearch, ) from openai.types.responses.response_output_refusal import ResponseOutputRefusal @@ -1602,7 +1603,10 @@ def test__construct_lc_result_from_responses_api_web_search_response() -> None: tool_choice="auto", output=[ ResponseFunctionWebSearch( - id="websearch_123", type="web_search_call", status="completed" + id="websearch_123", + type="web_search_call", + status="completed", + action=ActionSearch(type="search", query="search query"), ) ], ) @@ -1630,7 +1634,12 @@ def test__construct_lc_result_from_responses_api_web_search_response() -> None: response, output_version="responses/v1" ) assert result.generations[0].message.content == [ - {"type": "web_search_call", "id": "websearch_123", "status": "completed"} + { + "type": "web_search_call", + "id": "websearch_123", + "status": "completed", + "action": {"query": "search query", "type": "search"}, + } ] @@ -1751,7 +1760,10 @@ def test__construct_lc_result_from_responses_api_mixed_search_responses() -> Non status="completed", ), ResponseFunctionWebSearch( - id="websearch_123", type="web_search_call", status="completed" + id="websearch_123", + type="web_search_call", + status="completed", + action=ActionSearch(type="search", query="search query"), ), ResponseFileSearchToolCall( id="filesearch_123", @@ -1812,7 +1824,12 @@ def test__construct_lc_result_from_responses_api_mixed_search_responses() -> Non "annotations": [], "id": "msg_123", }, - {"type": "web_search_call", "id": "websearch_123", "status": "completed"}, + { + "type": "web_search_call", + "id": "websearch_123", + "status": "completed", + "action": {"type": "search", "query": "search query"}, + }, { "type": "file_search_call", "id": "filesearch_123", diff --git a/libs/partners/openai/uv.lock b/libs/partners/openai/uv.lock index 37bc8caba1e..79ac22449fe 100644 --- a/libs/partners/openai/uv.lock +++ b/libs/partners/openai/uv.lock @@ -994,7 +994,7 @@ wheels = [ [[package]] name = "openai" -version = "1.90.0" +version = "1.92.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -1006,9 +1006,9 @@ dependencies = [ { name = "tqdm" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/2d/30/0bdb712f5e25e823a76828136de6043f28bd69363886c417e05d7021420e/openai-1.90.0.tar.gz", hash = "sha256:9771982cdd5b6631af68c6a603da72ed44cd2caf73b49f717a72b71374bc565b", size = 471896 } +sdist = { url = "https://files.pythonhosted.org/packages/37/3f/75ad8dfe1ee4e6daacebc5a8145878c00b22c4b89e3446228d3ffccbf726/openai-1.92.0.tar.gz", hash = "sha256:acaf4ee5fca8611a09035e37ceb69a352b4a84e25b103f0fc1ccc696bf9a16f0", size = 485264 } wheels = [ - { url = "https://files.pythonhosted.org/packages/bd/e3/0d7a2ee7ae7293e794e7945ffeda942ff5e3a94de24be27cc3eb5ba6c188/openai-1.90.0-py3-none-any.whl", hash = "sha256:e5dcb5498ea6b42fec47546d10f1bcc05fb854219a7d953a5ba766718b212a02", size = 734638 }, + { url = "https://files.pythonhosted.org/packages/68/66/8f85019b7943e4976d931fdb0e2b973090b4dac999c3e90844d2336f1184/openai-1.92.0-py3-none-any.whl", hash = "sha256:99210715bad1a4de5a387993aca7e4e8e5a742f1e185eefe2f805001cc2c21f3", size = 753397 }, ] [[package]]