Documentation
¶
Overview ¶
Package tools provides a registry, dispatch, and explicit JSON-Schema helpers for tools the LLM may call.
Schemas are explicit; the package does not generate schemas from struct types (ADR-018). Callers who want struct-driven schemas use invopop/jsonschema:
import jsonschema "github.com/invopop/jsonschema"
schema, _ := json.Marshal(jsonschema.Reflect(&FooArgs{}))
Tool handlers capture the dependencies they need (storage, logger, clock) at registration time via closure (ADR-021). The Env passed to a Handler carries only fields that genuinely change per dispatch: SessionID and TurnID.
Index ¶
- Variables
- func Array(items any, description string) map[string]any
- func Boolean(description string) map[string]any
- func Enum(description string, values ...string) map[string]any
- func Integer(description string) map[string]any
- func Number(description string) map[string]any
- func Object(props map[string]any, required ...string) json.RawMessage
- func String(description string) map[string]any
- type Env
- type Handler
- type Registry
- type Result
Constants ¶
This section is empty.
Variables ¶
var ( ErrDuplicateTool = errors.New("aikido/tools: duplicate tool registration") ErrUnknownTool = errors.New("aikido/tools: unknown tool") )
Functions ¶
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds tool definitions and their handlers.
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Dispatch ¶
Dispatch routes a ToolCall to its handler.
Returns ErrUnknownTool if the name is not registered. Argument bytes are passed verbatim — handlers parse them.