Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,16 +46,25 @@ class GroqLLM:
|
|
46 |
print(error_msg)
|
47 |
return error_msg
|
48 |
|
49 |
-
def generate(self, prompt: Union[str, dict, List[Dict]], **kwargs) ->
|
50 |
"""Add generate method to make compatible with smolagents CodeAgent
|
51 |
|
52 |
Args:
|
53 |
prompt: The prompt to send to the model
|
54 |
**kwargs: Additional keyword arguments to support CodeAgent API
|
55 |
(stop_sequences, etc.) - these are ignored in the Groq implementation
|
|
|
|
|
|
|
56 |
"""
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
class DataAnalysisAgent(CodeAgent):
|
61 |
"""Extended CodeAgent with dataset awareness"""
|
|
|
46 |
print(error_msg)
|
47 |
return error_msg
|
48 |
|
49 |
+
def generate(self, prompt: Union[str, dict, List[Dict]], **kwargs) -> object:
|
50 |
"""Add generate method to make compatible with smolagents CodeAgent
|
51 |
|
52 |
Args:
|
53 |
prompt: The prompt to send to the model
|
54 |
**kwargs: Additional keyword arguments to support CodeAgent API
|
55 |
(stop_sequences, etc.) - these are ignored in the Groq implementation
|
56 |
+
|
57 |
+
Returns:
|
58 |
+
An object with a 'content' attribute containing the response text
|
59 |
"""
|
60 |
+
response_text = self.__call__(prompt)
|
61 |
+
|
62 |
+
# Create a simple object with a content attribute
|
63 |
+
class Response:
|
64 |
+
def __init__(self, content):
|
65 |
+
self.content = content
|
66 |
+
|
67 |
+
return Response(response_text)
|
68 |
|
69 |
class DataAnalysisAgent(CodeAgent):
|
70 |
"""Extended CodeAgent with dataset awareness"""
|