🧰 Tools
Ayo can use all tools from its toolbox to take actions on your local system.
Toolbox
The toolbox is a directory where ayo looks for tools to use.
By default, ayo will look into ~/.config/ayo/toolbox.
You can change the toolbox location by setting the AYO_TOOLBOX environment variable.
Tool
A tool is a JSON file that describes how ayo can use a command on your system.
{
"type": "function",
"function": {
"name": "cat",
"description": "Get the content of a file",
"parameters": {
"type": "object",
"properties": {
"file": {
"type": "string",
"description": "The file to read"
}
},
"required": [
"file"
]
}
},
"cmd": "cat",
"args": [
"{{.file}}"
]
}
Breaking down the JSON file:
typeis the type of tool. Currently, onlyfunctionis supported.functiondescribes the function which will be sent to the model.nameis the name of the function. It must be unique in ayo's toolbox.descriptionis a short description of the function.parametersdescribes the parameters of the function.typeis the type of the parameters. Currently, onlyobjectis supported.propertiesdescribes the properties of the object.requiredis an array of required properties.
cmdis the command to run. It will be executed using theos/execpackage.argsis an array of arguments to pass to the command. The arguments can be templated using Go's text/template package. The template will be executed with the function's parameters values returned by the model.