Class FilesClient

java.lang.Object
io.github.stefanbratanov.jvm.openai.FilesClient

public final class FilesClient extends Object
Files are used to upload documents that can be used with features like Assistants and Fine-tuning.

Based on Files

  • Field Details

    • httpClient

      protected final HttpClient httpClient
    • objectMapper

      protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
  • Method Details

    • uploadFile

      public File uploadFile(UploadFileRequest request)
      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

      public List<File> listFiles()
      Returns a list of files that belong to the user's organization
      Throws:
      OpenAIException - in case of API errors
    • retrieveFile

      public File retrieveFile(String fileId)
      Returns information about a specific file
      Throws:
      OpenAIException - in case of API errors
    • deleteFile

      public DeletionStatus deleteFile(String fileId)
      Delete a file
      Throws:
      OpenAIException - in case of API errors
    • retrieveFileContent

      public byte[] retrieveFileContent(String fileId)
      Returns the contents of the specified file
      Throws:
      OpenAIException - in case of API errors