Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Definition ¶
type Definition struct {
Name string
Description string
// InputSchema is the JSON Schema describing the tool's input parameters.
InputSchema *jsonschema.Schema
}
Definition holds the metadata that describes a tool to an LLM.
type Tool ¶
type Tool interface {
// Definition returns the tool's metadata used by the LLM to understand and call the tool.
Definition() Definition
// Run executes the tool with the given arguments JSON string and returns the result as a string.
Run(ctx context.Context, toolCallID string, arguments string) (string, error)
}
Tool is a provider-agnostic interface for tools that can be invoked by an LLM.
func WithTimeout ¶ added in v0.0.3
WithTimeout wraps t so that each Run invocation is bounded by the given timeout. The timeout is applied on top of any deadline already present in the incoming context, so the shorter of the two wins. A zero or negative duration is a no-op and returns t unchanged.
Click to show internal directories.
Click to hide internal directories.