1Z0-1127-25 LangChain and AI Application Development Practice Question
A developer needs to include the conversation history in a prompt for a LangChain chatbot. They want to insert previous exchanges between the user and the AI into the prompt at a specific position. Which component should they use?
⚠ Common exam trap
The 1Z0-1127 exam often tests the distinction between a prompt component (MessagesPlaceholder) and a memory component (ConversationBufferMemory), leading candidates to mistakenly choose the memory class when the question asks for a prompt injection mechanism.
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
✓
MessagesPlaceholder
MessagesPlaceholder is the correct component because it is specifically designed to inject a list of messages (e.g., conversation history) at a designated position within a ChatPromptTemplate. It acts as a slot that gets replaced with the actual message list at runtime, allowing the developer to control exactly where previous exchanges appear in the prompt.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
PromptTemplate
Why it's wrong here
PromptTemplate is for string prompts and does not support inserting message lists.
- ✓
MessagesPlaceholder
Why this is correct
MessagesPlaceholder defines a variable position in the prompt where a list of messages (history) will be inserted.
- ✗
ChatPromptTemplate
Why it's wrong here
ChatPromptTemplate can include MessagesPlaceholder but alone does not insert history.
- ✗
ConversationBufferMemory
Why it's wrong here
ConversationBufferMemory stores history but does not insert it into the prompt; it must be used with a MessagesPlaceholder.
Go deeper
Related to this question
About these practice questions
This 1Z0-1127-25 question is part of Courseiva's 768-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-1127-25 practice question is part of Courseiva's free Oracle 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 1Z0-1127-25 exam.