Open IANTHEREAL opened 8 months ago
@IANTHEREAL This is a good call out. For Azure assistants APIs, azure_deployment
is not supported. To explain, Assistants is a bit different than other deployment-based features, in that it does not require the deployment name in the URL like: {endpoint}/openai/deployments/{azure_deployment}/chat/completions
. While the client-level azure_deployment
keyword argument is meant as a convenience to add the deployment name to the URL for you, we see in this case that it's not needed and results in 404. For Assistants APIs where you do need to pass the name of your deployment, i.e. assistants.create
, you should pass it at the method-level:
my_assistant = client.beta.assistants.create(
instructions="You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
name="Math Tutor",
tools=[{"type": "code_interpreter"}],
model="deployment-name",
)
@rattrayalex - I think the AzureOpenAI docstring should be updated to mention that azure_deployment
is not supported for the assistants APIs. I can open a PR.
Please do, thank you Krista!
cc @RobertCraigie
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
When initializing the AzureOpenAI client with the azure_deployment parameter specified, a NotFoundError with error code 404 is raised upon calling client.beta.assistants.list(). However, omitting the azure_deployment parameter results in the expected behavior with no errors.
To Reproduce
Code snippets
No response
OS
macOS
Python version
Python 3.10.13
Library version
1.3.7