Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: force70

Databricks Certified Generative AI Engineer Associate Databricks-Generative-AI-Engineer-Associate Question # 5 Topic 1 Discussion

Databricks Certified Generative AI Engineer Associate Databricks-Generative-AI-Engineer-Associate Question # 5 Topic 1 Discussion

Databricks-Generative-AI-Engineer-Associate Exam Topic 1 Question 5 Discussion:
Question #: 5
Topic #: 1

A Generative AI Engineer is testing a simple prompt template in LangChain using the code below, but is getting an error:

Python

from langchain.chains import LLMChain

from langchain_community.llms import OpenAI

from langchain_core.prompts import PromptTemplate

prompt_template = "Tell me a {adjective} joke"

prompt = PromptTemplate(input_variables=["adjective"], template=prompt_template)

# ... (Error-prone section)

Assuming the API key was properly defined, what change does the Generative AI Engineer need to make to fix their chain?


A.

(Incorrect structure)


B.

(Incorrect structure)


C.

prompt_template = "Tell me a {adjective} joke"

prompt = PromptTemplate(input_variables=["adjective"], template=prompt_template)

llm = OpenAI()

llm_chain = LLMChain(prompt=prompt, llm=llm)

llm_chain.generate([{"adjective": "funny"}])


D.

(Incorrect structure)


Get Premium Databricks-Generative-AI-Engineer-Associate Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.