jonathanjordan21 commited on
Commit
48656b7
1 Parent(s): 10ffaa0

Create tag_chain.py

Browse files
Files changed (1) hide show
  1. components/tag_chain.py +15 -0
components/tag_chain.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain import PromptTemplate, LLMChain
2
+
3
+ def chain(llm):
4
+ sum_template = """what is the most significant actions or places or things, say it in at most 5 words :
5
+
6
+ {sentence}
7
+
8
+
9
+ """
10
+
11
+ sum_prompt = PromptTemplate(template=sum_template, input_variables=["sentence"])
12
+
13
+ sum_llm_chain = LLMChain(prompt=sum_prompt, llm=llm)
14
+
15
+ return sum_llm_chain