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
docs: add input streams documentation to realtime guides
Cover the problems input streams solve (cancelling AI SDK streamText
mid-stream, human-in-the-loop workflows, interactive agents), the full
API surface (on, once, peek, send), and a complete cancellable AI
streaming example.
Updates rules/4.3.0/realtime.md, manifest.json, and the Claude Code
skill docs.
https://claude.ai/code/session_01SJHJts7r2yAxmoKLLz8vpc
Copy file name to clipboardExpand all lines: .claude/skills/trigger-dev-tasks/realtime.md
+140Lines changed: 140 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ Realtime allows you to:
9
9
- Subscribe to run status changes, metadata updates, and streams
10
10
- Build real-time dashboards and UI updates
11
11
- Monitor task progress from frontend and backend
12
+
- Send data into running tasks with input streams
12
13
13
14
## Authentication
14
15
@@ -103,6 +104,143 @@ for await (const chunk of stream) {
103
104
}
104
105
```
105
106
107
+
## Input Streams
108
+
109
+
Input streams let you send data **into** a running task from your backend or frontend. Output streams send data out of tasks; input streams complete the loop.
110
+
111
+
### Problems Input Streams Solve
112
+
113
+
**Cancelling AI streams mid-generation.** When you use AI SDK's `streamText` inside a task, the LLM keeps generating tokens until it's done — even if the user has navigated away or clicked "Stop generating." Without input streams, there's no way to tell the running task to abort. With input streams, your frontend sends a cancel signal and the task aborts the LLM call immediately.
114
+
115
+
**Human-in-the-loop workflows.** A task generates a draft, then pauses and waits for user approval before proceeding.
116
+
117
+
**Interactive agents.** An AI agent running as a task needs follow-up information from the user mid-execution.
0 commit comments