-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TypedPredictor formatting with list output values (#1609)
* Changes and lint Signed-off-by: dbczumar <[email protected]> * Docstring Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * Fix test failures Signed-off-by: dbczumar <[email protected]> * Remove debug Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * Test Signed-off-by: dbczumar <[email protected]> * name Signed-off-by: dbczumar <[email protected]> * quote Signed-off-by: dbczumar <[email protected]> * Update test_functional.py --------- Signed-off-by: dbczumar <[email protected]>
- Loading branch information
Showing
6 changed files
with
198 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from typing import Literal | ||
|
||
from pydantic.fields import FieldInfo | ||
|
||
|
||
def get_dspy_field_type(field: FieldInfo) -> Literal["input", "output"]: | ||
field_type = field.json_schema_extra.get("__dspy_field_type") | ||
if field_type is None: | ||
raise ValueError(f"Field {field} does not have a __dspy_field_type") | ||
return field_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.