Skip to content

Commit 066be38

Browse files
authored
openai[patch]: update test following release of openai 1.92 (#31751)
Added new required fields for `ResponseFunctionWebSearch`
1 parent 61feaa4 commit 066be38

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

libs/partners/openai/tests/unit_tests/chat_models/test_base.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
)
3535
from openai.types.responses.response_function_tool_call import ResponseFunctionToolCall
3636
from openai.types.responses.response_function_web_search import (
37+
ActionSearch,
3738
ResponseFunctionWebSearch,
3839
)
3940
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:
16021603
tool_choice="auto",
16031604
output=[
16041605
ResponseFunctionWebSearch(
1605-
id="websearch_123", type="web_search_call", status="completed"
1606+
id="websearch_123",
1607+
type="web_search_call",
1608+
status="completed",
1609+
action=ActionSearch(type="search", query="search query"),
16061610
)
16071611
],
16081612
)
@@ -1630,7 +1634,12 @@ def test__construct_lc_result_from_responses_api_web_search_response() -> None:
16301634
response, output_version="responses/v1"
16311635
)
16321636
assert result.generations[0].message.content == [
1633-
{"type": "web_search_call", "id": "websearch_123", "status": "completed"}
1637+
{
1638+
"type": "web_search_call",
1639+
"id": "websearch_123",
1640+
"status": "completed",
1641+
"action": {"query": "search query", "type": "search"},
1642+
}
16341643
]
16351644

16361645

@@ -1751,7 +1760,10 @@ def test__construct_lc_result_from_responses_api_mixed_search_responses() -> Non
17511760
status="completed",
17521761
),
17531762
ResponseFunctionWebSearch(
1754-
id="websearch_123", type="web_search_call", status="completed"
1763+
id="websearch_123",
1764+
type="web_search_call",
1765+
status="completed",
1766+
action=ActionSearch(type="search", query="search query"),
17551767
),
17561768
ResponseFileSearchToolCall(
17571769
id="filesearch_123",
@@ -1812,7 +1824,12 @@ def test__construct_lc_result_from_responses_api_mixed_search_responses() -> Non
18121824
"annotations": [],
18131825
"id": "msg_123",
18141826
},
1815-
{"type": "web_search_call", "id": "websearch_123", "status": "completed"},
1827+
{
1828+
"type": "web_search_call",
1829+
"id": "websearch_123",
1830+
"status": "completed",
1831+
"action": {"type": "search", "query": "search query"},
1832+
},
18161833
{
18171834
"type": "file_search_call",
18181835
"id": "filesearch_123",

libs/partners/openai/uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)