@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 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.components.generate({
32
- availableComponents: {
33
- foo: {
34
- contextTools: [
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.componentName);
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.ComponentGenerateParams = {
70
- availableComponents: {
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.ComponentGenerateResponse = await client.components.generate(params);
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.components
104
- .generate({
105
- availableComponents: {
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.components.generate({ availableComponents: { foo: { contextTools: [{ description: 'description', name: 'name', parameters: [{ description: 'description', isRequired: true, name: 'name', type: 'type' }] }], description: 'description', name: 'name', props: { foo: 'bar' } } }, messageHistory: [{ message: 'message', sender: 'hydra' }] }, {
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.components.generate({ availableComponents: { foo: { contextTools: [{ description: 'description', name: 'name', parameters: [{ description: 'description', isRequired: true, name: 'name', type: 'type' }] }], description: 'description', name: 'name', props: { foo: 'bar' } } }, messageHistory: [{ message: 'message', sender: 'hydra' }] }, {
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('projectId')) {
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('projectId');
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.components
234
- .generate({
235
- availableComponents: {
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.components
256
- .generate({
257
- availableComponents: {
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.componentName);
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.components.generate(
380
- {
381
- availableComponents: {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tambo-ai/typescript-sdk",
3
- "version": "0.44.0",
3
+ "version": "0.45.0",
4
4
  "description": "The official TypeScript library for the Tambo AI API",
5
5
  "author": "Tambo AI <dev-feedback@tambo.co>",
6
6
  "types": "./index.d.ts",
@@ -34,7 +34,10 @@ export interface Suggestion {
34
34
  metadata?: Record<string, string>;
35
35
  }
36
36
  export interface SuggestionsGenerate {
37
- availableComponents: Array<Array<Shared.AvailableComponent>>;
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
- availableComponents: Array<Array<Shared.AvailableComponent>>;
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,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAE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@ export interface Suggestion {
57
57
  }
58
58
 
59
59
  export interface SuggestionsGenerate {
60
- availableComponents: Array<Array<Shared.AvailableComponent>>;
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
- availableComponents: Array<Array<Shared.AvailableComponent>>;
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.44.0'; // x-release-please-version
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.44.0";
1
+ export declare const VERSION = "0.45.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.44.0'; // x-release-please-version
4
+ exports.VERSION = '0.45.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.44.0'; // x-release-please-version
1
+ export const VERSION = '0.45.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map