DSPy: The framework for programming—not prompting—language models
Python
reverting caching function signature changes
Sri Vardhamanan6a721a3cdf2c
diff --git a/dsp/modules/gpt3.py b/dsp/modules/gpt3.pyindex 1e2b45ce8..2b56f1784 100644--- a/dsp/modules/gpt3.py+++ b/dsp/modules/gpt3.py@@ -152,13 +152,13 @@ class GPT3:@CacheMemory.cache-def cached_gpt3_request_v2(**kwargs) -> OpenAIObject:+def cached_gpt3_request_v2(**kwargs):return cast(OpenAIObject, openai.Completion.create(**kwargs))@functools.lru_cache(maxsize=None if cache_turn_on else 0)@NotebookCacheMemory.cache-def cached_gpt3_request_v2_wrapped(**kwargs) -> OpenAIObject:+def cached_gpt3_request_v2_wrapped(**kwargs):return cached_gpt3_request_v2(**kwargs)diff --git a/dsp/templates/utils.py b/dsp/templates/utils.pyindex 191a5356a..e21423bef 100644--- a/dsp/templates/utils.py+++ b/dsp/templates/utils.py@@ -28,7 +28,6 @@ def format_answers(answers: Union[str, list]) -> Optional[str]:_type_: Optiona[str]"""if isinstance(answers, list):- # TODO: why can answer not have one value?if len(answers) >= 1:return str(answers[0]).strip()if len(answers) == 0: