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

feat(core): add registerConfigureHook #7330

Merged
merged 8 commits into from
Dec 11, 2024

Conversation

ibolmo
Copy link
Contributor

@ibolmo ibolmo commented Dec 7, 2024

Follows similar pattern in LangChain (Python)

This allows langchain devs to register a callback without having to pass them explicitly in each invocation.

@ibolmo

Follows similar pattern in LangChain (Python)
Copy link

vercel bot commented Dec 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Dec 11, 2024 0:06am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Dec 11, 2024 0:06am

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Dec 7, 2024
@ibolmo ibolmo marked this pull request as ready for review December 8, 2024 00:34
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 8, 2024
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.

Thanks for the PR - looks good overall!

See comments for some nits, can apply myself later too.

langchain-core/src/callbacks/manager.ts Outdated Show resolved Hide resolved
langchain-core/src/callbacks/manager.ts Outdated Show resolved Hide resolved
@jacoblee93 jacoblee93 changed the title feature: add registerConfigureHook feat(core): add registerConfigureHook Dec 9, 2024
@jacoblee93 jacoblee93 added the close PRs that need one or two touch-ups to be ready label Dec 9, 2024
@jacoblee93
Copy link
Collaborator

Ah ok one more thing I realized - we need to be a little bit more clever so we don't pull in AsyncLocalStorage automatically for callbacks/manager and break web environments

@jacoblee93
Copy link
Collaborator

Need to fix a circular dep issue, will aim to get this in tomorrow or midweek

@jacoblee93 jacoblee93 added in progress PRs that are in progress but not ready to merge and removed close PRs that need one or two touch-ups to be ready labels Dec 10, 2024
@jacoblee93 jacoblee93 added lgtm PRs that are ready to be merged as-is and removed in progress PRs that are in progress but not ready to merge labels Dec 11, 2024
@jacoblee93
Copy link
Collaborator

May want to add a docs page later outside of API refs

@jacoblee93 jacoblee93 merged commit edea078 into langchain-ai:main Dec 11, 2024
36 checks passed
@jacoblee93
Copy link
Collaborator

Thanks again!

@ibolmo ibolmo deleted the register-configure-hook branch December 11, 2024 04:41
syntaxsec pushed a commit to aks-456/langchainjs that referenced this pull request Dec 13, 2024
Co-authored-by: jacoblee93 <jacoblee93@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features lgtm PRs that are ready to be merged as-is size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants