Closed Agazoth closed 1 day ago
Sorry, could you say a bit more.
Yes, it will throw an error if you set the provider to Azure and not set the endpoints.
I have set my AzOAISecrets to:
And I ran:
Set-OAIProvider -Provider AzureOpenAI
Then the error gets generated, when the threads endpoint is called:
The following change to New-OAIThread
fixes the error:
$body = $OAIProvider -eq 'OpenAI' ? @{
messages = $Messages
tool_resources = $ToolResources
metadata = $Metadata
} : ''
The Azure endpoint does not allow any body content when calliing the threads endpoint. The configuration with messages and tools is done on the assistant.
Thanks for getting to the root cause!
I've gone off the OpenAI API docs. I was under the impression that when Microsoft onboarded their new models the API would be the same.
This seems like a breaking issue. I see your deployment name is GPT-4o.
I have gpt4-o deploy and will try.
I also tried with my GPT-35-Turbo and GPT-4-Turbo deplotments. They work with the fix too.
Thanks for checking. Wonder for 3.5 and turbo if it works with the body. They may have tightened up the process.
Need to think about this. Seems like it would break others in the community too and don't know if they do a if()
around the code.
I am hoping to avoid special casing these sort of things. Or come up with a more robust way to handle it.
Strange. I interpreted the docs that the new-oaithread
params go into the body.
Guess I jumped the gun thinking this was in Azure.
Not the best, this means the OpenAI interface will have newer APIs than what is deployed by Microsoft.
https://platform.openai.com/docs/api-reference/threads/createThread
The only difference is I'll check Get-OAIProvider
body = (Get-OAIProvider) -eq 'OpenAI' ? @{
messages = $Messages
tool_resources = $ToolResources
metadata = $Metadata
} : ''
@Agazoth thanks for chasing that down. Published a new release.
When running with AzureOpenAI as OAIProvider, the module fails: