Documentation
¶
Overview ¶
Package llm is the plugin that calls a model: one call that gives the conversation so far, the tools on offer and what is wanted, and gets back what the model said, the tools it asked for, why it stopped and how many tokens were used.
Index ¶
Constants ¶
const ( StopEnd = "end" // it finished StopTools = "tools" // it asked for tools StopLength = "length" // it ran out of room )
Why a model stopped.
Variables ¶
var ( Images = []Accept{{"image/png", 5 << 20}, {"image/jpeg", 5 << 20}, {"image/gif", 5 << 20}, {"image/webp", 5 << 20}} Documents = []Accept{{"application/pdf", 32 << 20}} )
The types of content the services take beside text, and the largest of each, as the services say.
Functions ¶
func ResultText ¶
Types ¶
type Accept ¶
Accept is one type of content a service takes beside text, and the largest of it that it takes.
type Call ¶
type Call struct {
Model string
System string
Said []any // the conversation so far
Tools []any
Effort string
Room int // the most a reply may hold
// Address and Key are where a service on the web is and what opens it.
Address string
Key any
Limit time.Duration
// Own are the tools of its own that a program may use.
Own []string
// Shape is the shape of answer wanted, for a service that takes it
// itself.
Shape map[string]any
}
Call is one call to a model.
type File ¶
A File is content beside text that a part of the conversation carries: an image or a document, under the name the model knows it by.
type Reply ¶
type Reply struct {
Text string
Calls []any // each { id, name, args }
Stop string
Usage map[string]any
Kept any // parts the service wants back unchanged
}
Reply is what a model gave back.
type Service ¶
type Service struct {
Name string
// Address is where a service on the web usually lives. Program is,
// for one that is a program, the program that is started.
Address string
Program string
// Models are how the names of the models it is the usual service of
// begin. Known are models it is known to offer, by the names it knows
// them by: for a person choosing one. It takes any name, and what is
// not there is not listed.
Models []string
Known []string
// Tools are, for a program, the tools of its own it is known to have:
// for a person choosing which it may use. Any may be named.
Tools []string
// Efforts are the levels of effort it takes, and Accepts the kinds of
// content it takes beside text.
Efforts []string
Accepts []Accept
// Needs says, for a program, what a tool of the program's own could
// use: a group of permissions. Corbie does not run such a tool, so it
// is allowed only where that whole group is.
Needs func(tool string) string
// Shapes says the service has a way of its own to be given the shape
// of answer wanted. One that has none is told it in the system text.
Shapes bool
// Chat makes one call.
Chat func(job *plugin.Job, c *Call) (*Reply, error)
}
A Service is one way of reaching a model: an extension. One on the web speaks one service's way of talking; one that is a program starts it.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package claudecode is the model service that is a program: it starts Claude Code on the runner's machine and has it write one reply.
|
Package claudecode is the model service that is a program: it starts Claude Code on the runner's machine and has it write one reply. |