-   Notifications  
You must be signed in to change notification settings  - Fork 171
 
Open
Labels
Description
I am trying to upload a file using the OpenAI Java SDK and encountered an issue where the request fails when using InputStream, but succeeds when using Paths.get().
Use Code
public String uploadFile(MultipartFile file) { FileCreateParams params = FileCreateParams.builder() .file(file.getInputStream()) // Using InputStream .purpose(FilePurpose.ASSISTANTS) .build(); FileObject fileObject = openAIClient.files().create(params); return fileObject.id(); }When using InputStream, the following error occurs:
400: OpenAIError{additionalProperties={error={message=The browser (or proxy) sent a request that this server could not understand., type=server_error, param=null, code=null}}} However, when I use Paths.get() instead, the request succeeds without issues.
Is this an expected behavior, or am I incorrectly using the SDK?