Agent actions and gral function. Need agent classes to separate advanced agent functionality.
This commit is contained in:
1 parent
c3e55e89f2
commit
9a8e68f021
8 files changed
+222
-53
No files matched your search
@@ -22,10 +22,12 @@ class Toolset:
|
||||
return "\n".join(lines)
|
||||
|
||||
async def execute_action(toolset, name: str, argument: dict):
|
||||
# TODO: For security, check that the method is in the tool list
|
||||
method = getattr(toolset, name)
|
||||
result = method(**argument)
|
||||
if inspect.isawaitable(result):
|
||||
result = await result
|
||||
return result
|
||||
|
||||
class ToolDescription:
|
||||
def __init__(self, identifier, description, schema):
|
||||
|
||||
Reference in new issue
Block a user