Azure-Samples / azureai-assistant-tool

The Azure AI Assistant Tool is experimental Python application and middleware designed to simplify the development, experimentation, testing, and debugging of OpenAI assistants.
MIT License
113 stars 48 forks source link

Unable to converse with gpt model through Azure OpenAI Chat Assistant #47

Closed gujju62 closed 4 weeks ago

gujju62 commented 1 month ago

Please provide us with the following information: While trying to chat with Azure Open AI gpt-4 model as service using the chat assistant feature, I am getting error message "Failed to create thread Error Code 404. I have done following :

  • Have followed the installation guidelines
  • Have validated the access to gpt-4 service endpoint using nslookup
  • Tried to access the services using the URL provided by Azure OpenAI from Postman and I am getting response.
  • Have used deployment names in "Settings" --> system assistant and while creating new chat assistant

This issue is for a: (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  • Create New Chat Assistant
  • Start the conversation

Any log messages given by the failure

image

image

image

Expected/desired behavior

Should be able to have the chat conversation

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) Linux ubuntu 20.04

Versions

0.4.5 version for the Assistant

Mention any other details that might be useful


Thanks! We'll be in touch soon.

jhakulin commented 1 month ago

@gujju62 Thanks for the report. In the first error message, I see "Resource not found", thus I wonder if the endpoint or the model deployment name is set correctly for assistant.

Did you have following format in AZURE_OPENAI_ENDPOINT="your_endpoint_data.openai.azure.com/" ? Then did you use the model deployment name from Azure AI Studio, ie, not the model name (as that may be different).

gujju62 commented 1 month ago

@jhakulin - Thank you . Yes, I am using the endpoints and key provided by Azure OpenAI service.

I am also using using the deployment name that i have provided while creating the service.

cheers.

jhakulin commented 1 month ago

@gujju62 Need to figure out what is wrong as I cannot reproduce.

Could you please enable OpenAI logging check box in Debug view and send new trace to me to jhakulin@microsoft.com? NOTE: When you enable the OpenAI logging your api-key seems get exposed, so be careful and remove that before sharing the information. image

Also could you do pip list for the components you have installed.

gujju62 commented 4 weeks ago

@jhakulin - Please find attached the list of packages installed [pip install]. Under Menu Item "Diagnostics --> Debug View", I don't see any option for enabling OpenAI logging. packageslist.txt

jhakulin commented 4 weeks ago

@gujju62 You do not see check box like below? image

gujju62 commented 4 weeks ago

@jhakulin - I have emailed you sample trace . Thanks.

jhakulin commented 4 weeks ago

@gujju62 One problem could be that you have 2023-03-15-preview api version.

For Azure OpenAI Assistants, please use

set AZURE_OPENAI_API_VERSION=2024-05-01-preview

gujju62 commented 4 weeks ago

@jhakulin - With the API version change, I was able to access the tool and able to perform chat with the assistant. Thank you for your help.

I am also trying out speech capability of the tool, is there any documentation that you could point to me?

Thank you.

jhakulin commented 4 weeks ago

@gujju62 Great, please see instructions here how to get Azure Speech resource

https://learn.microsoft.com/en-us/azure/ai-services/speech-service/get-started-speech-to-text?tabs=linux%2Cterminal&pivots=programming-language-python

Once you get key and region, please update environment variables

set AZURE_AI_SPEECH_KEY=Your_Speech_Key set AZURE_AI_SPEECH_REGION=Your_Speech_Region

The same resource should work for both speech to text and text to speech

jhakulin commented 4 weeks ago

closing the issue, please let me know if need more help.