Documentation
¶
Overview ¶
Package toolkit is the machine that answers requests for tools: an open gives its instructions and its tools, 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 tool 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 Answer ¶ added in v0.51.0
Answer is the answer to a call or a resume: a result, which ends the call, or working or requests for input, with the state a resume gives back.
type Item ¶ added in v0.51.0
type Item struct {
Kind string `json:"kind"`
Name string `json:"name"`
Description string `json:"description,omitzero"`
Args map[string]any `json:"args,omitzero"`
}
An Item is one tool or toolkit an open gives: its kind, its name, its description and, for a tool, the shape of its arguments.
type Opened ¶ added in v0.51.0
Opened is the answer to an open: the instructions, and each item.
type Request ¶ added in v0.51.0
type Request struct {
Do string
Toolkit []string
Tool string
Args any
State any
Responses any
Said string // what the caller says of the call, which a hook reads
}
A Request is what a run of a toolkit is asked, as its input's request: gives it. Toolkit is the path of names to a toolkit inside this one.
type Tool ¶
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.