@tambo-ai/typescript-sdk 0.86.0 → 0.88.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/CHANGELOG.md +31 -0
- package/bin/migration-config.json +74 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/threads/index.d.mts +2 -1
- package/resources/threads/index.d.mts.map +1 -1
- package/resources/threads/index.d.ts +2 -1
- package/resources/threads/index.d.ts.map +1 -1
- package/resources/threads/index.js +3 -1
- package/resources/threads/index.js.map +1 -1
- package/resources/threads/index.mjs +1 -0
- package/resources/threads/index.mjs.map +1 -1
- package/resources/threads/runs.d.mts +12 -4
- package/resources/threads/runs.d.mts.map +1 -1
- package/resources/threads/runs.d.ts +12 -4
- package/resources/threads/runs.d.ts.map +1 -1
- package/resources/threads/state.d.mts +24 -38
- package/resources/threads/state.d.mts.map +1 -1
- package/resources/threads/state.d.ts +24 -38
- package/resources/threads/state.d.ts.map +1 -1
- package/resources/threads/state.js +1 -4
- package/resources/threads/state.js.map +1 -1
- package/resources/threads/state.mjs +1 -4
- package/resources/threads/state.mjs.map +1 -1
- package/resources/threads/suggestions.d.mts +122 -0
- package/resources/threads/suggestions.d.mts.map +1 -0
- package/resources/threads/suggestions.d.ts +122 -0
- package/resources/threads/suggestions.d.ts.map +1 -0
- package/resources/threads/suggestions.js +49 -0
- package/resources/threads/suggestions.js.map +1 -0
- package/resources/threads/suggestions.mjs +45 -0
- package/resources/threads/suggestions.mjs.map +1 -0
- package/resources/threads/threads.d.mts +32 -22
- package/resources/threads/threads.d.mts.map +1 -1
- package/resources/threads/threads.d.ts +32 -22
- package/resources/threads/threads.d.ts.map +1 -1
- package/resources/threads/threads.js +7 -3
- package/resources/threads/threads.js.map +1 -1
- package/resources/threads/threads.mjs +7 -3
- package/resources/threads/threads.mjs.map +1 -1
- package/src/client.ts +2 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/threads/index.ts +8 -0
- package/src/resources/threads/runs.ts +15 -5
- package/src/resources/threads/state.ts +27 -41
- package/src/resources/threads/suggestions.ts +170 -0
- package/src/resources/threads/threads.ts +56 -26
- 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
|
@@ -7,12 +7,15 @@ import * as RunsAPI from "./runs.mjs";
|
|
|
7
7
|
import { InputMessage, RunCreateParams, RunCreateResponse, RunDeleteParams, RunDeleteResponse, RunRunParams, RunRunResponse, Runs } from "./runs.mjs";
|
|
8
8
|
import * as StateAPI from "./state.mjs";
|
|
9
9
|
import { State, StateUpdateStateParams, StateUpdateStateResponse } from "./state.mjs";
|
|
10
|
+
import * as SuggestionsAPI from "./suggestions.mjs";
|
|
11
|
+
import { SuggestionCreateParams, SuggestionCreateResponse, SuggestionListParams, SuggestionListResponse, Suggestions } from "./suggestions.mjs";
|
|
10
12
|
import { APIPromise } from "../../core/api-promise.mjs";
|
|
11
13
|
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
12
14
|
export declare class Threads extends APIResource {
|
|
13
15
|
state: StateAPI.State;
|
|
14
16
|
messages: MessagesAPI.Messages;
|
|
15
17
|
runs: RunsAPI.Runs;
|
|
18
|
+
suggestions: SuggestionsAPI.Suggestions;
|
|
16
19
|
/**
|
|
17
20
|
* Create a new empty thread. Note: initialMessages is not supported yet; create
|
|
18
21
|
* the thread first, then add messages via runs/message endpoints.
|
|
@@ -34,10 +37,10 @@ export declare class Threads extends APIResource {
|
|
|
34
37
|
* );
|
|
35
38
|
* ```
|
|
36
39
|
*/
|
|
37
|
-
retrieve(threadID: string, options?: RequestOptions): APIPromise<ThreadRetrieveResponse>;
|
|
40
|
+
retrieve(threadID: string, query?: ThreadRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<ThreadRetrieveResponse>;
|
|
38
41
|
/**
|
|
39
42
|
* List all threads for the authenticated project. Supports cursor-based pagination
|
|
40
|
-
* and filtering by
|
|
43
|
+
* and filtering by user key.
|
|
41
44
|
*
|
|
42
45
|
* @example
|
|
43
46
|
* ```ts
|
|
@@ -161,10 +164,6 @@ export interface ThreadCreateResponse {
|
|
|
161
164
|
* When the thread was last updated (ISO 8601)
|
|
162
165
|
*/
|
|
163
166
|
updatedAt: string;
|
|
164
|
-
/**
|
|
165
|
-
* Optional context key for thread organization
|
|
166
|
-
*/
|
|
167
|
-
contextKey?: string;
|
|
168
167
|
/**
|
|
169
168
|
* ID of the currently active run (when not idle)
|
|
170
169
|
*/
|
|
@@ -195,6 +194,10 @@ export interface ThreadCreateResponse {
|
|
|
195
194
|
* Human-readable status message (e.g., 'Fetching weather data...')
|
|
196
195
|
*/
|
|
197
196
|
statusMessage?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Optional user key for thread organization
|
|
199
|
+
*/
|
|
200
|
+
userKey?: string;
|
|
198
201
|
}
|
|
199
202
|
export interface ThreadRetrieveResponse {
|
|
200
203
|
/**
|
|
@@ -218,10 +221,6 @@ export interface ThreadRetrieveResponse {
|
|
|
218
221
|
* When the thread was last updated (ISO 8601)
|
|
219
222
|
*/
|
|
220
223
|
updatedAt: string;
|
|
221
|
-
/**
|
|
222
|
-
* Optional context key for thread organization
|
|
223
|
-
*/
|
|
224
|
-
contextKey?: string;
|
|
225
224
|
/**
|
|
226
225
|
* ID of the currently active run (when not idle)
|
|
227
226
|
*/
|
|
@@ -252,6 +251,10 @@ export interface ThreadRetrieveResponse {
|
|
|
252
251
|
* Human-readable status message (e.g., 'Fetching weather data...')
|
|
253
252
|
*/
|
|
254
253
|
statusMessage?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Optional user key for thread organization
|
|
256
|
+
*/
|
|
257
|
+
userKey?: string;
|
|
255
258
|
}
|
|
256
259
|
export declare namespace ThreadRetrieveResponse {
|
|
257
260
|
interface Message {
|
|
@@ -310,10 +313,6 @@ export declare namespace ThreadListResponse {
|
|
|
310
313
|
* When the thread was last updated (ISO 8601)
|
|
311
314
|
*/
|
|
312
315
|
updatedAt: string;
|
|
313
|
-
/**
|
|
314
|
-
* Optional context key for thread organization
|
|
315
|
-
*/
|
|
316
|
-
contextKey?: string;
|
|
317
316
|
/**
|
|
318
317
|
* ID of the currently active run (when not idle)
|
|
319
318
|
*/
|
|
@@ -344,13 +343,13 @@ export declare namespace ThreadListResponse {
|
|
|
344
343
|
* Human-readable status message (e.g., 'Fetching weather data...')
|
|
345
344
|
*/
|
|
346
345
|
statusMessage?: string;
|
|
346
|
+
/**
|
|
347
|
+
* Optional user key for thread organization
|
|
348
|
+
*/
|
|
349
|
+
userKey?: string;
|
|
347
350
|
}
|
|
348
351
|
}
|
|
349
352
|
export interface ThreadCreateParams {
|
|
350
|
-
/**
|
|
351
|
-
* Optional context key for thread organization
|
|
352
|
-
*/
|
|
353
|
-
contextKey?: string;
|
|
354
353
|
/**
|
|
355
354
|
* Initial messages to seed the thread with
|
|
356
355
|
*/
|
|
@@ -359,12 +358,18 @@ export interface ThreadCreateParams {
|
|
|
359
358
|
* Additional metadata to attach to the thread
|
|
360
359
|
*/
|
|
361
360
|
metadata?: unknown;
|
|
361
|
+
/**
|
|
362
|
+
* Identifier for a user in your system. Required if no bearer token is provided.
|
|
363
|
+
*/
|
|
364
|
+
userKey?: string;
|
|
362
365
|
}
|
|
363
|
-
export interface
|
|
366
|
+
export interface ThreadRetrieveParams {
|
|
364
367
|
/**
|
|
365
|
-
*
|
|
368
|
+
* Optional user key for thread organization
|
|
366
369
|
*/
|
|
367
|
-
|
|
370
|
+
userKey?: string;
|
|
371
|
+
}
|
|
372
|
+
export interface ThreadListParams {
|
|
368
373
|
/**
|
|
369
374
|
* Cursor for pagination
|
|
370
375
|
*/
|
|
@@ -373,11 +378,16 @@ export interface ThreadListParams {
|
|
|
373
378
|
* Maximum number of threads to return
|
|
374
379
|
*/
|
|
375
380
|
limit?: string;
|
|
381
|
+
/**
|
|
382
|
+
* Filter by user key
|
|
383
|
+
*/
|
|
384
|
+
userKey?: string;
|
|
376
385
|
}
|
|
377
386
|
export declare namespace Threads {
|
|
378
|
-
export { type ComponentContent as ComponentContent, type ResourceContent as ResourceContent, type RunError as RunError, type TextContent as TextContent, type ToolResultContent as ToolResultContent, type ToolUseContent as ToolUseContent, type ThreadCreateResponse as ThreadCreateResponse, type ThreadRetrieveResponse as ThreadRetrieveResponse, type ThreadListResponse as ThreadListResponse, type ThreadCreateParams as ThreadCreateParams, type ThreadListParams as ThreadListParams, };
|
|
387
|
+
export { type ComponentContent as ComponentContent, type ResourceContent as ResourceContent, type RunError as RunError, type TextContent as TextContent, type ToolResultContent as ToolResultContent, type ToolUseContent as ToolUseContent, type ThreadCreateResponse as ThreadCreateResponse, type ThreadRetrieveResponse as ThreadRetrieveResponse, type ThreadListResponse as ThreadListResponse, type ThreadCreateParams as ThreadCreateParams, type ThreadRetrieveParams as ThreadRetrieveParams, type ThreadListParams as ThreadListParams, };
|
|
379
388
|
export { State as State, type StateUpdateStateResponse as StateUpdateStateResponse, type StateUpdateStateParams as StateUpdateStateParams, };
|
|
380
389
|
export { Messages as Messages, type MessageListResponse as MessageListResponse, type MessageGetResponse as MessageGetResponse, type MessageListParams as MessageListParams, type MessageGetParams as MessageGetParams, };
|
|
381
390
|
export { Runs as Runs, type InputMessage as InputMessage, type RunCreateResponse as RunCreateResponse, type RunDeleteResponse as RunDeleteResponse, type RunRunResponse as RunRunResponse, type RunCreateParams as RunCreateParams, type RunDeleteParams as RunDeleteParams, type RunRunParams as RunRunParams, };
|
|
391
|
+
export { Suggestions as Suggestions, type SuggestionCreateResponse as SuggestionCreateResponse, type SuggestionListResponse as SuggestionListResponse, type SuggestionCreateParams as SuggestionCreateParams, type SuggestionListParams as SuggestionListParams, };
|
|
382
392
|
}
|
|
383
393
|
//# sourceMappingURL=threads.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threads.d.mts","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,KAAK,WAAW;OAChB,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACT;OACM,KAAK,OAAO;OACZ,EACL,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,IAAI,EACL;OACM,KAAK,QAAQ;OACb,EAAE,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE;OAC3D,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;IACzD,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IACxE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;
|
|
1
|
+
{"version":3,"file":"threads.d.mts","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,KAAK,WAAW;OAChB,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACT;OACM,KAAK,OAAO;OACZ,EACL,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,IAAI,EACL;OACM,KAAK,QAAQ;OACb,EAAE,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE;OAC3D,KAAK,cAAc;OACnB,EACL,sBAAsB,EACtB,wBAA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L,WAAW,IAAI,WAAW,EAC1B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -7,12 +7,15 @@ import * as RunsAPI from "./runs.js";
|
|
|
7
7
|
import { InputMessage, RunCreateParams, RunCreateResponse, RunDeleteParams, RunDeleteResponse, RunRunParams, RunRunResponse, Runs } from "./runs.js";
|
|
8
8
|
import * as StateAPI from "./state.js";
|
|
9
9
|
import { State, StateUpdateStateParams, StateUpdateStateResponse } from "./state.js";
|
|
10
|
+
import * as SuggestionsAPI from "./suggestions.js";
|
|
11
|
+
import { SuggestionCreateParams, SuggestionCreateResponse, SuggestionListParams, SuggestionListResponse, Suggestions } from "./suggestions.js";
|
|
10
12
|
import { APIPromise } from "../../core/api-promise.js";
|
|
11
13
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
12
14
|
export declare class Threads extends APIResource {
|
|
13
15
|
state: StateAPI.State;
|
|
14
16
|
messages: MessagesAPI.Messages;
|
|
15
17
|
runs: RunsAPI.Runs;
|
|
18
|
+
suggestions: SuggestionsAPI.Suggestions;
|
|
16
19
|
/**
|
|
17
20
|
* Create a new empty thread. Note: initialMessages is not supported yet; create
|
|
18
21
|
* the thread first, then add messages via runs/message endpoints.
|
|
@@ -34,10 +37,10 @@ export declare class Threads extends APIResource {
|
|
|
34
37
|
* );
|
|
35
38
|
* ```
|
|
36
39
|
*/
|
|
37
|
-
retrieve(threadID: string, options?: RequestOptions): APIPromise<ThreadRetrieveResponse>;
|
|
40
|
+
retrieve(threadID: string, query?: ThreadRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<ThreadRetrieveResponse>;
|
|
38
41
|
/**
|
|
39
42
|
* List all threads for the authenticated project. Supports cursor-based pagination
|
|
40
|
-
* and filtering by
|
|
43
|
+
* and filtering by user key.
|
|
41
44
|
*
|
|
42
45
|
* @example
|
|
43
46
|
* ```ts
|
|
@@ -161,10 +164,6 @@ export interface ThreadCreateResponse {
|
|
|
161
164
|
* When the thread was last updated (ISO 8601)
|
|
162
165
|
*/
|
|
163
166
|
updatedAt: string;
|
|
164
|
-
/**
|
|
165
|
-
* Optional context key for thread organization
|
|
166
|
-
*/
|
|
167
|
-
contextKey?: string;
|
|
168
167
|
/**
|
|
169
168
|
* ID of the currently active run (when not idle)
|
|
170
169
|
*/
|
|
@@ -195,6 +194,10 @@ export interface ThreadCreateResponse {
|
|
|
195
194
|
* Human-readable status message (e.g., 'Fetching weather data...')
|
|
196
195
|
*/
|
|
197
196
|
statusMessage?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Optional user key for thread organization
|
|
199
|
+
*/
|
|
200
|
+
userKey?: string;
|
|
198
201
|
}
|
|
199
202
|
export interface ThreadRetrieveResponse {
|
|
200
203
|
/**
|
|
@@ -218,10 +221,6 @@ export interface ThreadRetrieveResponse {
|
|
|
218
221
|
* When the thread was last updated (ISO 8601)
|
|
219
222
|
*/
|
|
220
223
|
updatedAt: string;
|
|
221
|
-
/**
|
|
222
|
-
* Optional context key for thread organization
|
|
223
|
-
*/
|
|
224
|
-
contextKey?: string;
|
|
225
224
|
/**
|
|
226
225
|
* ID of the currently active run (when not idle)
|
|
227
226
|
*/
|
|
@@ -252,6 +251,10 @@ export interface ThreadRetrieveResponse {
|
|
|
252
251
|
* Human-readable status message (e.g., 'Fetching weather data...')
|
|
253
252
|
*/
|
|
254
253
|
statusMessage?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Optional user key for thread organization
|
|
256
|
+
*/
|
|
257
|
+
userKey?: string;
|
|
255
258
|
}
|
|
256
259
|
export declare namespace ThreadRetrieveResponse {
|
|
257
260
|
interface Message {
|
|
@@ -310,10 +313,6 @@ export declare namespace ThreadListResponse {
|
|
|
310
313
|
* When the thread was last updated (ISO 8601)
|
|
311
314
|
*/
|
|
312
315
|
updatedAt: string;
|
|
313
|
-
/**
|
|
314
|
-
* Optional context key for thread organization
|
|
315
|
-
*/
|
|
316
|
-
contextKey?: string;
|
|
317
316
|
/**
|
|
318
317
|
* ID of the currently active run (when not idle)
|
|
319
318
|
*/
|
|
@@ -344,13 +343,13 @@ export declare namespace ThreadListResponse {
|
|
|
344
343
|
* Human-readable status message (e.g., 'Fetching weather data...')
|
|
345
344
|
*/
|
|
346
345
|
statusMessage?: string;
|
|
346
|
+
/**
|
|
347
|
+
* Optional user key for thread organization
|
|
348
|
+
*/
|
|
349
|
+
userKey?: string;
|
|
347
350
|
}
|
|
348
351
|
}
|
|
349
352
|
export interface ThreadCreateParams {
|
|
350
|
-
/**
|
|
351
|
-
* Optional context key for thread organization
|
|
352
|
-
*/
|
|
353
|
-
contextKey?: string;
|
|
354
353
|
/**
|
|
355
354
|
* Initial messages to seed the thread with
|
|
356
355
|
*/
|
|
@@ -359,12 +358,18 @@ export interface ThreadCreateParams {
|
|
|
359
358
|
* Additional metadata to attach to the thread
|
|
360
359
|
*/
|
|
361
360
|
metadata?: unknown;
|
|
361
|
+
/**
|
|
362
|
+
* Identifier for a user in your system. Required if no bearer token is provided.
|
|
363
|
+
*/
|
|
364
|
+
userKey?: string;
|
|
362
365
|
}
|
|
363
|
-
export interface
|
|
366
|
+
export interface ThreadRetrieveParams {
|
|
364
367
|
/**
|
|
365
|
-
*
|
|
368
|
+
* Optional user key for thread organization
|
|
366
369
|
*/
|
|
367
|
-
|
|
370
|
+
userKey?: string;
|
|
371
|
+
}
|
|
372
|
+
export interface ThreadListParams {
|
|
368
373
|
/**
|
|
369
374
|
* Cursor for pagination
|
|
370
375
|
*/
|
|
@@ -373,11 +378,16 @@ export interface ThreadListParams {
|
|
|
373
378
|
* Maximum number of threads to return
|
|
374
379
|
*/
|
|
375
380
|
limit?: string;
|
|
381
|
+
/**
|
|
382
|
+
* Filter by user key
|
|
383
|
+
*/
|
|
384
|
+
userKey?: string;
|
|
376
385
|
}
|
|
377
386
|
export declare namespace Threads {
|
|
378
|
-
export { type ComponentContent as ComponentContent, type ResourceContent as ResourceContent, type RunError as RunError, type TextContent as TextContent, type ToolResultContent as ToolResultContent, type ToolUseContent as ToolUseContent, type ThreadCreateResponse as ThreadCreateResponse, type ThreadRetrieveResponse as ThreadRetrieveResponse, type ThreadListResponse as ThreadListResponse, type ThreadCreateParams as ThreadCreateParams, type ThreadListParams as ThreadListParams, };
|
|
387
|
+
export { type ComponentContent as ComponentContent, type ResourceContent as ResourceContent, type RunError as RunError, type TextContent as TextContent, type ToolResultContent as ToolResultContent, type ToolUseContent as ToolUseContent, type ThreadCreateResponse as ThreadCreateResponse, type ThreadRetrieveResponse as ThreadRetrieveResponse, type ThreadListResponse as ThreadListResponse, type ThreadCreateParams as ThreadCreateParams, type ThreadRetrieveParams as ThreadRetrieveParams, type ThreadListParams as ThreadListParams, };
|
|
379
388
|
export { State as State, type StateUpdateStateResponse as StateUpdateStateResponse, type StateUpdateStateParams as StateUpdateStateParams, };
|
|
380
389
|
export { Messages as Messages, type MessageListResponse as MessageListResponse, type MessageGetResponse as MessageGetResponse, type MessageListParams as MessageListParams, type MessageGetParams as MessageGetParams, };
|
|
381
390
|
export { Runs as Runs, type InputMessage as InputMessage, type RunCreateResponse as RunCreateResponse, type RunDeleteResponse as RunDeleteResponse, type RunRunResponse as RunRunResponse, type RunCreateParams as RunCreateParams, type RunDeleteParams as RunDeleteParams, type RunRunParams as RunRunParams, };
|
|
391
|
+
export { Suggestions as Suggestions, type SuggestionCreateResponse as SuggestionCreateResponse, type SuggestionListResponse as SuggestionListResponse, type SuggestionCreateParams as SuggestionCreateParams, type SuggestionListParams as SuggestionListParams, };
|
|
382
392
|
}
|
|
383
393
|
//# sourceMappingURL=threads.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,KAAK,WAAW;OAChB,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACT;OACM,KAAK,OAAO;OACZ,EACL,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,IAAI,EACL;OACM,KAAK,QAAQ;OACb,EAAE,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE;OAC3D,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;IACzD,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IACxE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;
|
|
1
|
+
{"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,KAAK,WAAW;OAChB,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACT;OACM,KAAK,OAAO;OACZ,EACL,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,IAAI,EACL;OACM,KAAK,QAAQ;OACb,EAAE,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE;OAC3D,KAAK,cAAc;OACnB,EACL,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,EACZ;OACM,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;IACzD,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IACxE,IAAI,EAAE,OAA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|
10
10
|
const runs_1 = require("./runs.js");
|
|
11
11
|
const StateAPI = tslib_1.__importStar(require("./state.js"));
|
|
12
12
|
const state_1 = require("./state.js");
|
|
13
|
+
const SuggestionsAPI = tslib_1.__importStar(require("./suggestions.js"));
|
|
14
|
+
const suggestions_1 = require("./suggestions.js");
|
|
13
15
|
const headers_1 = require("../../internal/headers.js");
|
|
14
16
|
const path_1 = require("../../internal/utils/path.js");
|
|
15
17
|
class Threads extends resource_1.APIResource {
|
|
@@ -18,6 +20,7 @@ class Threads extends resource_1.APIResource {
|
|
|
18
20
|
this.state = new StateAPI.State(this._client);
|
|
19
21
|
this.messages = new MessagesAPI.Messages(this._client);
|
|
20
22
|
this.runs = new RunsAPI.Runs(this._client);
|
|
23
|
+
this.suggestions = new SuggestionsAPI.Suggestions(this._client);
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
* Create a new empty thread. Note: initialMessages is not supported yet; create
|
|
@@ -42,12 +45,12 @@ class Threads extends resource_1.APIResource {
|
|
|
42
45
|
* );
|
|
43
46
|
* ```
|
|
44
47
|
*/
|
|
45
|
-
retrieve(threadID, options) {
|
|
46
|
-
return this._client.get((0, path_1.path) `/v1/threads/${threadID}`, options);
|
|
48
|
+
retrieve(threadID, query = {}, options) {
|
|
49
|
+
return this._client.get((0, path_1.path) `/v1/threads/${threadID}`, { query, ...options });
|
|
47
50
|
}
|
|
48
51
|
/**
|
|
49
52
|
* List all threads for the authenticated project. Supports cursor-based pagination
|
|
50
|
-
* and filtering by
|
|
53
|
+
* and filtering by user key.
|
|
51
54
|
*
|
|
52
55
|
* @example
|
|
53
56
|
* ```ts
|
|
@@ -76,4 +79,5 @@ exports.Threads = Threads;
|
|
|
76
79
|
Threads.State = state_1.State;
|
|
77
80
|
Threads.Messages = messages_1.Messages;
|
|
78
81
|
Threads.Runs = runs_1.Runs;
|
|
82
|
+
Threads.Suggestions = suggestions_1.Suggestions;
|
|
79
83
|
//# sourceMappingURL=threads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threads.js","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,mEAA0C;AAC1C,4CAMoB;AACpB,2DAAkC;AAClC,oCASgB;AAChB,6DAAoC;AACpC,sCAAkF;
|
|
1
|
+
{"version":3,"file":"threads.js","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,mEAA0C;AAC1C,4CAMoB;AACpB,2DAAkC;AAClC,oCASgB;AAChB,6DAAoC;AACpC,sCAAkF;AAClF,yEAAgD;AAChD,kDAMuB;AAEvB,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAgEzF,CAAC;IA9DC;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CACN,QAAgB,EAChB,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,EAAE,EAAE;YACxD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AApED,0BAoEC;AAoZD,OAAO,CAAC,KAAK,GAAG,aAAK,CAAC;AACtB,OAAO,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AAC5B,OAAO,CAAC,IAAI,GAAG,WAAI,CAAC;AACpB,OAAO,CAAC,WAAW,GAAG,yBAAW,CAAC"}
|
|
@@ -6,6 +6,8 @@ import * as RunsAPI from "./runs.mjs";
|
|
|
6
6
|
import { Runs, } from "./runs.mjs";
|
|
7
7
|
import * as StateAPI from "./state.mjs";
|
|
8
8
|
import { State } from "./state.mjs";
|
|
9
|
+
import * as SuggestionsAPI from "./suggestions.mjs";
|
|
10
|
+
import { Suggestions, } from "./suggestions.mjs";
|
|
9
11
|
import { buildHeaders } from "../../internal/headers.mjs";
|
|
10
12
|
import { path } from "../../internal/utils/path.mjs";
|
|
11
13
|
export class Threads extends APIResource {
|
|
@@ -14,6 +16,7 @@ export class Threads extends APIResource {
|
|
|
14
16
|
this.state = new StateAPI.State(this._client);
|
|
15
17
|
this.messages = new MessagesAPI.Messages(this._client);
|
|
16
18
|
this.runs = new RunsAPI.Runs(this._client);
|
|
19
|
+
this.suggestions = new SuggestionsAPI.Suggestions(this._client);
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
22
|
* Create a new empty thread. Note: initialMessages is not supported yet; create
|
|
@@ -38,12 +41,12 @@ export class Threads extends APIResource {
|
|
|
38
41
|
* );
|
|
39
42
|
* ```
|
|
40
43
|
*/
|
|
41
|
-
retrieve(threadID, options) {
|
|
42
|
-
return this._client.get(path `/v1/threads/${threadID}`, options);
|
|
44
|
+
retrieve(threadID, query = {}, options) {
|
|
45
|
+
return this._client.get(path `/v1/threads/${threadID}`, { query, ...options });
|
|
43
46
|
}
|
|
44
47
|
/**
|
|
45
48
|
* List all threads for the authenticated project. Supports cursor-based pagination
|
|
46
|
-
* and filtering by
|
|
49
|
+
* and filtering by user key.
|
|
47
50
|
*
|
|
48
51
|
* @example
|
|
49
52
|
* ```ts
|
|
@@ -71,4 +74,5 @@ export class Threads extends APIResource {
|
|
|
71
74
|
Threads.State = State;
|
|
72
75
|
Threads.Messages = Messages;
|
|
73
76
|
Threads.Runs = Runs;
|
|
77
|
+
Threads.Suggestions = Suggestions;
|
|
74
78
|
//# sourceMappingURL=threads.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threads.mjs","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,WAAW;OAChB,EAKL,QAAQ,GACT;OACM,KAAK,OAAO;OACZ,EAQL,IAAI,GACL;OACM,KAAK,QAAQ;OACb,EAAE,KAAK,EAAoD;
|
|
1
|
+
{"version":3,"file":"threads.mjs","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,WAAW;OAChB,EAKL,QAAQ,GACT;OACM,KAAK,OAAO;OACZ,EAQL,IAAI,GACL;OACM,KAAK,QAAQ;OACb,EAAE,KAAK,EAAoD;OAC3D,KAAK,cAAc;OACnB,EA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E,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAoZD,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;AACtB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
package/src/client.ts
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
ThreadCreateResponse,
|
|
30
30
|
ThreadListParams,
|
|
31
31
|
ThreadListResponse,
|
|
32
|
+
ThreadRetrieveParams,
|
|
32
33
|
ThreadRetrieveResponse,
|
|
33
34
|
Threads,
|
|
34
35
|
ToolResultContent,
|
|
@@ -847,6 +848,7 @@ export declare namespace TamboAI {
|
|
|
847
848
|
type ThreadRetrieveResponse as ThreadRetrieveResponse,
|
|
848
849
|
type ThreadListResponse as ThreadListResponse,
|
|
849
850
|
type ThreadCreateParams as ThreadCreateParams,
|
|
851
|
+
type ThreadRetrieveParams as ThreadRetrieveParams,
|
|
850
852
|
type ThreadListParams as ThreadListParams,
|
|
851
853
|
};
|
|
852
854
|
|
package/src/resources/index.ts
CHANGED
|
@@ -18,6 +18,13 @@ export {
|
|
|
18
18
|
type RunRunParams,
|
|
19
19
|
} from './runs';
|
|
20
20
|
export { State, type StateUpdateStateResponse, type StateUpdateStateParams } from './state';
|
|
21
|
+
export {
|
|
22
|
+
Suggestions,
|
|
23
|
+
type SuggestionCreateResponse,
|
|
24
|
+
type SuggestionListResponse,
|
|
25
|
+
type SuggestionCreateParams,
|
|
26
|
+
type SuggestionListParams,
|
|
27
|
+
} from './suggestions';
|
|
21
28
|
export {
|
|
22
29
|
Threads,
|
|
23
30
|
type ComponentContent,
|
|
@@ -30,5 +37,6 @@ export {
|
|
|
30
37
|
type ThreadRetrieveResponse,
|
|
31
38
|
type ThreadListResponse,
|
|
32
39
|
type ThreadCreateParams,
|
|
40
|
+
type ThreadRetrieveParams,
|
|
33
41
|
type ThreadListParams,
|
|
34
42
|
} from './threads';
|
|
@@ -188,6 +188,11 @@ export interface RunCreateParams {
|
|
|
188
188
|
* Client-side tools the model can call
|
|
189
189
|
*/
|
|
190
190
|
tools?: Array<RunCreateParams.Tool>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Identifier for a user in your system. Required if no bearer token is provided.
|
|
194
|
+
*/
|
|
195
|
+
userKey?: string;
|
|
191
196
|
}
|
|
192
197
|
|
|
193
198
|
export namespace RunCreateParams {
|
|
@@ -217,11 +222,6 @@ export namespace RunCreateParams {
|
|
|
217
222
|
* Thread configuration
|
|
218
223
|
*/
|
|
219
224
|
export interface Thread {
|
|
220
|
-
/**
|
|
221
|
-
* Optional context key for thread organization
|
|
222
|
-
*/
|
|
223
|
-
contextKey?: string;
|
|
224
|
-
|
|
225
225
|
/**
|
|
226
226
|
* Initial messages to seed the thread with
|
|
227
227
|
*/
|
|
@@ -231,6 +231,11 @@ export namespace RunCreateParams {
|
|
|
231
231
|
* Additional metadata to attach to the thread
|
|
232
232
|
*/
|
|
233
233
|
metadata?: unknown;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Identifier for a user in your system. Required if no bearer token is provided.
|
|
237
|
+
*/
|
|
238
|
+
userKey?: string;
|
|
234
239
|
}
|
|
235
240
|
|
|
236
241
|
export interface Name {
|
|
@@ -318,6 +323,11 @@ export interface RunRunParams {
|
|
|
318
323
|
* Client-side tools the model can call
|
|
319
324
|
*/
|
|
320
325
|
tools?: Array<RunRunParams.Tool>;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Identifier for a user in your system. Required if no bearer token is provided.
|
|
329
|
+
*/
|
|
330
|
+
userKey?: string;
|
|
321
331
|
}
|
|
322
332
|
|
|
323
333
|
export namespace RunRunParams {
|
|
@@ -14,10 +14,7 @@ export class State extends APIResource {
|
|
|
14
14
|
* ```ts
|
|
15
15
|
* const response = await client.threads.state.updateState(
|
|
16
16
|
* 'comp_xyz789abc',
|
|
17
|
-
* {
|
|
18
|
-
* threadId: 'thr_abc123xyz',
|
|
19
|
-
* state: { foo: 'bar' },
|
|
20
|
-
* },
|
|
17
|
+
* { threadId: 'thr_abc123xyz' },
|
|
21
18
|
* );
|
|
22
19
|
* ```
|
|
23
20
|
*/
|
|
@@ -41,55 +38,44 @@ export interface StateUpdateStateResponse {
|
|
|
41
38
|
state: unknown;
|
|
42
39
|
}
|
|
43
40
|
|
|
44
|
-
export
|
|
41
|
+
export interface StateUpdateStateParams {
|
|
42
|
+
/**
|
|
43
|
+
* Path param: Thread ID
|
|
44
|
+
*/
|
|
45
|
+
threadId: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Body param: JSON Patch operations to apply to current state
|
|
49
|
+
*/
|
|
50
|
+
patch?: Array<StateUpdateStateParams.Patch>;
|
|
45
51
|
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Body param: Full replacement state object
|
|
54
|
+
*/
|
|
55
|
+
state?: unknown;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export namespace StateUpdateStateParams {
|
|
59
|
+
export interface Patch {
|
|
48
60
|
/**
|
|
49
|
-
*
|
|
61
|
+
* Operation type
|
|
50
62
|
*/
|
|
51
|
-
|
|
63
|
+
op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
|
|
52
64
|
|
|
53
65
|
/**
|
|
54
|
-
*
|
|
66
|
+
* JSON Pointer path to the target location
|
|
55
67
|
*/
|
|
56
|
-
|
|
57
|
-
}
|
|
68
|
+
path: string;
|
|
58
69
|
|
|
59
|
-
export interface Variant1 {
|
|
60
70
|
/**
|
|
61
|
-
*
|
|
71
|
+
* Source path for move and copy operations
|
|
62
72
|
*/
|
|
63
|
-
|
|
73
|
+
from?: string;
|
|
64
74
|
|
|
65
75
|
/**
|
|
66
|
-
*
|
|
76
|
+
* Value to add, replace, or test (required for add, replace, test)
|
|
67
77
|
*/
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export namespace Variant1 {
|
|
72
|
-
export interface Patch {
|
|
73
|
-
/**
|
|
74
|
-
* Operation type
|
|
75
|
-
*/
|
|
76
|
-
op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* JSON Pointer path to the target location
|
|
80
|
-
*/
|
|
81
|
-
path: string;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Source path for move and copy operations
|
|
85
|
-
*/
|
|
86
|
-
from?: string;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Value to add, replace, or test (required for add, replace, test)
|
|
90
|
-
*/
|
|
91
|
-
value?: unknown;
|
|
92
|
-
}
|
|
78
|
+
value?: unknown;
|
|
93
79
|
}
|
|
94
80
|
}
|
|
95
81
|
|