@naturali/sdk 0.267.3 → 0.269.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +18 -2
- package/dist/index.d.cts +197 -41
- package/dist/index.d.mts +197 -41
- package/dist/index.mjs +18 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3500,7 +3500,7 @@ var Generations = class {
|
|
|
3500
3500
|
*
|
|
3501
3501
|
* The transcript is assembled at read time from the generation record and the trace's steps object; nothing is stored, so it cannot outlive the content it projects. Requires `traces:GetTrace` in addition to `generations:GetGeneration`, because the response merges content from both resources.
|
|
3502
3502
|
*
|
|
3503
|
-
* A generation whose content is unavailable — never written under zero-retention, or cleared by a purge — returns `200` with the skeleton rather than an error: `input` and `output` are null, `steps` is empty, and the `content_redacted_*` fields say which happened. `content_redacted_by_principal_id` is `zero_retention` when the content was never stored, and the purging principal's ID when it was erased later. A generation that is still running returns the
|
|
3503
|
+
* A generation whose content is unavailable — never written under zero-retention, or cleared by a purge — returns `200` with the skeleton rather than an error: `input` and `output` are null, `steps` is empty, and the `content_redacted_*` fields say which happened. `content_redacted_by_principal_id` is `zero_retention` when the content was never stored, and the purging principal's ID when it was erased later. A generation that is still running returns the steps it has ended so far and its `in_flight_tool_calls`; `status` says it runs. To follow it as it runs, read `GET /v1/projects/{project_id}/generations/{generation_id}/events`.
|
|
3504
3504
|
*
|
|
3505
3505
|
*/
|
|
3506
3506
|
static getGenerationTranscript(options) {
|
|
@@ -3509,6 +3509,22 @@ var Generations = class {
|
|
|
3509
3509
|
...options
|
|
3510
3510
|
});
|
|
3511
3511
|
}
|
|
3512
|
+
/**
|
|
3513
|
+
* List a generation's events
|
|
3514
|
+
*
|
|
3515
|
+
* The generation's transcript, incrementally: its progress rows in `seq` order, after `after_seq`. Each `generations.step_ended` row carries the step it ended as a `TranscriptStep`; the other rows say when a step or a tool call started and ended, and which generation a tool call started.
|
|
3516
|
+
*
|
|
3517
|
+
* Step content and tool names are the trace's content: reading them needs `traces:GetTrace` on the generation's trace beside `generations:GetGeneration`, and is refused with `403` without it. `progress_only=true` asks for the rows alone (`step` is null), which `generations:GetGeneration` alone allows. Content is re-read on every page: once a purge erases it, or under zero-retention, `step` is null.
|
|
3518
|
+
*
|
|
3519
|
+
* `stream=true` answers `text/event-stream` instead and follows the generation until it settles (`completed`, `failed` or `requires_action`), or stops running without a settle row. Each row is one `event: progress` frame whose `id` is its `seq`; the stream ends with `data: [DONE]`. A `: heartbeat` comment is sent every 15 seconds. After 5 minutes the stream ends with `event: end` and `data: {"reason": "max_lifetime", "generation_id": "...", "after_seq": N}`: reconnect with that `after_seq`, or let an `EventSource` reconnect with its `Last-Event-ID` header, which this route reads as `after_seq`. Every reconnect is authorized afresh.
|
|
3520
|
+
*
|
|
3521
|
+
*/
|
|
3522
|
+
static listGenerationEvents(options) {
|
|
3523
|
+
return (options.client ?? client).get({
|
|
3524
|
+
url: "/v1/projects/{project_id}/generations/{generation_id}/events",
|
|
3525
|
+
...options
|
|
3526
|
+
});
|
|
3527
|
+
}
|
|
3512
3528
|
};
|
|
3513
3529
|
var Guardrails = class {
|
|
3514
3530
|
/**
|
|
@@ -5711,7 +5727,7 @@ var Sessions = class {
|
|
|
5711
5727
|
/**
|
|
5712
5728
|
* Trigger agent generation
|
|
5713
5729
|
*
|
|
5714
|
-
* Triggers the agent to generate a response based on the current conversation. Background by default: returns `202 Accepted` with the generation's id once its record exists. Pass ?wait=true to block and receive the assistant reply (or a requires_action status if the agent needs client tool outputs) in the response.
|
|
5730
|
+
* Triggers the agent to generate a response based on the current conversation. Background by default: returns `202 Accepted` with the generation's id once its record exists. Pass ?wait=true to block and receive the assistant reply (or a requires_action status if the agent needs client tool outputs) in the response. Pass `stream: true` in the body to receive the turn's events as SSE, one frame per step and tool call, until it settles; `stream: true` with `?wait=false` is `400`.
|
|
5715
5731
|
*
|
|
5716
5732
|
*/
|
|
5717
5733
|
static generateSessionResponse(options) {
|