feat(observatory): admit canonical recorded replay
This commit is contained in:
@@ -341,10 +341,16 @@ def build_session_router(
|
||||
limit: int = Query(default=20, ge=1, le=100),
|
||||
cursor: str | None = Query(default=None, max_length=128),
|
||||
scope: Literal["all", "source", "laboratory"] = "all",
|
||||
lab_contract: Literal["v1", "v2"] = "v1",
|
||||
) -> dict[str, Any]:
|
||||
try:
|
||||
_refresh_catalog(catalog_refresher)
|
||||
page = store.list_recent(limit=limit, cursor=cursor, scope=scope)
|
||||
page = store.list_recent(
|
||||
limit=limit,
|
||||
cursor=cursor,
|
||||
scope=scope,
|
||||
include_capability_projections=lab_contract == "v2",
|
||||
)
|
||||
return {
|
||||
"items": [
|
||||
{
|
||||
@@ -356,7 +362,15 @@ def build_session_router(
|
||||
"modalities": list(item.modalities),
|
||||
"duration_seconds": item.duration_seconds or 0.0,
|
||||
"replayable": item.replayable,
|
||||
**({"lab": item.lab.as_dict()} if item.lab is not None else {}),
|
||||
**(
|
||||
{
|
||||
"lab": item.lab.as_dict(
|
||||
include_replay_capability=lab_contract == "v2"
|
||||
)
|
||||
}
|
||||
if item.lab is not None
|
||||
else {}
|
||||
),
|
||||
**(
|
||||
{
|
||||
"preparation": _catalog_preparation_document(
|
||||
|
||||
Reference in New Issue
Block a user