Courseiva

AI-102 Plan and manage an Azure AI solution Practice Question

Exhibit

Refer to the exhibit.
{
  "role": "system",
  "content": "You are an AI assistant that helps users find information. You have access to the following functions. Use them if required.\n{\n  \"type\": \"function\",\n  \"function\": {\n    \"name\": \"get_weather\",\n    \"description\": \"Get the current weather\",\n    \"parameters\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"location\": {\n          \"type\": \"string\",\n          \"description\": \"The city and state, e.g. San Francisco, CA\"\n        }\n      },\n      \"required\": [\"location\"]\n    }\n  }\n}

You see the exhibit from an Azure OpenAI chat completion request. The assistant is not calling the get_weather function when asked about the weather. What is the most likely reason?

⚠ Common exam trap

Test-takers frequently assume listing a function in the system message is sufficient for the model to call it, but Azure OpenAI requires the function definition to be explicitly included in the 'tools' parameter of the API 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

✓

The function is defined in the system message but not in the 'tools' array

D is correct because in Azure OpenAI, functions must be defined in the 'tools' array of the chat completion request to be available for the model to call. Defining a function only in the system message does not register it as a callable tool; the model can see the description but cannot invoke it. Without the function in 'tools', the assistant will ignore the request to call get_weather.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The required parameter 'location' is missing from the user message

    Why it's wrong here

    The model infers parameter values from the user's utterance; a missing 'location' would typically prompt a clarifying question or an attempted call with an empty argument, not silence. Required parameters matter when the schema marks them mandatory and the model must elicit them.

  • ✗

    Function calling is not supported in the current Azure OpenAI version

    Why it's wrong here

    Function calling is supported in current Azure OpenAI API versions, so this cannot explain the behaviour. Version limitations would be the cause only when using a legacy model deployment or an API version predating the tools parameter.

  • ✗

    The function definition is malformed

    Why it's wrong here

    A malformed definition usually produces a schema validation error or an HTTP 400 from the service, not a silent text reply. Malformed schemas are the diagnosis when the API rejects the tools payload outright during request validation.

  • ✓

    The function is defined in the system message but not in the 'tools' array

    Why this is correct

    Function calling requires each function declared in the request's 'tools' array, which the model inspects to decide when to emit a tool call. Describing get_weather only in the system message leaves no callable tool, so the assistant answers in text instead of invoking it.

About these practice questions

One of 761 original AI-102 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.