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 ecca79f
Browse filesBrowse the repository at this point in the historyBrowse files
feat(agent): add a text-completion projection to Agent definitions (#52)
Runs with `completion: 'text'` drop the Definition's completion Tool and then
decode the final text as Schema JSON, which streams raw JSON to readers of the
live text. Add an optional `textCompletion` projection to `Agent.make` so one
Definition serves Runs finished by its completion Tool and Runs finished as
plain assistant text. On a `'text'` Run the final assistant text is taken
verbatim, rejected when empty, and projected and encoded as the output; a Run
that keeps its completion Tool never uses the projection. The per-Run
definition copies in the engine and the durable runtime keep `textCompletion`
only on `'text'` Runs, the model-visible output contract asks for ordinary text,
and the replay digest gains a structural presence marker only when configured.
Co-authored-by: systemfsoftware-bot <318394648+systemfsoftware-bot@users.noreply.github.com>
Add `textCompletion` to `Agent.make` so one Definition can complete a `completion: "text"` Run from its final assistant text while other Runs keep the completion Tool. On such a Run the text is projected through `textCompletion`, rejected when empty, and encoded as the output.
|`completion`|`"text"` drops the Definition's completion Tool for this Run. The final text is decoded through the Definition's output Schema, as for a Definition without a completion Tool. `"definition"` keeps the default. |
18
-
|`contextTokenLimit`| Replaces the policy's `contextTokenLimit` for this Run; it must be a positive integer. Whenever a context limit applies, the compaction pressure check also counts the largest tool result of the most recent Tool batch, so the next Turn has room for a result that size. |
19
-
|`toolResultExemption`|`exempt(request)` returns `true` to keep one oversized result inline instead of truncating and offloading it. An exempted result is still bounded by `maxBytes` (a positive integer) and, for durable Runs, by the record limit. |
|`completion`|`"text"` drops the Definition's completion Tool for this Run. The final assistant text is taken verbatim and, when the Definition sets `textCompletion`, projected through it; otherwise it decodes through the output Schema as JSON, or is the output directly for `Output.text`, as for a Definition without a completion Tool. `"definition"` keeps the default.|
18
+
|`contextTokenLimit`| Replaces the policy's `contextTokenLimit` for this Run; it must be a positive integer. Whenever a context limit applies, the compaction pressure check also counts the largest tool result of the most recent Tool batch, so the next Turn has room for a result that size. |
19
+
|`toolResultExemption`|`exempt(request)` returns `true` to keep one oversized result inline instead of truncating and offloading it. An exempted result is still bounded by `maxBytes` (a positive integer) and, for durable Runs, by the record limit. |
20
20
21
21
The exemption request carries `toolName`, `toolCallId`, `turn`, `isFailure` and the encoded byte
22
22
length. It is called only for results larger than `toolResultBounds.maxBytes`.
0 commit comments