Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
Following are examples of chat completions create and assistants create calls:
response = client.chat.completions.create(
model=model,
messages=messages
)
assistant = client.beta.assistants.create(
name=name,
instructions=instructions,
tools=tools,
model=model,
file_ids=file_ids
)
In both API methods, the model parameter is specified as
model: ID of the model to use. See the model endpoint compatibility table for details on which models work with the Chat API.
The problem is that if client has been created with AzureOpenAI() constructor,
the required model parameter value is not actually model id but model deployment name (from Azure Portal)
This is problematic because:
- Documentation asks for model id, not for deployment name
- If customer lists the models using following API
client.models.list()
, it provides model ids that
works OK with OpenAI client, but not with AzureOpenAI client (unless the deployment name is the same as model id) - Listing the models using client api is probably common and the values there are expected to work with client APIs.
The problem can be avoided with AzureOpenAI if model deployment name and model id are the same, but it is not
clear for user always to do that.
To Reproduce
- Create Azure OpenAI resource and create model deployment with some name which is not the same as model id(name)
- Construct AzureOpenAI client
- List the model ids using
client.models.list()
API - Use e.g. chat completion api with the model id
- If the model id is not the same as model deployment name, there will be a "model deployment not found" error
Code snippets
No response
OS
Windows
Python version
Python v3.12.1
Library version
openai v1.7.0