Closed bc3tech closed 1 month ago
Thank you for reaching out, @bc3tech ! Could you share the code that is failing with this error?
Yes I am merely doing
var files = _azureOpenAiClient.Value.GetFileClient();
try
{
var gptFile = files.UploadFile(fileName, OpenAI.Files.FileUploadPurpose.Vision);
So the problem isn't in the .ToString()
now that I see that FileUploadPurpose
is a struct & not an enum as I assumed.
However, there's still something going awry here as I cannot seem to use any file uploading capabilities, despite the MultiPart Form Data entry for purpose
having the correct value (vision
in my case)
Ah, I think this might be problem: I see your client is called _azureOpenAiClient
which makes me think you're using the Azure.AI.OpenAI library with the Azure OpenAI service? If so, the Azure OpenAI service (as of version 2024-06-01
) does not yet support "vision" as a file purpose. That's probably what's causing the error that you're getting. Could you try uploading files with other purposes, e.g., "assistants"?
Yes I also tried assistants
and got the same error.
What version of the Azure OpenAI service are you targeting?
I assume you're referring to the api_version
passed in the querystring. I've no idea; I'm simply using the Azure SDK, which internally uses this library, which is failing. I'm not specifying any version in my calls.
Thank you, @bc3tech . I suspect the issue that you are seeing is specific to the Azure service. Since this about the Azure.AI.OpenAI library, could you file this issue in the Azure repo here: 🔗 https://github.com/Azure/azure-sdk-for-net
https://github.com/openai/openai-dotnet/blob/3e12a623b0b4fd3b62abb0d7915422a4291b65c9/src/Custom/Files/Internal/InternalFileUploadOptions.cs#L38
when uploading files, it doesn't matter what upload purpose I choose, I get an "invalid purpose" HTTP 400 error. The OpenAI specs show these values in all lower-case, but the code here simply takes the Enum Value and ToString's it which would result in case like
Assistants
and notassistants
I'm hypothesizing this is the reason none of my uploads work.