Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent interface {
AddPlugin(Plugin)
RemovePlugin(string) bool
RemoveAllPlugins()
Events() chan<- Event
Run() error
CleanStop()
}
An agent can run (blocking) and respond to events with tool calls.
type Event ¶
type Event interface {
Kind() string
Content() JsonObject
}
An event is somthing that happens that can trigger the agent to respond.
type JsonObject ¶
type Plugin ¶
type Plugin interface {
// Get the unique name of this plugin.
Name() string
// Is this plugin internal / required by the agent to function? Internal plugins cannot be removed.
// Internal plugins will also not be removed when calling RemoveAllPlugins. and their cleanup method will neveer be called.
Internal() bool
// Load the plugin, returning tools, a channel of events, a function to call to cleanup the plugin, and an error if the plugin failed to load.
Load() ([]Tool, <-chan Event, func(), error)
}
A plugin is somthing that provides tools to the agent. A plugin can be loaded all-or-nothing, so if one tool fails none will be added. A plugin may also have an event channel (can be nil) that will be forwarded to the agent.
Click to show internal directories.
Click to hide internal directories.