Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

raise issue for invalid type

Herumb Shandilyacdc039913db2
diff --git a/dspy/predict/parallel.py b/dspy/predict/parallel.py
index a6048960e..78ef3e8ea 100644
--- a/dspy/predict/parallel.py
+++ b/dspy/predict/parallel.py
@@ -51,6 +51,8 @@ class Parallel:
result = module(example)
elif isinstance(example, tuple):
result = module(*example)
+ else:
+ raise ValueError(f"Invalid example type: {type(example)}, only supported types are Example, dict, list and tuple")
return result
# Execute the processing function over the execution pairs