Skip to content

Conversation

@bansalkanav
Copy link
Contributor

Description:

Updated the documentation to import tool directly from langchain_core.tools instead of langchain.tools.

langchain.tools is a thin wrapper that simply re-exports tool from langchain_core.tools, adding no functional value and introducing an unnecessary import layer. This change improves clarity, aligns with the core API, and makes the documentation more future-proof with respect to version stability.

Issue: N/A

Dependencies: None

Twitter handle: N/A

@github-actions github-actions bot added external User is not a member of langchain-ai langchain For docs changes to LangChain oss labels Dec 16, 2025
@github-actions
Copy link
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 6 import issues:

File: src/oss/langchain/tools.mdx
Line: 21
Issue: Import from langchain.tools instead of langchain_core.tools
Current:   from langchain_core.tools import tool
Suggested: from langchain.tools import tool
--------------------------------------------------------------------------------
File: src/oss/langchain/tools.mdx
Line: 234
Issue: Import from langchain.tools instead of langchain_core.tools
Current:   from langchain_core.tools import tool
Suggested: from langchain.tools import tool
--------------------------------------------------------------------------------
File: src/oss/langchain/tools.mdx
Line: 274
Issue: Import from langchain.tools instead of langchain_core.tools
Current:   from langchain_core.tools import tool
Suggested: from langchain.tools import tool
--------------------------------------------------------------------------------
File: src/oss/langchain/tools.mdx
Line: 310
Issue: Import from langchain.tools instead of langchain_core.tools
Current:   from langchain_core.tools import tool
Suggested: from langchain.tools import tool
--------------------------------------------------------------------------------
File: src/oss/langchain/tools.mdx
Line: 409
Issue: Import from langchain.tools instead of langchain_core.tools
Current:   from langchain_core.tools import tool
Suggested: from langchain.tools import tool
--------------------------------------------------------------------------------
File: src/oss/langchain/tools.mdx
Line: 535
Issue: Import from langchain.tools instead of langchain_core.tools
Current:   from langchain_core.tools import tool
Suggested: from langchain.tools import tool
--------------------------------------------------------------------------------

 Found 6 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.

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

Labels

external User is not a member of langchain-ai langchain For docs changes to LangChain oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant