Description
- Package Name: azureml-rag[faiss,document_parsing,cognitive_search,hugging_face]
- Package Version: 0.2.2
- Operating System: Linux
- Python Version: 3.10
Describe the bug
A clear and concise description of what the bug is.
The infer_deployment
function (from azureml.rag.utils.deployment import infer_deployment
) contains reference to Deployment.list
which isn't a valid method for the Deployment
class from the openai
package.
Digging into this a bit more - it's because there is no /deployments
route here:
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/authoring/preview/2023-07-01-preview/azureopenai.json
or
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/inference.json
However, there is a /models
route.
So for example,
https://aoairesourcename.openai.azure.com/openai/models?api-version=2023-07-01-preview
will work but
https://aoairesourcename.openai.azure.com/openai/deployments?api-version=2023-07-01-preview
will not.
To Reproduce
Steps to reproduce the behavior:
This will always fail to retrieve any deployments
from azureml.rag.utils.deployment import infer_deployment
aoai_embedding_model_name = "text-embedding-ada-002"
try:
aoai_embedding_deployment_name = infer_deployment(
aoai_connection, aoai_embedding_model_name
)
print(
f"Deployment name in AOAI workspace for model '{aoai_embedding_model_name}' is '{aoai_embedding_deployment_name}'"
)
except Exception as e:
print(f"Deployment name in AOAI workspace for model '{aoai_embedding_model_name}' is not found.")
print(
f"Please create a deployment for this model by following the deploy instructions on the resource page for '{aoai_connection['properties']['target']}' in Azure Portal."
)
e.g. from here
https://github.com/Azure/azureml-examples/blob/main/sdk/python/generative-ai/rag/notebooks/mlindex_with_testgen_autoprompt.ipynb
Expected behavior
A list of deployments should be retrieved
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.