Skip to content

Conversation

@mdrxy
Copy link
Member

@mdrxy mdrxy commented Dec 10, 2025

4/5 of the listed examples did not run successfully. Hydrated examples to work e2e when copy / pasting

@github-actions github-actions bot added internal langchain For docs changes to LangChain python For content related to the Python version of LangChain projects oss and removed internal labels Dec 10, 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 3 import issues:

File: src/oss/python/integrations/middleware/anthropic.mdx
Line: 81
Issue: Import from langchain.messages instead of langchain_core.messages
Current:   from langchain_core.messages import HumanMessage
Suggested: from langchain.messages import HumanMessage
--------------------------------------------------------------------------------
File: src/oss/python/integrations/middleware/anthropic.mdx
Line: 506
Issue: Import from langchain.messages instead of langchain_core.messages
Current:   from langchain_core.messages import HumanMessage
Suggested: from langchain.messages import HumanMessage
--------------------------------------------------------------------------------
File: src/oss/python/integrations/middleware/anthropic.mdx
Line: 567
Issue: Import from langchain.messages instead of langchain_core.messages
Current:   from langchain_core.messages import HumanMessage
Suggested: from langchain.messages import HumanMessage
--------------------------------------------------------------------------------

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

@github-actions
Copy link
Contributor

Mintlify preview ID generated: preview-mdrxyf-1765341759-4660171

@github-actions
Copy link
Contributor

Mintlify preview ID generated: preview-mdrxyf-1765343241-c0ef69d

@mdrxy mdrxy merged commit 9604d85 into main Dec 10, 2025
14 checks passed
@mdrxy mdrxy deleted the mdrxy/fix-thropic-middleware branch December 10, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants