Help us shape the future of Go! Take the 2026 Go Developer Survey

aguiprovider

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 22 Imported by: 0

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.

func WithThreadID added in v0.1.1

func WithThreadID(id string) agent.Option

WithThreadID sets the AG-UI thread ID when creating a session. Thread IDs identify remote runs but do not imply that the service stores chat history. They are persisted in session state, not in agent.Session.ServiceID.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL