Skip to content

trading_agent.tools.bash_check_tool

The bash_check tool: reports on a background job.

Typical usage example:

tool = BashCheckTool(session)

JobArguments

Bases: BaseModel

The arguments of bash_check.

Attributes:

Name Type Description
job_id str

The identifier bash_background returned.

BashCheckTool

BashCheckTool(session)

Bases: BashTool

Says whether a background job is still running.

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)

Checks the job.

Parameters:

Name Type Description Default
arguments JobArguments

The job id.

required

Returns:

Type Description
ToolResult

"running" or "finished", then the end of the job's output.

Source code in src/trading_agent/tools/bash_check_tool.py
async def run(self, arguments: JobArguments) -> tool.ToolResult:
    """Checks the job.

    Args:
        arguments (JobArguments): The job id.

    Returns:
        tool.ToolResult: "running" or "finished", then the end of the job's output.
    """
    outcome = await self._session.check_background(arguments.job_id)
    return self._result_from(outcome)