Class FilesClient
java.lang.Object
io.github.stefanbratanov.jvm.openai.FilesClient
Files are used to upload documents that can be used with features like Assistants and
Fine-tuning.
Based on Files
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final HttpClient
protected final com.fasterxml.jackson.databind.ObjectMapper
-
Method Summary
Modifier and TypeMethodDescriptiondeleteFile
(String fileId) Delete a fileReturns a list of files that belong to the user's organizationretrieveFile
(String fileId) Returns information about a specific filebyte[]
retrieveFileContent
(String fileId) Returns the contents of the specified fileuploadFile
(UploadFileRequest request) Upload a file that can be used across various endpoints.
-
Field Details
-
httpClient
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Method Details
-
uploadFile
Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB.- Throws:
OpenAIException
- in case of API errors
-
listFiles
Returns a list of files that belong to the user's organization- Throws:
OpenAIException
- in case of API errors
-
retrieveFile
Returns information about a specific file- Throws:
OpenAIException
- in case of API errors
-
deleteFile
Delete a file- Throws:
OpenAIException
- in case of API errors
-
retrieveFileContent
Returns the contents of the specified file- Throws:
OpenAIException
- in case of API errors
-