Skip to content
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

fix(js): LangChain / traceable handoff #678

Merged
merged 31 commits into from May 17, 2024
Merged

Conversation

dqbd
Copy link
Collaborator

@dqbd dqbd commented May 9, 2024

  • 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.

  • Yarn 1.x: does not install the @langchain/core, not included in package-lock.json
  • PNPM: does not install @langchain/core, included in package-lock.json
  • NPM: does not install @langchain/core, included in package-lock.json
  • Bun: does not install @langchain/core, included in package-lock.json
  • Deno: does not install @langchain/core

Upstream PR which implements similar functionality can be seen in langchain-ai/langchainjs#5339

Closes #598

@dqbd dqbd requested a review from hinthornw May 10, 2024 15:41
@dqbd dqbd force-pushed the dqbd/langchain-langsmith-handoff branch from 97aabcc to 0acabbb Compare May 13, 2024 02:24
@dqbd dqbd marked this pull request as ready for review May 13, 2024 02:29
@dqbd dqbd force-pushed the dqbd/langchain-langsmith-handoff branch 2 times, most recently from ba98cf3 to 2f63516 Compare May 15, 2024 15:31
@dqbd dqbd requested a review from jacoblee93 May 15, 2024 23:49
js/src/run_trees.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@jacoblee93 jacoblee93 left a comment

Choose a reason for hiding this comment

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

I think looks solid! A few questions/comments

@dqbd dqbd force-pushed the dqbd/langchain-langsmith-handoff branch from eb3b3e7 to 0c7105b Compare May 16, 2024 21:28
@dqbd dqbd requested a review from jacoblee93 May 16, 2024 21:30
js/src/env.ts Outdated Show resolved Hide resolved
@dqbd dqbd requested a review from jacoblee93 May 17, 2024 13:12
@dqbd dqbd merged commit 1f665b4 into main May 17, 2024
12 of 13 checks passed
@dqbd dqbd deleted the dqbd/langchain-langsmith-handoff branch May 17, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JS SDK traceable is not compatible with langchain JS chain.invoke tracing
2 participants