GENERATIVE-AI-LEADER practice question 5 of 10
An organization wants to use generative AI to create a chatbot that can answer customer questions about their account balances. They need to ensure that the chatbot can access previous portions of the conversation with the customer. Which prompting technique should they use?
Full set: 76 questionsDomain Innovating with data and Google Cloud
Prompt chaining is the technique of using the output of one prompt as the input for a subsequent prompt. In the context of a conversational chatbot, this is essential for maintaining state and memory. To ensure the chatbot can access previous portions of the conversation, the application must chain the prompts by appending the new user query to the existing conversation history. This combined text is then sent to the model as the new prompt, allowing it to generate a response that is contextually aware of the entire interaction.
A. Use zero-shot prompting. This technique asks the model to perform a task without any prior examples in the prompt. It does not inherently manage or access conversational history across multiple turns.
B. Use role prompting. This sets the persona or character of the AI (e.g., "You are a helpful bank teller"). While useful for tone, it is not the mechanism for remembering past conversational context.
C. Use few-shot prompting. This provides a few examples of the desired input/output format within a single prompt to guide the model. It does not maintain the history of a multi-turn conversation. ---
1. Google Cloud Documentation, "Introduction to prompt design": This document defines prompt chaining: "Chaining is the practice of using the output of one prompt as the input of a second prompt. You can create sophisticated applications by chaining prompts together." This principle is directly applied in multi-turn conversations to maintain context.
2. Google Cloud Skills Boost, "Introduction to Large Language Models": In the module on "Prompt Engineering," the course explains that for multi-turn conversations, the prompt must be updated with the conversation history. It states, "To have a multi-turn conversation, you need to send the conversation history with each new turn." This is a direct application of the prompt chaining concept for building chatbots.
3. Google Cloud Blog, "An introduction to prompt design for generative AI": This article discusses building conversational experiences and notes the importance of including conversation history in the prompt. "For a chatbot to have a memory of the conversation, you need to include the conversation history in the prompt." This confirms that managing history is a key prompting strategy, achieved through chaining.
Keep practicing
Take the free GENERATIVE-AI-LEADER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GENERATIVE-AI-LEADER practice questions
- Question 1A global news agency is developing a generative AI tool to quickly summarize breaking new…
- Question 2A security team needs a centralized platform to gain a comprehensive overview of their or…
- Question 3A company’s development team is eager to start building generative AI solutions with Goog…
- Question 4A company wants to use an AI agent to automate some tasks. They want everyone to understa…
- Question 6An organization wants granular control over who can use and see their generative AI model…
- Question 7A marketing team wants to use a foundation model to create social media and advertising c…
