Documentation
¶
Overview ¶
Package agent is the machine whose tools a model picks: the model is asked what to do, the tools it picks are run, the results go back to it, and this repeats until it answers without asking for a tool.
Index ¶
Constants ¶
const DefaultTurns = 20
DefaultTurns is how many turns an agent has unless it says otherwise.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
Model Model `json:"model"`
System string `json:"system,omitzero"`
Prompt any `json:"prompt,omitzero"`
Tools map[string]*Tool `json:"tools,omitzero"`
// Turns is how many turns the agent has; twenty if it says nothing.
Turns int `json:"turns,omitzero"`
// Reply is the shape of the reply in the agent's result, where it is
// data and not text: each name with the type of its value.
Reply map[string]any `json:"reply,omitzero"`
// Conversation is a conversation so far, to carry on from.
Conversation any `json:"conversation,omitzero"`
// Turn is the job that makes a turn.
Turn *machine.JobSpec `json:"turn"`
}
Agent is the full form of an agent's own part of a definition.
type Model ¶
type Model struct {
Name string `json:"name"`
// Secret is the name of the secret that is the service's key.
Secret string `json:"secret,omitzero"`
// Service is which service's way of talking is spoken; it follows from
// the model's name where it is not given.
Service string `json:"service,omitzero"`
// Address is where the service lives, for one that is not at its usual
// place.
Address string `json:"address,omitzero"`
Effort string `json:"effort,omitzero"`
// ReplyTokens is the most a reply may hold, in tokens.
ReplyTokens int `json:"reply_tokens,omitzero"`
// Own are the tools of its own that a model run as a program may use:
// tools Corbie does not run.
Own []string `json:"own,omitzero"`
}
Model names the model an agent's turns are sent to.
type Tool ¶
type Tool struct {
Does string `json:"does"`
Args map[string]any `json:"args,omitzero"`
Job *machine.JobSpec `json:"job"`
// Agent says the tool's job is an agent: the model is shown what that
// agent replied, and not the conversation it had.
Agent bool `json:"agent,omitzero"`
}
Tool is a named job a model may pick, with what it does and the shape of its arguments.