aguiserver

command
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package main provides a reference AG-UI HTTP server that exposes a gains agent via the AG-UI protocol over Server-Sent Events (SSE).

This server demonstrates how to integrate gains with AG-UI compatible frontends like CopilotKit. It uses only the Go standard library for HTTP.

Configuration is via environment variables:

AGUI_PORT         - Server port (default: 8000)
AGUI_LOG_LEVEL    - Log level: debug, info, warn, error (default: info)
GAINS_PROVIDER    - Provider: anthropic, openai, or google (required)
GAINS_MODEL       - Model override (optional, uses provider default)
GAINS_MAX_STEPS   - Max agent iterations (default: 10)
GAINS_TIMEOUT     - Agent timeout (default: 2m)
GAINS_DEMO_TOOLS  - Enable demo tools (default: true)
ANTHROPIC_API_KEY - Anthropic API key
OPENAI_API_KEY    - OpenAI API key
GOOGLE_API_KEY    - Google API key

Usage:

GAINS_PROVIDER=anthropic go run ./cmd/aguiserver

Debug logging (shows all events):

AGUI_LOG_LEVEL=debug GAINS_PROVIDER=anthropic go run ./cmd/aguiserver

Jump to

Keyboard shortcuts

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