Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

Fix test_xml_adapter_full_prompt (#8904)

TomuHirata3e549cb0d0e3
diff --git a/dspy/adapters/xml_adapter.py b/dspy/adapters/xml_adapter.py
index c0971b52d..4c0084d2c 100644
--- a/dspy/adapters/xml_adapter.py
+++ b/dspy/adapters/xml_adapter.py
@@ -55,7 +55,7 @@ class XMLAdapter(ChatAdapter):
)
def user_message_output_requirements(self, signature: type[Signature]) -> str:
- message = "Respond with the corresponding output fields wrapped in XML tags"
+ message = "Respond with the corresponding output fields wrapped in XML tags "
message += ", then ".join(f"`<{f}>`" for f in signature.output_fields)
message += "."
return message
diff --git a/tests/adapters/test_xml_adapter.py b/tests/adapters/test_xml_adapter.py
index 644b7d688..4a0844b37 100644
--- a/tests/adapters/test_xml_adapter.py
+++ b/tests/adapters/test_xml_adapter.py
@@ -292,7 +292,7 @@ def test_xml_adapter_full_prompt():
expected_user = (
"[[ ## query ## ]]\nwhen was Marie Curie born\n\n"
- "Respond with the corresponding output fields wrapped in XML tags"
+ "Respond with the corresponding output fields wrapped in XML tags `<answer>`."
)
assert messages[0]["content"] == expected_system