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 with CallbackHandlers #7317

Closed
wants to merge 4 commits into from

Conversation

FilipZmijewski
Copy link
Contributor

This PR introduces callbacks that are passed to our Watsonx sdk

FilipZmijewski and others added 4 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 <[email protected]>
…nx (#31)

Provide fixes to bugs that were found during usage of multiple components
* Add callbacks
* Update sdk package
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 4, 2024
Copy link

vercel bot commented Dec 4, 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 4, 2024 2:29pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Dec 4, 2024 2:29pm

@FilipZmijewski FilipZmijewski marked this pull request as draft December 4, 2024 14:04
@dosubot dosubot bot added auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Dec 4, 2024
@FilipZmijewski FilipZmijewski changed the title Introduce callbacks to IBM Watsonx SDK feat(community): Introduce callbacks to IBM Watsonx SDK Dec 4, 2024
@FilipZmijewski FilipZmijewski marked this pull request as ready for review December 4, 2024 14:21
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. auto:improvement Medium size change to existing code to handle new use-cases and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Dec 4, 2024
@@ -631,19 +630,25 @@ export class ChatWatsonx<
async *_streamResponseChunks(
messages: BaseMessage[],
options: this["ParsedCallOptions"],
_runManager?: CallbackManagerForLLMRun
_runManager?: WatsonxCallbackManagerForLLMRun
Copy link
Collaborator

@jacoblee93 jacoblee93 Dec 4, 2024

Choose a reason for hiding this comment

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

Don't think you want to type it this way

And in general are you able to just use this instead?

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

Copy link
Contributor Author

@FilipZmijewski FilipZmijewski Dec 5, 2024

Choose a reason for hiding this comment

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

@jacoblee93 How would you recommend to type it? We are extending class in this case. I don't think dispatching custom events help much. We just want to pass the callbacks that we create to our SDK, so nothing but passing the callbacks happens on langchain side. The case is that it would be good to still pass it in callbacks property

@jacoblee93 jacoblee93 added the question Further information is requested label Dec 4, 2024
@FilipZmijewski FilipZmijewski marked this pull request as draft December 6, 2024 15:31
@FilipZmijewski FilipZmijewski changed the title feat(community): Introduce callbacks to IBM Watsonx SDK feat(community): Introduce callbacks to IBM Watsonx SDK with CallbackHandlers Dec 6, 2024
@FilipZmijewski
Copy link
Contributor Author

FilipZmijewski commented Dec 6, 2024

@jacoblee93 We have discussed this case and proceeded with following implementation that will be much simpler. Converted this to draft and created new PR. If you could have a look at it and provide feedback if that is a better case: #7329

@jacoblee93 jacoblee93 closed this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features auto:improvement Medium size change to existing code to handle new use-cases question Further information is requested 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