Interface FileService
-
- All Implemented Interfaces:
public interface FileServiceFiles are used to upload documents that can be used with features like Assistants and Fine-tuning.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceFileService.WithRawResponseA view of FileService that provides access to raw HTTP responses for each method.
-
Method Summary
-
-
Method Detail
-
withRawResponse
abstract FileService.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
withOptions
abstract FileService withOptions(Consumer<ClientOptions.Builder> modifier)
Returns a view of this service with the given option modifications applied.
The original service is not modified.
-
create
FileObject create(FileCreateParams 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.
-
create
abstract FileObject create(FileCreateParams params, RequestOptions requestOptions)
-
retrieve
FileObject retrieve(String fileId)
Returns information about a specific file.
-
retrieve
FileObject retrieve(String fileId, FileRetrieveParams params, RequestOptions requestOptions)
-
retrieve
FileObject retrieve(String fileId, FileRetrieveParams params)
-
retrieve
abstract FileObject retrieve(FileRetrieveParams params, RequestOptions requestOptions)
-
retrieve
FileObject retrieve(FileRetrieveParams params)
-
retrieve
FileObject retrieve(String fileId, RequestOptions requestOptions)
-
list
FileListPage list()
Returns a list of files.
-
list
abstract FileListPage list(FileListParams params, RequestOptions requestOptions)
-
list
FileListPage list(FileListParams params)
-
list
FileListPage list(RequestOptions requestOptions)
-
delete
FileDeleted delete(String fileId)
Delete a file and remove it from all vector stores.
-
delete
FileDeleted delete(String fileId, FileDeleteParams params, RequestOptions requestOptions)
-
delete
FileDeleted delete(String fileId, FileDeleteParams params)
-
delete
abstract FileDeleted delete(FileDeleteParams params, RequestOptions requestOptions)
-
delete
FileDeleted delete(FileDeleteParams params)
-
delete
FileDeleted delete(String fileId, RequestOptions requestOptions)
-
content
@MustBeClosed() HttpResponse content(String fileId)
Returns the contents of the specified file.
-
content
@MustBeClosed() HttpResponse content(String fileId, FileContentParams params, RequestOptions requestOptions)
-
content
@MustBeClosed() HttpResponse content(String fileId, FileContentParams params)
-
content
@MustBeClosed() abstract HttpResponse content(FileContentParams params, RequestOptions requestOptions)
-
content
@MustBeClosed() HttpResponse content(FileContentParams params)
-
content
@MustBeClosed() HttpResponse content(String fileId, RequestOptions requestOptions)
-
-
-
-