Generative AI Leader Practice Question: Techniques to Improve Generative AI Model Output
Which technique allows a model to incorporate real-time data from external APIs?
⚠ Common exam trap
A common pitfall is thinking that prompt engineering alone can achieve real-time data integration with external APIs. However, in Google Cloud's generative AI context, only RAG with tool calling (function calling) provides the explicit mechanism to execute API calls and incorporate live results into model responses.
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
✓
RAG with tool calling
RAG with tool calling is correct because it enables a generative AI model to query external APIs in real-time, retrieve up-to-date information, and incorporate that data into its response. This technique combines retrieval-augmented generation (RAG) with function calling, where the model outputs a structured request (e.g., a JSON object) to invoke an API, receive the result, and then generate a context-aware answer. Unlike static methods, this allows dynamic data integration without retraining.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
RAG with tool calling
Why this is correct
RAG with tool calling lets the model invoke external APIs at inference time, retrieving live data rather than relying solely on static training weights. This satisfies the stem's real-time external API constraint, which plain retrieval-augmented generation alone cannot meet.
- ✗
Prompt engineering
Why it's wrong here
Prompt engineering shapes a model's response through instructions and examples, but it cannot fetch live API data; the model still answers from its training or supplied context. It is tempting because well-crafted prompts genuinely improve output quality and consistency, and prompt engineering would be the right choice when refining tone, format or reasoning without needing external, current information.
- ✗
Fine-tuning
Why it's wrong here
Fine-tuning adjusts a model's weights using a static labelled dataset, so it cannot query an external API at inference time and returns only knowledge baked in during training. It is tempting because it genuinely specialises a model's behaviour or tone for a domain; it would be the right choice when you need consistent task-specific responses from fixed data, not live data.
- ✗
Model pruning
Why it's wrong here
Model pruning removes redundant weights to shrink a trained model, so it cannot fetch live API data at inference time. It is tempting because it genuinely improves latency and deployment cost for an already-trained model, and would be the right choice when the goal is reducing model size or speeding up inference on constrained hardware.
Go deeper
Related to this question
About these practice questions
One of 1,008 original Generative AI Leader 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 Generative AI Leader practice question is part of Courseiva's free Google Cloud 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 Generative AI Leader exam.