from langchain.prompts import PromptTemplate | |
from langchain.chains import LLMChain | |
def chain(llm): | |
sum_template = """what is the most significant actions or places or things, say it in at most 5 words : | |
{sentence} | |
""" | |
sum_prompt = PromptTemplate(template=sum_template, input_variables=["sentence"]) | |
sum_llm_chain = LLMChain(prompt=sum_prompt, llm=llm) | |
return sum_llm_chain |