A grocery chain is building a chatbot that must query live inventory and return item locations in the store. Which prompt engineering pattern is most appropriate for building this chatbot?
Choose an answer
Tap an option to check your answer.
Correct answer: Reasoning and acting (ReAct) prompting.
Why this is the answer
Reasoning and acting (ReAct) prompting is ideal because it allows the chatbot to interleave reasoning steps with actions, such as querying a live inventory database. This enables the chatbot to retrieve real-time information (like item locations) and then use that information to formulate a relevant response. Zero-shot and few-shot prompting are less suitable as they primarily focus on generating responses based on pre-existing knowledge or a few examples, without the ability to interact with external tools or databases. Least-to-most prompting is a strategy for breaking down complex problems into simpler sub-problems, which is not the primary requirement for real-time data retrieval in this scenario.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed