Skip to content

docs: add docs for providerToolSearchMiddleware#4355

Merged
Mason Daugherty (mdrxy) merged 8 commits into
mainfrom
alex/provider-tool-search-middleware
Jun 10, 2026
Merged

docs: add docs for providerToolSearchMiddleware#4355
Mason Daugherty (mdrxy) merged 8 commits into
mainfrom
alex/provider-tool-search-middleware

Conversation

@aolsenjazz

@aolsenjazz Alexander Olsen (aolsenjazz) commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Overview

Documents the new providerToolSearchMiddleware on the prebuilt middleware page. Adds a JS-only "Provider tool search" section plus a JS middleware-table entry, and registers the providerToolSearchMiddleware symbol in link_map.py.

Type of change

Type: Update existing documentation

Related issues/PRs

  • Linear issue: LC-544

Checklist

  • I have read the contributing guidelines, including the language policy
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

Additional notes

@github-actions github-actions Bot added docs-infra langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects internal labels Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for opening a docs PR, Alexander Olsen (@aolsenjazz)! When it's ready for review, please add the relevant reviewers:

  • @npentrel or @lnhsingh (LangChain)

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

❌ Import check failed

This PR contains imports from langchain_core that should be imported from langchain instead.

Detailed issues
Analyzing diff for import issues...
 Found 1 import issues:

File: src/oss/langchain/middleware/built-in.mdx
Line: 2319
Issue: Import from langchain.tools instead of langchain_core.tools
Current:   from langchain_core.tools import tool
Suggested: from langchain.tools import tool
--------------------------------------------------------------------------------

 Found 1 import issues that need to be fixed.

Why this is a problem

The langchain package re-exports many modules and classes from langchain_core. When possible, imports should use langchain instead of langchain_core for:

  • Better user experience (single import source)
  • Consistency across documentation
  • Reduced cognitive load for users

How to fix

Replace the imports as suggested above. For example:

  • from langchain_core.messages import HumanMessage
  • from langchain.messages import HumanMessage

🤖 Automated check

This check is based on the latest analysis of langchain re-exports from langchain_core.

Mason Daugherty (mdrxy) added a commit to langchain-ai/langchain that referenced this pull request Jun 10, 2026
[Docs](langchain-ai/docs#4355)

Adds `ProviderToolSearchMiddleware` to let agents defer selected tools
behind OpenAI/Anthropic provider-native tool search while preserving
existing `extras={"defer_loading": True}` behavior. The middleware
validates searchable tool names, injects the provider search tool only
when a tool is deferred, and rejects unsupported providers up front.

Made by [Open SWE](https://openswe.vercel.app)

---------

Co-authored-by: Alexander Olsen <13665641+aolsenjazz@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: Mason Daugherty <github@mdrxy.com>
Co-authored-by: Mason Daugherty <mason@langchain.dev>
@github-actions

Copy link
Copy Markdown
Contributor

Mintlify preview branch generated: preview-alexpr-1781114723-5d436be

Site preview: https://langchain-5e9cc07a-preview-alexpr-1781114723-5d436be.mintlify.app

Important

Preview links may take a few minutes to start working while the deployment finishes.

Changed documentation pages (preview deep links):

@mdrxy Mason Daugherty (mdrxy) merged commit b4e3d54 into main Jun 10, 2026
21 checks passed
@mdrxy Mason Daugherty (mdrxy) deleted the alex/provider-tool-search-middleware branch June 10, 2026 18:06
</Accordion>

:::python
### Provider tool search

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally this would be outside of these blocks so that it's always the same heading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-infra internal langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants