Documentation
¶
Overview ¶
web-chat exposes an Agent over AG-UI Server-Sent Events with a single bridge call. Drivers without token deltas still surface their final Result.Text as one assistant message before the AG-UI terminal event.
The bridge takes an adaptor.Runner, the interface both *Agent and *Thread satisfy. Hand it the Agent and it binds each request to agent.Thread(<key derived from the inbound threadId>); hand it a Thread and the conversation is pinned by the host instead.
Usage:
go run ./examples/web-chat
# In another terminal:
curl -N -X POST http://localhost:8080/v1/chat \
-H 'Content-Type: application/json' \
-d '{"threadId":"demo","messages":[{"id":"1","role":"user","content":"write a haiku"}]}'
Or open http://localhost:8080/ in a browser for a tiny JS chat page.
The server requires the selected local CLI in PATH and existing authentication.
Directories
¶
| Path | Synopsis |
|---|---|
|
web-chat/aguiclient is the minimal-middleware AG-UI demo:
|
web-chat/aguiclient is the minimal-middleware AG-UI demo: |
|
web-chat/copilotkit combines the SDK's unified Event stream with CopilotKit's React UI through the AG-UI protocol.
|
web-chat/copilotkit combines the SDK's unified Event stream with CopilotKit's React UI through the AG-UI protocol. |
Click to show internal directories.
Click to hide internal directories.