Commit 8d3c457
fix: Update LangChain imports for v1.x compatibility (#2700)
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.
<!-- This is an auto-generated description by cubic. -->
---
## 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).
<sup>Written for commit 7fed064.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
Co-authored-by: Josh Hayes <[email protected]>1 parent 5b0abea commit 8d3c457
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments