gateway

command
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

cmd/gateway — HTTP gateway that exposes a go-agent as a REST API.

Endpoints:

POST /chat        synchronous chat: {session, message} → {response}
POST /stream      SSE streaming:    {session, message} → text/event-stream
GET  /health      liveness check:   → {ok: true}

Examples (no API key required — uses dummy model by default):

go run .
curl -s -X POST http://localhost:8080/chat \
     -H "Content-Type: application/json" \
     -d '{"session":"alice","message":"Hello!"}'

# Switch to a real provider:
export GOOGLE_API_KEY=...
go run . -provider gemini -model gemini-2.5-flash

Jump to

Keyboard shortcuts

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