
Answer-first summary for fast verification
Answer: Reasoning and acting (ReAct) prompting
The correct answer is **D: Reasoning and acting (ReAct) prompting**. This prompt engineering technique is specifically designed for scenarios where an AI system needs to perform both cognitive reasoning and external actions in a sequential manner. **Why ReAct prompting is optimal:** 1. **Combines reasoning and action**: ReAct prompting enables the chatbot to first reason about the customer's query (e.g., understanding the product name, interpreting the request) and then take action by querying external systems like the real-time inventory database. 2. **Real-time external data integration**: The requirement to check inventory in real-time necessitates interaction with external APIs or databases. ReAct prompting is built for such tool-calling scenarios where the model needs to retrieve current data from outside sources. 3. **Structured problem-solving**: For a grocery store chatbot, the process involves multiple steps: understanding the product request, checking availability, retrieving location data, and formulating a response. ReAct prompting provides a framework for this step-by-step execution. **Why other options are less suitable:** - **A: Zero-shot prompting**: This involves giving the model a task without examples. While it could potentially answer simple questions, it cannot interact with external inventory systems in real-time, which is a core requirement. - **B: Few-shot prompting**: This provides examples to guide the model's responses. While it might improve response quality, it still lacks the capability to perform actions like querying external databases. - **C: Least-to-most prompting**: This technique breaks complex problems into simpler subproblems. While useful for complex reasoning tasks, it doesn't inherently support the action component needed to interact with external systems. The key distinction is that ReAct prompting uniquely addresses both the reasoning aspect (understanding customer queries) and the acting aspect (querying real-time inventory systems), making it the most appropriate choice for this use case where dynamic, real-world data integration is essential.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A grocery store plans to develop a chatbot that assists customers in locating products within the store. The chatbot needs to access real-time inventory data and give the product's specific store location.
Which prompt engineering technique should be employed to construct this chatbot?
A
Zero-shot prompting
B
Few-shot prompting
C
Least-to-most prompting
D
Reasoning and acting (ReAct) prompting