wip: add tools to agent control and improve tool class
This commit is contained in:
1 parent
6134c026a6
commit
9585008433
7 files changed
+144
-13
No files matched your search
+5
-1
@@ -41,6 +41,9 @@ class App(ChatMixin):
|
||||
agents_mod.ExpertAgent,
|
||||
]
|
||||
|
||||
from features.calc import Calc
|
||||
self.tool_classes = [Calc]
|
||||
|
||||
# --- Connection Management (Synchronous) ---
|
||||
|
||||
def on_event(self, callback):
|
||||
@@ -231,12 +234,13 @@ class App(ChatMixin):
|
||||
|
||||
async def get_agent_control(self, agent_id):
|
||||
agent = await self.get_agent(agent_id)
|
||||
resources = await self.get_agent_resources(agent_id)
|
||||
|
||||
agent_class = next((kind for kind in self.agent_classes if kind.identifier == agent.kind), None)
|
||||
if agent_class is None:
|
||||
raise Exception(f"invalid agent kind: {agent.kind}")
|
||||
|
||||
control = agent_class(self, agent.data)
|
||||
control = agent_class(self, agent.data, resources)
|
||||
control._set_basic_info(agent_id, agent.name, agent.user_id)
|
||||
return control
|
||||
|
||||
|
||||
Reference in new issue
Block a user