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
streamText({ model, messages, abortSignal: signal }),
30
+
run: async ({ messages, signal }) =>streamText({ model, messages, abortSignal: signal }),
32
31
});
33
32
```
34
33
@@ -160,13 +159,13 @@ Hard cutover — there is no compat shim. v4.5 is prerelease.
160
159
161
160
Customers building human-in-the-loop tools were re-implementing the same accumulator-walking logic to figure out which tool calls were pending, which were resolved, and which results in an incoming wire message were actually new. Lifted into the SDK as five new methods on `chat.history`:
162
161
163
-
| Method | Description |
164
-
|---|---|
165
-
|`chat.history.getPendingToolCalls()`| Tool calls on the most recent assistant message in `input-available` state — gates fresh user turns during HITL. |
166
-
|`chat.history.getResolvedToolCalls()`| All tool calls in the chain in `output-available` or `output-error` state. |
|`chat.history.getPendingToolCalls()`| Tool calls on the most recent assistant message in `input-available` state — gates fresh user turns during HITL.|
165
+
|`chat.history.getResolvedToolCalls()`| All tool calls in the chain in `output-available` or `output-error` state.|
167
166
|`chat.history.extractNewToolResults(message)`| Tool results in `message` whose `toolCallId` is not already resolved on the chain. Most useful in `hydrateMessages` against an incoming wire message, before the runtime merges it. |
168
-
|`chat.history.getChain()`| Same as `chat.history.all()` — alias that reads better alongside parent-aware APIs. |
169
-
|`chat.history.findMessage(messageId)`| Direct lookup; `undefined` if absent. |
167
+
|`chat.history.getChain()`| Same as `chat.history.all()` — alias that reads better alongside parent-aware APIs.|
168
+
|`chat.history.findMessage(messageId)`| Direct lookup; `undefined` if absent.|
170
169
171
170
```ts
172
171
// Refuse a regenerate while a tool call is awaiting an answer
@@ -291,7 +290,7 @@ Tool schemas (`description` + `inputSchema`) live in their own module that impor
291
290
292
291
### Compared to Preload
293
292
294
-
Preload eagerly triggers the run on page load (good when you're confident the user *will* send a message — trades idle compute for fast TTFC). Head Start gates the run on a real first message — no idle compute, customer's process runs step 1 directly. Pick one per chat.
293
+
Preload eagerly triggers the run on page load (good when you're confident the user _will_ send a message — trades idle compute for fast TTFC). Head Start gates the run on a real first message — no idle compute, customer's process runs step 1 directly. Pick one per chat.
295
294
296
295
### Works on every runtime
297
296
@@ -440,17 +439,19 @@ import { myAgent } from "./my-agent";
0 commit comments