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(community): Introduce callbacks to IBM Watsonx SDK #7329

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

FilipZmijewski
Copy link
Contributor

This PR introduces callbacks that are passed to our Watsonx sdk

FilipZmijewski and others added 3 commits November 26, 2024 11:19
* Fixed missing tool_choice in call options of chat (#30)

* Add rerank implementation to existing IBM community implementation (#25)

Extend existing implementation

- rename variables to camelCase
- remove default values for model
- Update and remove some tests
- update urls in documentation, shrink outputs

* Add fixes according to review (#32)

* Add fixes according to review
* Upload config info

* Fix notebooks

* Fix notebook

* Add to sidebar

* Show in docs

* Fix doc

---------

Co-authored-by: jacoblee93 <jacoblee93@gmail.com>
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 6, 2024
Copy link

vercel bot commented Dec 6, 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 💬 Add feedback Dec 10, 2024 11:13am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Dec 10, 2024 11:13am

@jacoblee93
Copy link
Collaborator

Think it'd be nicer to map your internal events to our custom events to avoid a developer needing to use two different systems

But this is ok, thank you!

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Dec 10, 2024
@jacoblee93
Copy link
Collaborator

CI is throwing some errors (possibly due to the version bump?)

src/document_compressors/ibm.ts(169,5): error TS2322: Type '({ index: number; relevanceScore: number; input: { text: string; }; } | { index: number; relevanceScore: number; input?: undefined; })[]' is not assignable to type '{ index: number; relevanceScore: number; input?: string | undefined; }[]'.

@jacoblee93 jacoblee93 added the hold On hold label Dec 10, 2024
@FilipZmijewski
Copy link
Contributor Author

This is correct, version bump issue which I somehow did not see. Fixed now.

@FilipZmijewski
Copy link
Contributor Author

Also, I am having troubles understanding what "mapping events to out custom events" means, if you could provide any slice of documentation for that maybe I would be able to understand that a little bit more. Thank you!

@jacoblee93
Copy link
Collaborator

jacoblee93 commented Dec 10, 2024

Also, I am having troubles understanding what "mapping events to out custom events" means, if you could provide any slice of documentation for that maybe I would be able to understand that a little bit more. Thank you!

Pass some custom callbacks into your SDK

Then use dispatchCustomEventWeb (or I think you can call handleCustomEvent on the callback manager directly):

https://js.langchain.com/docs/how_to/callbacks_custom_events/

User then can hook into it via the LangChain system

I don't really think it matters much

@jacoblee93 jacoblee93 merged commit ee0e8a2 into langchain-ai:main Dec 10, 2024
32 checks passed
@jacoblee93
Copy link
Collaborator

Thanks!

syntaxsec pushed a commit to aks-456/langchainjs that referenced this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases hold On hold 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