Databricks Certified Generative AI Engineer - Associate

Databricks Certified Generative AI Engineer - Associate

Get started today

Ultimate access to all questions.


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

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
)

llm = LLMChain(prompt=prompt)
llm.generate(["adjective": "funny"])

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

50.8%

47.5%

1.7%

0.0%

Comments

Loading comments...