Latest OpenAI web search tool raises an error caused by hardcoded values in langchain-core

### Checked other resources

- [x] This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
- [x] I added a clear and descriptive title that summarizes this issue.
- [x] I used the GitHub search to find a similar question and didn't find it.
- [x] I am sure that this is a bug in LangChain rather than my code.
- [x] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
- [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
- [x] I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

### Example Code

The following code:

```python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model='gpt-5')
bound_llm = llm.bind_tools([{'type': 'web_search'}])
bound_llm.invoke('Hi')
```

Which returns:
```python
ValueError: Unsupported function
{'type': 'web_search'}
```

### Error Message and Stack Trace (if applicable)

```
ValueError                                Traceback (most recent call last)
Cell In[4], line 4
      1 from langchain_openai import ChatOpenAI
      3 llm = ChatOpenAI(model='gpt-5')
----> 4 bound_llm = llm.bind_tools([{'type': 'web_search'}])
      5 bound_llm.invoke('Hi')

File [~/Downloads/.miniforge/envs/goto/lib/python3.11/site-packages/langchain_openai/chat_models/base.py:1725](...), in BaseChatOpenAI.bind_tools(self, tools, tool_choice, strict, parallel_tool_calls, **kwargs)
   1723 if parallel_tool_calls is not None:
   1724     kwargs["parallel_tool_calls"] = parallel_tool_calls
-> 1725 formatted_tools = [
   1726     convert_to_openai_tool(tool, strict=strict) for tool in tools
   1727 ]
   1728 tool_names = []
   1729 for tool in formatted_tools:

File [~/Downloads/.miniforge/envs/goto/lib/python3.11/site-packages/langchain_openai/chat_models/base.py:1726](...), in <listcomp>(.0)
   1723 if parallel_tool_calls is not None:
   1724     kwargs["parallel_tool_calls"] = parallel_tool_calls
   1725 formatted_tools = [
-> 1726     convert_to_openai_tool(tool, strict=strict) for tool in tools
   1727 ]
   1728 tool_names = []
   1729 for tool in formatted_tools:

File [~/Downloads/.miniforge/envs/goto/lib/python3.11/site-packages/langchain_core/utils/function_calling.py:595](...), in convert_to_openai_tool(tool, strict)
    593         oai_tool["format"] = tool.metadata["format"]
    594     return oai_tool
--> 595 oai_function = convert_to_openai_function(tool, strict=strict)
    596 return {"type": "function", "function": oai_function}

File [~/Downloads/.miniforge/envs/goto/lib/python3.11/site-packages/langchain_core/utils/function_calling.py:486](...), in convert_to_openai_function(function, strict)
    479 else:
    480     msg = (
    481         f"Unsupported function\n\n{function}\n\nFunctions must be passed in"
    482         " as Dict, pydantic.BaseModel, or Callable. If they're a dict they must"
    483         " either be in OpenAI function format or valid JSON schema with top-level"
    484         " 'title' and 'description' keys."
    485     )
--> 486     raise ValueError(msg)
    488 if strict is not None:
    489     if "strict" in oai_function and oai_function["strict"] != strict:

ValueError: Unsupported function

{'type': 'web_search'}

Functions must be passed in as Dict, pydantic.BaseModel, or Callable. If they're a dict they must either be in OpenAI function format or valid JSON schema with top-level 'title' and 'description' keys.
```

### Description

Note that `web_search` is the newer version of `web_search_preview` and is a supported function according to OpenAI:
https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses

The check that fails is this line where the accepted values are hardcoded:

In this file:
https://github.com/langchain-ai/langchain/blob/1fe2c4084b1c6338d2aee23da3cbc936cd5f7c8a/libs/core/langchain_core/utils/function_calling.py#L584

I believe it should accept `web_search` as an accepted value. 

### System Info

```
System Information
------------------
> OS:  Darwin
> OS Version:  Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:55 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6031
> Python Version:  3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:34:54) [Clang 16.0.6 ]

Package Information
-------------------
> langchain_core: 0.3.74
> langchain: 0.3.27
> langchain_community: 0.3.27
> langsmith: 0.3.45
> langchain_anthropic: 0.3.9
> langchain_aws: 0.2.30
> langchain_azure_ai: 0.1.2
> langchain_chroma: 0.2.2
> langchain_docling: 0.2.0
> langchain_experimental: 0.3.4
> langchain_google_community: 2.0.7
> langchain_google_vertexai: 2.0.26
> langchain_huggingface: 0.1.2
> langchain_mcp_adapters: 0.1.9
> langchain_openai: 0.3.32
> langchain_postgres: 0.0.13
> langchain_pymupdf4llm: 0.2.0
> langchain_text_splitters: 0.3.9
> langchain_unstructured: 0.1.6
> langgraph: 0.1.9

Optional packages not installed
-------------------------------
> langserve

Other Dependencies
------------------
> aiohttp: 3.11.11
> aiohttp<4.0.0,>=3.8.3: Installed. No version info available.
> anthropic<1,>=0.47.0: Installed. No version info available.
> anthropic[vertexai]: Installed. No version info available.
> async-timeout<5.0.0,>=4.0.0;: Installed. No version info available.
> azure-ai-inference[opentelemetry]: Installed. No version info available.
> azure-core: 1.32.0
> azure-cosmos: 4.9.0
> azure-identity: 1.19.0
> azure-monitor-opentelemetry: Installed. No version info available.
> beautifulsoup4: 4.12.3
> bedrock-agentcore: Installed. No version info available.
> boto3: 1.39.16
> bottleneck: 1.5.0
> chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0: Installed. No version info available.
> dataclasses-json<0.7,>=0.5.7: Installed. No version info available.
> db-dtypes: Installed. No version info available.
> docling: 2.26.0
> gapic-google-longrunning: Installed. No version info available.
> google-api-core: 2.25.1
> google-api-python-client: 2.179.0
> google-auth: 2.34.0
> google-auth-httplib2: 0.2.0
> google-auth-oauthlib: Installed. No version info available.
> google-cloud-aiplatform: 1.97.0
> google-cloud-bigquery: 3.25.0
> google-cloud-bigquery-storage: Installed. No version info available.
> google-cloud-contentwarehouse: Installed. No version info available.
> google-cloud-core: 2.4.3
> google-cloud-discoveryengine: Installed. No version info available.
> google-cloud-documentai: Installed. No version info available.
> google-cloud-documentai-toolbox: Installed. No version info available.
> google-cloud-speech: Installed. No version info available.
> google-cloud-storage: 2.18.2
> google-cloud-texttospeech: Installed. No version info available.
> google-cloud-translate: 3.20.0
> google-cloud-vision: 3.10.0
> googlemaps: Installed. No version info available.
> grpcio: 1.74.0
> httpx: 0.28.1
> httpx-sse: 0.4.0
> httpx-sse<1.0.0,>=0.4.0: Installed. No version info available.
> huggingface-hub: 0.24.5
> jsonpatch<2.0,>=1.33: Installed. No version info available.
> langchain-anthropic;: Installed. No version info available.
> langchain-aws;: Installed. No version info available.
> langchain-azure-ai;: Installed. No version info available.
> langchain-cohere;: Installed. No version info available.
> langchain-community;: Installed. No version info available.
> langchain-core!=0.3.0,!=0.3.1,!=0.3.10,!=0.3.11,!=0.3.12,!=0.3.13,!=0.3.14,!=0.3.2,!=0.3.3,!=0.3.4,!=0.3.5,!=0.3.6,!=0.3.7,!=0.3.8,!=0.3.9,<0.4.0,>=0.2.43: Installed. No version info available.
> langchain-core<0.4,>=0.3.36: Installed. No version info available.
> langchain-core<1.0.0,>=0.3.41: Installed. No version info available.
> langchain-core<1.0.0,>=0.3.66: Installed. No version info available.
> langchain-core<1.0.0,>=0.3.72: Installed. No version info available.
> langchain-core<1.0.0,>=0.3.74: Installed. No version info available.
> langchain-deepseek;: Installed. No version info available.
> langchain-fireworks;: Installed. No version info available.
> langchain-google-genai;: Installed. No version info available.
> langchain-google-vertexai;: Installed. No version info available.
> langchain-groq;: Installed. No version info available.
> langchain-huggingface;: Installed. No version info available.
> langchain-mistralai: Installed. No version info available.
> langchain-mistralai;: Installed. No version info available.
> langchain-ollama;: Installed. No version info available.
> langchain-openai;: Installed. No version info available.
> langchain-perplexity;: Installed. No version info available.
> langchain-text-splitters<1.0.0,>=0.3.9: Installed. No version info available.
> langchain-together;: Installed. No version info available.
> langchain-xai;: Installed. No version info available.
> langchain<1.0.0,>=0.3.26: Installed. No version info available.
> langsmith-pyo3: Installed. No version info available.
> langsmith>=0.1.125: Installed. No version info available.
> langsmith>=0.1.17: Installed. No version info available.
> langsmith>=0.3.45: Installed. No version info available.
> mcp>=1.9.2: Installed. No version info available.
> numexpr: 2.10.1
> numpy: 1.26.4
> numpy<2.0.0,>=1.22.4;: Installed. No version info available.
> numpy<2.0.0,>=1.26.2;: Installed. No version info available.
> numpy>=1.26.2;: Installed. No version info available.
> numpy>=2.1.0;: Installed. No version info available.
> onnxruntime: 1.19.0
> openai-agents: 0.0.11
> openai<2.0.0,>=1.99.9: Installed. No version info available.
> opentelemetry-api: 1.33.1
> opentelemetry-exporter-otlp-proto-http: 1.33.1
> opentelemetry-instrumentation-threading: Installed. No version info available.
> opentelemetry-sdk: 1.33.1
> opentelemetry-semantic-conventions-ai: Installed. No version info available.
> orjson: 3.10.6
> packaging: 23.2
> packaging>=23.2: Installed. No version info available.
> pandas: 2.3.0
> pgvector: 0.2.5
> playwright: Installed. No version info available.
> psycopg: 3.2.1
> psycopg-pool: 3.2.2
> pyarrow: 18.1.0
> pydantic: 2.11.7
> pydantic-settings<3.0.0,>=2.4.0: Installed. No version info available.
> pydantic<3.0.0,>=2.7.4: Installed. No version info available.
> pydantic>=2.7.4: Installed. No version info available.
> pymongo: 4.11.1
> pymupdf4llm: 0.0.21
> pytest: 8.2.2
> PyYAML>=5.3: Installed. No version info available.
> requests: 2.32.3
> requests-toolbelt: 1.0.0
> requests<3,>=2: Installed. No version info available.
> rich: 14.0.0
> sentence-transformers: 3.0.1
> simsimd: 6.2.1
> sqlalchemy: 2.0.31
> SQLAlchemy<3,>=1.4: Installed. No version info available.
> tenacity!=8.4.0,<10,>=8.1.0: Installed. No version info available.
> tenacity!=8.4.0,<10.0.0,>=8.1.0: Installed. No version info available.
> tiktoken<1,>=0.7: Installed. No version info available.
> tokenizers: 0.19.1
> transformers: 4.43.3
> typing-extensions>=4.14.0: Installed. No version info available.
> typing-extensions>=4.7: Installed. No version info available.
> unstructured-client: 0.31.1
> unstructured[all-docs]: Installed. No version info available.
> validators: 0.35.0
> zstandard: 0.23.0
```

Labels: bug
State: closed