Tools are a fundamental building block in re-factor that enable LLMs to interact with external systems and perform real-world actions. Tools enable LLMs to go beyond generating text and perform real work on your behalf.
A tool is an interface that defines how an LLM can interact with an external system or resource. Tools can, subject to your permissions, provide a means for your LLM to:
The Tool Registry is a central repository where all tools you want to expose to your LLMs can be registered and managed. Each tool in the registry includes:
// Example tool definitionconst databaseTool = { name: 'query_database', description: 'Query the application database', parameters: { query: 'string', limit: 'number' }, returns: 'array'};// Example tool usage in a promptconst prompt = `You have access to a database query tool. To use it, call query_database with a SQL query and limit.`;