Tools
Tools can be used to extend the capabilities of the agent. You can use them to call external APIs, handle logic, provide knowledge and much more. Additionally to the logic a tool can also have a UI component which can visualize the results of a tool.
Tool Definition
SAALT calls the /tools route to get all available tools. These will be provided to the LLM. If the LLM decides to use a tool a POST request is sent to /tools and the execution is handled by the App.
The bridge helps you to define and execute tools, but the logic can also be implemented without the bridge.
Tool Response
Example of a tool defined via the bridge
Code
execute must resolve to { result: unknown; error?: string } — put your payload under result, and set error (a string) when the tool call fails.
If you wish to implement tools in other programming languages you can easily do that. Simply implement a /tools route that returns an array of tool definitions, omitting the execute function.
On the post request a toolIdentifier is included in the body which can then be used to find the right tool the execute.
Tool Components
SAALT also lets you use custom federated React components to visualize tool calls and responses in the chat UI. To enable tool components you need to add the name of your federated tool component to the tool configurations. The chat UI will then attempt to fetch that component from your App.