GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #36
GENERATIVE-AI-ENGINEER-ASSOCIATE Question #36: Real Exam Question with Answer & Explanation
The correct answer is D: Provide a template argument to PromptTemplate(). The PromptTemplate constructor requires you to pass in the template string itself. In this snippet you only supplied input_variables, so you need to add something like template=template_text when you create the PromptTemplate. That will resolve the missing-template error.
Question
A Generative AI Engineer is using LangChain to assist a museum in classifying documents and using this code: Their code results in an error. What do they need to change in order to fix this template?
Options
- AProvide an LLM argument to PromptTemplate()
- BProvide template and LLM arguments to PromptTemplate()
- COmit PromptTemplate(), it is only used for multi-part templates
- DProvide a template argument to PromptTemplate()
Explanation
The PromptTemplate constructor requires you to pass in the template string itself. In this snippet you only supplied input_variables, so you need to add something like template=template_text when you create the PromptTemplate. That will resolve the missing-template error.
Topics
Community Discussion
No community discussion yet for this question.