Skip to content

Commit a9cfa71

Browse files
docs(api): clarify file_batches usage in vector stores files and file batches
1 parent 4d10778 commit a9cfa71

3 files changed

Lines changed: 49 additions & 18 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 151
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-00994178cc8e20d71754b00c54b0e4f5b4128e1c1cce765e9b7d696bd8c80d33.yml
3-
openapi_spec_hash: 81f404053b663f987209b4fb2d08a230
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-24647ccd7356fee965aaca347476460727c6aec762e16a9eb41950d6fbccf0be.yml
3+
openapi_spec_hash: ef99e305f20ae8ae7b2758a205280cca
44
config_hash: 5635033cdc8c930255f8b529a78de722

openai-java-core/src/main/kotlin/com/openai/models/vectorstores/filebatches/FileBatchCreateParams.kt

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ private constructor(
6161
* A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector
6262
* store should use. Useful for tools like `file_search` that can access files. If `attributes`
6363
* or `chunking_strategy` are provided, they will be applied to all files in the batch. The
64-
* maximum batch size is 2000 files. Mutually exclusive with `files`.
64+
* maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and
65+
* helps reduce per-vector-store write request pressure. Mutually exclusive with `files`.
6566
*
6667
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
6768
* server responded with an unexpected value).
@@ -72,7 +73,9 @@ private constructor(
7273
* A list of objects that each include a `file_id` plus optional `attributes` or
7374
* `chunking_strategy`. Use this when you need to override metadata for specific files. The
7475
* global `attributes` or `chunking_strategy` will be ignored and must be specified for each
75-
* file. The maximum batch size is 2000 files. Mutually exclusive with `file_ids`.
76+
* file. The maximum batch size is 2000 files. This endpoint is recommended for multi-file
77+
* ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with
78+
* `file_ids`.
7679
*
7780
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
7881
* server responded with an unexpected value).
@@ -228,7 +231,9 @@ private constructor(
228231
* A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the
229232
* vector store should use. Useful for tools like `file_search` that can access files. If
230233
* `attributes` or `chunking_strategy` are provided, they will be applied to all files in
231-
* the batch. The maximum batch size is 2000 files. Mutually exclusive with `files`.
234+
* the batch. The maximum batch size is 2000 files. This endpoint is recommended for
235+
* multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually
236+
* exclusive with `files`.
232237
*/
233238
fun fileIds(fileIds: List<String>) = apply { body.fileIds(fileIds) }
234239

@@ -252,7 +257,9 @@ private constructor(
252257
* A list of objects that each include a `file_id` plus optional `attributes` or
253258
* `chunking_strategy`. Use this when you need to override metadata for specific files. The
254259
* global `attributes` or `chunking_strategy` will be ignored and must be specified for each
255-
* file. The maximum batch size is 2000 files. Mutually exclusive with `file_ids`.
260+
* file. The maximum batch size is 2000 files. This endpoint is recommended for multi-file
261+
* ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive
262+
* with `file_ids`.
256263
*/
257264
fun files(files: List<File>) = apply { body.files(files) }
258265

@@ -465,7 +472,9 @@ private constructor(
465472
* A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the
466473
* vector store should use. Useful for tools like `file_search` that can access files. If
467474
* `attributes` or `chunking_strategy` are provided, they will be applied to all files in
468-
* the batch. The maximum batch size is 2000 files. Mutually exclusive with `files`.
475+
* the batch. The maximum batch size is 2000 files. This endpoint is recommended for
476+
* multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually
477+
* exclusive with `files`.
469478
*
470479
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
471480
* server responded with an unexpected value).
@@ -476,7 +485,9 @@ private constructor(
476485
* A list of objects that each include a `file_id` plus optional `attributes` or
477486
* `chunking_strategy`. Use this when you need to override metadata for specific files. The
478487
* global `attributes` or `chunking_strategy` will be ignored and must be specified for each
479-
* file. The maximum batch size is 2000 files. Mutually exclusive with `file_ids`.
488+
* file. The maximum batch size is 2000 files. This endpoint is recommended for multi-file
489+
* ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive
490+
* with `file_ids`.
480491
*
481492
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
482493
* server responded with an unexpected value).
@@ -623,8 +634,9 @@ private constructor(
623634
* A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the
624635
* vector store should use. Useful for tools like `file_search` that can access files.
625636
* If `attributes` or `chunking_strategy` are provided, they will be applied to all
626-
* files in the batch. The maximum batch size is 2000 files. Mutually exclusive with
627-
* `files`.
637+
* files in the batch. The maximum batch size is 2000 files. This endpoint is
638+
* recommended for multi-file ingestion and helps reduce per-vector-store write request
639+
* pressure. Mutually exclusive with `files`.
628640
*/
629641
fun fileIds(fileIds: List<String>) = fileIds(JsonField.of(fileIds))
630642

@@ -655,8 +667,9 @@ private constructor(
655667
* A list of objects that each include a `file_id` plus optional `attributes` or
656668
* `chunking_strategy`. Use this when you need to override metadata for specific files.
657669
* The global `attributes` or `chunking_strategy` will be ignored and must be specified
658-
* for each file. The maximum batch size is 2000 files. Mutually exclusive with
659-
* `file_ids`.
670+
* for each file. The maximum batch size is 2000 files. This endpoint is recommended for
671+
* multi-file ingestion and helps reduce per-vector-store write request pressure.
672+
* Mutually exclusive with `file_ids`.
660673
*/
661674
fun files(files: List<File>) = files(JsonField.of(files))
662675

@@ -902,7 +915,10 @@ private constructor(
902915

903916
/**
904917
* A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store
905-
* should use. Useful for tools like `file_search` that can access files.
918+
* should use. Useful for tools like `file_search` that can access files. For multi-file
919+
* ingestion, we recommend
920+
* [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
921+
* to minimize per-vector-store write requests.
906922
*
907923
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
908924
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -1000,7 +1016,10 @@ private constructor(
10001016

10011017
/**
10021018
* A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector
1003-
* store should use. Useful for tools like `file_search` that can access files.
1019+
* store should use. Useful for tools like `file_search` that can access files. For
1020+
* multi-file ingestion, we recommend
1021+
* [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
1022+
* to minimize per-vector-store write requests.
10041023
*/
10051024
fun fileId(fileId: String) = fileId(JsonField.of(fileId))
10061025

openai-java-core/src/main/kotlin/com/openai/models/vectorstores/files/FileCreateParams.kt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ private constructor(
4242

4343
/**
4444
* A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store
45-
* should use. Useful for tools like `file_search` that can access files.
45+
* should use. Useful for tools like `file_search` that can access files. For multi-file
46+
* ingestion, we recommend
47+
* [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
48+
* to minimize per-vector-store write requests.
4649
*
4750
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
4851
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -149,7 +152,10 @@ private constructor(
149152

150153
/**
151154
* A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store
152-
* should use. Useful for tools like `file_search` that can access files.
155+
* should use. Useful for tools like `file_search` that can access files. For multi-file
156+
* ingestion, we recommend
157+
* [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
158+
* to minimize per-vector-store write requests.
153159
*/
154160
fun fileId(fileId: String) = apply { body.fileId(fileId) }
155161

@@ -397,7 +403,10 @@ private constructor(
397403

398404
/**
399405
* A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store
400-
* should use. Useful for tools like `file_search` that can access files.
406+
* should use. Useful for tools like `file_search` that can access files. For multi-file
407+
* ingestion, we recommend
408+
* [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
409+
* to minimize per-vector-store write requests.
401410
*
402411
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
403412
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -495,7 +504,10 @@ private constructor(
495504

496505
/**
497506
* A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector
498-
* store should use. Useful for tools like `file_search` that can access files.
507+
* store should use. Useful for tools like `file_search` that can access files. For
508+
* multi-file ingestion, we recommend
509+
* [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
510+
* to minimize per-vector-store write requests.
499511
*/
500512
fun fileId(fileId: String) = fileId(JsonField.of(fileId))
501513

0 commit comments

Comments
 (0)