chat_agent
¶
SensAI top-level chat agent - delegates to the domain agents and replies in plain text.
PlotEditFailed
¶
Bases: Exception
The plot agent could not make the change. The message is what to tell the user, and the chat agent is not asked to put it in its own words: a model that was told the change failed would keep sending the same request to the plot agent again.
usage_limits
¶
usage_limits(max_requests: int) -> UsageLimits
The cap on model requests for one chat message, to pass to the chat agent's run and to each specialist's run so that the specialists count against the same total (they share the run's usage).
max_requests is dojo.sensai.max_requests. A request takes one to three (route it, edit, answer) and a refused edit adds one to three more, so the default of 12 leaves room to correct a mistake or two. When a model loops, or rate limits make every request cost several attempts, it is what stops the message from sending dozens.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/chat_agent.py
ask_job_status_agent
async
¶
ask_job_status_agent(
ctx: RunContext[SensAIDeps], request: str
) -> str
Forward a job-status request to the job-status agent and return its answer. It knows the job's progress, trials, timing, errors and logs, and the input distributions the trials were sampled from and what each trial drew.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The calling agent's run context - |
required |
request
|
str
|
The request to hand off, in natural language (e.g. "how far along is the job?", "which trials are running?", "which trial took the longest?" or "what range is the wind speed sampled from?" or "which trials drew a high wind speed?"). |
required |
Returns:
| Type | Description |
|---|---|
str
|
The answer, in words, with the numbers and trial numbers from the job's status. Say it as it is: do not round or change them. |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/chat_agent.py
ask_column_manifest_agent
async
¶
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 - |
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
ask_docs_agent
async
¶
ask_docs_agent(
ctx: RunContext[SensAIDeps], request: str
) -> str
Forward a question about how to use MuJoCo Mojo, or what changed in a release, to the docs agent and return its answer.
Use this for "how do I..." and "what is..." questions about Mojo itself: installing it, starting a project, the generate and runtime scripts, running Monte Carlo jobs, SLURM, the Dojo, Reloaded, requirements, optimization, the examples, which setting does what, and what changed in a release. It answers from the Mojo docs (the user guides, the command line reference and the changelog) and the list of settings, and links the page.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The calling agent's run context - |
required |
request
|
str
|
The question, in natural language, such as "how do I submit a job to SLURM?". |
required |
Returns:
| Type | Description |
|---|---|
str
|
The answer, with the steps or code it found and a link to the page. Pass it on to the user as it is. |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/chat_agent.py
ask_plot_config_agent
async
¶
ask_plot_config_agent(
ctx: RunContext[SensAIDeps], request: str
) -> str
Forward a plot request to the plot-config agent and return what it did or found.
Use this for any request about the trial viewer plot: reading its current state, changing it (colors, axes, grid, signals, filters, ...), loading a saved plot profile, or versus mode (showing other trials, such as the ones that failed a requirement, behind this one). The plot itself is updated by the agent; you only report what it says.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The calling agent's run context - |
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 |
|---|---|
str
|
A short description of what was changed or found. |