Pre-Winter Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ac4s65

A Generative AI Engineer is testing a simple prompt template in LangChain using the code...

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)

Databricks-Generative-AI-Engineer-Associate PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now Databricks-Generative-AI-Engineer-Associate pdf
Get 65% Discount on All Products, Use Coupon: "ac4s65"