DSPy: The framework for programming—not prompting—language models
Python
Update lm.py
Andrés Wagner866840d42d24
diff --git a/dsp/modules/lm.py b/dsp/modules/lm.pyindex cfe8b88d0..6cc07efc6 100644--- a/dsp/modules/lm.py+++ b/dsp/modules/lm.py@@ -55,6 +55,8 @@ class LM(ABC):printed.append((prompt, x["response"].text))elif provider == "mistral":printed.append((prompt, x['response'].choices))+ elif provider == "ibm":+ printed.append((prompt, x))else:printed.append((prompt, x["response"]["choices"]))@@ -84,6 +86,8 @@ class LM(ABC):text = choices[0].parts[0].textelif provider == "mistral":text = choices[0].message.content+ elif provider == "ibm":+ text = choiceselse:text = choices[0]["text"]printing_value += self.print_green(text, end="")