DSPy: The framework for programming—not prompting—language models
Python
Fix typos
Ikko Eltociear Ashimine19f98e6d0d12
diff --git a/dsp/templates/template_v2.py b/dsp/templates/template_v2.pyindex a89ba3747..2d739074f 100644--- a/dsp/templates/template_v2.py+++ b/dsp/templates/template_v2.py@@ -46,14 +46,14 @@ class TemplateV2:match = re.search("(.*)(\s){(.*)}\s(.*\${.*})", template)if match is not None:name = match.group(1)- seperator = match.group(2)+ separator = match.group(2)variable = match.group(3)description = match.group(4)else:match = re.search("(.*)(\s){(.*)}", template)if match is not None:name = match.group(1)- seperator = match.group(2)+ separator = match.group(2)variable = match.group(3)description = Noneelse:@@ -70,7 +70,7 @@ class TemplateV2:self.fields.append(Field(name=name,- seperator=seperator,+ separator=separator,input_variable=input_variable,output_variable=output_variable,description=description,@@ -102,7 +102,7 @@ class TemplateV2:else:def format_handler(x): return ' '.join(x.split())- result.append(f"{field.name}{field.seperator}{format_handler(example[field.input_variable])}")+ result.append(f"{field.name}{field.separator}{format_handler(example[field.input_variable])}")if self._has_augmented_guidelines() and ("augmented" in example and example.augmented):return "\n\n".join(result)@@ -121,7 +121,7 @@ class TemplateV2:return resultdef _has_augmented_guidelines(self):- return len(self.fields) > 3 or any(field.seperator == "\n" for field in self.fields)+ return len(self.fields) > 3 or any(field.separator == "\n" for field in self.fields)def extract(self, example, raw_pred):example = dsp.Example(example)diff --git a/dsp/templates/template_v3.py b/dsp/templates/template_v3.pyindex bf9fe44a9..0e6a6b0f8 100644--- a/dsp/templates/template_v3.py+++ b/dsp/templates/template_v3.py@@ -24,7 +24,7 @@ class Template(TemplateV2):prefix = value.prefixseparator = ' ' if prefix.rstrip() == prefix else prefix[len(prefix.rstrip()):]field = Field(name=prefix.strip(), description=value.desc,- input_variable=key, output_variable=key, seperator=separator)+ input_variable=key, output_variable=key, separator=separator)self.fields.append(field)if value.format: