Documentation
¶
Index ¶
Constants ¶
const ( // WeatherAPICredential is the key of the credential holding the // WeatherAPI key, which adds the weather tools WeatherAPICredential = "WEATHERAPI_API_KEY" // OllamaCredential is the key of the credential holding the Ollama API // key, which adds the web search and fetch tools OllamaCredential = "OLLAMA_API_KEY" // NewsAPICredential is the key of the credential holding the NewsAPI key, // which adds the news tools NewsAPICredential = "NEWSAPI_API_KEY" // HomeAssistantCredential is the key of the credential holding the Home // Assistant access token, which adds the Home Assistant tools, with the // HomeAssistantURLCredential credential HomeAssistantCredential = "HOMEASSISTANT_API_KEY" // HomeAssistantURLCredential is the key of the credential holding the URL // of the Home Assistant server, such as http://homeassistant.local:8123 HomeAssistantURLCredential = "HOMEASSISTANT_URL" )
Variables ¶
This section is empty.
Functions ¶
func AddTools ¶
AddTools adds the memory tools, which are always added, and the tools whose credentials exist, to the toolkit. API keys are read from the toolkit's credentials, and the tools' clients are created with the toolkit's client options. The tools which are added are logged, and those which aren't, such as when their credential doesn't exist, are logged as a warning, with why.
Types ¶
type ClientCommands ¶
type ClientCommands struct {
ToolCommands
}
type Flags ¶
type Flags struct{}
Flags are the toolkit's flags for the server, which has none yet: the tools are added when their credentials are set
func (Flags) WithToolkit ¶
func (flags Flags) WithToolkit(ctx server.Cmd, srv *servercmd.RunServer, fn func(*toolkit.Toolkit) error, opts ...toolkit.Opt) error
WithToolkit creates a toolkit for the server, with the server's tracer, and the server's client options, such as its timeout, with its name and version as the user agent, for the tools' clients, and then the options, such as its credentials provider, adds the tools whose credentials are set, registers its HTTP handlers with the server, when there is one, and then calls the function with the toolkit, returning any error
type ToolCallCmd ¶
type ToolCommands ¶
type ToolCommands struct {
ToolList ToolListCmd `cmd:"" name:"tools" help:"List the tools and agents which models can call." group:"LLM TOOLS & AGENTS"`
ToolGet ToolGetCmd `cmd:"" name:"tool" help:"Get a tool or agent by name, with the JSON schema of its input." group:"LLM TOOLS & AGENTS"`
ToolCall ToolCallCmd `cmd:"" name:"call" help:"Call a tool or agent, and print its result." group:"LLM TOOLS & AGENTS"`
}
type ToolGetCmd ¶
type ToolGetCmd struct {
Name string `` /* 132-byte string literal not displayed */
}
type ToolListCmd ¶
type ToolListCmd struct {
schema.ToolListRequest
}