You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to upload a large file (approximately 110MB) in Assistants API (I am using Azure OpenAI, FWIW). I am trying to upload it by splitting it in chunks. However, I am getting the error in the very first request when I try to create an upload (so that I can get an upload id).
Here's my code:
var client = new Azure.AI.OpenAI.AzureOpenAIClient(new Uri(azureOpenAiEndpoint), new DefaultAzureCredential());
var uploadData = $"{{purpose: 'assistants',filename:'azure-storage-blobs.pdf',bytes:{bytesRemaining},mime_type:'application/pdf'}}";
var createUploadResult = fileClient.CreateUpload(BinaryContent.Create(new MemoryStream(Encoding.UTF8.GetBytes(uploadData))));
I am getting a 404 error on the last line. When I see the request details, I noticed that it is trying to make a Post request at https://<my-azure-open-ai-service-name>.openai.azure.com/uploads and that is failing with 404 error. Here's the complete error stack trace:
System.ClientModel.ClientResultException
HResult=0x80131500
Message=HTTP 404 (: 404)
Resource not found
Source=OpenAI
StackTrace:
at OpenAI.ClientPipelineExtensions.ProcessMessage(ClientPipeline pipeline, PipelineMessage message, RequestOptions options) in /_/src/Custom/Internal/ClientPipelineExtensions.cs:line 47
at OpenAI.Files.InternalUploadsClient.CreateUpload(BinaryContent content, RequestOptions options) in /_/src/Generated/InternalUploadsClient.cs:line 56
at OpenAI.Files.OpenAIFileClient.CreateUpload(BinaryContent content, RequestOptions options) in /_/src/Custom/Files/OpenAIFileClient.Protocol.cs:line 241
at AssistantsAPIDemo.Program.Main(String[] args) in C:\Users\CP00DCY\source\repos\AssistantsAPIDemo\Program.cs:line 48
Uploading small files in single request works perfectly fine.
Also, why there are no properly typed objects as input and output for uploading file in chunks? For uploading files in chunks, I noticed that the input is always BinaryContent and the output is ClientResult. That would mean that I will need to manually parse the response that is returned by the API.
Service
Azure OpenAI
Describe the bug
I am trying to upload a large file (approximately 110MB) in Assistants API (I am using Azure OpenAI, FWIW). I am trying to upload it by splitting it in chunks. However, I am getting the error in the very first request when I try to create an upload (so that I can get an upload id).
Here's my code:
I am getting a 404 error on the last line. When I see the request details, I noticed that it is trying to make a
Post
request athttps://<my-azure-open-ai-service-name>.openai.azure.com/uploads
and that is failing with 404 error. Here's the complete error stack trace:Uploading small files in single request works perfectly fine.
Also, why there are no properly typed objects as input and output for uploading file in chunks? For uploading files in chunks, I noticed that the input is always
BinaryContent
and the output isClientResult
. That would mean that I will need to manually parse the response that is returned by the API.Steps to reproduce
Please see above
Code snippets
OS
Windows
.NET version
8.0
Library version
Azure.AI.OpenAI (2.1.0-beta.1)
The text was updated successfully, but these errors were encountered: