@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.mjs
CHANGED
|
@@ -3499,7 +3499,7 @@ var Generations = class {
|
|
|
3499
3499
|
*
|
|
3500
3500
|
* 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.
|
|
3501
3501
|
*
|
|
3502
|
-
* 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
|
|
3502
|
+
* 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`.
|
|
3503
3503
|
*
|
|
3504
3504
|
*/
|
|
3505
3505
|
static getGenerationTranscript(options) {
|
|
@@ -3508,6 +3508,22 @@ var Generations = class {
|
|
|
3508
3508
|
...options
|
|
3509
3509
|
});
|
|
3510
3510
|
}
|
|
3511
|
+
/**
|
|
3512
|
+
* List a generation's events
|
|
3513
|
+
*
|
|
3514
|
+
* 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.
|
|
3515
|
+
*
|
|
3516
|
+
* 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.
|
|
3517
|
+
*
|
|
3518
|
+
* `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.
|
|
3519
|
+
*
|
|
3520
|
+
*/
|
|
3521
|
+
static listGenerationEvents(options) {
|
|
3522
|
+
return (options.client ?? client).get({
|
|
3523
|
+
url: "/v1/projects/{project_id}/generations/{generation_id}/events",
|
|
3524
|
+
...options
|
|
3525
|
+
});
|
|
3526
|
+
}
|
|
3511
3527
|
};
|
|
3512
3528
|
var Guardrails = class {
|
|
3513
3529
|
/**
|
|
@@ -5710,7 +5726,7 @@ var Sessions = class {
|
|
|
5710
5726
|
/**
|
|
5711
5727
|
* Trigger agent generation
|
|
5712
5728
|
*
|
|
5713
|
-
* 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.
|
|
5729
|
+
* 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`.
|
|
5714
5730
|
*
|
|
5715
5731
|
*/
|
|
5716
5732
|
static generateSessionResponse(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.269.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"naturali",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@hey-api/openapi-ts": "^0.99.0",
|
|
41
|
-
"@naturali/api": "0.
|
|
41
|
+
"@naturali/api": "0.269.0",
|
|
42
42
|
"@ttoss/openapi-codegen": "^0.10.1",
|
|
43
43
|
"@types/node": "^26.5.1",
|
|
44
44
|
"tsdown": "^0.23.0",
|