liveBook · Manning

Prediction

As explained in Building LLM Applications with DSPy

A DSPy prediction is the structured object representing a language model's output, with fields specified by a signature.

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:

Prediction(
    answer='The capital of France is Paris.'
)

A question-answering prediction contains the answer field specified by the signature. section 2.7

How Building LLM Applications with DSPy covers it

How deep it goes
Defines the output object and field access, without detailing its implementation.
Examples
Shows a question-answering result with an answer field containing the capital of France.
What it assumes
Relies on a signature to specify the prediction’s output fields.
What you can do after
Understand how to retrieve signature-defined output fields using bracket or dot notation.
How it connects
Connects predictions to signatures, language models, and DSPy programs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building LLM Applications with DSPy. The section links point to the parts of the book it draws on.