nerdexam
DatabricksDatabricks

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.

Generative AI Application Development

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

#LangChain#Prompt Engineering#PromptTemplate#GenAI Application Development

Community Discussion

No community discussion yet for this question.

Full GENERATIVE-AI-ENGINEER-ASSOCIATE PracticeBrowse All GENERATIVE-AI-ENGINEER-ASSOCIATE Questions