aguiprovider

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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. Provider updates retain their original AG-UI event in agent.ResponseUpdate.RawRepresentation.

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