Skip to content

chat_agent

SensAI top-level chat agent - delegates to the domain agents and replies in plain text.

ask_job_status_agent async

Python
ask_job_status_agent(
    ctx: RunContext[SensAIDeps], request: str
) -> JobStatus | None

Forward a job-status request to the job-status agent and return its answer.

Parameters:

Name Type Description Default
ctx RunContext[SensAIDeps]

The calling agent's run context - ctx.model (the same FallbackModel this run was given) has to be passed through explicitly, since job_status_agent has no model= of its own to fall back on; ctx.deps/ctx.usage share dashboard state and token accounting with the nested run the same way.

required
request str

The request to hand off, in natural language (e.g. "how far along is the job?" or "what happened on trial 12?").

required

Returns:

Type Description
JobStatus | None

The current job status, or None if no job is loaded.

Source code in src/mujoco_mojo/utils/layers/dojo/sensai/chat_agent.py
Python
@chat_agent.tool
async def ask_job_status_agent(
    ctx: RunContext[SensAIDeps], request: str
) -> JobStatus | None:
    """
    Forward a job-status request to the job-status agent and return its answer.

    Args:
        ctx: The calling agent's run context - `ctx.model` (the same `FallbackModel` this run was given) has to be passed through explicitly, since `job_status_agent` has no `model=` of its own to fall back on; `ctx.deps`/`ctx.usage` share dashboard state and token accounting with the nested run the same way.
        request: The request to hand off, in natural language (e.g. "how far along is the job?" or "what happened on trial 12?").

    Returns:
        The current job status, or None if no job is loaded.

    """
    result = await job_status_agent.run(
        request, model=_delegate_model(ctx), deps=ctx.deps, usage=ctx.usage
    )
    return result.output

ask_column_manifest_agent async

Python
ask_column_manifest_agent(
    ctx: RunContext[SensAIDeps], request: str
) -> ColumnManifest

Forward a signal-column request to the column-manifest agent and return its answer.

Parameters:

Name Type Description Default
ctx RunContext[SensAIDeps]

The calling agent's run context - ctx.model (the same FallbackModel this run was given) has to be passed through explicitly, since column_manifest_agent has no model= of its own to fall back on; ctx.deps/ctx.usage share dashboard state and token accounting with the nested run the same way.

required
request str

The request to hand off, in natural language (e.g. "what signals can I plot?").

required

Returns:

Type Description
ColumnManifest

The current column manifest.

Source code in src/mujoco_mojo/utils/layers/dojo/sensai/chat_agent.py
Python
@chat_agent.tool
async def ask_column_manifest_agent(
    ctx: RunContext[SensAIDeps], request: str
) -> ColumnManifest:
    """
    Forward a signal-column request to the column-manifest agent and return its answer.

    Args:
        ctx: The calling agent's run context - `ctx.model` (the same `FallbackModel` this run was given) has to be passed through explicitly, since `column_manifest_agent` has no `model=` of its own to fall back on; `ctx.deps`/`ctx.usage` share dashboard state and token accounting with the nested run the same way.
        request: The request to hand off, in natural language (e.g. "what signals can I plot?").

    Returns:
        The current column manifest.

    """
    result = await column_manifest_agent.run(
        request, model=_delegate_model(ctx), deps=ctx.deps, usage=ctx.usage
    )
    return result.output

ask_plot_config_agent async

Python
ask_plot_config_agent(
    ctx: RunContext[SensAIDeps], request: str
) -> PlotConfig | None

Forward a plot request to the plot-config agent and return its answer.

Use this for any request about the trial viewer plot: reading its current state, editing it (colors, axes, grid, signals, ...), or saving/loading/deleting it as a named profile.

Parameters:

Name Type Description Default
ctx RunContext[SensAIDeps]

The calling agent's run context - ctx.model (the same FallbackModel this run was given) has to be passed through explicitly, since plot_config_agent has no model= of its own to fall back on; ctx.deps/ctx.usage share dashboard state and token accounting with the nested run the same way.

required
request str

The request to hand off, in natural language (e.g. "make the box_acc:y line red" or "save this as robotics/baseline").

required

Returns:

Type Description
PlotConfig | None

The resulting plot config (current, edited, saved, or loaded).

Source code in src/mujoco_mojo/utils/layers/dojo/sensai/chat_agent.py
Python
@chat_agent.tool
async def ask_plot_config_agent(
    ctx: RunContext[SensAIDeps], request: str
) -> PlotConfig | None:
    """
    Forward a plot request to the plot-config agent and return its answer.

    Use this for any request about the trial viewer plot: reading its current state, editing \
    it (colors, axes, grid, signals, ...), or saving/loading/deleting it as a named profile.

    Args:
        ctx: The calling agent's run context - `ctx.model` (the same `FallbackModel` this run was given) has to be passed through explicitly, since `plot_config_agent` has no `model=` of its own to fall back on; `ctx.deps`/`ctx.usage` share dashboard state and token accounting with the nested run the same way.
        request: The request to hand off, in natural language (e.g. "make the box_acc:y line red" or "save this as robotics/baseline").

    Returns:
        The resulting plot config (current, edited, saved, or loaded).

    """
    result = await plot_config_agent.run(
        request, model=_delegate_model(ctx), deps=ctx.deps, usage=ctx.usage
    )
    return result.output