QuestionQ11

Implement AI solutions by using Microsoft Foundry

You have a Microsoft Foundry project named project1 that contains an Azure OpenAI resource named Resource1.

A gpt-4.1-mini model is deployed to Resource1 by using the model deployment named my-mini-gpt.

You need to connect to my-mini-gpt from an application.

How should you complete the Python code? Each value may be used once, more than once, or not at all.

Drag & Drop
gpt-4.1-mini
my-mini-gpt
project1
resource1
client = OpenAI(api_key="...",
    base_url="https://.openai.azure.com/openai/v1/",)
response = client.responses.create(
    model="",
    ...
)
Explanation

For Azure OpenAI v1, the client base URL is the Azure OpenAI resource endpoint, whose host begins with the resource name. Requests specify the deployed model’s deployment name in model; my-mini-gpt is the deployment, whereas gpt-4.1-mini is the underlying model.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!