Skip to content

Conversation

@RoyBA
Copy link
Contributor

@RoyBA RoyBA commented Nov 28, 2025

Fixes #2607

  • Replace deprecated langchain.* imports with langchain_core.*
  • Updates imports for Run, dumps, and BaseMessage
  • Resolves ModuleNotFoundError when using LangchainCallbackHandler with LangChain v1.x

Note: This PR uses the correct langchain_core.tracers.schemas.Run import, which is part of LangChain's core tracer interface. Another PR (#2695) uses langsmith.schemas.Run, but langchain_core is the proper source as it contains the base abstractions that LangChain's callback system is built on, while langsmith is specifically for the LangSmith monitoring service integration.


Summary by cubic

Updated LangChain imports to use langchain_core so the LangchainCallbackHandler works with LangChain v1.x. Fixes #2607 by resolving ModuleNotFoundError from deprecated langchain.* imports (dumps, BaseMessage, Run).

Written for commit 758e85d. Summary will update automatically on new commits.

Fixes Chainlit#2607

- Replace deprecated `langchain.*` imports with `langchain_core.*`
- Updates imports for Run, dumps, and BaseMessage
- Resolves ModuleNotFoundError when using LangchainCallbackHandler with LangChain v1.x
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. backend Pertains to the Python backend. bug Something isn't working labels Nov 28, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

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

Labels

backend Pertains to the Python backend. bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cl.LangchainCallbackHandler() - Not working with Langchain v1

1 participant