Documentation
¶
Overview ¶
Package aguiprovider exposes agents over the AG-UI protocol, streaming agent responses as AG-UI events with HTTP handler and hosting support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAgent ¶
func NewAgent(aclient *aguiSSEClient.Client, config AgentConfig) *agent.Agent
NewAgent creates a new agent.Agent backed by a remote agent that speaks the AG-UI protocol over Server-Sent Events via the AG-UI client. It panics if aclient is nil.
func NewJSONHTTPHandler ¶
func NewJSONHTTPHandler(hostedAgent *agent.Agent, cfg HandlerConfig) http.Handler
NewJSONHTTPHandler returns an http.Handler that hosts hostedAgent behind the AG-UI protocol: it accepts POSTed AG-UI run input and streams the agent's response back as AG-UI Server-Sent Events. It panics if hostedAgent is nil.
Types ¶
type AgentConfig ¶
type AgentConfig struct {
agent.Config
// ToolAutoCall configures automatic function-tool invocation. When nil, defaults
// are used.
ToolAutoCall *toolautocall.Config
// Instructions are sent to AG-UI as a leading system message for each run.
Instructions string
// Decoder decodes the AG-UI event stream. When nil, a default decoder is used.
Decoder *aguiEvents.EventDecoder
}
AgentConfig contains configuration for NewAgent.
type HandlerConfig ¶
type HandlerConfig struct {
// Logger receives handler diagnostics. When nil, logs are discarded.
Logger *slog.Logger
}
HandlerConfig contains configuration for NewJSONHTTPHandler.
Click to show internal directories.
Click to hide internal directories.