Skip to content

Commit 4828a85

Browse files
authored
feat(core): add web_search in OpenAI tools list (#32738)
1 parent b999f35 commit 4828a85

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

libs/core/langchain_core/utils/function_calling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ def convert_to_openai_function(
515515
"mcp",
516516
"image_generation",
517517
"web_search_preview",
518+
"web_search",
518519
)
519520

520521

libs/partners/openai/langchain_openai/chat_models/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
WellKnownTools = (
124124
"file_search",
125125
"web_search_preview",
126+
"web_search",
126127
"computer_use_preview",
127128
"code_interpreter",
128129
"mcp",
@@ -2374,7 +2375,7 @@ class GetPopulation(BaseModel):
23742375
23752376
llm = ChatOpenAI(model="gpt-4.1-mini", output_version="responses/v1")
23762377
2377-
tool = {"type": "web_search_preview"}
2378+
tool = {"type": "web_search"}
23782379
llm_with_tools = llm.bind_tools([tool])
23792380
23802381
response = llm_with_tools.invoke(

libs/partners/openai/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = { text = "MIT" }
88
requires-python = ">=3.9"
99
dependencies = [
1010
"langchain-core<1.0.0,>=0.3.74",
11-
"openai<2.0.0,>=1.99.9",
11+
"openai<2.0.0,>=1.104.2",
1212
"tiktoken<1,>=0.7",
1313
]
1414
name = "langchain-openai"

libs/partners/openai/uv.lock

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

0 commit comments

Comments
 (0)