AI-102 Implement generative AI solutions Practice Question
You are building a generative AI assistant on Azure OpenAI that must call internal REST APIs to look up order status. You decide to use function calling. Which TWO actions are required to make the assistant reliably invoke the correct API and return a coherent answer? (Choose two.)
⚠ Common exam trap
The trap here is assuming the model executes the function itself rather than only emitting a structured call request.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Execute the function in your application code and send the result back to the model as a tool message so it can generate the final response.
Function calling is a two-part contract. First, the application declares available functions with names, descriptions, and JSON schemas in the tools parameter so the model can choose one and emit structured arguments. Second, the application executes the chosen function and returns the result as a tool message, allowing the model to compose the final answer. Temperature, browsing, and token limits do not enable this loop.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set the model temperature to zero so the function call arguments are always deterministic.
Why it's wrong here
Temperature affects sampling randomness and can make outputs more consistent, but it does not enable function calling. Even at zero temperature, the model cannot produce valid function calls without function definitions, and it still cannot execute them. Determinism may help reproducibility of arguments, but it is not a required action for the assistant to invoke APIs and answer users. This option addresses a different concern.
- ✓
Execute the function in your application code and send the result back to the model as a tool message so it can generate the final response.
Why this is correct
The model does not execute functions; it only emits a request to call one with arguments. Your application must run the actual API, then append a message with role tool that includes the function result, keyed by the tool call ID. The model uses that result to produce the final natural-language answer. Skipping this round trip leaves the conversation incomplete and the user without an answer.
- ✓
Define each API as a function with a name, a description, and a JSON schema for its parameters, and pass these definitions in the tools parameter of the chat completion request.
Why this is correct
Function calling requires the model to know what functions exist and what arguments they accept. Providing a name, a natural-language description, and a JSON schema for parameters in the tools array lets the model decide when to call a function and produce arguments that conform to the schema. Without these definitions, the model has no basis for emitting a structured function call, so this step is mandatory.
- ✗
Enable the model's built-in web browsing tool so it can reach the internal APIs directly.
Why it's wrong here
Built-in tools such as web browsing target public internet content and cannot authenticate to or reach internal REST APIs behind your network. They also do not provide the structured argument handling that function calling offers. Relying on browsing would fail for private endpoints and would not satisfy the requirement to call specific internal services with typed parameters. Function calling with application-side execution is the correct mechanism.
- ✗
Increase the max_tokens value to ensure the function call arguments fit in the response.
Why it's wrong here
Raising max_tokens allows longer outputs, but function call arguments are typically short and are not the reason a call fails. The absence of function definitions or the failure to return tool results are the real blockers. Increasing the token limit does not enable the model to know which functions exist or to receive their results, so it does not contribute to a working function-calling loop.
Go deeper
Related to this question
About these practice questions
This AI-102 question is part of Courseiva's 761-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Microsoft exam blueprint
This AI-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-102 exam.