DSPy: The framework for programming—not prompting—language models
Python
feature(modules): support inspect_history for aws models
Dhar Rawald19205741491
diff --git a/dsp/modules/lm.py b/dsp/modules/lm.pyindex 4af1dc80e..9364f38e0 100644--- a/dsp/modules/lm.py+++ b/dsp/modules/lm.py@@ -46,7 +46,7 @@ class LM(ABC):prompt = x["prompt"]if prompt != last_prompt:- if provider == "clarifai" or provider == "google":+ if provider == "clarifai" or provider == "google" or provider == "Bedrock" or provider == "Sagemaker":printed.append((prompt, x["response"]))elif provider == "anthropic":blocks = [{"text": block.text} for block in x["response"].content if block.type == "text"]@@ -74,7 +74,7 @@ class LM(ABC):printing_value += prompttext = ""- if provider == "cohere":+ if provider == "cohere" or provider == "Bedrock" or provider == "Sagemaker":text = choiceselif provider == "openai" or provider == "ollama":text = ' ' + self._get_choice_text(choices[0]).strip()