Skip to content

trading_agent.tools.bash_restart_tool

The bash_restart tool: gives the desk a fresh terminal.

Typical usage example:

tool = BashRestartTool(session)

BashRestartTool

BashRestartTool(session)

Bases: BashTool

Restarts the desk's terminal.

Source code in src/trading_agent/tools/bash_tool.py
def __init__(self, session: bash_session_module.BashSession):
    """Creates the tool.

    Args:
        session (bash_session_module.BashSession): The desk's terminal.
    """
    self._session = session

run async

run(arguments)

Restarts the terminal.

Parameters:

Name Type Description Default
arguments NoArguments

No arguments.

required

Returns:

Type Description
ToolResult

A confirmation.

Source code in src/trading_agent/tools/bash_restart_tool.py
async def run(self, arguments: tool.NoArguments) -> tool.ToolResult:
    """Restarts the terminal.

    Args:
        arguments (tool.NoArguments): No arguments.

    Returns:
        tool.ToolResult: A confirmation.
    """
    del arguments
    await self._session.restart()
    return tool.ToolResult.success('The terminal was restarted.')