Zeta / insights_bullet_chain.py
Ritvik19's picture
synopsis / insight bullets
eed34fa verified
raw
history blame contribute delete
No virus
780 Bytes
from langchain_core.prompts import PromptTemplate
from langchain_core.output_parsers import StrOutputParser
insights_bullet_prompt_template = """
Draw the key insights about objective, method, results and conclusions from the given excerpt in the form of bullet points. Also mention the figure or tables referred to along-with the corresponding bullet points
Note: if results and conclusions are not much different, feel free to combine them to avoid duplication of information
excerpt: {paper}
"""
insights_bullet_output_parser = StrOutputParser()
insights_bullet_prompt = PromptTemplate(
template=insights_bullet_prompt_template,
input_variables=["paper"],
)
insights_bullet_chain = (
lambda model: insights_bullet_prompt | model | insights_bullet_output_parser
)