DSPy: The framework for programming—not prompting—language models
Python
Fix: Make sure Base LM builds on self.kwargs (#8104)
Timo Koehler2513472b6e68
diff --git a/dspy/clients/base_lm.py b/dspy/clients/base_lm.pyindex c0a181232..7d05e408c 100644--- a/dspy/clients/base_lm.py+++ b/dspy/clients/base_lm.py@@ -49,7 +49,8 @@ class BaseLM(ABC):self.history = []def _process_lm_response(self, response, prompt, messages, **kwargs):- if kwargs.get("logprobs"):+ merged_kwargs = {**self.kwargs, **kwargs}+ if merged_kwargs.get("logprobs"):outputs = [{"text": c.message.content if hasattr(c, "message") else c["text"],