dspy.Prediction¶
dspy.Prediction(*args, **kwargs)
¶
Bases: Example
A prediction object that contains the output of a DSPy module.
Prediction inherits from Example.
To allow feedback-augmented scores, Prediction supports comparison operations
(<, >, <=, >=) for Predictions with a score
field. The comparison operations
compare the 'score' values as floats. For equality comparison, Predictions are equal
if their underlying data stores are equal (inherited from Example).
Arithmetic operations (+, /, etc.) are also supported for Predictions with a 'score' field, operating on the score value.
Source code in dspy/primitives/prediction.py
Functions¶
copy(**kwargs)
¶
from_completions(list_or_dict, signature=None)
classmethod
¶
get(key, default=None)
¶
get_lm_usage()
¶
inputs()
¶
Source code in dspy/primitives/example.py
items(include_dspy=False)
¶
keys(include_dspy=False)
¶
labels()
¶
set_lm_usage(value)
¶
toDict()
¶
Source code in dspy/primitives/example.py
values(include_dspy=False)
¶
with_inputs(*keys)
¶
:::