LangChainGo / openai_prompt_template.py
Last commit not found
raw
history blame
353 Bytes
from langchain.prompts import PromptTemplate
from langchain.llms import OpenAI
from langchain.chains import LLMChain
llm = OpenAI(temperature=0.9)
prompt = PromptTemplate(
input_variables=["product"],
template="What is a good name for a company that makes {product}?"
)
chain = LLMChain(llm=llm,prompt=prompt)
print(chain.run("colorful socks"))