Skip to main content

Tools

Tools are functions and descriptions of their parameters and purpose. They can be used by language models in prompts to execute actions. This enables chatbots and agents to go beyond generating text and to interact with the world.

ModelFusion comes with two main functions for invoking tools:

  • Run Tool: a function that generates a single tool call and executes the tool with the generated arguments.
  • Run Tools: a function that generates multiple tool calls and/or text from a prompt, and then executes the tools.

ModelFusion also provides several tools as standalone packages. You can also create your own tools:

You can run tools inside an agent loop:

  • Agent Loop: an example of how to use the building blocks to run an agent loop that generates tool calls and text from a prompt, and then executes the tools.

Finally, ModelFusion offers some advanced functions for using tools:

  • Execute Tool: a function that executes a tool with the provided arguments.
  • Generate Tool Call: a function that generates a tool call for a specific tool from a prompt.
  • Generate Tool Calls: a function that generates a set of tool calls and text from a prompt. This is useful for chat agents that need to decide whether to run tools or to generate text.