refine_prompts.py — langchain Source File
Architecture documentation for refine_prompts.py, a python file in the langchain codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR d3a04c03_9b6b_2acf_c609_e19bfd6c590f["refine_prompts.py"] 435e49bf_bb2e_2016_ead7_0afb9d57ad71["langchain_core.prompts"] d3a04c03_9b6b_2acf_c609_e19bfd6c590f --> 435e49bf_bb2e_2016_ead7_0afb9d57ad71 style d3a04c03_9b6b_2acf_c609_e19bfd6c590f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
from langchain_core.prompts import PromptTemplate
REFINE_PROMPT_TMPL = """\
Your job is to produce a final summary.
We have provided an existing summary up to a certain point: {existing_answer}
We have the opportunity to refine the existing summary (only if needed) with some more context below.
------------
{text}
------------
Given the new context, refine the original summary.
If the context isn't useful, return the original summary.\
""" # noqa: E501
REFINE_PROMPT = PromptTemplate.from_template(REFINE_PROMPT_TMPL)
prompt_template = """Write a concise summary of the following:
"{text}"
CONCISE SUMMARY:"""
PROMPT = PromptTemplate.from_template(prompt_template)
Dependencies
- langchain_core.prompts
Source
Frequently Asked Questions
What does refine_prompts.py do?
refine_prompts.py is a source file in the langchain codebase, written in python.
What does refine_prompts.py depend on?
refine_prompts.py imports 1 module(s): langchain_core.prompts.
Where is refine_prompts.py in the architecture?
refine_prompts.py is located at libs/langchain/langchain_classic/chains/summarize/refine_prompts.py (directory: libs/langchain/langchain_classic/chains/summarize).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free