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 the size of all files uploaded by one organization can be up to 1 TB.
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
.jsonl
files. The input also has certain required formats for fine-tuning chat or completions models.The Batch API only supports
.jsonl
files up to 200 MB in size. The input also has a specific required format.Please contact us if you need to increase these storage limits.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
FileCreateParams.Builder
A builder for FileCreateParams.
public final class
FileCreateParams.Body
public final class
FileCreateParams.ExpiresAfter
The expiration policy for a file. By default, files with
purpose=batch
expire after 30 days and all other files are persisted until they are manually deleted.
-
Method Summary
Modifier and Type Method Description final InputStream
file()
The File object (not file name) to be uploaded. final FilePurpose
purpose()
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.Builder
toBuilder()
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. Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static FileCreateParams.Builder
builder()
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 API -batch
: Used in the Batch API -fine-tune
: Used for fine-tuning -vision
: Images used for vision fine-tuning -user_data
: Flexible file type for any purpose -evals
: Used for eval data sets
-
expiresAfter
final Optional<FileCreateParams.ExpiresAfter> expiresAfter()
The expiration policy for a file. By default, files with
purpose=batch
expire 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()
-
-
-
-