stanfordnlp / dspy

DSPy: The framework for programming—not prompting—language models
https://dspy.ai
MIT License
18.84k stars 1.44k forks source link

fix(evaluate): fix evaluate dict merge for pydantic #1490

Closed MSNP1381 closed 1 month ago

MSNP1381 commented 2 months ago

it had error when your module's output was a pydantic object rather that a dict

MSNP1381 commented 1 month ago

Thanks @MSNP1381 ! left some minor comments to avoid extraneous changes togpt3.py but the changes to evaluate LGTM

i just added the code comments but the merge function is unstable be cause there is varying type of output for modules. My opinion is either we just use pydantic Object or any inherited objects or user have to follow some basic interfaces (as simple as dict interface))

MSNP1381 commented 1 month ago

@okhat can i talk to you through the email?