siyah1 commited on
Commit
52d8119
·
verified ·
1 Parent(s): 7c22527

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
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) -> str:
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
- # Simply ignore kwargs that aren't needed and pass through to __call__
58
- return self.__call__(prompt)
 
 
 
 
 
 
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"""