Closed abhinavdalal closed 10 months ago
I am trying to upload a file using file_upload function but i get error below
APIError { message: "415: {\n \"error\": {\n \"message\": \"Invalid Content-Type header (application/json; charset=UTF-8), expected multipart/form-data. (HINT: If you're using curl, you can pass -H 'Content-Type: multipart/form-data')\",\n \"type\": \"invalid_request_error\",\n \"param\": null,\n \"code\": null\n }\n}\n" }
try to do a file upload using the file_upload function it gives api error.
I think as the error says we need to pass the correct header for file.. cant be the common header in content-type
client.file_upload(FileUploadRequest::new( FILE_PATH.to_string(), "assistants".to_string(), ))
ubuntu
Rust v1.73
openai-api-rs v2.1.4
@abhinavdalal Thank you for the report I use minreq, but I'm having trouble using multipart. reqwest is an option, but the library is too heavy. Consider other openai crates. Sorry.
Describe the bug
I am trying to upload a file using file_upload function but i get error below
To Reproduce
try to do a file upload using the file_upload function it gives api error.
I think as the error says we need to pass the correct header for file.. cant be the common header in content-type
Code snippets
OS
ubuntu
Rust version
Rust v1.73
Library version
openai-api-rs v2.1.4