AI-901 practice question: Chat client apps with the Foundry SDK (2 of 4)
Implement AI solutions by using Microsoft Foundry A free question from our original AI-901 practice exam. Try it, then open the answer to see why each option is right or wrong.
A retail analytics team has started a Python chat app that signs in to its Foundry project with Microsoft Entra ID. The next line should create an OpenAI-style client for sending prompts to a model deployment.
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
project = AIProjectClient(endpoint=ENDPOINT, credential=DefaultAzureCredential())
openai_client = project.________()
Which method name fills the blank?
Choose one answer.
AA. the agents.create_version method
BB. the responses.create method
CC. the get_openai_client method
DD. the create_thread_and_run method
Show the answer and explanation
Answer: C
A. Wrong: agents.create_version creates a versioned agent definition in the project. It does not return a client for sending chat prompts to a model deployment.
B. Wrong: responses.create sends a prompt, but it is a method on the OpenAI-style client, which the blank has to create first.
D. Wrong: create_thread_and_run belongs to the older threads-and-runs pattern, not to the current project client used for chat prompts.
Explanation
The project client gives an OpenAI-style client through get_openai_client, and that client sends prompts with responses.create. Agent definitions and thread-based calls are separate tasks.
Want more on Chat client apps with the Foundry SDK? The 5 full-length practice sets have 20 more Chat client apps with the Foundry SDK questions, 225 in all, none of them in the free exam. One payment of $9.99 $6.99, no subscription. Get the practice sets →
✓ Every exam starts with free questions. No account needed.
Can we use Google Analytics cookies to see which pages help people? No ads, and we never sell data. Privacy