Skip to content

The agent engineering platform.

Prompt fix for empty intermediate steps in summarization (#660)

vertinski65f3a341b01c
diff --git a/langchain/chains/summarize/map_reduce_prompt.py b/langchain/chains/summarize/map_reduce_prompt.py
index 82f93732c4..3cd9f941f4 100644
--- a/langchain/chains/summarize/map_reduce_prompt.py
+++ b/langchain/chains/summarize/map_reduce_prompt.py
@@ -4,7 +4,7 @@ from langchain.prompts import PromptTemplate
prompt_template = """Write a concise summary of the following:
-{text}
+"{text}"
CONCISE SUMMARY:"""
diff --git a/langchain/chains/summarize/refine_prompts.py b/langchain/chains/summarize/refine_prompts.py
index 33bdeabd3a..fc59d9e23d 100644
--- a/langchain/chains/summarize/refine_prompts.py
+++ b/langchain/chains/summarize/refine_prompts.py
@@ -21,7 +21,7 @@ REFINE_PROMPT = PromptTemplate(
prompt_template = """Write a concise summary of the following:
-{text}
+"{text}"
CONCISE SUMMARY:"""
diff --git a/langchain/chains/summarize/stuff_prompt.py b/langchain/chains/summarize/stuff_prompt.py
index 82f93732c4..3cd9f941f4 100644
--- a/langchain/chains/summarize/stuff_prompt.py
+++ b/langchain/chains/summarize/stuff_prompt.py
@@ -4,7 +4,7 @@ from langchain.prompts import PromptTemplate
prompt_template = """Write a concise summary of the following:
-{text}
+"{text}"
CONCISE SUMMARY:"""