Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

Use `language` in system instructions for `dspy.Code` fields (#9106)

Marius Arvinted27c5afe5e5f
diff --git a/dspy/adapters/types/code.py b/dspy/adapters/types/code.py
index f9cf0eabb..96af0f707 100644
--- a/dspy/adapters/types/code.py
+++ b/dspy/adapters/types/code.py
@@ -79,7 +79,7 @@ class Code(Type):
def description(cls) -> str:
return (
"Code represented in a string, specified in the `code` field. If this is an output field, the code "
- "field should follow the markdown code block format, e.g. \n```python\n{code}\n``` or \n```cpp\n{code}\n```"
+ f"field should follow the markdown code block format, e.g. \n```{cls.language.lower()}\n{{code}}\n```"
f"\nProgramming language: {cls.language}"
)