cmd

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 24 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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

func AddTools(ctx server.Cmd, tools *toolkit.Toolkit) error

AddTools adds the tools whose credentials exist to the toolkit, apart from the memory, which a system adds, with its store. 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 NamespaceListCmd added in v1.0.0

type NamespaceListCmd struct{}

NamespaceListCmd lists the namespaces of the tools

func (*NamespaceListCmd) Run added in v1.0.0

func (cmd *NamespaceListCmd) Run(ctx server.Cmd) error

Run prints the namespaces, with how many tools each has, and their descriptions

type ToolCallCmd

type ToolCallCmd struct {
	Name  string `` /* 132-byte string literal not displayed */
	Input string `arg:"" name:"input" help:"Input to the tool as JSON, such as '{\"query\":\"London\"}'." optional:""`
}

func (*ToolCallCmd) Run

func (cmd *ToolCallCmd) Run(ctx server.Cmd) error

type ToolCommands

type ToolCommands struct {
	Namespaces NamespaceListCmd `cmd:"" name:"namespaces" help:"List the namespaces of the tools, and what they're for." group:"LLM TOOLS & AGENTS"`
	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 */
}

func (*ToolGetCmd) Run

func (cmd *ToolGetCmd) Run(ctx server.Cmd) error

type ToolListCmd

type ToolListCmd struct {
	schema.ToolListRequest
}

func (*ToolListCmd) Run

func (cmd *ToolListCmd) Run(ctx server.Cmd) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL