openai[patch]: update test following release of openai 1.92 (#31751)

Added new required fields for `ResponseFunctionWebSearch`
This commit is contained in:
ccurme
2025-06-26 14:22:58 -04:00
committed by GitHub
parent 61feaa4656
commit 066be383e3
2 changed files with 24 additions and 7 deletions

View File

@@ -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",