You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1ea559a
Browse filesBrowse the repository at this point in the historyBrowse files
docs: 4.8.0 follow-ups for agent examples, MCP secrets and self-hosted webhooks
Docs updates for 4.8.0: `chat.agent` examples use the `streamText`
passed to `run()`, the webhook secret MCP tools document
`previousSecretTtlSeconds`, self-hosting docs cover turning on webhooks
and `KUBERNETES_POD_RESERVED_SOURCE_PORTS`, and the agents overview
introduces channels.
Mono-RevId: 3eb1ed33ef2e0e21cd1197391b71a3a7c57e9785
Copy file name to clipboardExpand all lines: docs/ai-chat/overview.mdx
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,11 +56,12 @@ See [Quick Start](/ai-chat/quick-start) for the matching server actions and a ru
56
56
57
57
## How it fits together
58
58
59
-
Three primitives, related but distinct:
59
+
Four primitives, related but distinct:
60
60
61
61
-**Chat agents** — the SDK surface you define with [`chat.agent()`](/ai-chat/backend#chat-agent). Owns the turn loop, lifecycle hooks, and the response stream.
62
62
-**Sessions** — the durable, bi-directional channel keyed on `chatId` that holds the conversation across run boundaries. A chat agent runs *on top of* a [Session](/ai-chat/sessions).
63
63
-**Sub-agents** — Delegate work from one agent to another via [`AgentChat`](/ai-chat/patterns/sub-agents). The sub-agent runs as its own durable agent on its own session; its response streams back through the parent as preliminary tool results, so the frontend sees the sub-agent working inside the parent's tool card.
64
+
-**Channels** connect an agent to a surface other than your frontend. [`slack()`](/webhooks/slack) and [`linear()`](/webhooks/linear) turn an agent into a Slack or Linear agent, and [`chat.channels.custom()`](/webhooks/channels) connects any chat surface that sends webhooks. Each conversation there is still a durable session, and the reply posts back to the surface.
The `streamText` passed to `run()` applies the stored prompt: its system text, its model (resolved through the agent's `registry`), its `config`, and telemetry that links each generation to the prompt version. Options you pass at the call site win, apart from `system`, which throws when a prompt already sets one.
255
+
252
256
### chat.toStreamTextOptions()
253
257
254
-
Returns an options object ready to spread into `streamText()`. When a prompt is stored via `chat.prompt.set()`, it includes:
258
+
Inside a `chat.agent` you don't need this: the `streamText` passed to `run()` applies the same options. Use `chat.toStreamTextOptions()` when you call `streamText` yourself, as in a [custom agent](/ai-chat/custom-agents). It returns an options object ready to spread into `streamText()`. When a prompt is stored via `chat.prompt.set()`, it includes:
255
259
256
260
-`system` — the compiled prompt text
257
261
-`model` — resolved via the `registry` when provided
0 commit comments