openai 4.47.3 → 4.48.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +1 -1
  3. package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
  4. package/lib/AbstractChatCompletionRunner.js +6 -1
  5. package/lib/AbstractChatCompletionRunner.js.map +1 -1
  6. package/lib/AbstractChatCompletionRunner.mjs +6 -1
  7. package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/batches.d.ts +4 -2
  10. package/resources/batches.d.ts.map +1 -1
  11. package/resources/batches.js +3 -1
  12. package/resources/batches.js.map +1 -1
  13. package/resources/batches.mjs +3 -1
  14. package/resources/batches.mjs.map +1 -1
  15. package/resources/beta/assistants.d.ts +87 -2
  16. package/resources/beta/assistants.d.ts.map +1 -1
  17. package/resources/beta/assistants.js.map +1 -1
  18. package/resources/beta/assistants.mjs.map +1 -1
  19. package/resources/beta/threads/threads.d.ts +78 -0
  20. package/resources/beta/threads/threads.d.ts.map +1 -1
  21. package/resources/beta/threads/threads.js.map +1 -1
  22. package/resources/beta/threads/threads.mjs.map +1 -1
  23. package/resources/beta/vector-stores/file-batches.d.ts +39 -0
  24. package/resources/beta/vector-stores/file-batches.d.ts.map +1 -1
  25. package/resources/beta/vector-stores/file-batches.js.map +1 -1
  26. package/resources/beta/vector-stores/file-batches.mjs.map +1 -1
  27. package/resources/beta/vector-stores/files.d.ts +76 -0
  28. package/resources/beta/vector-stores/files.d.ts.map +1 -1
  29. package/resources/beta/vector-stores/files.js.map +1 -1
  30. package/resources/beta/vector-stores/files.mjs.map +1 -1
  31. package/resources/beta/vector-stores/vector-stores.d.ts +37 -0
  32. package/resources/beta/vector-stores/vector-stores.d.ts.map +1 -1
  33. package/resources/beta/vector-stores/vector-stores.js.map +1 -1
  34. package/resources/beta/vector-stores/vector-stores.mjs.map +1 -1
  35. package/resources/chat/completions.d.ts +3 -3
  36. package/resources/chat/completions.d.ts.map +1 -1
  37. package/resources/files.d.ts +9 -3
  38. package/resources/files.d.ts.map +1 -1
  39. package/resources/files.js +8 -2
  40. package/resources/files.js.map +1 -1
  41. package/resources/files.mjs +8 -2
  42. package/resources/files.mjs.map +1 -1
  43. package/resources/fine-tuning/jobs/jobs.d.ts +5 -0
  44. package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -1
  45. package/resources/fine-tuning/jobs/jobs.js.map +1 -1
  46. package/resources/fine-tuning/jobs/jobs.mjs.map +1 -1
  47. package/resources/shared.d.ts +4 -4
  48. package/src/lib/AbstractChatCompletionRunner.ts +6 -1
  49. package/src/resources/batches.ts +4 -2
  50. package/src/resources/beta/assistants.ts +99 -0
  51. package/src/resources/beta/threads/threads.ts +90 -0
  52. package/src/resources/beta/vector-stores/file-batches.ts +47 -0
  53. package/src/resources/beta/vector-stores/files.ts +90 -0
  54. package/src/resources/beta/vector-stores/vector-stores.ts +43 -0
  55. package/src/resources/chat/completions.ts +3 -3
  56. package/src/resources/files.ts +9 -3
  57. package/src/resources/fine-tuning/jobs/jobs.ts +5 -0
  58. package/src/resources/shared.ts +4 -4
  59. package/src/version.ts +1 -1
  60. package/version.d.ts +1 -1
  61. package/version.js +1 -1
  62. package/version.mjs +1 -1
@@ -217,6 +217,11 @@ export interface VectorStoreFile {
217
217
  * attached to.
218
218
  */
219
219
  vector_store_id: string;
220
+
221
+ /**
222
+ * The strategy used to chunk the file.
223
+ */
224
+ chunking_strategy?: VectorStoreFile.Static | VectorStoreFile.Other;
220
225
  }
221
226
 
222
227
  export namespace VectorStoreFile {
@@ -235,6 +240,44 @@ export namespace VectorStoreFile {
235
240
  */
236
241
  message: string;
237
242
  }
243
+
244
+ export interface Static {
245
+ static: Static.Static;
246
+
247
+ /**
248
+ * Always `static`.
249
+ */
250
+ type: 'static';
251
+ }
252
+
253
+ export namespace Static {
254
+ export interface Static {
255
+ /**
256
+ * The number of tokens that overlap between chunks. The default value is `400`.
257
+ *
258
+ * Note that the overlap must not exceed half of `max_chunk_size_tokens`.
259
+ */
260
+ chunk_overlap_tokens: number;
261
+
262
+ /**
263
+ * The maximum number of tokens in each chunk. The default value is `800`. The
264
+ * minimum value is `100` and the maximum value is `4096`.
265
+ */
266
+ max_chunk_size_tokens: number;
267
+ }
268
+ }
269
+
270
+ /**
271
+ * This is returned when the chunking strategy is unknown. Typically, this is
272
+ * because the file was indexed before the `chunking_strategy` concept was
273
+ * introduced in the API.
274
+ */
275
+ export interface Other {
276
+ /**
277
+ * Always `other`.
278
+ */
279
+ type: 'other';
280
+ }
238
281
  }
239
282
 
240
283
  export interface VectorStoreFileDeleted {
@@ -252,6 +295,53 @@ export interface FileCreateParams {
252
295
  * files.
253
296
  */
254
297
  file_id: string;
298
+
299
+ /**
300
+ * The chunking strategy used to chunk the file(s). If not set, will use the `auto`
301
+ * strategy.
302
+ */
303
+ chunking_strategy?:
304
+ | FileCreateParams.AutoChunkingStrategyRequestParam
305
+ | FileCreateParams.StaticChunkingStrategyRequestParam;
306
+ }
307
+
308
+ export namespace FileCreateParams {
309
+ /**
310
+ * The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
311
+ * `800` and `chunk_overlap_tokens` of `400`.
312
+ */
313
+ export interface AutoChunkingStrategyRequestParam {
314
+ /**
315
+ * Always `auto`.
316
+ */
317
+ type: 'auto';
318
+ }
319
+
320
+ export interface StaticChunkingStrategyRequestParam {
321
+ static: StaticChunkingStrategyRequestParam.Static;
322
+
323
+ /**
324
+ * Always `static`.
325
+ */
326
+ type: 'static';
327
+ }
328
+
329
+ export namespace StaticChunkingStrategyRequestParam {
330
+ export interface Static {
331
+ /**
332
+ * The number of tokens that overlap between chunks. The default value is `400`.
333
+ *
334
+ * Note that the overlap must not exceed half of `max_chunk_size_tokens`.
335
+ */
336
+ chunk_overlap_tokens: number;
337
+
338
+ /**
339
+ * The maximum number of tokens in each chunk. The default value is `800`. The
340
+ * minimum value is `100` and the maximum value is `4096`.
341
+ */
342
+ max_chunk_size_tokens: number;
343
+ }
344
+ }
255
345
  }
256
346
 
257
347
  export interface FileListParams extends CursorPageParams {
@@ -200,6 +200,12 @@ export interface VectorStoreDeleted {
200
200
  }
201
201
 
202
202
  export interface VectorStoreCreateParams {
203
+ /**
204
+ * The chunking strategy used to chunk the file(s). If not set, will use the `auto`
205
+ * strategy. Only applicable if `file_ids` is non-empty.
206
+ */
207
+ chunking_strategy?: VectorStoreCreateParams.Auto | VectorStoreCreateParams.Static;
208
+
203
209
  /**
204
210
  * The expiration policy for a vector store.
205
211
  */
@@ -227,6 +233,43 @@ export interface VectorStoreCreateParams {
227
233
  }
228
234
 
229
235
  export namespace VectorStoreCreateParams {
236
+ /**
237
+ * The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
238
+ * `800` and `chunk_overlap_tokens` of `400`.
239
+ */
240
+ export interface Auto {
241
+ /**
242
+ * Always `auto`.
243
+ */
244
+ type: 'auto';
245
+ }
246
+
247
+ export interface Static {
248
+ static: Static.Static;
249
+
250
+ /**
251
+ * Always `static`.
252
+ */
253
+ type: 'static';
254
+ }
255
+
256
+ export namespace Static {
257
+ export interface Static {
258
+ /**
259
+ * The number of tokens that overlap between chunks. The default value is `400`.
260
+ *
261
+ * Note that the overlap must not exceed half of `max_chunk_size_tokens`.
262
+ */
263
+ chunk_overlap_tokens: number;
264
+
265
+ /**
266
+ * The maximum number of tokens in each chunk. The default value is `800`. The
267
+ * minimum value is `100` and the maximum value is `4096`.
268
+ */
269
+ max_chunk_size_tokens: number;
270
+ }
271
+ }
272
+
230
273
  /**
231
274
  * The expiration policy for a vector store.
232
275
  */
@@ -137,7 +137,7 @@ export interface ChatCompletionAssistantMessageParam {
137
137
  * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of
138
138
  * a function that should be called, as generated by the model.
139
139
  */
140
- function_call?: ChatCompletionAssistantMessageParam.FunctionCall;
140
+ function_call?: ChatCompletionAssistantMessageParam.FunctionCall | null;
141
141
 
142
142
  /**
143
143
  * An optional name for the participant. Provides the model information to
@@ -885,8 +885,8 @@ export namespace ChatCompletionCreateParams {
885
885
 
886
886
  /**
887
887
  * The parameters the functions accepts, described as a JSON Schema object. See the
888
- * [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
889
- * for examples, and the
888
+ * [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
889
+ * and the
890
890
  * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
891
891
  * documentation about the format.
892
892
  *
@@ -21,9 +21,15 @@ export class Files extends APIResource {
21
21
  * [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) for
22
22
  * details.
23
23
  *
24
- * The Fine-tuning API only supports `.jsonl` files.
24
+ * The Fine-tuning API only supports `.jsonl` files. The input also has certain
25
+ * required formats for fine-tuning
26
+ * [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or
27
+ * [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
28
+ * models.
25
29
  *
26
- * The Batch API only supports `.jsonl` files up to 100 MB in size.
30
+ * The Batch API only supports `.jsonl` files up to 100 MB in size. The input also
31
+ * has a specific required
32
+ * [format](https://platform.openai.com/docs/api-reference/batch/request-input).
27
33
  *
28
34
  * Please [contact us](https://help.openai.com/) if you need to increase these
29
35
  * storage limits.
@@ -194,7 +200,7 @@ export interface FileCreateParams {
194
200
  * [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for
195
201
  * [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning).
196
202
  */
197
- purpose: 'assistants' | 'batch' | 'fine-tune';
203
+ purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision';
198
204
  }
199
205
 
200
206
  export interface FileListParams {
@@ -312,6 +312,11 @@ export interface JobCreateParams {
312
312
  * Your dataset must be formatted as a JSONL file. Additionally, you must upload
313
313
  * your file with the purpose `fine-tune`.
314
314
  *
315
+ * The contents of the file should differ depending on if the model uses the
316
+ * [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or
317
+ * [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
318
+ * format.
319
+ *
315
320
  * See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
316
321
  * for more details.
317
322
  */
@@ -25,8 +25,8 @@ export interface FunctionDefinition {
25
25
 
26
26
  /**
27
27
  * The parameters the functions accepts, described as a JSON Schema object. See the
28
- * [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
29
- * for examples, and the
28
+ * [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
29
+ * and the
30
30
  * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
31
31
  * documentation about the format.
32
32
  *
@@ -37,8 +37,8 @@ export interface FunctionDefinition {
37
37
 
38
38
  /**
39
39
  * The parameters the functions accepts, described as a JSON Schema object. See the
40
- * [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
41
- * for examples, and the
40
+ * [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
41
+ * and the
42
42
  * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
43
43
  * documentation about the format.
44
44
  *
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '4.47.3'; // x-release-please-version
1
+ export const VERSION = '4.48.2'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.47.3";
1
+ export declare const VERSION = "4.48.2";
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 = '4.47.3'; // x-release-please-version
4
+ exports.VERSION = '4.48.2'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '4.47.3'; // x-release-please-version
1
+ export const VERSION = '4.48.2'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map