Skip to content

Commit 05e195b

Browse files
Merge pull request #950 from qhoxie/qhoxie/fix-functional-bool-condition
fix(dspy): remove unreachable type condition in TypedPredictor
2 parents 88fc6c5 + 67e20ce commit 05e195b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dspy/functional/functional.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def _predictor(func) -> dspy.Module:
2222
return _StripOutput(TypedPredictor(signature, **kwargs), output_key)
2323

2424
# if we have only a single callable argument, the decorator was invoked with no key word arguments
25-
# so we just return the wrapped function
25+
# so we just return the wrapped function
2626
if len(args) == 1 and callable(args[0]) and len(kwargs) == 0:
2727
return _predictor(args[0])
2828
return _predictor
@@ -36,7 +36,7 @@ def _cot(func) -> dspy.Module:
3636
return _StripOutput(TypedChainOfThought(signature, **kwargs), output_key)
3737

3838
# if we have only a single callable argument, the decorator was invoked with no key word arguments
39-
# so we just return the wrapped function
39+
# so we just return the wrapped function
4040
if len(args) == 1 and callable(args[0]) and len(kwargs) == 0:
4141
return _cot(args[0])
4242
return _cot
@@ -217,7 +217,7 @@ def parse(x):
217217
format=lambda x: x if isinstance(x, str) else str(x),
218218
parser=parse,
219219
)
220-
elif type_ in (str, int, float, bool):
220+
elif type_ in (str, int, float):
221221
signature = signature.with_updated_fields(
222222
name,
223223
desc=field.json_schema_extra.get("desc", "")

0 commit comments

Comments
 (0)