Interface OpenAI.Uploads

  • Enclosing interface:
    OpenAI

    @Resource("/v1/uploads")
    public static interface OpenAI.Uploads
    Allows you to upload large files in multiple parts.
    See Also:
    OpenAI Upload
    • Method Detail

      • create

        @POST
        CompletableFuture<Upload> create​(@Body
                                         UploadRequest uploadRequest)
        Creates an intermediate Upload object that you can add Parts to.
        Parameters:
        uploadRequest - The creation request.
        Returns:
        The Upload object with status pending.
      • addPart

        @Multipart
        @POST("/{uploadId}/parts")
        CompletableFuture<UploadPart> addPart​(@Path("uploadId")
                                              String uploadId,
                                              @Body
                                              UploadPartRequest uploadPartRequest)
        Adds a Part to an Upload object. A Part represents a chunk of bytes from the file you are trying to upload.
        Parameters:
        uploadId - The ID of the Upload.
        uploadPartRequest - The chunk of bytes for this Part.
        Returns:
        The upload Part object.
      • complete

        @POST("/{uploadId}/complete")
        CompletableFuture<Upload> complete​(@Path("uploadId")
                                           String uploadId,
                                           @Body
                                           UploadCompleteRequest uploadCompleteRequest)
        Completes the Upload.
        Parameters:
        uploadId - The ID of the Upload.
        uploadCompleteRequest - The request including the ordered list of Part IDs.
        Returns:
        The Upload object with status completed.
      • cancel

        @POST("/{uploadId}/cancel")
        CompletableFuture<Upload> cancel​(@Path("uploadId")
                                         String uploadId)
        Cancels the Upload. No Parts may be added after an Upload is cancelled.
        Parameters:
        uploadId - The ID of the Upload.
        Returns:
        The Upload object with status cancelled.