AI0-001 Implementing AI Solutions Practice Question
A developer is building an AI agent that needs to call external APIs (e.g., get weather, send email) based on user requests. Which pattern is BEST for enabling the agent to autonomously decide when to call these APIs?
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
✓
Implement function calling in the LLM to generate structured API calls
Function calling allows the LLM to output structured commands that invoke specific API functions, enabling autonomous tool use in a controlled manner.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Hard-code the API calls in the agent's logic
Why it's wrong here
Hard-coding limits flexibility; the agent cannot adapt to new or varied user requests without manual intervention.
- ✗
Use a chain-of-thought prompt to reason about the steps
Why it's wrong here
Chain-of-thought helps reasoning but does not provide a structured way to invoke APIs; function calling is needed for actual tool use.
- ✓
Implement function calling in the LLM to generate structured API calls
Why this is correct
Function calling allows the LLM to produce a JSON object specifying which function to call and with what arguments, enabling the agent to decide autonomously.
- ✗
Use a planning agent with a predefined workflow
Why it's wrong here
A predefined workflow restricts the agent to a fixed sequence, reducing autonomy.
About these practice questions
One of 754 original AI0-001 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AI0-001 practice question is part of Courseiva's free CompTIA 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 AI0-001 exam.