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 100 GB.
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
-
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 MultipartField<InputStream>
_file()
Returns the raw multipart value of file. final MultipartField<FilePurpose>
_purpose()
Returns the raw multipart value of purpose. final Headers
_additionalHeaders()
final QueryParams
_additionalQueryParams()
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
-
_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.
-
_additionalHeaders
final Headers _additionalHeaders()
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
-
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()
-
-
-
-