Class FileCreateParams
-
- All Implemented Interfaces:
-
com.openai.core.Params
public final class FileCreateParams implements Params
Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, and each project can store up to 2.5 TB of files in total. There is no organization-wide storage limit. Uploads to this endpoint are rate-limited to 2,000 files per minute per organization.
The Assistants API supports files up to 2 million tokens and of specific file types. See the Assistants Tools guide for details.
The Fine-tuning API only supports
.jsonlfiles. The input also has certain required formats for fine-tuning chat or completions models.The Batch API only supports
.jsonlfiles up to 200 MB in size. The input also has a specific required format.For Retrieval or
file_searchingestion, upload files here first. If you need to attach multiple uploaded files to the same vector store, use/vector_stores/{vector_store_id}/file_batchesinstead of attaching them one by one.
Please contact us if you need to increase these storage limits.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classFileCreateParams.BuilderA builder for FileCreateParams.
public final classFileCreateParams.Bodypublic final classFileCreateParams.ExpiresAfterThe expiration policy for a file. By default, files with
purpose=batchexpire after 30 days and all other files are persisted until they are manually deleted.
-
Method Summary
Modifier and Type Method Description final InputStreamfile()The File object (not file name) to be uploaded. final FilePurposepurpose()The intended purpose of the uploaded file. final Optional<FileCreateParams.ExpiresAfter>expiresAfter()The expiration policy for a file. final MultipartField<InputStream>_file()Returns the raw multipart value of file. final MultipartField<FilePurpose>_purpose()Returns the raw multipart value of purpose. final MultipartField<FileCreateParams.ExpiresAfter>_expiresAfter()Returns the raw multipart value of expiresAfter. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final FileCreateParams.BuildertoBuilder()final Map<String, MultipartField<?>>_body()Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. Booleanequals(Object other)IntegerhashCode()StringtoString()final static FileCreateParams.Builderbuilder()Returns a mutable builder for constructing an instance of FileCreateParams. -
-
Method Detail
-
file
final InputStream file()
The File object (not file name) to be uploaded.
-
purpose
final FilePurpose purpose()
The intended purpose of the uploaded file. One of:
assistants: Used in the Assistants APIbatch: Used in the Batch APIfine-tune: Used for fine-tuningvision: Images used for vision fine-tuninguser_data: Flexible file type for any purposeevals: Used for eval data sets
-
expiresAfter
final Optional<FileCreateParams.ExpiresAfter> expiresAfter()
The expiration policy for a file. By default, files with
purpose=batchexpire after 30 days and all other files are persisted until they are manually deleted.
-
_file
final MultipartField<InputStream> _file()
Returns the raw multipart value of file.
Unlike file, this method doesn't throw if the multipart field has an unexpected type.
-
_purpose
final MultipartField<FilePurpose> _purpose()
Returns the raw multipart value of purpose.
Unlike purpose, this method doesn't throw if the multipart field has an unexpected type.
-
_expiresAfter
final MultipartField<FileCreateParams.ExpiresAfter> _expiresAfter()
Returns the raw multipart value of expiresAfter.
Unlike expiresAfter, this method doesn't throw if the multipart field has an unexpected type.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
Additional headers to send with the request.
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
Additional query param to send with the request.
-
toBuilder
final FileCreateParams.Builder toBuilder()
-
_body
final Map<String, MultipartField<?>> _body()
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
builder
final static FileCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of FileCreateParams.
The following fields are required:
.file() .purpose()
-
-
-
-