Toolpacks
Defining a Toolpack
import { Tool, Toolpack } from '@obayd/agentic';
// Define some tools first
const searchFilesTool = Tool.make("search_files")
.description("Searches user's files by keyword.")
.param("keyword", "Search keyword", { required: true })
.action(async (params) => `File A matching ${params.keyword}`);
const readFileTool = Tool.make("read_file")
.description("Reads the content of a specific file.")
.param("filename", "The name of the file to read.", { required: true })
.action(async (params) => ({ content: `Content of ${params.filename}...` }));
// Create a Toolpack and add the tools
const fileManagementPack = Toolpack.make("file_management") // Unique name
.description("Tools for searching and reading user files.") // Description of the pack
.add(searchFilesTool, readFileTool, /* ... */) // Add a single tool, or multiple tools
// You can also chain tool definitions directly
const webToolsPack = Toolpack.make("web_tools")
.description("Tools for interacting with the web.")
.add(
Tool.make("browse_page")
.description("Gets the content of a webpage.")
.param("url", "URL to browse", { required: true })
.action(async (params) => ({ content: `Content of ${params.url}...` }))
);
Configuration Methods
Using Toolpacks in Conversation
Using Enabled Tools
Benefits of Toolpacks
Last updated