GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #36
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?
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?
Exhibit
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()
How the community answered
(22 responses)- C5% (1)
- D95% (21)
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.
