@naturali/sdk 0.121.0 → 0.122.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 +1 -1
- package/dist/index.d.cts +49 -4
- package/dist/index.d.mts +49 -4
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3742,7 +3742,7 @@ var Sessions = class {
|
|
|
3742
3742
|
/**
|
|
3743
3743
|
* Get a session
|
|
3744
3744
|
*
|
|
3745
|
-
* Returns details of a single session.
|
|
3745
|
+
* Returns details of a single session, including a `usage` roll-up of what its generations cost. The listing omits `usage`; for a window, or a split by day, model, agent, provider or run, read `GET /v1/projects/{project_id}/usage` instead.
|
|
3746
3746
|
*/
|
|
3747
3747
|
static getSession(options) {
|
|
3748
3748
|
return (options.client ?? client).get({
|
package/dist/index.d.cts
CHANGED
|
@@ -3928,6 +3928,16 @@ type Generation = {
|
|
|
3928
3928
|
*
|
|
3929
3929
|
*/
|
|
3930
3930
|
chain_id?: string | null;
|
|
3931
|
+
/**
|
|
3932
|
+
* Public ID of the session this generation was dispatched through, or null for a generation started outside one. This is the link a per-session cost reading follows; the session's own `usage` field reports the roll-up directly.
|
|
3933
|
+
*
|
|
3934
|
+
*/
|
|
3935
|
+
session_id?: string | null;
|
|
3936
|
+
/**
|
|
3937
|
+
* Public ID of the end-user actor the generation was attributed to, or null when none was. Copied onto the generation's usage event.
|
|
3938
|
+
*
|
|
3939
|
+
*/
|
|
3940
|
+
actor_id?: string | null;
|
|
3931
3941
|
/**
|
|
3932
3942
|
* Type of the principal that started the generation
|
|
3933
3943
|
*/
|
|
@@ -5596,6 +5606,12 @@ type SessionRecord = {
|
|
|
5596
5606
|
*
|
|
5597
5607
|
*/
|
|
5598
5608
|
forked_from_position?: number | null;
|
|
5609
|
+
/**
|
|
5610
|
+
* What the session's generations cost: token counts and `cost_usd` summed across every metered generation dispatched through it. Present on the single-session read; omitted from session and fork list responses.
|
|
5611
|
+
*
|
|
5612
|
+
* A fork is a session of its own, so it starts at zero rather than inheriting what the history it copied cost — summing `usage` across a session and its forks therefore never double-counts. Work the platform does around a session without a generation of its own (a memory extraction pass, for instance) is metered on the project, not here.
|
|
5613
|
+
*/
|
|
5614
|
+
usage?: UsageTotals;
|
|
5599
5615
|
};
|
|
5600
5616
|
type ForkSessionRequest = {
|
|
5601
5617
|
/**
|
|
@@ -6887,6 +6903,10 @@ type ListActorsData = {
|
|
|
6887
6903
|
* External ID to filter by (e.g. WhatsApp phone number)
|
|
6888
6904
|
*/
|
|
6889
6905
|
external_id?: string;
|
|
6906
|
+
/**
|
|
6907
|
+
* Case-insensitive substring match on the actor name
|
|
6908
|
+
*/
|
|
6909
|
+
name?: string;
|
|
6890
6910
|
/**
|
|
6891
6911
|
* Return only actors linked to this agent
|
|
6892
6912
|
*/
|
|
@@ -12904,7 +12924,12 @@ type DownloadFileData = {
|
|
|
12904
12924
|
*/
|
|
12905
12925
|
file_id: string;
|
|
12906
12926
|
};
|
|
12907
|
-
query?:
|
|
12927
|
+
query?: {
|
|
12928
|
+
/**
|
|
12929
|
+
* Signed single-file download token, an alternative to a bearer credential (issued for ingestion-rule converters).
|
|
12930
|
+
*/
|
|
12931
|
+
token?: string;
|
|
12932
|
+
};
|
|
12908
12933
|
url: '/v1/projects/{project_id}/files/{file_id}/download';
|
|
12909
12934
|
};
|
|
12910
12935
|
type DownloadFileErrors = {
|
|
@@ -12997,7 +13022,12 @@ type DownloadFileBase64Data = {
|
|
|
12997
13022
|
*/
|
|
12998
13023
|
file_id: string;
|
|
12999
13024
|
};
|
|
13000
|
-
query?:
|
|
13025
|
+
query?: {
|
|
13026
|
+
/**
|
|
13027
|
+
* Signed single-file download token, an alternative to a bearer credential (issued for ingestion-rule converters).
|
|
13028
|
+
*/
|
|
13029
|
+
token?: string;
|
|
13030
|
+
};
|
|
13001
13031
|
url: '/v1/projects/{project_id}/files/{file_id}/download/base64';
|
|
13002
13032
|
};
|
|
13003
13033
|
type DownloadFileBase64Errors = {
|
|
@@ -13530,6 +13560,16 @@ type ListGenerationsData = {
|
|
|
13530
13560
|
* Filter by trace public ID
|
|
13531
13561
|
*/
|
|
13532
13562
|
trace_id?: string;
|
|
13563
|
+
/**
|
|
13564
|
+
* Return only the generations dispatched through one session — the turns behind that conversation's spend. A session that does not exist in scope yields an empty page.
|
|
13565
|
+
*
|
|
13566
|
+
*/
|
|
13567
|
+
session_id?: string;
|
|
13568
|
+
/**
|
|
13569
|
+
* Return only the generations one end user started, across every session they appear in. An actor that does not exist in scope yields an empty page.
|
|
13570
|
+
*
|
|
13571
|
+
*/
|
|
13572
|
+
actor_id?: string;
|
|
13533
13573
|
/**
|
|
13534
13574
|
* Filter by the public ID of the parent generation. Returns all generations triggered by that generation — sub-agent invocations. Null-initiated (top-level) generations are not returned.
|
|
13535
13575
|
*
|
|
@@ -16540,7 +16580,12 @@ type DeleteSecretData = {
|
|
|
16540
16580
|
*/
|
|
16541
16581
|
secret_id: string;
|
|
16542
16582
|
};
|
|
16543
|
-
query?:
|
|
16583
|
+
query?: {
|
|
16584
|
+
/**
|
|
16585
|
+
* Delete the secret even when AI providers reference it, destroying those providers too. Without it a referenced secret answers SECRET_HAS_DEPENDENTS.
|
|
16586
|
+
*/
|
|
16587
|
+
force?: boolean;
|
|
16588
|
+
};
|
|
16544
16589
|
url: '/v1/projects/{project_id}/secrets/{secret_id}';
|
|
16545
16590
|
};
|
|
16546
16591
|
type DeleteSecretErrors = {
|
|
@@ -20700,7 +20745,7 @@ declare class Sessions {
|
|
|
20700
20745
|
/**
|
|
20701
20746
|
* Get a session
|
|
20702
20747
|
*
|
|
20703
|
-
* Returns details of a single session.
|
|
20748
|
+
* Returns details of a single session, including a `usage` roll-up of what its generations cost. The listing omits `usage`; for a window, or a split by day, model, agent, provider or run, read `GET /v1/projects/{project_id}/usage` instead.
|
|
20704
20749
|
*/
|
|
20705
20750
|
static getSession<ThrowOnError extends boolean = false>(options: Options<GetSessionData, ThrowOnError>): RequestResult<GetSessionResponses, GetSessionErrors, ThrowOnError>;
|
|
20706
20751
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -3928,6 +3928,16 @@ type Generation = {
|
|
|
3928
3928
|
*
|
|
3929
3929
|
*/
|
|
3930
3930
|
chain_id?: string | null;
|
|
3931
|
+
/**
|
|
3932
|
+
* Public ID of the session this generation was dispatched through, or null for a generation started outside one. This is the link a per-session cost reading follows; the session's own `usage` field reports the roll-up directly.
|
|
3933
|
+
*
|
|
3934
|
+
*/
|
|
3935
|
+
session_id?: string | null;
|
|
3936
|
+
/**
|
|
3937
|
+
* Public ID of the end-user actor the generation was attributed to, or null when none was. Copied onto the generation's usage event.
|
|
3938
|
+
*
|
|
3939
|
+
*/
|
|
3940
|
+
actor_id?: string | null;
|
|
3931
3941
|
/**
|
|
3932
3942
|
* Type of the principal that started the generation
|
|
3933
3943
|
*/
|
|
@@ -5596,6 +5606,12 @@ type SessionRecord = {
|
|
|
5596
5606
|
*
|
|
5597
5607
|
*/
|
|
5598
5608
|
forked_from_position?: number | null;
|
|
5609
|
+
/**
|
|
5610
|
+
* What the session's generations cost: token counts and `cost_usd` summed across every metered generation dispatched through it. Present on the single-session read; omitted from session and fork list responses.
|
|
5611
|
+
*
|
|
5612
|
+
* A fork is a session of its own, so it starts at zero rather than inheriting what the history it copied cost — summing `usage` across a session and its forks therefore never double-counts. Work the platform does around a session without a generation of its own (a memory extraction pass, for instance) is metered on the project, not here.
|
|
5613
|
+
*/
|
|
5614
|
+
usage?: UsageTotals;
|
|
5599
5615
|
};
|
|
5600
5616
|
type ForkSessionRequest = {
|
|
5601
5617
|
/**
|
|
@@ -6887,6 +6903,10 @@ type ListActorsData = {
|
|
|
6887
6903
|
* External ID to filter by (e.g. WhatsApp phone number)
|
|
6888
6904
|
*/
|
|
6889
6905
|
external_id?: string;
|
|
6906
|
+
/**
|
|
6907
|
+
* Case-insensitive substring match on the actor name
|
|
6908
|
+
*/
|
|
6909
|
+
name?: string;
|
|
6890
6910
|
/**
|
|
6891
6911
|
* Return only actors linked to this agent
|
|
6892
6912
|
*/
|
|
@@ -12904,7 +12924,12 @@ type DownloadFileData = {
|
|
|
12904
12924
|
*/
|
|
12905
12925
|
file_id: string;
|
|
12906
12926
|
};
|
|
12907
|
-
query?:
|
|
12927
|
+
query?: {
|
|
12928
|
+
/**
|
|
12929
|
+
* Signed single-file download token, an alternative to a bearer credential (issued for ingestion-rule converters).
|
|
12930
|
+
*/
|
|
12931
|
+
token?: string;
|
|
12932
|
+
};
|
|
12908
12933
|
url: '/v1/projects/{project_id}/files/{file_id}/download';
|
|
12909
12934
|
};
|
|
12910
12935
|
type DownloadFileErrors = {
|
|
@@ -12997,7 +13022,12 @@ type DownloadFileBase64Data = {
|
|
|
12997
13022
|
*/
|
|
12998
13023
|
file_id: string;
|
|
12999
13024
|
};
|
|
13000
|
-
query?:
|
|
13025
|
+
query?: {
|
|
13026
|
+
/**
|
|
13027
|
+
* Signed single-file download token, an alternative to a bearer credential (issued for ingestion-rule converters).
|
|
13028
|
+
*/
|
|
13029
|
+
token?: string;
|
|
13030
|
+
};
|
|
13001
13031
|
url: '/v1/projects/{project_id}/files/{file_id}/download/base64';
|
|
13002
13032
|
};
|
|
13003
13033
|
type DownloadFileBase64Errors = {
|
|
@@ -13530,6 +13560,16 @@ type ListGenerationsData = {
|
|
|
13530
13560
|
* Filter by trace public ID
|
|
13531
13561
|
*/
|
|
13532
13562
|
trace_id?: string;
|
|
13563
|
+
/**
|
|
13564
|
+
* Return only the generations dispatched through one session — the turns behind that conversation's spend. A session that does not exist in scope yields an empty page.
|
|
13565
|
+
*
|
|
13566
|
+
*/
|
|
13567
|
+
session_id?: string;
|
|
13568
|
+
/**
|
|
13569
|
+
* Return only the generations one end user started, across every session they appear in. An actor that does not exist in scope yields an empty page.
|
|
13570
|
+
*
|
|
13571
|
+
*/
|
|
13572
|
+
actor_id?: string;
|
|
13533
13573
|
/**
|
|
13534
13574
|
* Filter by the public ID of the parent generation. Returns all generations triggered by that generation — sub-agent invocations. Null-initiated (top-level) generations are not returned.
|
|
13535
13575
|
*
|
|
@@ -16540,7 +16580,12 @@ type DeleteSecretData = {
|
|
|
16540
16580
|
*/
|
|
16541
16581
|
secret_id: string;
|
|
16542
16582
|
};
|
|
16543
|
-
query?:
|
|
16583
|
+
query?: {
|
|
16584
|
+
/**
|
|
16585
|
+
* Delete the secret even when AI providers reference it, destroying those providers too. Without it a referenced secret answers SECRET_HAS_DEPENDENTS.
|
|
16586
|
+
*/
|
|
16587
|
+
force?: boolean;
|
|
16588
|
+
};
|
|
16544
16589
|
url: '/v1/projects/{project_id}/secrets/{secret_id}';
|
|
16545
16590
|
};
|
|
16546
16591
|
type DeleteSecretErrors = {
|
|
@@ -20700,7 +20745,7 @@ declare class Sessions {
|
|
|
20700
20745
|
/**
|
|
20701
20746
|
* Get a session
|
|
20702
20747
|
*
|
|
20703
|
-
* Returns details of a single session.
|
|
20748
|
+
* Returns details of a single session, including a `usage` roll-up of what its generations cost. The listing omits `usage`; for a window, or a split by day, model, agent, provider or run, read `GET /v1/projects/{project_id}/usage` instead.
|
|
20704
20749
|
*/
|
|
20705
20750
|
static getSession<ThrowOnError extends boolean = false>(options: Options<GetSessionData, ThrowOnError>): RequestResult<GetSessionResponses, GetSessionErrors, ThrowOnError>;
|
|
20706
20751
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -3741,7 +3741,7 @@ var Sessions = class {
|
|
|
3741
3741
|
/**
|
|
3742
3742
|
* Get a session
|
|
3743
3743
|
*
|
|
3744
|
-
* Returns details of a single session.
|
|
3744
|
+
* Returns details of a single session, including a `usage` roll-up of what its generations cost. The listing omits `usage`; for a window, or a split by day, model, agent, provider or run, read `GET /v1/projects/{project_id}/usage` instead.
|
|
3745
3745
|
*/
|
|
3746
3746
|
static getSession(options) {
|
|
3747
3747
|
return (options.client ?? client).get({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.122.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"tsx": "^4.23.1",
|
|
38
38
|
"typescript": "~6.0.3",
|
|
39
39
|
"vitest": "^4.1.10",
|
|
40
|
-
"@naturali/api": "0.
|
|
40
|
+
"@naturali/api": "0.122.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"generate": "tsx scripts/generate.ts",
|