-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS SDK traceable is not compatible with langchain JS chain.invoke tracing #598
Comments
Ya we haven't created an automatic handoff yet. Thanks for flagging. The way around it is to conver tthe run tree into a callback manager |
Awesome, thanks for the reply. What's the best way to convert the RunTree into a callback manager? I'm mid implementation atm. |
I'm checking with the team, but we do something similar here: https://github.com/langchain-ai/langchainjs/blob/b9f63251fc7d6b2ab5b20189bc5dca2150413b49/langchain/src/smith/runner_utils.ts#L223 We do an auto-handoff in python but I don't believe we have addedit yet in js. Another option is to use |
Thanks, ended up using a class similar to RunnableLambda to meet my needs as seen here langchain-ai/langchainjs#5083 |
Same issue with RunTree's, using chain.invoke inside creates a new trace |
- Traceable to LangChain: add the entire tree of RunTrees into the BaseTracer `runMap`, assign the `_parentRunId` to the callback manager - LangChain to Traceable: the `RunnableTraceable` invokes the function without calling `*WithConfig`, avoiding unwanted callback invocation **Verifying package manager behaviour** Exposed the LangChain utilities + added `@langchain/core` as an optional dependency to allow supporting older versions of LangChain. - [x] Yarn 1.x: does not install the `@langchain/core`, not included in package-lock.json - [X] PNPM: does not install `@langchain/core`, included in package-lock.json - [X] NPM: does not install `@langchain/core`, included in package-lock.json - [X] Bun: does not install `@langchain/core`, included in package-lock.json - [X] Deno: does not install `@langchain/core` Upstream PR which implements similar functionality can be seen in langchain-ai/langchainjs#5339 Closes #598
Feature request
Any chains invoked inside a function wrapped with
traceable
have separate trace ids (or vice versa, with chains callingtraceable
functions internally).Ideally the trace id gets propagated automatically.
Related to langchain-ai/langchainjs#5083
Motivation
Increase compatibility with Langchain JS native tracing.
Example
The text was updated successfully, but these errors were encountered: