-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add Tool Registry Feature #234
Conversation
I would recommend packaging this into an external third-party library, rather than including this in the There are already alternative implementations such as LangChain's tool calling feature, and as not everyone requires tools, adding extra dependencies such as |
Thank you for your feedback on my PR. Would it be helpful if I refactored the PR to make this feature optional, perhaps as a separate module within |
I can't speak for the team, but personally, I think the best approach is a third-party library. You can add it to the Libraries section of the But as I said, this is my opinion. Maybe they have a different vision. |
i think it's fantastic :-) thanks for this , overdue even :-) |
No problem, I understand what you're trying to say. If you guys decide to close this PR, I'll go and release it as a third party library. Thanks for your time! |
I am glad you found this feature useful. You're most welcome! |
@TheEpic-dev I removed pydantic dependency :). You can take a look at this commit: 637f9a9 |
Hi, I have released this feature as a separate library: https://github.com/synacktraa/tool-parse. I will now close this PR👍 |
@synacktraa I believe you would be interested in reviewing #238 or collaborating on your new tool-parse library. I think we're attacking the same problem from slightly different places but can converge. |
Nice implementation without introducing any dependencies, although I ended up making pydantic optional there is still docstring_parser. I was already thinking about using annotated type for adding parameter description like autogen and your implementation does. With the help of annotated even docstring_parser can be made optional. |
Description
This PR introduces a new
ToolRegistry
class to the Ollama library. The Tool Registry is designed to manage various tools, including functions (both synchronous and asynchronous),pydantic.BaseModel
,typing.TypedDict
, andtyping.NamedTuple
. It provides functionality to generate schemas for these tools, which are essential for LLM tool-calling, and allows for the invocation of tools using their metadata.Features
Changes I've made:
tool_calling
which stores all functionality of tool registry.ToolRegistry
class. (All tests passed)How to use this functionality?
Creating a tool registry
Adding tools to the registry instance
Get tool schema list
Invoking the tool