Rudraprasad commited on
Commit
943f8f1
·
verified ·
1 Parent(s): f0bc20c

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +5 -1
agents.py CHANGED
@@ -14,7 +14,7 @@ from smolagents import CodeAgent, DuckDuckGoSearchTool, VisitWebpageTool, Wikipe
14
  from langchain_groq import ChatGroq
15
 
16
  # === WRAPPER CLASS TO FIX 'content' ERROR ===
17
- from langchain_core.messages import AIMessage # <-- import AIMessage
18
 
19
  class WrappedChatGroq(ChatGroq):
20
  def invoke(self, *args, **kwargs):
@@ -23,6 +23,10 @@ class WrappedChatGroq(ChatGroq):
23
  return AIMessage(content=result["content"])
24
  return result
25
 
 
 
 
 
26
  # === TOOLS ===
27
  class GetTaskFileTool(Tool):
28
  name = "get_task_file_tool"
 
14
  from langchain_groq import ChatGroq
15
 
16
  # === WRAPPER CLASS TO FIX 'content' ERROR ===
17
+ from langchain_core.messages import AIMessage
18
 
19
  class WrappedChatGroq(ChatGroq):
20
  def invoke(self, *args, **kwargs):
 
23
  return AIMessage(content=result["content"])
24
  return result
25
 
26
+ def __call__(self, *args, **kwargs):
27
+ return self.invoke(*args, **kwargs)
28
+
29
+
30
  # === TOOLS ===
31
  class GetTaskFileTool(Tool):
32
  name = "get_task_file_tool"