Seeking Assistance with Azure Deployment: Error Code 404 in Assistant Creation

Li, Yuming 20 Reputation points
2024-03-04T15:16:10.0366667+00:00

HI! I'm currently seeking some guidance regarding an issue I've encountered with Azure. I've successfully created a deployment with the Deployment Name "123", using the GPT-4 model and the 1106-Preview version. However, I've run into a roadblock while trying to create an assistant. Every attempt results in the following error: "Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}".

I'm wondering if this issue might be related to incorrect entries in the api_version and model parameters. Could anyone kindly advise on where I can find detailed information about these parameters, or suggest potential solutions to this issue? Your expertise and insights would be greatly appreciated.

Thank you in advance for your time and assistance!

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,124 questions
{count} votes

Accepted answer
  1. Charlie Wei 3,335 Reputation points
    2024-03-04T16:22:25.3066667+00:00

    Hello Li, Yuming,

    You are currently using the Python SDK, and I recommend checking out this Quickstart. For the api_version, it is advisable to use the latest version, 2024-02-15-preview. The model parameter is the name of your model deployment, which I believe is 123.

    Please try the following modified program.

    import os
    from openai import AzureOpenAI
    
    client = AzureOpenAI(
        api_key=os.getenv("AZURE_OPENAI_API_KEY"),  
        api_version="2024-02-15-preview",
        azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
    )
    
    assistant = client.beta.assistants.create(
        name="Data Visualization",
        instructions="...",
        tools=[{"type": "code_interpreter"}],
        model="123" #You must replace this value with the deployment name for your model.
    )
    

    Best regards,
    Charlie


    If you find my response helpful, please consider accepting this answer and voting 'yes' to support the community. Thank you!

    3 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. zayne komichi 0 Reputation points
    2024-04-14T10:55:02.19+00:00

    Thank you Charlie, i can confirm it was an issue with the api version in use, worked after changing it!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.