-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Add Toolset to tooling architecture #9161
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
Conversation
Pull Request Test Coverage Report for Build 14266761775Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I don't particularly like the fact that we would have to change all ChatGenerators, but right now I don't see any other way to do Pipeline/YAML support
- We also talked about giving users the ability to filter tools e.g. from MCP server. How do you envision this? How can this be supported in Pipeline/YAML?
Yeah - neither do I but as you say - there doesn't seem to be another option. Perhaps we can zero-in on the changes required - as exemplified - by OpenAIChatGenerator - so that the changes are minimal, clear and easy to apply in one swoop over all chat generators, e.g. in this early cycle and targeting for 2.13 release
I would defer it to custom impls of Toolset subclasses as they are all free to do whatever filtering the see the most suitable. For example via init param as a list of tool names. |
I understand. It would be great if you can show a pseudocode example for this use case. Thinking of MCP, this seems a common use case: you have several tools available, but you want to restrict your Pipeline to only use some of them. |
Ok, yes roughly something like this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall design looks good.
I found some details to be refined.
@bilgeyucel have a look now please |
Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
Have another look @anakin87 at the pydoc of Toolset - much better now IMHO, thanks for single-ing this out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is getting a little hard to follow and review.
Here's what we could try:
- Go through my comments and close the related GitHub conversations (linking the relevant commits if possible).
- Tidy up the tests: remove duplicates or less important ones, and consolidate most of them in test_toolset.py to keep things readable.
- Keep in mind that integration tests don't contribute to the coverage - let's try to avoid them because they don't give benefits in this case and increase time spent by the CI.
- Ping me when you need another review (or use the Re-request review button).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's much better.
I have some suggestions for tests removal.
@anakin87 I was a bit hesitant to commit the suggested changes above - but check the latest commit - I think it does what you suggested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for me.
Feel free to ask @bilgeyucel for another review.
@bilgeyucel @dfokina I'll integrate this now so we can update all ChatGenerators to use Toolset - if something minor comes up we can adjust it, still lots of time till next release. |
Why:
Enhances the tooling infrastructure by introducing a new abstraction, the
Toolset
class, to facilitate the grouping and management of related tool functionalities, supporting dynamic tool loading and registration.What:
Toolset
class to manage collections of tools and enable dynamic loading of tool configurations.__init__.py
to include theToolset
in the exposed API.Toolset
class to ensure its functionality.How can it be used:
The
Toolset
class can be used to group related tools into a cohesive unit, allowing for easier management and potential dynamic loading from external sources:How did you test it:
Tests were written to validate the
Toolset
functionality, including registration of tools, serialization/deserialization, and integration within a pipeline. Specific methods likeToolInvoker
were used to test tool invocation. Tests confirm that tools can be dynamically loaded, executed, and serialized correctly.Notes for the reviewer:
Please pay special attention to the dynamic loading capabilities and serialization logic within the
Toolset
. Ensure there are no name conflicts when registering tools and that the integration tests cover all intended use cases.