GitHub Agentic AI Developer · 25% of the exam

Agentic AI Fundamentals and GitHub Models: free practice questions

5 sample questions from our 12-question bank for this domain — answers and explanations included. These are the same scenario-based style as the real GitHub exam.

1. While experimenting in the GitHub Models Playground, a developer notices that setting the temperature to 0.0 on a code-generation model produces nearly identical responses on repeated runs, while a temperature of 1.5 produces highly varied output. Which explanation is MOST accurate?

  • A. Temperature controls the maximum number of tokens the model generates per response.
  • B. Temperature scales the probability distribution over the model's next-token predictions; lower values make the distribution sharper, favoring the highest-probability token, while higher values flatten it, increasing randomness.✓ Correct
  • C. Temperature determines how many candidate responses the model generates internally before selecting the best one.
  • D. Temperature adjusts the size of the context window used during inference, with lower values consuming fewer tokens.
Explanation

Temperature is a softmax scaling parameter applied to logits before sampling. At 0.0 (or near 0), the model greedily picks the top token, yielding deterministic output. At high values like 1.5, the distribution flattens, making lower-probability tokens more likely and output more random. Option A is wrong — that describes `max_tokens`. Option C describes beam search or best-of-N sampling, not temperature. Option D is wrong — context window size is a model architecture constant, not controlled by temperature.

2. Your GitHub Models agent tool-calling loop receives this message from the model: `{"role": "assistant", "tool_calls": [{"id": "call_abc", "type": "function", "function": {"name": "get_pr_status", "arguments": "{\"pr_number\": 42}"}}]}`. What is the CORRECT next step in the agentic loop?

  • A. Treat the tool_call message as the final answer and return it directly to the user.
  • B. Re-submit the same user message to the model with a higher temperature to generate a plain-text response instead.
  • C. Execute the `get_pr_status` function with `pr_number=42`, then append both the original assistant tool_call message and a new `tool` role message containing the function result to the conversation history, and call the model again.✓ Correct
  • D. Append only the function result as a new `user` role message and call the model again, discarding the original assistant tool_call message.
Explanation

The correct tool-calling loop requires: (1) executing the requested function, (2) appending the assistant's tool_call message to history (preserving the call ID), and (3) appending a `tool` role message with the matching `tool_call_id` and the function result, then calling the model again so it can incorporate the result. Option A is wrong because the tool_call message is a request to act, not a final answer. Option B is wrong because temperature and re-prompting don't resolve a tool call — the model is explicitly signaling it needs external data. Option D is wrong because omitting the assistant tool_call message breaks the conversation threading that links the `tool_call_id` to the result, causing API errors.

3. A startup is building a GitHub Copilot extension using GitHub Models and is concerned about hitting rate limits during a live demo. Which THREE strategies are MOST effective for managing rate limits and cost on GitHub Models?

  • A. Cache deterministic tool outputs and previously seen prompt/response pairs to avoid redundant API calls.✓ Correct
  • B. Use the `max_tokens` parameter to cap response length, preventing runaway long completions that consume token quota.✓ Correct
  • C. Switch to a higher-tier model (e.g., GPT-4o over Phi-3) to get access to higher rate limits by default.
  • D. Implement exponential backoff with jitter when a 429 Too Many Requests response is received.✓ Correct
  • E. Set temperature to 0 on all requests, which reduces the number of tokens billed per request.
  • F. Batch multiple independent single-turn queries into one compound prompt where semantically appropriate to reduce the number of API calls.
Explanation

Caching (A) avoids repeat calls for identical inputs, directly reducing API usage. Capping `max_tokens` (B) limits token consumption per call and prevents unexpectedly long responses from exhausting quota. Exponential backoff with jitter (D) is the standard resilience pattern when 429 errors occur, preventing thundering herd retry storms. Option C is wrong — on GitHub Models, heavier models typically have *lower* rate limits, not higher. Option E is wrong — temperature is a sampling parameter and does not affect the number of tokens billed; the token count is determined by the actual input/output length. Option F, while sometimes useful, carries risks of conflated context and is not a primary rate-limit strategy.

4. An agent built with GitHub Models is losing important context from earlier in a long conversation because the accumulated messages exceed the model's context window. The team wants to preserve key facts across sessions without truncating the full history. Which memory strategy BEST addresses this requirement?

  • A. In-context memory — append all prior messages to every new request, relying on the model's context window to handle the full history.
  • B. Episodic memory with a vector database — store conversation summaries or key facts as embeddings in an external store and retrieve only the most relevant chunks to include in the next prompt.✓ Correct
  • C. Increase the model's temperature to encourage it to recall earlier statements more accurately.
  • D. Use a system prompt that explicitly instructs the model to remember everything the user has said in the current session.
Explanation

When history exceeds the context window, external (episodic) memory using a vector database allows the agent to store and semantically retrieve only the most relevant historical information, keeping prompt size manageable while preserving important context across sessions. Option A is precisely the problem described — in-context memory doesn't scale beyond the context window. Option C is wrong because temperature affects randomness in generation, not memory retention. Option D is wrong because a system prompt instruction cannot grant the model access to tokens that were already pushed out of the context window; the information is literally not present in the request.

5. You are defining a tool for a GitHub Models-powered agent that can look up a pull request's status. The tool definition is passed in the `tools` parameter of the chat completion request. Which TWO elements are REQUIRED in a well-formed tool/function definition for the OpenAI-compatible API?

  • A. A `name` field that uniquely identifies the function the model can call.✓ Correct
  • B. A `temperature` field that controls how deterministically the model decides to invoke the tool.
  • C. A `parameters` field (JSON Schema object) describing the arguments the function accepts.✓ Correct
  • D. A `return_type` field declaring the data type the function will return to the model.
  • E. A `max_calls` field limiting how many times the agent may invoke this tool per turn.
  • F. An `examples` array showing the model sample inputs and expected outputs for the tool.
Explanation

The OpenAI function-calling schema requires at minimum a `name` (so the model knows what to call) and a `parameters` JSON Schema object (so the model knows what arguments to supply). Option B is wrong — temperature is a top-level inference parameter, not part of a tool definition. Option D is wrong — there is no `return_type` field in the spec; return values are passed back as tool-role messages by the developer. Option E is wrong — `max_calls` is not part of the tool schema. Option F is wrong — examples are optionally included in the description string, not as a required structured field.

7 more questions in this domain

Practice the full bank with instant grading, flashcards, and a timed mock exam.

Start practicing free