plot_config_agent
¶
SensAI domain agent for the trial viewer plot: reads the plot config, changes it with small edits, and loads saved profiles.
current_plot
async
¶
current_plot(ctx: RunContext[SensAIDeps]) -> str
The plot as it is now, as JSON with every default value left out, so it is short. It is built for every request to the model, so it already shows an edit made a moment ago.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
find_signals
async
¶
find_signals(
ctx: RunContext[SensAIDeps], query: str
) -> list[str] | list[dict[str, str]] | str
Searches this trial's signals by name, and by description where they have one, so a signal can be named exactly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The run context holding the dashboard state; it is not something you send. |
required |
query
|
str
|
Words from the name or from what the signal measures, such as 'box1 xpos' or 'box1 angular velocity'. Case and separators (spaces, |
required |
Returns:
| Type | Description |
|---|---|
list[str] | list[dict[str, str]] | str
|
Up to 25 exact signal names containing every word, shortest first; the closest spellings if none contain them all. When the trial's signals have descriptions, each is an object with its |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
add_signals
async
¶
add_signals(
ctx: RunContext[SensAIDeps], names: list[str]
) -> str
Plots more signals, each in an automatic color. The signals already plotted stay plotted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The run context holding the dashboard state; it is not something you send. |
required |
names
|
list[str]
|
The exact names of the signals to plot, such as ["Bodies/box2/xvelr:y"]. One that is not a signal of this trial is refused, with the closest real names. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Which parts of the plot changed. |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
edit_signal
async
¶
Changes how one plotted signal is drawn. Whatever you leave out of changes stays as it is.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The run context holding the dashboard state; it is not something you send. |
required |
name
|
str
|
The exact name of a signal that is plotted now, such as "Bodies/box1/xvelr:y". To plot one that is not, call add_signals first. |
required |
changes
|
dict[str, Any]
|
Only the signal's fields to change, such as {"color": "#ff2056", "width": 4} or {"label": "spin", "dash": "dot"}. The fields are listed under "Signal fields". A color is one from the palette in your instructions. Never null. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Which parts of the plot changed. |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
edit_plot_config
async
¶
edit_plot_config(
ctx: RunContext[SensAIDeps], changes: dict[str, Any]
) -> str
Changes plot-wide fields such as the title, grid, axis ranges, legend or x-axis column. Whatever you leave out stays as it is. To add, remove or restyle signals use add_signals, remove_signals and edit_signal instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The run context holding the dashboard state; it is not something you send. |
required |
changes
|
dict[str, Any]
|
Only the fields to change, such as {"title": "Wheel speed", "grid": "none", "rangeX": [0, 5]} or {"xAxis": {"col": "time"}}. The fields are listed under "Plot-wide fields". Never null, except null for rangeX or rangeY to make a range automatic. A field that does not exist or a value that is not allowed is refused with the reason. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Which parts of the plot changed. |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
remove_signals
async
¶
remove_signals(
ctx: RunContext[SensAIDeps], names: list[str]
) -> str
Stops plotting signals. The signals that are not named stay plotted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The run context holding the dashboard state; it is not something you send. |
required |
names
|
list[str]
|
The exact names of the plotted signals to stop plotting, such as ["Bodies/box2/xvelr:y"]. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Which parts of the plot changed. |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
current_versus
async
¶
current_versus(ctx: RunContext[SensAIDeps]) -> str | None
Versus mode as it is now, rebuilt for every request so it shows a change made a moment ago. Nothing when there is no trial viewer to change it.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
set_versus
async
¶
set_versus(
ctx: RunContext[SensAIDeps],
enabled: bool | None = None,
trial_range: list[int] | None = None,
no_range: bool = False,
pin: list[int] | None = None,
unpin: list[int] | None = None,
failed_requirement: str | None = None,
input_outliers: str | None = None,
min_sigma: float = 2.0,
clear_pins: bool = False,
) -> str
Changes versus mode, which draws other trials' traces behind the open trial's. What you leave out stays as it is, and pinned trials are added to the ones pinned already.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The run context holding the dashboard state; it is not something you send. |
required |
enabled
|
bool | None
|
True to show the comparison traces and false to turn versus mode off, such as true. Leave it out to keep it as it is: pinning trials or setting a range turns it on by itself. |
None
|
trial_range
|
list[int] | None
|
The first and last trial number to compare, such as [3, 9]. It replaces the range from before. Leave it out to keep the range. |
None
|
no_range
|
bool
|
True to compare only the pinned trials, with no range, such as true. Use it with pin or failed_requirement when the user wants only those trials. |
False
|
pin
|
list[int] | None
|
Trial numbers the user named, to add to the pinned ones, such as [12, 15]. For the trials that failed a requirement use failed_requirement, and for the ones that drew an input far from its mean use input_outliers; never write those numbers yourself. |
None
|
unpin
|
list[int] | None
|
Trial numbers to stop comparing, such as [12]. |
None
|
failed_requirement
|
str | None
|
Pins the trials that missed a requirement, found by the server. A requirement's name or part of it, such as "touchdown_speed", or "any" for the trials that missed any requirement, or "error" for the trials that crashed. |
None
|
input_outliers
|
str | None
|
Pins the trials that drew a sampled input far from its mean, found by the server. The input's name or part of it, such as "wind_speed". How far is min_sigma. |
None
|
min_sigma
|
float
|
How many standard deviations from its mean an input must have been drawn for input_outliers to pin the trial, such as 2 (the default) or 3. It is only used with input_outliers. |
2.0
|
clear_pins
|
bool
|
True to drop every pinned trial first, such as true, when the user wants other trials instead of the ones shown now. |
False
|
Returns:
| Type | Description |
|---|---|
str
|
What versus mode is set to now, and how many trials were left out if there were too many to add in one message. |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
| Python | |
|---|---|
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | |
describe_filters
async
¶
describe_filters(
ctx: RunContext[SensAIDeps],
filter_type: str | None = None,
) -> str
Describes the filters a signal or the x-axis can have.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The run context holding the dashboard state; it is not something you send. |
required |
filter_type
|
str | None
|
One filter type from the list, to get its parameters and how to write it. Leave it out to list every type. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The list of filter types, or the one type's parameters. |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
list_saved_plot_configs
¶
List the names of every saved plot config profile.
Returns:
| Type | Description |
|---|---|
list[str]
|
Every saved profile's name (including sub-folder paths, e.g. 'robotics/baseline'), most recently modified first. |
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/plot_config_agent.py
load_plot_config
async
¶
load_plot_config(
ctx: RunContext[SensAIDeps], name: str
) -> str
Load a previously saved plot config profile by name, replacing the plot with it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
RunContext[SensAIDeps]
|
The run context holding the dashboard state; it is not something you send. |
required |
name
|
str
|
The profile name to load, e.g. 'robotics/baseline'. |
required |
Returns:
| Type | Description |
|---|---|
str
|
What was loaded. |
Raises:
| Type | Description |
|---|---|
ModelRetry
|
If no profile with this name exists, so the caller can retry with a corrected name. |