From a8ad5cb6caccfc9a9fab64991a17a83432d3340e Mon Sep 17 00:00:00 2001 From: Marius Arvinte Date: Mon, 1 Dec 2025 16:33:52 -0800 Subject: [PATCH 1/2] Use language in system instructions --- dspy/adapters/types/code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspy/adapters/types/code.py b/dspy/adapters/types/code.py index f9cf0eabb8..37e3faf7a6 100644 --- a/dspy/adapters/types/code.py +++ b/dspy/adapters/types/code.py @@ -79,7 +79,7 @@ def serialize_model(self): 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}\n{{code}}\n```" f"\nProgramming language: {cls.language}" ) From 6e9bbdfed4904a9c8757eba9bc28d3ea60befbb4 Mon Sep 17 00:00:00 2001 From: Marius Arvinte Date: Mon, 1 Dec 2025 16:38:19 -0800 Subject: [PATCH 2/2] Use lowercase --- dspy/adapters/types/code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspy/adapters/types/code.py b/dspy/adapters/types/code.py index 37e3faf7a6..96af0f7072 100644 --- a/dspy/adapters/types/code.py +++ b/dspy/adapters/types/code.py @@ -79,7 +79,7 @@ def serialize_model(self): def description(cls) -> str: return ( "Code represented in a string, specified in the `code` field. If this is an output field, the code " - f"field should follow the markdown code block format, e.g. \n```{cls.language}\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}" )