Closed krishnankuppaswamy closed 6 months ago
Hi @higty - love this library.
I had used the assistants API via direct OpenAI subscription.
- Everything works π
I now have access to Azure OpenAI subscription. With the AzureSettings class, created the OpenAIClient as per the documentation. Set the API Version too. However, unable to get the Assistatns API working.
- I get
Resource not found
exception.Please note:
- I can make use of the Azure OpenAI studio and create assistant and run that on the web portal. - works
- I created a postman request, and able to create assistant. - works
Request URL
Payload
{ "tools": [], "name": "Math Tutor", "instructions": "You are a personal math tutor. Answer questions briefly, in a sentence or less.", "model": "gpt-4-1106-preview", "file_ids": [] }
AssistantCreateParameter
class has a GetApiPath() set to/assistants
. Should it be/openai/assistants
instead?
- I tried setting the endpointUri to - ending with
/
- I tried setting the endpointUri to - ending with
/openai/
as wellNo luck.
Please confirm if the library was tested with the Azure OpenAI?
Some guidance over this query would be helpful. Appreciate your time.
Hi @higty - please find the additional details.
It appears like the following is extra information in the URL
deployments/gpt-4-1106-preview/
How to work with the library in this case?
Hi @higty - love this library. I had used the assistants API via direct OpenAI subscription.
- Everything works π
I now have access to Azure OpenAI subscription. With the AzureSettings class, created the OpenAIClient as per the documentation. Set the API Version too. However, unable to get the Assistatns API working.
- I get
Resource not found
exception.Please note:
- I can make use of the Azure OpenAI studio and create assistant and run that on the web portal. - works
- I created a postman request, and able to create assistant. - works
Request URL
Payload
{ "tools": [], "name": "Math Tutor", "instructions": "You are a personal math tutor. Answer questions briefly, in a sentence or less.", "model": "gpt-4-1106-preview", "file_ids": [] }
AssistantCreateParameter
class has a GetApiPath() set to/assistants
. Should it be/openai/assistants
instead?
- I tried setting the endpointUri to - ending with
/
- I tried setting the endpointUri to - ending with
/openai/
as wellNo luck. Please confirm if the library was tested with the Azure OpenAI? Some guidance over this query would be helpful. Appreciate your time.
Hi @higty - please find the additional details.
- Expected - https://myapp-openai-00001.openai.azure.com/openai/assistants?api-version=2024-02-15-preview
- Actual URI that's built by the library is - https://myapp-openai-00001.openai.azure.com/openai/deployments/gpt-4-1106-preview/assistants?api-version=2024-02-15-preview
It appears like the following is extra information in the URL
deployments/gpt-4-1106-preview/
How to work with the library in this case?
@higty Is there a way to set up the ApiUrl or any other logic that can be setup for assistants?
https://github.com/higty/higlabo/blob/master/Net8/HigLabo.OpenAI/Core/OpenAIClient.cs#L43
Hi @higty - Unfortunately I am moving towards Azure OpenAI SDK while I haven't heard from you.
I will be watching for the changes to the repo though. All the best!
Hi. Sorry late reply. Thank you for your comment. It may be bug. I'll investigate to it.
Actually, I don't test for AzureOpenAI. I assumed that all endpoint must be same as OpenAI. But from your comment, it seems different. I'll investigate it.
I changed ApiUrl logic based on your information. If you set DeploymentId is null or empty, ApiUrl will return "https://myapp-openai-00001.openai.azure.com/openai". So, it may be work.
And yesterday, I added assistant streming API feature. Now you can consume Assistant API response like ChatCompletion API endpoint. This improve UX for your user.
I'm looking forward to hear this works correctly as you expected without bug.
regarad.
I changed ApiUrl logic based on your information. If you set DeploymentId is null or empty, ApiUrl will return "https://myapp-openai-00001.openai.azure.com/openai". So, it may be work.
And yesterday, I added assistant streming API feature. Now you can consume Assistant API response like ChatCompletion API endpoint. This improve UX for your user.
I'm looking forward to hear this works correctly as you expected without bug.
regarad.
Thanks @higty π
I will review this later today or tomorrow and provide you an update.
Thanks for the support.
I'll support youπ I can't wait that all works great and help your work!
It may work based on provided information. I'll close this issue. If it does not work, please reopen issue.
Sure, @higty. Thanks
I confirmed all works on AzureOpenAI.
Thanks, @higty. I will review this with the updated library.
Hi @higty - love this library.
I had used the assistants API via direct OpenAI subscription.
I now have access to Azure OpenAI subscription. With the AzureSettings class, created the OpenAIClient as per the documentation. Set the API Version too. However, unable to get the Assistatns API working.
Resource not found
exception.Please note:
Request URL
Payload
AssistantCreateParameter
class has a GetApiPath() set to/assistants
. Should it be/openai/assistants
instead?/
/openai/
as wellNo luck.
Please confirm if the library was tested with the Azure OpenAI?
Some guidance over this query would be helpful. Appreciate your time.