From 2156a5e18cd5bb7fd48f6a6900b7ccf48cd4c35e Mon Sep 17 00:00:00 2001 From: Omar Khattab Date: Sat, 26 Oct 2024 15:25:42 -0700 Subject: [PATCH] Consistently use _parse_values=False from functional.py (#1701) * Improve ChatAdapter's handling of typed values and Pydantic models * Fixes for Literal * Fixes for formatting complex-typed values * Improve ChatAdapter, introduce JsonAdapter, add default retries with the latter. * Minor fixes * Update lock file * Updates for json retries * Consistently use _parse_values=False from functional.py --- dspy/functional/functional.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dspy/functional/functional.py b/dspy/functional/functional.py index 2dff1dcf7..8bb826044 100644 --- a/dspy/functional/functional.py +++ b/dspy/functional/functional.py @@ -153,6 +153,7 @@ def _make_example(self, field) -> str: "json_schema -> json_object", "Make a very succinct json object that validates with the following schema", ), + _parse_values=False, )(json_schema=schema).json_object # We use the parser to make sure the json object is valid. try: @@ -220,6 +221,7 @@ class Signature(dspy.Signature): task_description=task_description, language_model_output=model_output, error=error, + _parse_values=False, ).advice def _prepare_signature(self) -> dspy.Signature: