MCPcopy
hub / github.com/IBM/AssetOpsBench / set_run_context

Function set_run_context

src/observability/runspan.py:23–34  ·  view source on GitHub ↗

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
)

Source from the content-addressed store, hash-verified

21
22
23def 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
37def _system_from_model(model_id: str) -> str:

Calls

no outgoing calls