Spaces:
Sleeping
Sleeping
| # agents/groq_compound.py | |
| from groq import Groq | |
| import os | |
| class GroqCompoundAgent: | |
| """Wrapper around Groq’s compound-beta model for GAIA scoring.""" | |
| def __init__(self, model: str = "compound-beta-mini", temperature: float = 0.2): | |
| self.client = Groq(api_key=os.getenv("GROQ_API_KEY")) | |
| self.model = model | |
| self.temperature = temperature | |
| def __call__(self, question: str) -> str: | |
| resp = self.client.chat.completions.create( | |
| model=self.model, | |
| messages=[ | |
| { | |
| "role": "system", | |
| "content": ( | |
| "You are a careful GAIA solver. " | |
| "Think step-by-step, use tools when helpful, " | |
| "and then return ONLY the final answer on one line." | |
| ), | |
| }, | |
| {"role": "user", "content": question}, | |
| ], | |
| temperature=self.temperature, | |
| max_tokens=512, | |
| ) | |
| return resp.choices[0].message.content.strip() | |