Files
2023-03-26 19:49:46 -07:00

1.6 KiB

Writer

This example goes over how to use LangChain to interact with Writer models

In [ ]:
from langchain.llms import Writer
from langchain import PromptTemplate, LLMChain
In [ ]:
template = """Question: {question}

Answer: Let's think step by step."""

prompt = PromptTemplate(template=template, input_variables=["question"])
In [ ]:
llm = Writer()
In [ ]:
llm_chain = LLMChain(prompt=prompt, llm=llm)
In [ ]:
question = "What NFL team won the Super Bowl in the year Justin Beiber was born?"

llm_chain.run(question)