Set the ambient run/scenario IDs read by the next :func:`agent_run_span`. CLIs call this once before invoking ``runner.run(...)``; the runner itself does not need to know about these identifiers.
(
*, run_id: str | None = None, scenario_id: str | None = None
)
| 21 | |
| 22 | |
| 23 | def set_run_context( |
| 24 | *, run_id: str | None = None, scenario_id: str | None = None |
| 25 | ) -> None: |
| 26 | """Set the ambient run/scenario IDs read by the next :func:`agent_run_span`. |
| 27 | |
| 28 | CLIs call this once before invoking ``runner.run(...)``; the runner itself |
| 29 | does not need to know about these identifiers. |
| 30 | """ |
| 31 | if run_id is not None: |
| 32 | _run_id_var.set(run_id) |
| 33 | if scenario_id is not None: |
| 34 | _scenario_id_var.set(scenario_id) |
| 35 | |
| 36 | |
| 37 | def _system_from_model(model_id: str) -> str: |
no outgoing calls