@letta-ai/letta-client 1.2.0 → 1.3.2
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/CHANGELOG.md +43 -0
- package/README.md +40 -79
- package/client.d.mts +13 -7
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -7
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +7 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +18 -13
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +18 -13
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +1 -1
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/index.d.mts +1 -1
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +1 -1
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/messages.d.mts +33 -1
- package/resources/agents/messages.d.mts.map +1 -1
- package/resources/agents/messages.d.ts +33 -1
- package/resources/agents/messages.d.ts.map +1 -1
- package/resources/agents/tools.d.mts +59 -1
- package/resources/agents/tools.d.mts.map +1 -1
- package/resources/agents/tools.d.ts +59 -1
- package/resources/agents/tools.d.ts.map +1 -1
- package/resources/agents/tools.js +10 -0
- package/resources/agents/tools.js.map +1 -1
- package/resources/agents/tools.mjs +10 -0
- package/resources/agents/tools.mjs.map +1 -1
- package/resources/archives/archives.d.mts +2 -2
- package/resources/archives/archives.d.mts.map +1 -1
- package/resources/archives/archives.d.ts +2 -2
- package/resources/archives/archives.d.ts.map +1 -1
- package/resources/archives/archives.js.map +1 -1
- package/resources/archives/archives.mjs.map +1 -1
- package/resources/archives/index.d.mts +1 -1
- package/resources/archives/index.d.mts.map +1 -1
- package/resources/archives/index.d.ts +1 -1
- package/resources/archives/index.d.ts.map +1 -1
- package/resources/archives/index.js.map +1 -1
- package/resources/archives/index.mjs +1 -1
- package/resources/archives/index.mjs.map +1 -1
- package/resources/archives/passages.d.mts +3 -71
- package/resources/archives/passages.d.mts.map +1 -1
- package/resources/archives/passages.d.ts +3 -71
- package/resources/archives/passages.d.ts.map +1 -1
- package/resources/blocks/agents.d.mts +4 -4
- package/resources/blocks/agents.d.ts +4 -4
- package/resources/blocks/blocks.d.mts +9 -8
- package/resources/blocks/blocks.d.mts.map +1 -1
- package/resources/blocks/blocks.d.ts +9 -8
- package/resources/blocks/blocks.d.ts.map +1 -1
- package/resources/blocks/blocks.js.map +1 -1
- package/resources/blocks/blocks.mjs.map +1 -1
- package/resources/identities/identities.d.mts +4 -0
- package/resources/identities/identities.d.mts.map +1 -1
- package/resources/identities/identities.d.ts +4 -0
- package/resources/identities/identities.d.ts.map +1 -1
- package/resources/identities/identities.js.map +1 -1
- package/resources/identities/identities.mjs.map +1 -1
- package/resources/index.d.mts +5 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/mcp-servers/index.d.mts +1 -1
- package/resources/mcp-servers/index.d.mts.map +1 -1
- package/resources/mcp-servers/index.d.ts +1 -1
- package/resources/mcp-servers/index.d.ts.map +1 -1
- package/resources/mcp-servers/index.js.map +1 -1
- package/resources/mcp-servers/index.mjs.map +1 -1
- package/resources/mcp-servers/mcp-servers.d.mts +1 -41
- package/resources/mcp-servers/mcp-servers.d.mts.map +1 -1
- package/resources/mcp-servers/mcp-servers.d.ts +1 -41
- package/resources/mcp-servers/mcp-servers.d.ts.map +1 -1
- package/resources/mcp-servers/mcp-servers.js.map +1 -1
- package/resources/mcp-servers/mcp-servers.mjs.map +1 -1
- package/resources/mcp-servers/tools.d.mts +4 -4
- package/resources/mcp-servers/tools.d.mts.map +1 -1
- package/resources/mcp-servers/tools.d.ts +4 -4
- package/resources/mcp-servers/tools.d.ts.map +1 -1
- package/resources/mcp-servers/tools.js +1 -1
- package/resources/mcp-servers/tools.mjs +1 -1
- package/resources/messages.d.mts +114 -0
- package/resources/messages.d.mts.map +1 -0
- package/resources/messages.d.ts +114 -0
- package/resources/messages.d.ts.map +1 -0
- package/resources/messages.js +24 -0
- package/resources/messages.js.map +1 -0
- package/resources/messages.mjs +20 -0
- package/resources/messages.mjs.map +1 -0
- package/resources/models/models.d.mts +11 -0
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +11 -0
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs.map +1 -1
- package/resources/passages.d.mts +150 -0
- package/resources/passages.d.mts.map +1 -0
- package/resources/passages.d.ts +150 -0
- package/resources/passages.d.ts.map +1 -0
- package/resources/passages.js +25 -0
- package/resources/passages.js.map +1 -0
- package/resources/passages.mjs +21 -0
- package/resources/passages.mjs.map +1 -0
- package/resources/runs/usage.d.mts +4 -2
- package/resources/runs/usage.d.mts.map +1 -1
- package/resources/runs/usage.d.ts +4 -2
- package/resources/runs/usage.d.ts.map +1 -1
- package/resources/steps/steps.d.mts +8 -1
- package/resources/steps/steps.d.mts.map +1 -1
- package/resources/steps/steps.d.ts +8 -1
- package/resources/steps/steps.d.ts.map +1 -1
- package/resources/steps/steps.js.map +1 -1
- package/resources/steps/steps.mjs.map +1 -1
- package/resources/templates/index.d.mts +1 -1
- package/resources/templates/index.d.mts.map +1 -1
- package/resources/templates/index.d.ts +1 -1
- package/resources/templates/index.d.ts.map +1 -1
- package/resources/templates/index.js.map +1 -1
- package/resources/templates/index.mjs +1 -1
- package/resources/templates/index.mjs.map +1 -1
- package/resources/templates/templates.d.mts +99 -0
- package/resources/templates/templates.d.mts.map +1 -1
- package/resources/templates/templates.d.ts +99 -0
- package/resources/templates/templates.d.ts.map +1 -1
- package/resources/templates/templates.js +19 -0
- package/resources/templates/templates.js.map +1 -1
- package/resources/templates/templates.mjs +19 -0
- package/resources/templates/templates.mjs.map +1 -1
- package/resources/tools.d.mts +83 -6
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +83 -6
- package/resources/tools.d.ts.map +1 -1
- package/resources/tools.js +11 -6
- package/resources/tools.js.map +1 -1
- package/resources/tools.mjs +11 -6
- package/resources/tools.mjs.map +1 -1
- package/src/client.ts +58 -9
- package/src/resources/agents/agents.ts +30 -12
- package/src/resources/agents/index.ts +3 -0
- package/src/resources/agents/messages.ts +39 -1
- package/src/resources/agents/tools.ts +70 -0
- package/src/resources/archives/archives.ts +1 -2
- package/src/resources/archives/index.ts +1 -6
- package/src/resources/archives/passages.ts +3 -88
- package/src/resources/blocks/agents.ts +4 -4
- package/src/resources/blocks/blocks.ts +9 -8
- package/src/resources/identities/identities.ts +4 -0
- package/src/resources/index.ts +23 -4
- package/src/resources/mcp-servers/index.ts +0 -2
- package/src/resources/mcp-servers/mcp-servers.ts +0 -47
- package/src/resources/mcp-servers/tools.ts +4 -4
- package/src/resources/messages.ts +165 -0
- package/src/resources/models/models.ts +21 -0
- package/src/resources/passages.ts +182 -0
- package/src/resources/runs/usage.ts +6 -2
- package/src/resources/steps/steps.ts +7 -1
- package/src/resources/templates/index.ts +9 -1
- package/src/resources/templates/templates.ts +143 -0
- package/src/resources/tools.ts +104 -9
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -394,8 +394,8 @@ export interface BlockListParams extends ArrayPageParams {
|
|
|
394
394
|
connected_to_agents_count_lt?: number | null;
|
|
395
395
|
|
|
396
396
|
/**
|
|
397
|
-
* Search blocks by description. If provided, returns blocks
|
|
398
|
-
*
|
|
397
|
+
* Search blocks by description. If provided, returns blocks whose description
|
|
398
|
+
* matches the search query. This is a full-text search on block descriptions.
|
|
399
399
|
*/
|
|
400
400
|
description_search?: string | null;
|
|
401
401
|
|
|
@@ -405,23 +405,23 @@ export interface BlockListParams extends ArrayPageParams {
|
|
|
405
405
|
identifier_keys?: Array<string> | null;
|
|
406
406
|
|
|
407
407
|
/**
|
|
408
|
-
*
|
|
408
|
+
* The ID of the identity in the format 'identity-<uuid4>'
|
|
409
409
|
*/
|
|
410
410
|
identity_id?: string | null;
|
|
411
411
|
|
|
412
412
|
/**
|
|
413
|
-
*
|
|
413
|
+
* Label to include (alphanumeric, hyphens, underscores only)
|
|
414
414
|
*/
|
|
415
415
|
label?: string | null;
|
|
416
416
|
|
|
417
417
|
/**
|
|
418
|
-
* Search blocks by label. If provided, returns blocks
|
|
419
|
-
* is a full-text search on labels.
|
|
418
|
+
* Search blocks by label. If provided, returns blocks whose label matches the
|
|
419
|
+
* search query. This is a full-text search on block labels.
|
|
420
420
|
*/
|
|
421
421
|
label_search?: string | null;
|
|
422
422
|
|
|
423
423
|
/**
|
|
424
|
-
* Name
|
|
424
|
+
* Name filter (alphanumeric, spaces, hyphens, underscores)
|
|
425
425
|
*/
|
|
426
426
|
name?: string | null;
|
|
427
427
|
|
|
@@ -436,7 +436,8 @@ export interface BlockListParams extends ArrayPageParams {
|
|
|
436
436
|
templates_only?: boolean;
|
|
437
437
|
|
|
438
438
|
/**
|
|
439
|
-
* Search blocks by value. If provided, returns blocks
|
|
439
|
+
* Search blocks by value. If provided, returns blocks whose value matches the
|
|
440
|
+
* search query. This is a full-text search on block values.
|
|
440
441
|
*/
|
|
441
442
|
value_search?: string | null;
|
|
442
443
|
}
|
|
@@ -213,6 +213,10 @@ export interface IdentityListParams extends ArrayPageParams {
|
|
|
213
213
|
|
|
214
214
|
name?: string | null;
|
|
215
215
|
|
|
216
|
+
/**
|
|
217
|
+
* @deprecated [DEPRECATED: Use X-Project-Id header instead] Filter identities by
|
|
218
|
+
* project ID
|
|
219
|
+
*/
|
|
216
220
|
project_id?: string | null;
|
|
217
221
|
}
|
|
218
222
|
|
package/src/resources/index.ts
CHANGED
|
@@ -117,11 +117,9 @@ export {
|
|
|
117
117
|
type CreateSseMcpServer,
|
|
118
118
|
type CreateStdioMcpServer,
|
|
119
119
|
type CreateStreamableHTTPMcpServer,
|
|
120
|
-
type McpToolExecuteRequest,
|
|
121
120
|
type SseMcpServer,
|
|
122
121
|
type StdioMcpServer,
|
|
123
122
|
type StreamableHTTPMcpServer,
|
|
124
|
-
type ToolExecutionResult,
|
|
125
123
|
type UpdateSseMcpServer,
|
|
126
124
|
type UpdateStdioMcpServer,
|
|
127
125
|
type UpdateStreamableHTTPMcpServer,
|
|
@@ -134,6 +132,15 @@ export {
|
|
|
134
132
|
type McpServerUpdateParams,
|
|
135
133
|
type McpServerRefreshParams,
|
|
136
134
|
} from './mcp-servers/mcp-servers';
|
|
135
|
+
export {
|
|
136
|
+
Messages,
|
|
137
|
+
type MessageSearchRequest,
|
|
138
|
+
type MessageSearchResult,
|
|
139
|
+
type MessageListResponse,
|
|
140
|
+
type MessageSearchResponse,
|
|
141
|
+
type MessageListParams,
|
|
142
|
+
type MessageSearchParams,
|
|
143
|
+
} from './messages';
|
|
137
144
|
export {
|
|
138
145
|
Models,
|
|
139
146
|
type EmbeddingConfig,
|
|
@@ -145,6 +152,7 @@ export {
|
|
|
145
152
|
type ModelListResponse,
|
|
146
153
|
type ModelListParams,
|
|
147
154
|
} from './models/models';
|
|
155
|
+
export { Passages, type Passage, type PassageSearchResponse, type PassageSearchParams } from './passages';
|
|
148
156
|
export { Runs, type Job, type StopReasonType, type RunListParams } from './runs/runs';
|
|
149
157
|
export {
|
|
150
158
|
Steps,
|
|
@@ -154,7 +162,15 @@ export {
|
|
|
154
162
|
type StepsArrayPage,
|
|
155
163
|
} from './steps/steps';
|
|
156
164
|
export { Tags, type TagListResponse, type TagListParams } from './tags';
|
|
157
|
-
export {
|
|
165
|
+
export {
|
|
166
|
+
Templates,
|
|
167
|
+
type TemplateCreateResponse,
|
|
168
|
+
type TemplateUpdateResponse,
|
|
169
|
+
type TemplateDeleteResponse,
|
|
170
|
+
type TemplateCreateParams,
|
|
171
|
+
type TemplateUpdateParams,
|
|
172
|
+
type TemplateDeleteParams,
|
|
173
|
+
} from './templates/templates';
|
|
158
174
|
export {
|
|
159
175
|
Tools,
|
|
160
176
|
type NpmRequirement,
|
|
@@ -162,12 +178,15 @@ export {
|
|
|
162
178
|
type Tool,
|
|
163
179
|
type ToolCreate,
|
|
164
180
|
type ToolReturnMessage,
|
|
181
|
+
type ToolSearchRequest,
|
|
182
|
+
type ToolSearchResult,
|
|
165
183
|
type ToolType,
|
|
166
184
|
type ToolDeleteResponse,
|
|
167
|
-
type
|
|
185
|
+
type ToolSearchResponse,
|
|
168
186
|
type ToolCreateParams,
|
|
169
187
|
type ToolUpdateParams,
|
|
170
188
|
type ToolListParams,
|
|
189
|
+
type ToolSearchParams,
|
|
171
190
|
type ToolUpsertParams,
|
|
172
191
|
type ToolsArrayPage,
|
|
173
192
|
} from './tools';
|
|
@@ -5,11 +5,9 @@ export {
|
|
|
5
5
|
type CreateSseMcpServer,
|
|
6
6
|
type CreateStdioMcpServer,
|
|
7
7
|
type CreateStreamableHTTPMcpServer,
|
|
8
|
-
type McpToolExecuteRequest,
|
|
9
8
|
type SseMcpServer,
|
|
10
9
|
type StdioMcpServer,
|
|
11
10
|
type StreamableHTTPMcpServer,
|
|
12
|
-
type ToolExecutionResult,
|
|
13
11
|
type UpdateSseMcpServer,
|
|
14
12
|
type UpdateStdioMcpServer,
|
|
15
13
|
type UpdateStreamableHTTPMcpServer,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
-
import * as AgentsAPI from '../agents/agents';
|
|
5
4
|
import * as ToolsAPI from './tools';
|
|
6
5
|
import { ToolListResponse, ToolRetrieveParams, ToolRunParams, Tools } from './tools';
|
|
7
6
|
import { APIPromise } from '../../core/api-promise';
|
|
@@ -153,16 +152,6 @@ export interface CreateStreamableHTTPMcpServer {
|
|
|
153
152
|
mcp_server_type?: 'streamable_http';
|
|
154
153
|
}
|
|
155
154
|
|
|
156
|
-
/**
|
|
157
|
-
* Request to execute an MCP tool by IDs.
|
|
158
|
-
*/
|
|
159
|
-
export interface McpToolExecuteRequest {
|
|
160
|
-
/**
|
|
161
|
-
* Arguments to pass to the MCP tool
|
|
162
|
-
*/
|
|
163
|
-
args?: { [key: string]: unknown };
|
|
164
|
-
}
|
|
165
|
-
|
|
166
155
|
/**
|
|
167
156
|
* An SSE MCP server
|
|
168
157
|
*/
|
|
@@ -269,40 +258,6 @@ export interface StreamableHTTPMcpServer {
|
|
|
269
258
|
mcp_server_type?: 'streamable_http';
|
|
270
259
|
}
|
|
271
260
|
|
|
272
|
-
export interface ToolExecutionResult {
|
|
273
|
-
/**
|
|
274
|
-
* The status of the tool execution and return object
|
|
275
|
-
*/
|
|
276
|
-
status: 'success' | 'error';
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Representation of an agent's state. This is the state of the agent at a given
|
|
280
|
-
* time, and is persisted in the DB backend. The state has all the information
|
|
281
|
-
* needed to recreate a persisted agent.
|
|
282
|
-
*/
|
|
283
|
-
agent_state?: AgentsAPI.AgentState | null;
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* The function return object
|
|
287
|
-
*/
|
|
288
|
-
func_return?: unknown;
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* The fingerprint of the config for the sandbox
|
|
292
|
-
*/
|
|
293
|
-
sandbox_config_fingerprint?: string | null;
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Captured stderr from the function invocation
|
|
297
|
-
*/
|
|
298
|
-
stderr?: Array<string> | null;
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Captured stdout (prints, logs) from function invocation
|
|
302
|
-
*/
|
|
303
|
-
stdout?: Array<string> | null;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
261
|
/**
|
|
307
262
|
* Update schema for SSE MCP server - all fields optional
|
|
308
263
|
*/
|
|
@@ -433,11 +388,9 @@ export declare namespace McpServers {
|
|
|
433
388
|
type CreateSseMcpServer as CreateSseMcpServer,
|
|
434
389
|
type CreateStdioMcpServer as CreateStdioMcpServer,
|
|
435
390
|
type CreateStreamableHTTPMcpServer as CreateStreamableHTTPMcpServer,
|
|
436
|
-
type McpToolExecuteRequest as McpToolExecuteRequest,
|
|
437
391
|
type SseMcpServer as SseMcpServer,
|
|
438
392
|
type StdioMcpServer as StdioMcpServer,
|
|
439
393
|
type StreamableHTTPMcpServer as StreamableHTTPMcpServer,
|
|
440
|
-
type ToolExecutionResult as ToolExecutionResult,
|
|
441
394
|
type UpdateSseMcpServer as UpdateSseMcpServer,
|
|
442
395
|
type UpdateStdioMcpServer as UpdateStdioMcpServer,
|
|
443
396
|
type UpdateStreamableHTTPMcpServer as UpdateStreamableHTTPMcpServer,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as ToolsAPI from '../tools';
|
|
5
|
-
import * as
|
|
5
|
+
import * as AgentsToolsAPI from '../agents/tools';
|
|
6
6
|
import { APIPromise } from '../../core/api-promise';
|
|
7
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
8
|
import { path } from '../../internal/utils/path';
|
|
@@ -26,14 +26,14 @@ export class Tools extends APIResource {
|
|
|
26
26
|
/**
|
|
27
27
|
* Execute a specific MCP tool
|
|
28
28
|
*
|
|
29
|
-
* The request body should contain the tool arguments in the
|
|
29
|
+
* The request body should contain the tool arguments in the ToolExecuteRequest
|
|
30
30
|
* format.
|
|
31
31
|
*/
|
|
32
32
|
run(
|
|
33
33
|
toolID: string,
|
|
34
34
|
params: ToolRunParams,
|
|
35
35
|
options?: RequestOptions,
|
|
36
|
-
): APIPromise<
|
|
36
|
+
): APIPromise<AgentsToolsAPI.ToolExecutionResult> {
|
|
37
37
|
const { mcp_server_id, ...body } = params;
|
|
38
38
|
return this._client.post(path`/v1/mcp-servers/${mcp_server_id}/tools/${toolID}/run`, {
|
|
39
39
|
body,
|
|
@@ -55,7 +55,7 @@ export interface ToolRunParams {
|
|
|
55
55
|
mcp_server_id: string;
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Body param: Arguments to pass to the
|
|
58
|
+
* Body param: Arguments to pass to the tool
|
|
59
59
|
*/
|
|
60
60
|
args?: { [key: string]: unknown };
|
|
61
61
|
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as ToolsAPI from './tools';
|
|
5
|
+
import * as AgentsMessagesAPI from './agents/messages';
|
|
6
|
+
import { APIPromise } from '../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
|
|
9
|
+
export class Messages extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* List messages across all agents for the current user.
|
|
12
|
+
*/
|
|
13
|
+
list(
|
|
14
|
+
query: MessageListParams | null | undefined = {},
|
|
15
|
+
options?: RequestOptions,
|
|
16
|
+
): APIPromise<MessageListResponse> {
|
|
17
|
+
return this._client.get('/v1/messages/', { query, ...options });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Search messages across the organization with optional agent filtering. Returns
|
|
22
|
+
* messages with FTS/vector ranks and total RRF score.
|
|
23
|
+
*
|
|
24
|
+
* This is a cloud-only feature.
|
|
25
|
+
*/
|
|
26
|
+
search(body: MessageSearchParams, options?: RequestOptions): APIPromise<MessageSearchResponse> {
|
|
27
|
+
return this._client.post('/v1/messages/search', { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface MessageSearchRequest {
|
|
32
|
+
/**
|
|
33
|
+
* Text query for full-text search
|
|
34
|
+
*/
|
|
35
|
+
query: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Filter messages created on or before this date
|
|
39
|
+
*/
|
|
40
|
+
end_date?: string | null;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Maximum number of results to return
|
|
44
|
+
*/
|
|
45
|
+
limit?: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Search mode to use
|
|
49
|
+
*/
|
|
50
|
+
search_mode?: 'vector' | 'fts' | 'hybrid';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Filter messages created after this date
|
|
54
|
+
*/
|
|
55
|
+
start_date?: string | null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Result from a message search operation with scoring details.
|
|
60
|
+
*/
|
|
61
|
+
export interface MessageSearchResult {
|
|
62
|
+
/**
|
|
63
|
+
* The embedded content (LLM-friendly)
|
|
64
|
+
*/
|
|
65
|
+
embedded_text: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The raw message object
|
|
69
|
+
*/
|
|
70
|
+
message: AgentsMessagesAPI.InternalMessage;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Reciprocal Rank Fusion combined score
|
|
74
|
+
*/
|
|
75
|
+
rrf_score: number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Full-text search rank position if FTS was used
|
|
79
|
+
*/
|
|
80
|
+
fts_rank?: number | null;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Vector search rank position if vector search was used
|
|
84
|
+
*/
|
|
85
|
+
vector_rank?: number | null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type MessageListResponse = Array<AgentsMessagesAPI.Message>;
|
|
89
|
+
|
|
90
|
+
export type MessageSearchResponse = Array<
|
|
91
|
+
| AgentsMessagesAPI.SystemMessage
|
|
92
|
+
| AgentsMessagesAPI.UserMessage
|
|
93
|
+
| AgentsMessagesAPI.ReasoningMessage
|
|
94
|
+
| AgentsMessagesAPI.HiddenReasoningMessage
|
|
95
|
+
| AgentsMessagesAPI.ToolCallMessage
|
|
96
|
+
| ToolsAPI.ToolReturnMessage
|
|
97
|
+
| AgentsMessagesAPI.AssistantMessage
|
|
98
|
+
| AgentsMessagesAPI.ApprovalRequestMessage
|
|
99
|
+
| AgentsMessagesAPI.ApprovalResponseMessage
|
|
100
|
+
| AgentsMessagesAPI.SummaryMessage
|
|
101
|
+
| AgentsMessagesAPI.EventMessage
|
|
102
|
+
>;
|
|
103
|
+
|
|
104
|
+
export interface MessageListParams {
|
|
105
|
+
/**
|
|
106
|
+
* Message ID cursor for pagination. Returns messages that come after this message
|
|
107
|
+
* ID in the specified sort order
|
|
108
|
+
*/
|
|
109
|
+
after?: string | null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Message ID cursor for pagination. Returns messages that come before this message
|
|
113
|
+
* ID in the specified sort order
|
|
114
|
+
*/
|
|
115
|
+
before?: string | null;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Maximum number of messages to return
|
|
119
|
+
*/
|
|
120
|
+
limit?: number | null;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
|
|
124
|
+
* newest first
|
|
125
|
+
*/
|
|
126
|
+
order?: 'asc' | 'desc';
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface MessageSearchParams {
|
|
130
|
+
/**
|
|
131
|
+
* Text query for full-text search
|
|
132
|
+
*/
|
|
133
|
+
query: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Filter messages created on or before this date
|
|
137
|
+
*/
|
|
138
|
+
end_date?: string | null;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Maximum number of results to return
|
|
142
|
+
*/
|
|
143
|
+
limit?: number;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Search mode to use
|
|
147
|
+
*/
|
|
148
|
+
search_mode?: 'vector' | 'fts' | 'hybrid';
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Filter messages created after this date
|
|
152
|
+
*/
|
|
153
|
+
start_date?: string | null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export declare namespace Messages {
|
|
157
|
+
export {
|
|
158
|
+
type MessageSearchRequest as MessageSearchRequest,
|
|
159
|
+
type MessageSearchResult as MessageSearchResult,
|
|
160
|
+
type MessageListResponse as MessageListResponse,
|
|
161
|
+
type MessageSearchResponse as MessageSearchResponse,
|
|
162
|
+
type MessageListParams as MessageListParams,
|
|
163
|
+
type MessageSearchParams as MessageSearchParams,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as AgentsAPI from '../agents/agents';
|
|
4
5
|
import * as EmbeddingsAPI from './embeddings';
|
|
5
6
|
import { EmbeddingListResponse, Embeddings } from './embeddings';
|
|
6
7
|
import { APIPromise } from '../../core/api-promise';
|
|
@@ -326,6 +327,16 @@ export interface LlmConfig {
|
|
|
326
327
|
*/
|
|
327
328
|
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | null;
|
|
328
329
|
|
|
330
|
+
/**
|
|
331
|
+
* The response format for the model's output. Supports text, json_object, and
|
|
332
|
+
* json_schema (structured outputs). Can be set via model_settings.
|
|
333
|
+
*/
|
|
334
|
+
response_format?:
|
|
335
|
+
| AgentsAPI.TextResponseFormat
|
|
336
|
+
| AgentsAPI.JsonSchemaResponseFormat
|
|
337
|
+
| AgentsAPI.JsonObjectResponseFormat
|
|
338
|
+
| null;
|
|
339
|
+
|
|
329
340
|
/**
|
|
330
341
|
* The temperature to use when generating text with the model. A higher temperature
|
|
331
342
|
* will result in more random text.
|
|
@@ -481,6 +492,16 @@ export interface Model {
|
|
|
481
492
|
*/
|
|
482
493
|
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | null;
|
|
483
494
|
|
|
495
|
+
/**
|
|
496
|
+
* The response format for the model's output. Supports text, json_object, and
|
|
497
|
+
* json_schema (structured outputs). Can be set via model_settings.
|
|
498
|
+
*/
|
|
499
|
+
response_format?:
|
|
500
|
+
| AgentsAPI.TextResponseFormat
|
|
501
|
+
| AgentsAPI.JsonSchemaResponseFormat
|
|
502
|
+
| AgentsAPI.JsonObjectResponseFormat
|
|
503
|
+
| null;
|
|
504
|
+
|
|
484
505
|
/**
|
|
485
506
|
* @deprecated Deprecated: The temperature to use when generating text with the
|
|
486
507
|
* model.
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as PassagesAPI from './passages';
|
|
5
|
+
import * as ModelsAPI from './models/models';
|
|
6
|
+
import { APIPromise } from '../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
|
|
9
|
+
export class Passages extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Search passages across the organization with optional agent and archive
|
|
12
|
+
* filtering. Returns passages with relevance scores.
|
|
13
|
+
*
|
|
14
|
+
* This endpoint supports semantic search through passages:
|
|
15
|
+
*
|
|
16
|
+
* - If neither agent_id nor archive_id is provided, searches ALL passages in the
|
|
17
|
+
* organization
|
|
18
|
+
* - If agent_id is provided, searches passages across all archives attached to
|
|
19
|
+
* that agent
|
|
20
|
+
* - If archive_id is provided, searches passages within that specific archive
|
|
21
|
+
* - If both are provided, agent_id takes precedence
|
|
22
|
+
*/
|
|
23
|
+
search(body: PassageSearchParams, options?: RequestOptions): APIPromise<PassageSearchResponse> {
|
|
24
|
+
return this._client.post('/v1/passages/search', { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Representation of a passage, which is stored in archival memory.
|
|
30
|
+
*/
|
|
31
|
+
export interface Passage {
|
|
32
|
+
/**
|
|
33
|
+
* The embedding of the passage.
|
|
34
|
+
*/
|
|
35
|
+
embedding: Array<number> | null;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Configuration for embedding model connection and processing parameters.
|
|
39
|
+
*/
|
|
40
|
+
embedding_config: ModelsAPI.EmbeddingConfig | null;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The text of the passage.
|
|
44
|
+
*/
|
|
45
|
+
text: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The human-friendly ID of the Passage
|
|
49
|
+
*/
|
|
50
|
+
id?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The unique identifier of the archive containing this passage.
|
|
54
|
+
*/
|
|
55
|
+
archive_id?: string | null;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The creation date of the passage.
|
|
59
|
+
*/
|
|
60
|
+
created_at?: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The id of the user that made this object.
|
|
64
|
+
*/
|
|
65
|
+
created_by_id?: string | null;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The unique identifier of the file associated with the passage.
|
|
69
|
+
*/
|
|
70
|
+
file_id?: string | null;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The name of the file (only for source passages).
|
|
74
|
+
*/
|
|
75
|
+
file_name?: string | null;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Whether this passage is deleted or not.
|
|
79
|
+
*/
|
|
80
|
+
is_deleted?: boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The id of the user that made this object.
|
|
84
|
+
*/
|
|
85
|
+
last_updated_by_id?: string | null;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The metadata of the passage.
|
|
89
|
+
*/
|
|
90
|
+
metadata?: { [key: string]: unknown } | null;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated Deprecated: Use `folder_id` field instead. The data source of the
|
|
94
|
+
* passage.
|
|
95
|
+
*/
|
|
96
|
+
source_id?: string | null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Tags associated with this passage.
|
|
100
|
+
*/
|
|
101
|
+
tags?: Array<string> | null;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The timestamp when the object was last updated.
|
|
105
|
+
*/
|
|
106
|
+
updated_at?: string | null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type PassageSearchResponse = Array<PassageSearchResponse.PassageSearchResponseItem>;
|
|
110
|
+
|
|
111
|
+
export namespace PassageSearchResponse {
|
|
112
|
+
/**
|
|
113
|
+
* Result from a passage search operation with scoring details.
|
|
114
|
+
*/
|
|
115
|
+
export interface PassageSearchResponseItem {
|
|
116
|
+
/**
|
|
117
|
+
* The passage object
|
|
118
|
+
*/
|
|
119
|
+
passage: PassagesAPI.Passage;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Relevance score
|
|
123
|
+
*/
|
|
124
|
+
score: number;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Additional metadata about the search result
|
|
128
|
+
*/
|
|
129
|
+
metadata?: { [key: string]: unknown };
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface PassageSearchParams {
|
|
134
|
+
/**
|
|
135
|
+
* Text query for semantic search
|
|
136
|
+
*/
|
|
137
|
+
query: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Filter passages by agent ID
|
|
141
|
+
*/
|
|
142
|
+
agent_id?: string | null;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Filter passages by archive ID
|
|
146
|
+
*/
|
|
147
|
+
archive_id?: string | null;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Filter results to passages created before this datetime
|
|
151
|
+
*/
|
|
152
|
+
end_date?: string | null;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Maximum number of results to return
|
|
156
|
+
*/
|
|
157
|
+
limit?: number;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Filter results to passages created after this datetime
|
|
161
|
+
*/
|
|
162
|
+
start_date?: string | null;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* How to match tags - 'any' to match passages with any of the tags, 'all' to match
|
|
166
|
+
* only passages with all tags
|
|
167
|
+
*/
|
|
168
|
+
tag_match_mode?: 'any' | 'all';
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Optional list of tags to filter search results
|
|
172
|
+
*/
|
|
173
|
+
tags?: Array<string> | null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare namespace Passages {
|
|
177
|
+
export {
|
|
178
|
+
type Passage as Passage,
|
|
179
|
+
type PassageSearchResponse as PassageSearchResponse,
|
|
180
|
+
type PassageSearchParams as PassageSearchParams,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
@@ -28,11 +28,15 @@ export interface UsageRetrieveResponse {
|
|
|
28
28
|
|
|
29
29
|
export namespace UsageRetrieveResponse {
|
|
30
30
|
export interface CompletionTokensDetails {
|
|
31
|
-
reasoning_tokens?: number;
|
|
31
|
+
reasoning_tokens?: number | null;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export interface PromptTokensDetails {
|
|
35
|
-
|
|
35
|
+
cache_creation_tokens?: number | null;
|
|
36
|
+
|
|
37
|
+
cache_read_tokens?: number | null;
|
|
38
|
+
|
|
39
|
+
cached_tokens?: number | null;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
|
|
@@ -111,7 +111,7 @@ export interface Step {
|
|
|
111
111
|
completion_tokens?: number | null;
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* Detailed completion token breakdown (e.g., reasoning_tokens).
|
|
115
115
|
*/
|
|
116
116
|
completion_tokens_details?: { [key: string]: unknown } | null;
|
|
117
117
|
|
|
@@ -166,6 +166,12 @@ export interface Step {
|
|
|
166
166
|
*/
|
|
167
167
|
prompt_tokens?: number | null;
|
|
168
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Detailed prompt token breakdown (e.g., cached_tokens, cache_read_tokens,
|
|
171
|
+
* cache_creation_tokens).
|
|
172
|
+
*/
|
|
173
|
+
prompt_tokens_details?: { [key: string]: unknown } | null;
|
|
174
|
+
|
|
169
175
|
/**
|
|
170
176
|
* The category of the provider used for this step.
|
|
171
177
|
*/
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export { Agents, type AgentCreateResponse, type AgentCreateParams } from './agents';
|
|
4
|
-
export {
|
|
4
|
+
export {
|
|
5
|
+
Templates,
|
|
6
|
+
type TemplateCreateResponse,
|
|
7
|
+
type TemplateUpdateResponse,
|
|
8
|
+
type TemplateDeleteResponse,
|
|
9
|
+
type TemplateCreateParams,
|
|
10
|
+
type TemplateUpdateParams,
|
|
11
|
+
type TemplateDeleteParams,
|
|
12
|
+
} from './templates';
|