mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-03 02:11:48 +00:00
tool dedup
This commit is contained in:
parent
8dccd6569e
commit
4939130485
18 changed files with 376 additions and 4288 deletions
|
|
@ -11,7 +11,6 @@ from __future__ import annotations
|
|||
from typing import Optional
|
||||
|
||||
from .base import Tool, ToolResult, ToolSchema
|
||||
from .basic_tools import BashTool
|
||||
|
||||
|
||||
class TerminalStatefulTool(Tool):
|
||||
|
|
@ -39,7 +38,8 @@ class TerminalStatefulTool(Tool):
|
|||
return True, None
|
||||
|
||||
async def execute(self, command: str, timeout: Optional[int] = None) -> ToolResult:
|
||||
# Fallback direct execution (not stateful) when used outside ToolExecutor.
|
||||
bash = BashTool(timeout=float(timeout) if timeout else 30.0)
|
||||
return await bash.execute(command=command)
|
||||
|
||||
_ = (command, timeout)
|
||||
return ToolResult(
|
||||
success=False,
|
||||
error="terminal_stateful must be executed via ToolExecutor inside the sandbox",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue