Introduction
ToolFuse
is a library for building tools for LLM-based agents.
It provides a simple interface for defining tools and their actions and observations.
Motivation
AI agent developers know that one of the biggest challenges in building agents is defining the tools they can use. Tools do specific tasks and interact with their environment. They can fetch data, navigate a UI, summarize text, review an image, type, click buttons, talk to an API, write to files, etc.
The challenge breaks down into multiple smaller problems:
- How to let the model know what tools it can use?
- How does the LLM know what the tool can do?
- How do we enforce the rules around the actions?
- How to wield that tool based on the model’s reasoning and response?
ToolFuse
focuses on all of these problems and makes it easier that ever to use tools.
Installation
ToolFuse
in action
Let’s take a look at a super simple example. Let’s say we have a class Desktop
that lets your agent
interact with that desktop and get information from the environment like the mouse postion, as well as
take actions like moving the mouse. The class gets defined as follows:
When we create an instance of the Desktop
class, we can use it with an agent, we can request a schema of the tool actions and observations:
Now, if we get a JSON that corresponds to this schema, we can feed it to a tool and ask it to perform an action.
What’s next?
- Look at the detailed example of using a Tool with an LLM at Weather Agent tutorial.