@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
|
@@ -144,6 +144,10 @@ export interface RunCreateParams {
|
|
|
144
144
|
* Client-side tools the model can call
|
|
145
145
|
*/
|
|
146
146
|
tools?: Array<RunCreateParams.Tool>;
|
|
147
|
+
/**
|
|
148
|
+
* Identifier for a user in your system. Required if no bearer token is provided.
|
|
149
|
+
*/
|
|
150
|
+
userKey?: string;
|
|
147
151
|
}
|
|
148
152
|
export declare namespace RunCreateParams {
|
|
149
153
|
interface AvailableComponent {
|
|
@@ -168,10 +172,6 @@ export declare namespace RunCreateParams {
|
|
|
168
172
|
* Thread configuration
|
|
169
173
|
*/
|
|
170
174
|
interface Thread {
|
|
171
|
-
/**
|
|
172
|
-
* Optional context key for thread organization
|
|
173
|
-
*/
|
|
174
|
-
contextKey?: string;
|
|
175
175
|
/**
|
|
176
176
|
* Initial messages to seed the thread with
|
|
177
177
|
*/
|
|
@@ -180,6 +180,10 @@ export declare namespace RunCreateParams {
|
|
|
180
180
|
* Additional metadata to attach to the thread
|
|
181
181
|
*/
|
|
182
182
|
metadata?: unknown;
|
|
183
|
+
/**
|
|
184
|
+
* Identifier for a user in your system. Required if no bearer token is provided.
|
|
185
|
+
*/
|
|
186
|
+
userKey?: string;
|
|
183
187
|
}
|
|
184
188
|
interface Name {
|
|
185
189
|
name?: string;
|
|
@@ -251,6 +255,10 @@ export interface RunRunParams {
|
|
|
251
255
|
* Client-side tools the model can call
|
|
252
256
|
*/
|
|
253
257
|
tools?: Array<RunRunParams.Tool>;
|
|
258
|
+
/**
|
|
259
|
+
* Identifier for a user in your system. Required if no bearer token is provided.
|
|
260
|
+
*/
|
|
261
|
+
userKey?: string;
|
|
254
262
|
}
|
|
255
263
|
export declare namespace RunRunParams {
|
|
256
264
|
interface AvailableComponent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/resources/threads/runs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OAEV,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAS9F;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAKvG;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;CAQxG;AAED,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC,eAAe,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAEnG;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MA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AE,OAAO,CAAC;QAErB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QAEvB;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,YAAY,IAAI,YAAY,GAClC,CAAC;CACH"}
|
|
@@ -10,10 +10,7 @@ export declare class State extends APIResource {
|
|
|
10
10
|
* ```ts
|
|
11
11
|
* const response = await client.threads.state.updateState(
|
|
12
12
|
* 'comp_xyz789abc',
|
|
13
|
-
* {
|
|
14
|
-
* threadId: 'thr_abc123xyz',
|
|
15
|
-
* state: { foo: 'bar' },
|
|
16
|
-
* },
|
|
13
|
+
* { threadId: 'thr_abc123xyz' },
|
|
17
14
|
* );
|
|
18
15
|
* ```
|
|
19
16
|
*/
|
|
@@ -25,49 +22,38 @@ export interface StateUpdateStateResponse {
|
|
|
25
22
|
*/
|
|
26
23
|
state: unknown;
|
|
27
24
|
}
|
|
28
|
-
export
|
|
25
|
+
export interface StateUpdateStateParams {
|
|
26
|
+
/**
|
|
27
|
+
* Path param: Thread ID
|
|
28
|
+
*/
|
|
29
|
+
threadId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Body param: JSON Patch operations to apply to current state
|
|
32
|
+
*/
|
|
33
|
+
patch?: Array<StateUpdateStateParams.Patch>;
|
|
34
|
+
/**
|
|
35
|
+
* Body param: Full replacement state object
|
|
36
|
+
*/
|
|
37
|
+
state?: unknown;
|
|
38
|
+
}
|
|
29
39
|
export declare namespace StateUpdateStateParams {
|
|
30
|
-
interface
|
|
40
|
+
interface Patch {
|
|
31
41
|
/**
|
|
32
|
-
*
|
|
42
|
+
* Operation type
|
|
33
43
|
*/
|
|
34
|
-
|
|
44
|
+
op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
|
|
35
45
|
/**
|
|
36
|
-
*
|
|
46
|
+
* JSON Pointer path to the target location
|
|
37
47
|
*/
|
|
38
|
-
|
|
39
|
-
[key: string]: unknown;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
interface Variant1 {
|
|
48
|
+
path: string;
|
|
43
49
|
/**
|
|
44
|
-
*
|
|
50
|
+
* Source path for move and copy operations
|
|
45
51
|
*/
|
|
46
|
-
|
|
52
|
+
from?: string;
|
|
47
53
|
/**
|
|
48
|
-
*
|
|
54
|
+
* Value to add, replace, or test (required for add, replace, test)
|
|
49
55
|
*/
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
namespace Variant1 {
|
|
53
|
-
interface Patch {
|
|
54
|
-
/**
|
|
55
|
-
* Operation type
|
|
56
|
-
*/
|
|
57
|
-
op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
|
|
58
|
-
/**
|
|
59
|
-
* JSON Pointer path to the target location
|
|
60
|
-
*/
|
|
61
|
-
path: string;
|
|
62
|
-
/**
|
|
63
|
-
* Source path for move and copy operations
|
|
64
|
-
*/
|
|
65
|
-
from?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Value to add, replace, or test (required for add, replace, test)
|
|
68
|
-
*/
|
|
69
|
-
value?: unknown;
|
|
70
|
-
}
|
|
56
|
+
value?: unknown;
|
|
71
57
|
}
|
|
72
58
|
}
|
|
73
59
|
export declare namespace State {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.mts","sourceRoot":"","sources":["../../src/resources/threads/state.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"state.d.mts","sourceRoot":"","sources":["../../src/resources/threads/state.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,WAAW,CACT,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;CAOxC;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAE5C;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,yBAAiB,sBAAsB,CAAC;IACtC,UAAiB,KAAK;QACpB;;WAEG;QACH,EAAE,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;QAE5D;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -10,10 +10,7 @@ export declare class State extends APIResource {
|
|
|
10
10
|
* ```ts
|
|
11
11
|
* const response = await client.threads.state.updateState(
|
|
12
12
|
* 'comp_xyz789abc',
|
|
13
|
-
* {
|
|
14
|
-
* threadId: 'thr_abc123xyz',
|
|
15
|
-
* state: { foo: 'bar' },
|
|
16
|
-
* },
|
|
13
|
+
* { threadId: 'thr_abc123xyz' },
|
|
17
14
|
* );
|
|
18
15
|
* ```
|
|
19
16
|
*/
|
|
@@ -25,49 +22,38 @@ export interface StateUpdateStateResponse {
|
|
|
25
22
|
*/
|
|
26
23
|
state: unknown;
|
|
27
24
|
}
|
|
28
|
-
export
|
|
25
|
+
export interface StateUpdateStateParams {
|
|
26
|
+
/**
|
|
27
|
+
* Path param: Thread ID
|
|
28
|
+
*/
|
|
29
|
+
threadId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Body param: JSON Patch operations to apply to current state
|
|
32
|
+
*/
|
|
33
|
+
patch?: Array<StateUpdateStateParams.Patch>;
|
|
34
|
+
/**
|
|
35
|
+
* Body param: Full replacement state object
|
|
36
|
+
*/
|
|
37
|
+
state?: unknown;
|
|
38
|
+
}
|
|
29
39
|
export declare namespace StateUpdateStateParams {
|
|
30
|
-
interface
|
|
40
|
+
interface Patch {
|
|
31
41
|
/**
|
|
32
|
-
*
|
|
42
|
+
* Operation type
|
|
33
43
|
*/
|
|
34
|
-
|
|
44
|
+
op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
|
|
35
45
|
/**
|
|
36
|
-
*
|
|
46
|
+
* JSON Pointer path to the target location
|
|
37
47
|
*/
|
|
38
|
-
|
|
39
|
-
[key: string]: unknown;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
interface Variant1 {
|
|
48
|
+
path: string;
|
|
43
49
|
/**
|
|
44
|
-
*
|
|
50
|
+
* Source path for move and copy operations
|
|
45
51
|
*/
|
|
46
|
-
|
|
52
|
+
from?: string;
|
|
47
53
|
/**
|
|
48
|
-
*
|
|
54
|
+
* Value to add, replace, or test (required for add, replace, test)
|
|
49
55
|
*/
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
namespace Variant1 {
|
|
53
|
-
interface Patch {
|
|
54
|
-
/**
|
|
55
|
-
* Operation type
|
|
56
|
-
*/
|
|
57
|
-
op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
|
|
58
|
-
/**
|
|
59
|
-
* JSON Pointer path to the target location
|
|
60
|
-
*/
|
|
61
|
-
path: string;
|
|
62
|
-
/**
|
|
63
|
-
* Source path for move and copy operations
|
|
64
|
-
*/
|
|
65
|
-
from?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Value to add, replace, or test (required for add, replace, test)
|
|
68
|
-
*/
|
|
69
|
-
value?: unknown;
|
|
70
|
-
}
|
|
56
|
+
value?: unknown;
|
|
71
57
|
}
|
|
72
58
|
}
|
|
73
59
|
export declare namespace State {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/resources/threads/state.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/resources/threads/state.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,WAAW,CACT,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;CAOxC;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAE5C;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,yBAAiB,sBAAsB,CAAC;IACtC,UAAiB,KAAK;QACpB;;WAEG;QACH,EAAE,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;QAE5D;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -13,10 +13,7 @@ class State extends resource_1.APIResource {
|
|
|
13
13
|
* ```ts
|
|
14
14
|
* const response = await client.threads.state.updateState(
|
|
15
15
|
* 'comp_xyz789abc',
|
|
16
|
-
* {
|
|
17
|
-
* threadId: 'thr_abc123xyz',
|
|
18
|
-
* state: { foo: 'bar' },
|
|
19
|
-
* },
|
|
16
|
+
* { threadId: 'thr_abc123xyz' },
|
|
20
17
|
* );
|
|
21
18
|
* ```
|
|
22
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/resources/threads/state.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/resources/threads/state.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;OAWG;IACH,WAAW,CACT,WAAmB,EACnB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,eAAe,WAAW,QAAQ,EAAE;YACtF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,sBAwBC"}
|
|
@@ -10,10 +10,7 @@ export class State extends APIResource {
|
|
|
10
10
|
* ```ts
|
|
11
11
|
* const response = await client.threads.state.updateState(
|
|
12
12
|
* 'comp_xyz789abc',
|
|
13
|
-
* {
|
|
14
|
-
* threadId: 'thr_abc123xyz',
|
|
15
|
-
* state: { foo: 'bar' },
|
|
16
|
-
* },
|
|
13
|
+
* { threadId: 'thr_abc123xyz' },
|
|
17
14
|
* );
|
|
18
15
|
* ```
|
|
19
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.mjs","sourceRoot":"","sources":["../../src/resources/threads/state.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"state.mjs","sourceRoot":"","sources":["../../src/resources/threads/state.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,WAAW,CACT,WAAmB,EACnB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,eAAe,QAAQ,eAAe,WAAW,QAAQ,EAAE;YACtF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as ThreadsSuggestionsAPI from "../beta/threads/suggestions.mjs";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
|
+
export declare class Suggestions extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Generate AI-powered suggestions for the next action based on the thread context.
|
|
8
|
+
* Suggestions are persisted and can be retrieved later via the list endpoint.
|
|
9
|
+
* Calling this endpoint replaces any existing suggestions for the message.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const suggestion = await client.threads.suggestions.create(
|
|
14
|
+
* 'msg_xyz789abc',
|
|
15
|
+
* { threadId: 'thr_abc123xyz' },
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
create(messageID: string, params: SuggestionCreateParams, options?: RequestOptions): APIPromise<SuggestionCreateResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* List suggestions that have been generated for a specific message. Supports
|
|
22
|
+
* cursor-based pagination.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const suggestions = await client.threads.suggestions.list(
|
|
27
|
+
* 'msg_xyz789abc',
|
|
28
|
+
* { threadId: 'thr_abc123xyz' },
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(messageID: string, params: SuggestionListParams, options?: RequestOptions): APIPromise<SuggestionListResponse>;
|
|
33
|
+
}
|
|
34
|
+
export interface SuggestionCreateResponse {
|
|
35
|
+
/**
|
|
36
|
+
* Whether there are more results
|
|
37
|
+
*/
|
|
38
|
+
hasMore: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* List of suggestions for the message
|
|
41
|
+
*/
|
|
42
|
+
suggestions: Array<ThreadsSuggestionsAPI.Suggestion>;
|
|
43
|
+
/**
|
|
44
|
+
* Cursor for the next page of results
|
|
45
|
+
*/
|
|
46
|
+
nextCursor?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface SuggestionListResponse {
|
|
49
|
+
/**
|
|
50
|
+
* Whether there are more results
|
|
51
|
+
*/
|
|
52
|
+
hasMore: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* List of suggestions for the message
|
|
55
|
+
*/
|
|
56
|
+
suggestions: Array<ThreadsSuggestionsAPI.Suggestion>;
|
|
57
|
+
/**
|
|
58
|
+
* Cursor for the next page of results
|
|
59
|
+
*/
|
|
60
|
+
nextCursor?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SuggestionCreateParams {
|
|
63
|
+
/**
|
|
64
|
+
* Path param: Thread ID
|
|
65
|
+
*/
|
|
66
|
+
threadId: string;
|
|
67
|
+
/**
|
|
68
|
+
* Body param: Available components that suggestions can reference
|
|
69
|
+
*/
|
|
70
|
+
availableComponents?: Array<SuggestionCreateParams.AvailableComponent>;
|
|
71
|
+
/**
|
|
72
|
+
* Body param: Maximum number of suggestions to generate (1-10)
|
|
73
|
+
*/
|
|
74
|
+
maxSuggestions?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Body param: Identifier for a user in your system. Required if no bearer token is
|
|
77
|
+
* provided.
|
|
78
|
+
*/
|
|
79
|
+
userKey?: string;
|
|
80
|
+
}
|
|
81
|
+
export declare namespace SuggestionCreateParams {
|
|
82
|
+
interface AvailableComponent {
|
|
83
|
+
/**
|
|
84
|
+
* Description of what this component displays
|
|
85
|
+
*/
|
|
86
|
+
description: string;
|
|
87
|
+
/**
|
|
88
|
+
* Component name (e.g., 'StockChart')
|
|
89
|
+
*/
|
|
90
|
+
name: string;
|
|
91
|
+
/**
|
|
92
|
+
* JSON Schema for component props
|
|
93
|
+
*/
|
|
94
|
+
propsSchema: unknown;
|
|
95
|
+
/**
|
|
96
|
+
* Optional JSON Schema for component state
|
|
97
|
+
*/
|
|
98
|
+
stateSchema?: unknown;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export interface SuggestionListParams {
|
|
102
|
+
/**
|
|
103
|
+
* Path param: Thread ID
|
|
104
|
+
*/
|
|
105
|
+
threadId: string;
|
|
106
|
+
/**
|
|
107
|
+
* Query param: Cursor for pagination
|
|
108
|
+
*/
|
|
109
|
+
cursor?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Query param: Maximum number of suggestions to return
|
|
112
|
+
*/
|
|
113
|
+
limit?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Query param: Optional user key for thread organization
|
|
116
|
+
*/
|
|
117
|
+
userKey?: string;
|
|
118
|
+
}
|
|
119
|
+
export declare namespace Suggestions {
|
|
120
|
+
export { type SuggestionCreateResponse as SuggestionCreateResponse, type SuggestionListResponse as SuggestionListResponse, type SuggestionCreateParams as SuggestionCreateParams, type SuggestionListParams as SuggestionListParams, };
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=suggestions.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions.d.mts","sourceRoot":"","sources":["../../src/resources/threads/suggestions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,qBAAqB;OAC1B,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAQvC;;;;;;;;;;;OAWG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;CAOtC;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,qBAAqB,CAAC,U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+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as ThreadsSuggestionsAPI from "../beta/threads/suggestions.js";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
|
+
export declare class Suggestions extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Generate AI-powered suggestions for the next action based on the thread context.
|
|
8
|
+
* Suggestions are persisted and can be retrieved later via the list endpoint.
|
|
9
|
+
* Calling this endpoint replaces any existing suggestions for the message.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const suggestion = await client.threads.suggestions.create(
|
|
14
|
+
* 'msg_xyz789abc',
|
|
15
|
+
* { threadId: 'thr_abc123xyz' },
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
create(messageID: string, params: SuggestionCreateParams, options?: RequestOptions): APIPromise<SuggestionCreateResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* List suggestions that have been generated for a specific message. Supports
|
|
22
|
+
* cursor-based pagination.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const suggestions = await client.threads.suggestions.list(
|
|
27
|
+
* 'msg_xyz789abc',
|
|
28
|
+
* { threadId: 'thr_abc123xyz' },
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(messageID: string, params: SuggestionListParams, options?: RequestOptions): APIPromise<SuggestionListResponse>;
|
|
33
|
+
}
|
|
34
|
+
export interface SuggestionCreateResponse {
|
|
35
|
+
/**
|
|
36
|
+
* Whether there are more results
|
|
37
|
+
*/
|
|
38
|
+
hasMore: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* List of suggestions for the message
|
|
41
|
+
*/
|
|
42
|
+
suggestions: Array<ThreadsSuggestionsAPI.Suggestion>;
|
|
43
|
+
/**
|
|
44
|
+
* Cursor for the next page of results
|
|
45
|
+
*/
|
|
46
|
+
nextCursor?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface SuggestionListResponse {
|
|
49
|
+
/**
|
|
50
|
+
* Whether there are more results
|
|
51
|
+
*/
|
|
52
|
+
hasMore: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* List of suggestions for the message
|
|
55
|
+
*/
|
|
56
|
+
suggestions: Array<ThreadsSuggestionsAPI.Suggestion>;
|
|
57
|
+
/**
|
|
58
|
+
* Cursor for the next page of results
|
|
59
|
+
*/
|
|
60
|
+
nextCursor?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SuggestionCreateParams {
|
|
63
|
+
/**
|
|
64
|
+
* Path param: Thread ID
|
|
65
|
+
*/
|
|
66
|
+
threadId: string;
|
|
67
|
+
/**
|
|
68
|
+
* Body param: Available components that suggestions can reference
|
|
69
|
+
*/
|
|
70
|
+
availableComponents?: Array<SuggestionCreateParams.AvailableComponent>;
|
|
71
|
+
/**
|
|
72
|
+
* Body param: Maximum number of suggestions to generate (1-10)
|
|
73
|
+
*/
|
|
74
|
+
maxSuggestions?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Body param: Identifier for a user in your system. Required if no bearer token is
|
|
77
|
+
* provided.
|
|
78
|
+
*/
|
|
79
|
+
userKey?: string;
|
|
80
|
+
}
|
|
81
|
+
export declare namespace SuggestionCreateParams {
|
|
82
|
+
interface AvailableComponent {
|
|
83
|
+
/**
|
|
84
|
+
* Description of what this component displays
|
|
85
|
+
*/
|
|
86
|
+
description: string;
|
|
87
|
+
/**
|
|
88
|
+
* Component name (e.g., 'StockChart')
|
|
89
|
+
*/
|
|
90
|
+
name: string;
|
|
91
|
+
/**
|
|
92
|
+
* JSON Schema for component props
|
|
93
|
+
*/
|
|
94
|
+
propsSchema: unknown;
|
|
95
|
+
/**
|
|
96
|
+
* Optional JSON Schema for component state
|
|
97
|
+
*/
|
|
98
|
+
stateSchema?: unknown;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export interface SuggestionListParams {
|
|
102
|
+
/**
|
|
103
|
+
* Path param: Thread ID
|
|
104
|
+
*/
|
|
105
|
+
threadId: string;
|
|
106
|
+
/**
|
|
107
|
+
* Query param: Cursor for pagination
|
|
108
|
+
*/
|
|
109
|
+
cursor?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Query param: Maximum number of suggestions to return
|
|
112
|
+
*/
|
|
113
|
+
limit?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Query param: Optional user key for thread organization
|
|
116
|
+
*/
|
|
117
|
+
userKey?: string;
|
|
118
|
+
}
|
|
119
|
+
export declare namespace Suggestions {
|
|
120
|
+
export { type SuggestionCreateResponse as SuggestionCreateResponse, type SuggestionListResponse as SuggestionListResponse, type SuggestionCreateParams as SuggestionCreateParams, type SuggestionListParams as SuggestionListParams, };
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=suggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions.d.ts","sourceRoot":"","sources":["../../src/resources/threads/suggestions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,qBAAqB;OAC1B,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAQvC;;;;;;;;;;;OAWG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;CAOtC;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,qBAAqB,CAAC,UA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
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Suggestions = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
+
class Suggestions extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Generate AI-powered suggestions for the next action based on the thread context.
|
|
10
|
+
* Suggestions are persisted and can be retrieved later via the list endpoint.
|
|
11
|
+
* Calling this endpoint replaces any existing suggestions for the message.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const suggestion = await client.threads.suggestions.create(
|
|
16
|
+
* 'msg_xyz789abc',
|
|
17
|
+
* { threadId: 'thr_abc123xyz' },
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(messageID, params, options) {
|
|
22
|
+
const { threadId, ...body } = params;
|
|
23
|
+
return this._client.post((0, path_1.path) `/v1/threads/${threadId}/messages/${messageID}/suggestions`, {
|
|
24
|
+
body,
|
|
25
|
+
...options,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* List suggestions that have been generated for a specific message. Supports
|
|
30
|
+
* cursor-based pagination.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const suggestions = await client.threads.suggestions.list(
|
|
35
|
+
* 'msg_xyz789abc',
|
|
36
|
+
* { threadId: 'thr_abc123xyz' },
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
list(messageID, params, options) {
|
|
41
|
+
const { threadId, ...query } = params;
|
|
42
|
+
return this._client.get((0, path_1.path) `/v1/threads/${threadId}/messages/${messageID}/suggestions`, {
|
|
43
|
+
query,
|
|
44
|
+
...options,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.Suggestions = Suggestions;
|
|
49
|
+
//# sourceMappingURL=suggestions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions.js","sourceRoot":"","sources":["../../src/resources/threads/suggestions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAiD;AAEjD,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,SAAiB,EACjB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,aAAa,SAAS,cAAc,EAAE;YACxF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,SAAiB,EACjB,MAA4B,EAC5B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,aAAa,SAAS,cAAc,EAAE;YACvF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAjDD,kCAiDC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
export class Suggestions extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Generate AI-powered suggestions for the next action based on the thread context.
|
|
7
|
+
* Suggestions are persisted and can be retrieved later via the list endpoint.
|
|
8
|
+
* Calling this endpoint replaces any existing suggestions for the message.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const suggestion = await client.threads.suggestions.create(
|
|
13
|
+
* 'msg_xyz789abc',
|
|
14
|
+
* { threadId: 'thr_abc123xyz' },
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
create(messageID, params, options) {
|
|
19
|
+
const { threadId, ...body } = params;
|
|
20
|
+
return this._client.post(path `/v1/threads/${threadId}/messages/${messageID}/suggestions`, {
|
|
21
|
+
body,
|
|
22
|
+
...options,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* List suggestions that have been generated for a specific message. Supports
|
|
27
|
+
* cursor-based pagination.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const suggestions = await client.threads.suggestions.list(
|
|
32
|
+
* 'msg_xyz789abc',
|
|
33
|
+
* { threadId: 'thr_abc123xyz' },
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
list(messageID, params, options) {
|
|
38
|
+
const { threadId, ...query } = params;
|
|
39
|
+
return this._client.get(path `/v1/threads/${threadId}/messages/${messageID}/suggestions`, {
|
|
40
|
+
query,
|
|
41
|
+
...options,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=suggestions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions.mjs","sourceRoot":"","sources":["../../src/resources/threads/suggestions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,SAAiB,EACjB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,eAAe,QAAQ,aAAa,SAAS,cAAc,EAAE;YACxF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,SAAiB,EACjB,MAA4B,EAC5B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,eAAe,QAAQ,aAAa,SAAS,cAAc,EAAE;YACvF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|