A DSPy prediction is a Python object that represents a language model’s output in the format specified by a signature. It contains the signature’s output fields. section 2.7
Read an output field using either form:
- Bracket notation: prediction['answer'] section 2.7
- Dot notation: prediction.answer section 2.7
Prediction(
answer='The capital of France is Paris.'
)
A question-answering prediction contains the answer field specified by the signature. section 2.7
