Interface OpenAI.Files

  • Enclosing interface:
    OpenAI

    @Resource("/v1/files")
    public static interface OpenAI.Files
    Files are used to upload documents that can be used with features like fine-tuning.
    See Also:
    OpenAI Files
    • Method Detail

      • create

        @Multipart
        @POST
        CompletableFuture<FileResponse> create​(@Body
                                               FileRequest fileRequest)
        Upload a file that contains document(s) to be used across various endpoints/features. Currently *.jsonl files are supported only.
        Parameters:
        fileRequest - Includes the file to be uploaded.
        Returns:
        Represents a document that has been uploaded.
      • getListPrimitive

        @GET
        CompletableFuture<Generic<FileResponse>> getListPrimitive​(@Query("purpose")
                                                                  FileRequest.PurposeType purpose)
        Returns a Generic of files that belong to the user's organization (don't call it directly).
        Parameters:
        purpose - Only return files with the given purpose.
        Returns:
        Generic object of files.
      • getOne

        @GET("/{fileId}")
        CompletableFuture<FileResponse> getOne​(@Path("fileId")
                                               String fileId)
        Returns information about a specific file.
        Parameters:
        fileId - The id of the file to use for this request.
        Returns:
        Specific file.
      • getContent

        @GET("/{fileId}/content")
        CompletableFuture<String> getContent​(@Path("fileId")
                                             String fileId)
        Returns a file content.
        Parameters:
        fileId - The id of the file to use for this request.
        Returns:
        Content of specific file.
      • getContentInputStream

        @GET("/{fileId}/content")
        CompletableFuture<InputStream> getContentInputStream​(@Path("fileId")
                                                             String fileId)
        Returns a file content as a stream.
        Parameters:
        fileId - The id of the file to use for this request.
        Returns:
        Content of specific file.
      • delete

        @DELETE("/{fileId}")
        CompletableFuture<DeletedObject> delete​(@Path("fileId")
                                                String fileId)
        Delete a file.
        Parameters:
        fileId - The id of the file to use for this request.
        Returns:
        Deletion status.