Spaces:
Build error
Build error
Update agents.py
Browse files
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
|
| 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"
|