It is the model name that you must replace with the deployment name. It often can be the same, but you are also given an opportunity to rename it.
Then more modifications in your use of the OpenAI python library, as outlined in my link above.
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")
)
If this is the first of any use of OpenAI Azure services, I’d start with chat completions and see that you get a simple response there.
More, if using entra ID:
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
from openai import AzureOpenAI
token_provider = get_bearer_token_provider(
DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default"
)
api_version = "2023-12-01-preview"
endpoint = "https://my-resource.openai.azure.com"
client = AzureOpenAI(
api_version=api_version,
azure_endpoint=endpoint,
azure_ad_token_provider=token_provider,
)