Dave Aitel
08/25/2024, 5:01 PMclass CommandRunnerInput(BaseModel):
command: str = Field(..., description="The command to execute")
class CommandRunnerTool(BaseTool):
name = "CommandRunnerTool"
description = "Tool to execute a shell command. Returns the STDOUT and STDERR from the executed command."
args_schema = CommandRunnerInput
def _run(self, command: str) -> str:
"""
Function to call the Python runner API endpoint.
Args:
code (str): The Python code to send to the API.
Returns:
str: The result from the API
"""
print("Commmand Runner Tool running %s" % command)