DSPy: The framework for programming—not prompting—language models
Python
adding the inspect_history
Somesh Fengade9f4b07af115f
diff --git a/dsp/modules/groq_client.py b/dsp/modules/groq_client.pyindex 44c591538..14b1b7096 100644--- a/dsp/modules/groq_client.py+++ b/dsp/modules/groq_client.py@@ -1,7 +1,7 @@import loggingimport osimport json-from typing import Any, Literal, Optional+from typing import Any, Literal, Optional, Requiredimport backofffrom groq import Groq, AsyncGroqimport groq@@ -42,15 +42,18 @@ class GroqLM(LM):def __init__(self,+ api_key: str,model: str = "mixtral-8x7b-32768",- api_key: Optional[str] = None,**kwargs,):super().__init__(model)-+ self.provider = "groq"if api_key:self.api_key = api_keyself.client = Groq(api_key = api_key)+ else:+ raise ValueError("api_key is required for groq")+self.kwargs = {"temperature": 0.0,@@ -85,7 +88,7 @@ class GroqLM(LM):history = {"prompt": prompt,- "response": response,+ "response": response.choices[0].message.content,"kwargs": kwargs,"raw_kwargs": raw_kwargs,}