Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Fix for history, only returning the `text` from Cohere LM

Connor Shorten0e91c6b5a6b5
diff --git a/dsp/modules/lm.py b/dsp/modules/lm.py
index 557b03a63..7c678a5e1 100644
--- a/dsp/modules/lm.py
+++ b/dsp/modules/lm.py
@@ -52,7 +52,7 @@ class LM(ABC):
blocks = [{"text": block.text} for block in x["response"].content if block.type == "text"]
printed.append((prompt, blocks))
elif provider == "cohere":
- printed.append((prompt, x["response"].generations))
+ printed.append((prompt, x["response"]))
elif provider == "mistral":
printed.append((prompt, x['response'].choices))
else: