@tambo-ai/typescript-sdk 0.44.0 → 0.45.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 +9 -0
- package/README.md +28 -107
- package/package.json +1 -1
- package/resources/beta/threads/suggestions.d.ts +8 -2
- package/resources/beta/threads/suggestions.d.ts.map +1 -1
- package/src/resources/beta/threads/suggestions.ts +8 -2
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.45.0 (2025-04-28)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.44.0...v0.45.0](https://github.com/tambo-ai/typescript-sdk/compare/v0.44.0...v0.45.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([2870a89](https://github.com/tambo-ai/typescript-sdk/commit/2870a89bc11c2c801533e8b06f274cb26713b0f0))
|
|
10
|
+
* **api:** updated examples, params ([ff132ee](https://github.com/tambo-ai/typescript-sdk/commit/ff132ee0759dd7c3d9157457281d5a08c15da63e))
|
|
11
|
+
|
|
3
12
|
## 0.44.0 (2025-04-24)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v0.43.0...v0.44.0](https://github.com/tambo-ai/typescript-sdk/compare/v0.43.0...v0.44.0)
|
package/README.md
CHANGED
|
@@ -28,25 +28,14 @@ const client = new TamboAI({
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
async function main() {
|
|
31
|
-
const response = await client.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
description: 'description',
|
|
37
|
-
name: 'name',
|
|
38
|
-
parameters: [{ description: 'description', isRequired: true, name: 'name', type: 'type' }],
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
description: 'description',
|
|
42
|
-
name: 'name',
|
|
43
|
-
props: { foo: 'bar' },
|
|
44
|
-
},
|
|
31
|
+
const response = await client.beta.threads.advance({
|
|
32
|
+
messageToAppend: {
|
|
33
|
+
'role"': 'user',
|
|
34
|
+
content: [{ type: 'text', text: 'What is the weather in berkeley?' }],
|
|
45
35
|
},
|
|
46
|
-
messageHistory: [{ message: 'message', sender: 'hydra' }],
|
|
47
36
|
});
|
|
48
37
|
|
|
49
|
-
console.log(response.
|
|
38
|
+
console.log(response.generationStage);
|
|
50
39
|
}
|
|
51
40
|
|
|
52
41
|
main();
|
|
@@ -66,24 +55,13 @@ const client = new TamboAI({
|
|
|
66
55
|
});
|
|
67
56
|
|
|
68
57
|
async function main() {
|
|
69
|
-
const params: TamboAI.
|
|
70
|
-
|
|
71
|
-
foo: {
|
|
72
|
-
contextTools: [
|
|
73
|
-
{
|
|
74
|
-
description: 'description',
|
|
75
|
-
name: 'name',
|
|
76
|
-
parameters: [{ description: 'description', isRequired: true, name: 'name', type: 'type' }],
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
description: 'description',
|
|
80
|
-
name: 'name',
|
|
81
|
-
props: { foo: 'bar' },
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
messageHistory: [{ message: 'message', sender: 'hydra' }],
|
|
58
|
+
const params: TamboAI.Beta.ThreadAdvanceByIDParams = {
|
|
59
|
+
messageToAppend: { role: 'user', content: [{ type: 'text', text: 'And what about oakland?' }] },
|
|
85
60
|
};
|
|
86
|
-
const response: TamboAI.
|
|
61
|
+
const response: TamboAI.Beta.ThreadAdvanceByIDResponse = await client.beta.threads.advanceById(
|
|
62
|
+
'thr_123',
|
|
63
|
+
params,
|
|
64
|
+
);
|
|
87
65
|
}
|
|
88
66
|
|
|
89
67
|
main();
|
|
@@ -100,23 +78,9 @@ a subclass of `APIError` will be thrown:
|
|
|
100
78
|
<!-- prettier-ignore -->
|
|
101
79
|
```ts
|
|
102
80
|
async function main() {
|
|
103
|
-
const response = await client.
|
|
104
|
-
.
|
|
105
|
-
|
|
106
|
-
foo: {
|
|
107
|
-
contextTools: [
|
|
108
|
-
{
|
|
109
|
-
description: 'description',
|
|
110
|
-
name: 'name',
|
|
111
|
-
parameters: [{ description: 'description', isRequired: true, name: 'name', type: 'type' }],
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
description: 'description',
|
|
115
|
-
name: 'name',
|
|
116
|
-
props: { foo: 'bar' },
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
messageHistory: [{ message: 'message', sender: 'hydra' }],
|
|
81
|
+
const response = await client.beta.threads
|
|
82
|
+
.advanceById('thr_123', {
|
|
83
|
+
messageToAppend: { role: 'user', content: [{ type: 'text', text: 'And what about oakland?' }] },
|
|
120
84
|
})
|
|
121
85
|
.catch(async (err) => {
|
|
122
86
|
if (err instanceof TamboAI.APIError) {
|
|
@@ -161,7 +125,7 @@ const client = new TamboAI({
|
|
|
161
125
|
});
|
|
162
126
|
|
|
163
127
|
// Or, configure per-request:
|
|
164
|
-
await client.
|
|
128
|
+
await client.beta.threads.advanceById('thr_123', { messageToAppend: { role: 'user', content: [{ type: 'text', text: 'And what about oakland?' }] } }, {
|
|
165
129
|
maxRetries: 5,
|
|
166
130
|
});
|
|
167
131
|
```
|
|
@@ -178,7 +142,7 @@ const client = new TamboAI({
|
|
|
178
142
|
});
|
|
179
143
|
|
|
180
144
|
// Override per-request:
|
|
181
|
-
await client.
|
|
145
|
+
await client.beta.threads.advanceById('thr_123', { messageToAppend: { role: 'user', content: [{ type: 'text', text: 'And what about oakland?' }] } }, {
|
|
182
146
|
timeout: 5 * 1000,
|
|
183
147
|
});
|
|
184
148
|
```
|
|
@@ -196,7 +160,7 @@ You can use the `for await … of` syntax to iterate through items across all pa
|
|
|
196
160
|
async function fetchAllBetaThreads(params) {
|
|
197
161
|
const allBetaThreads = [];
|
|
198
162
|
// Automatically fetches more pages as needed.
|
|
199
|
-
for await (const thread of client.beta.threads.list('
|
|
163
|
+
for await (const thread of client.beta.threads.list('p_123')) {
|
|
200
164
|
allBetaThreads.push(thread);
|
|
201
165
|
}
|
|
202
166
|
return allBetaThreads;
|
|
@@ -206,7 +170,7 @@ async function fetchAllBetaThreads(params) {
|
|
|
206
170
|
Alternatively, you can request a single page at a time:
|
|
207
171
|
|
|
208
172
|
```ts
|
|
209
|
-
let page = await client.beta.threads.list('
|
|
173
|
+
let page = await client.beta.threads.list('p_123');
|
|
210
174
|
for (const thread of page.items) {
|
|
211
175
|
console.log(thread);
|
|
212
176
|
}
|
|
@@ -230,49 +194,21 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
|
|
|
230
194
|
```ts
|
|
231
195
|
const client = new TamboAI();
|
|
232
196
|
|
|
233
|
-
const response = await client.
|
|
234
|
-
.
|
|
235
|
-
|
|
236
|
-
foo: {
|
|
237
|
-
contextTools: [
|
|
238
|
-
{
|
|
239
|
-
description: 'description',
|
|
240
|
-
name: 'name',
|
|
241
|
-
parameters: [{ description: 'description', isRequired: true, name: 'name', type: 'type' }],
|
|
242
|
-
},
|
|
243
|
-
],
|
|
244
|
-
description: 'description',
|
|
245
|
-
name: 'name',
|
|
246
|
-
props: { foo: 'bar' },
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
messageHistory: [{ message: 'message', sender: 'hydra' }],
|
|
197
|
+
const response = await client.beta.threads
|
|
198
|
+
.advanceById('thr_123', {
|
|
199
|
+
messageToAppend: { role: 'user', content: [{ type: 'text', text: 'And what about oakland?' }] },
|
|
250
200
|
})
|
|
251
201
|
.asResponse();
|
|
252
202
|
console.log(response.headers.get('X-My-Header'));
|
|
253
203
|
console.log(response.statusText); // access the underlying Response object
|
|
254
204
|
|
|
255
|
-
const { data: response, response: raw } = await client.
|
|
256
|
-
.
|
|
257
|
-
|
|
258
|
-
foo: {
|
|
259
|
-
contextTools: [
|
|
260
|
-
{
|
|
261
|
-
description: 'description',
|
|
262
|
-
name: 'name',
|
|
263
|
-
parameters: [{ description: 'description', isRequired: true, name: 'name', type: 'type' }],
|
|
264
|
-
},
|
|
265
|
-
],
|
|
266
|
-
description: 'description',
|
|
267
|
-
name: 'name',
|
|
268
|
-
props: { foo: 'bar' },
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
messageHistory: [{ message: 'message', sender: 'hydra' }],
|
|
205
|
+
const { data: response, response: raw } = await client.beta.threads
|
|
206
|
+
.advanceById('thr_123', {
|
|
207
|
+
messageToAppend: { role: 'user', content: [{ type: 'text', text: 'And what about oakland?' }] },
|
|
272
208
|
})
|
|
273
209
|
.withResponse();
|
|
274
210
|
console.log(raw.headers.get('X-My-Header'));
|
|
275
|
-
console.log(response.
|
|
211
|
+
console.log(response.generationStage);
|
|
276
212
|
```
|
|
277
213
|
|
|
278
214
|
### Making custom/undocumented requests
|
|
@@ -376,24 +312,9 @@ const client = new TamboAI({
|
|
|
376
312
|
});
|
|
377
313
|
|
|
378
314
|
// Override per-request:
|
|
379
|
-
await client.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
foo: {
|
|
383
|
-
contextTools: [
|
|
384
|
-
{
|
|
385
|
-
description: 'description',
|
|
386
|
-
name: 'name',
|
|
387
|
-
parameters: [{ description: 'description', isRequired: true, name: 'name', type: 'type' }],
|
|
388
|
-
},
|
|
389
|
-
],
|
|
390
|
-
description: 'description',
|
|
391
|
-
name: 'name',
|
|
392
|
-
props: { foo: 'bar' },
|
|
393
|
-
},
|
|
394
|
-
},
|
|
395
|
-
messageHistory: [{ message: 'message', sender: 'hydra' }],
|
|
396
|
-
},
|
|
315
|
+
await client.beta.threads.advanceById(
|
|
316
|
+
'thr_123',
|
|
317
|
+
{ messageToAppend: { role: 'user', content: [{ type: 'text', text: 'And what about oakland?' }] } },
|
|
397
318
|
{
|
|
398
319
|
httpAgent: new http.Agent({ keepAlive: false }),
|
|
399
320
|
},
|
package/package.json
CHANGED
|
@@ -34,7 +34,10 @@ export interface Suggestion {
|
|
|
34
34
|
metadata?: Record<string, string>;
|
|
35
35
|
}
|
|
36
36
|
export interface SuggestionsGenerate {
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Available components that can be used with this suggestion
|
|
39
|
+
*/
|
|
40
|
+
availableComponents?: Array<Shared.AvailableComponent>;
|
|
38
41
|
/**
|
|
39
42
|
* Maximum number of suggestions to generate
|
|
40
43
|
*/
|
|
@@ -43,7 +46,10 @@ export interface SuggestionsGenerate {
|
|
|
43
46
|
export type SuggestionListResponse = Array<Suggestion>;
|
|
44
47
|
export type SuggestionGenerateResponse = Array<Suggestion>;
|
|
45
48
|
export interface SuggestionGenerateParams {
|
|
46
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Available components that can be used with this suggestion
|
|
51
|
+
*/
|
|
52
|
+
availableComponents?: Array<Shared.AvailableComponent>;
|
|
47
53
|
/**
|
|
48
54
|
* Maximum number of suggestions to generate
|
|
49
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/threads/suggestions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AAEvC,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACH,IAAI,CACF,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAI1C;;OAEG;IACH,QAAQ,CACN,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC;CAG/C;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,EAAE,EA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AmB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAEvD;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAEvD,MAAM,MAAM,0BAA0B,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAE3D,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAEvD;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -57,7 +57,10 @@ export interface Suggestion {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export interface SuggestionsGenerate {
|
|
60
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Available components that can be used with this suggestion
|
|
62
|
+
*/
|
|
63
|
+
availableComponents?: Array<Shared.AvailableComponent>;
|
|
61
64
|
|
|
62
65
|
/**
|
|
63
66
|
* Maximum number of suggestions to generate
|
|
@@ -70,7 +73,10 @@ export type SuggestionListResponse = Array<Suggestion>;
|
|
|
70
73
|
export type SuggestionGenerateResponse = Array<Suggestion>;
|
|
71
74
|
|
|
72
75
|
export interface SuggestionGenerateParams {
|
|
73
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Available components that can be used with this suggestion
|
|
78
|
+
*/
|
|
79
|
+
availableComponents?: Array<Shared.AvailableComponent>;
|
|
74
80
|
|
|
75
81
|
/**
|
|
76
82
|
* Maximum number of suggestions to generate
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.45.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.45.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.45.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|