DSPy: The framework for programming—not prompting—language models
Python
🎨 Format files
Christopher Teedcb71f005b75
diff --git a/dsp/modules/lm.py b/dsp/modules/lm.pyindex 708600512..7f7966d4b 100644--- a/dsp/modules/lm.py+++ b/dsp/modules/lm.py@@ -71,7 +71,7 @@ class LM(ABC):elif provider == "ibm":printed.append((prompt, x))elif provider == "you.com":- printed.append((prompt, x['response']['answer']))+ printed.append((prompt, x["response"]["answer"]))else:printed.append((prompt, x["response"]["choices"]))@@ -89,7 +89,17 @@ class LM(ABC):printing_value += prompttext = ""- if provider in ("cohere", "Bedrock", "Sagemaker", "clarifai", "claude", "ibm", "premai", "you.com", "tensorrt_llm"):+ if provider in (+ "cohere",+ "Bedrock",+ "Sagemaker",+ "clarifai",+ "claude",+ "ibm",+ "premai",+ "you.com",+ "tensorrt_llm",+ ):text = choiceselif provider == "openai" or provider == "ollama":text = " " + self._get_choice_text(choices[0]).strip()