Documentation
¶
Overview ¶
Package toolkit is the machine that answers requests for tools: an open gives its instructions and its entries, and a call runs one tool. Its tools are written in its definition, or one job answers every request.
Index ¶
Constants ¶
const ( Open = "open" Call = "call" Resume = "resume" Cancel = "cancel" )
What a request asks, as its do: says.
const ( KindTool = "tool" KindToolkit = "toolkit" )
The kinds of entry an open gives.
const (
DefaultResume = 10 * time.Minute
)
DefaultResume is how long a resume waits for work to end by default, and defaultWait how long it waits between two asks where the answer gives no time.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tool ¶
type Tool struct {
Description string `json:"description"`
Args map[string]any `json:"args,omitzero"`
Job *machine.JobSpec `json:"job"`
// Machine is the file of the machine the tool names, and Call its
// location. Job runs it with the input the tool fixes.
Machine string `json:"machine,omitzero"`
Call string `json:"call,omitzero"`
}
Tool is a named job a call runs, with its description and the shape of its arguments, a JSON Schema of an object. Written machine: or call: it names a machine, whose description it takes, and its arguments are that machine's input without the names the tool fixes.
type Toolkit ¶
type Toolkit struct {
// Instructions are the text an open gives, filled from the input.
Instructions string `json:"instructions,omitzero"`
Tools map[string]*Tool `json:"tools,omitzero"`
// Job answers every request, in place of Instructions and Tools.
Job *machine.JobSpec `json:"job,omitzero"`
// Resume is how long a resume waits for work to end; ten minutes if it
// says nothing.
Resume machine.Duration `json:"resume,omitzero"`
}
Toolkit is the full form of the fields of a definition that only a toolkit has. It has Tools, or Job.