Repository navigation
Commit 2151e3a
fix(adapters): serialize non-JSON values one at a time in serialize_for_json (#10634)
One value pydantic can't serialize (e.g. a numpy scalar from a pandas row)
made serialize_for_json fall back to str() of the whole value. With
InstructionProposer as GEPA's default, this turned every reflection example
into a Python repr, dropped dspy.Image parts, and ignored custom __str__.
Pass fallback=str so only the offending value is stringified.
Amp-Thread-ID: https://ampcode.com/threads/T-01a12205-bc16-7750-9c23-8d86826ea0ec
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Isaac Miller <isaac@cmpnd.ai>1 parent 81a41fd commit 2151e3a
2 files changed
Lines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
643 | 644 | | |
644 | 645 | | |
645 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
646 | 651 | | |
647 | 652 | | |
648 | 653 | | |
649 | 654 | | |
650 | 655 | | |
651 | | - | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
652 | 664 | | |
653 | 665 | | |
654 | 666 | | |
| |||
660 | 672 | | |
661 | 673 | | |
662 | 674 | | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
663 | 678 | | |
664 | 679 | | |
665 | 680 | | |
| |||
0 commit comments