Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

changes to the API

Shangyintc33a24b9aec3
diff --git a/dspy/assertions/assertions.py b/dspy/assertions/assertions.py
index 18b3f0014..3bbb308fc 100644
--- a/dspy/assertions/assertions.py
+++ b/dspy/assertions/assertions.py
@@ -12,11 +12,9 @@ class Assert:
self.kwargs = kwargs
# assert fun should always return bool
- def __call__(self) -> list[bool]:
+ def __call__(self) -> bool:
result = self.assert_fun(*self.args, **self.kwargs)
if isinstance(result, bool):
- return [result]
- elif isinstance(result, list) and all(isinstance(x, bool) for x in result):
return result
else:
raise ValueError("Assertion function should always return [bool]")