wip(backend/tool): tool collection and execution is now agents job
This commit is contained in:
1 parent
f3a8376df6
commit
2ba8096a3c
2 files changed
+103
-87
No files matched your search
@@ -183,6 +183,18 @@ class Agent:
|
||||
return [r for r in self.resources
|
||||
if r.kind == kind and (key is None or r.key == key)]
|
||||
|
||||
def get_tools(self, run=None):
|
||||
"""Collect the tools available to this agent.
|
||||
|
||||
Returns the agent-configured tools (derived from its resources) plus
|
||||
any remote tools referenced by the run input. When a run is given,
|
||||
remote names in ``run.input['remotes']`` are resolved and appended.
|
||||
"""
|
||||
tools = list(self.tools)
|
||||
if run is not None and 'remotes' in run.input:
|
||||
tools += self.app.getRemoteTools(self.user_id, run.input['remotes'])
|
||||
return tools
|
||||
|
||||
|
||||
class DebugAgent(Agent):
|
||||
identifier = "debug"
|
||||
|
||||
Reference in new issue
Block a user