Skip to content

AttributeError: 'Prediction' object has no attribute 'rationale' #1746

@priamai

Description

@priamai

Hi there,
I am following the tutorial:

https://dspy-docs.vercel.app/building-blocks/2-signatures

but I get this error:

AttributeError: 'Prediction' object has no attribute 'rationale'

from:


# Example from the XSum dataset.
document = """The 21-year-old made seven appearances for the Hammers and netted his only goal for them in a Europa League qualification round match against Andorran side FC Lustrains last season. Lee had two loan spells in League One last term, with Blackpool and then Colchester United. He scored twice for the U's but was unable to save them from relegation. The length of Lee's contract with the promoted Tykes has not been revealed. Find all the latest football transfers on our dedicated page."""

summarize = dspy.ChainOfThought('document -> summary')
response = summarize(document=document)

print(response.summary)
print("Rationale:", response.rationale)

Maybe something has changed from the docs.
Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions