tool

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package tool defines the Tool interface and a thread-safe registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry holds Tools and provides thread-safe lookup.

func NewRegistry

func NewRegistry(tools []Tool) *Registry

NewRegistry creates a Registry from a slice of Tools. Duplicate names cause a panic.

func (*Registry) Get

func (r *Registry) Get(name string) Tool

Get returns a Tool by name, or nil if not found.

func (*Registry) Tools

func (r *Registry) Tools() []Tool

Tools returns all registered tools.

type Tool

type Tool interface {
	Name() string
	Description() string
	Schema() any // JSON Schema for tool parameters
	Call(args string) (string, error)
}

Tool is the interface the agent uses to discover and invoke capabilities. It's identical to the top-level odek.Tool — re-exported here for internal use.

Jump to

Keyboard shortcuts

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