DSPy: The framework for programming—not prompting—language models
Python
Merge pull request #1337 from stanfordnlp/format-inspect-history
arnavsinghvi1171fa56482479
diff --cc dsp/modules/lm.pyindex 13ddfbffa,c14fd0a79..c0569852b--- a/dsp/modules/lm.py+++ b/dsp/modules/lm.py@@@ -116,14 -101,17 +116,15 @@@ class LM(ABC)text = choices[0].message.contentelif provider == "cloudflare":text = choices[0]- elif provider == "ibm" or provider == "premai":- text = choiceselse:text = choices[0]["text"]- printing_value += self.print_green(text, end="")+ printing_value += self.print_green(text, end="") if color_format else textif len(choices) > 1 and isinstance(choices, list):+ choices_text = f" \t (and {len(choices)-1} other completions)"printing_value += self.print_red(- f" \t (and {len(choices)-1} other completions)", end="",- )+ choices_text, end="",+ ) if color_format else choices_textprinting_value += "\n\n\n"