Documentation
¶
Overview ¶
Package durablechat is the public-contract Durable Chat example.
Index ¶
- func NewWebHandler(config WebConfig) (http.Handler, error)
- func RunTerminal(ctx context.Context, app *App, input io.Reader, output io.Writer) error
- type App
- func (app *App) Cancel(ctx context.Context, sessionID agentruntime.SessionID, ...) (agentruntime.Turn, error)
- func (app *App) NewSession(ctx context.Context, revision agentruntime.AgentRevisionID) (agentruntime.Session, error)
- func (app *App) Reconnect(ctx context.Context, sessionID agentruntime.SessionID, ...) (agentruntime.EventPage, error)
- func (app *App) Resume(ctx context.Context, sessionID agentruntime.SessionID) (agentruntime.SessionView, error)
- func (app *App) Send(ctx context.Context, sessionID agentruntime.SessionID, text string) (agentruntime.SendInputResult, error)
- type KeySource
- type RandomKeys
- type SessionClient
- type WebConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWebHandler ¶
NewWebHandler creates the minimal Durable Chat web UI. The UI never receives the runtime bearer credential; its local server owns the public SDK client.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App coordinates Durable Chat commands entirely through the public SDK.
func NewApp ¶
func NewApp(client SessionClient, keys KeySource) (*App, error)
NewApp constructs one Durable Chat application controller.
func (*App) Cancel ¶
func (app *App) Cancel(ctx context.Context, sessionID agentruntime.SessionID, turnID agentruntime.TurnID) (agentruntime.Turn, error)
Cancel records a durable cancellation request for one public Turn.
func (*App) NewSession ¶
func (app *App) NewSession(ctx context.Context, revision agentruntime.AgentRevisionID) (agentruntime.Session, error)
NewSession creates a Session pinned to the requested public Agent revision.
func (*App) Reconnect ¶
func (app *App) Reconnect(ctx context.Context, sessionID agentruntime.SessionID, cursor agentruntime.Cursor) (agentruntime.EventPage, error)
Reconnect resumes Product-event observation from the caller's last opaque Cursor.
func (*App) Resume ¶
func (app *App) Resume(ctx context.Context, sessionID agentruntime.SessionID) (agentruntime.SessionView, error)
Resume reads the durable Session projection after a server or browser restart.
func (*App) Send ¶
func (app *App) Send(ctx context.Context, sessionID agentruntime.SessionID, text string) (agentruntime.SendInputResult, error)
Send queues one bounded text Input behind any active Turn.
type RandomKeys ¶
type RandomKeys struct{}
RandomKeys creates opaque idempotency keys without deriving them from chat content.
type SessionClient ¶
type SessionClient interface {
CreateSession(context.Context, agentruntime.CreateSessionRequest) (agentruntime.Session, error)
SendInput(context.Context, agentruntime.SendInputRequest) (agentruntime.SendInputResult, error)
InspectSession(context.Context, agentruntime.SessionID) (agentruntime.SessionView, error)
Events(context.Context, agentruntime.SessionID, agentruntime.Cursor, int) (agentruntime.EventPage, error)
CancelTurn(context.Context, agentruntime.CancelTurnRequest) (agentruntime.Turn, error)
}
SessionClient is the deliberately narrow public SDK surface Durable Chat needs. It keeps the example independent of runtime implementation packages.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
durable-chat
command
Command durable-chat runs the Durable Chat web or terminal example through Agent Runtime's public Go SDK only.
|
Command durable-chat runs the Durable Chat web or terminal example through Agent Runtime's public Go SDK only. |