Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Update template_v2.py

Omar Khattab7d0d82d01035
diff --git a/dsp/templates/template_v2.py b/dsp/templates/template_v2.py
index 04eefaa70..0e1b36885 100644
--- a/dsp/templates/template_v2.py
+++ b/dsp/templates/template_v2.py
@@ -259,7 +259,7 @@ class TemplateV2:
query = self.query(example)
rdemos = "\n\n".join(rdemos)
- ademos = "\n\n".join(ademos)
+
if len(rdemos) >= 1 and len(ademos) == 0 and not long_query:
rdemos_and_query = "\n\n".join([rdemos, query])
parts = [
@@ -271,7 +271,7 @@ class TemplateV2:
parts = [
self.instructions,
self.guidelines(show_guidelines),
- ademos,
+ *ademos,
query,
]
else:
@@ -279,7 +279,7 @@ class TemplateV2:
self.instructions,
rdemos,
self.guidelines(show_guidelines),
- ademos,
+ *ademos,
query,
]