Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.53k stars 2.76k forks source link

[AzureOpenAi] Unable to create a AIClient() with the right parameters #37003

Closed Lucas-Simonet closed 2 weeks ago

Lucas-Simonet commented 3 weeks ago

azure-ai-ml = "1.15.0" azure-ai-generative = "^1.0.0b8"

Describe the bug I'm trying to create an AIClient object to interact with my Azure OpenAi deployments (and get their quotas for example)

image

But I can't find what I'm suppose to put as project_name or ai_ressource_name When trying to call ai_client.azure_open_ai_deployments.list() or ai_client.azure_open_ai_deployments.get("deployment_name") methods, I get the following error :

Message: The Resource 'Microsoft.MachineLearningServices/workspaces/project_name' under resource group 'ressource_group' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

A lot of the docs seems to fit the AI Azure Studio, but I'm working with the Azure Openai Studio

Expected behavior Be able to interact with my Azure OpenAi deployments Could you please show me screenshots of where I could find such project_name ?

Thanks a lot

github-actions[bot] commented 3 weeks ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

github-actions[bot] commented 2 weeks ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-ml-sdk @azureml-github.

kristapratico commented 2 weeks ago

@Lucas-Simonet for interacting with Azure OpenAI deployments, I suggest using the azure-mgmt-cognitiveservices library since I believe azure-ai-resources to be deprecated.

This doc shows how to install the library and get a deployment: https://learn.microsoft.com/en-us/rest/api/aiservices/accountmanagement/deployments/get?view=rest-aiservices-accountmanagement-2023-05-01&tabs=Python#getdeployment. Note that it returns a Deployment object which has information about call quota under the properties. Let us know if that works for you!

github-actions[bot] commented 2 weeks ago

Hi @Lucas-Simonet. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Lucas-Simonet commented 2 weeks ago

It worked 🥳 Thanks a lot @kristapratico