Get a context source's test run
/v1/context-sources/{slug}/test-runs/{runId}Get a context source's test run.
The run with its per-question results: the expected sections, the sections chosen within the budget, the status and the recall of each question.
Requires an organization admin key, or a key of the source's workspace. Returns 404 when the source or run does not exist.
Authorization
AuthorizationBearer va_A platform API key (
va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.
Path parameters
slugstringrequiredThe source's identifier (
ctx-...).runIdstringrequiredThe run's id.
Query parameters
organizationstringrequiredThe organization's identifier (slug).
Responses
idstringThe run's id.
statusenum<string>RUNNING,COMPLETEDorFAILED.One of
"RUNNING","COMPLETED","FAILED"virtual_keystringThe virtual key the selections ran on.
modelstringThe model that chose the sections.
budgetinteger<int32>Tokens of section text allowed per question.
case_countinteger<int32>Test cases in the run.
recallnumber<double>Mean section recall over the cases, 0 to 1. Absent until the run completes.
hit_ratenumber<double>Share of cases where at least one expected section was chosen, 0 to 1. Absent until the run completes.
freshbooleanTrue when the run skipped the selection cache, so every selection time is a real selection call.
select_p50_msinteger<int64>Median selection time over the questions not answered from the selection cache, in milliseconds. Absent until the run completes, or when every question came from the cache.
select_p95_msinteger<int64>95th-percentile selection time over the same questions, in milliseconds.
errorstringWhy the run failed.
resultsobject[]Per-case results, in the test set's order. Present when you get one run, absent in lists.
Child attributes
case_idstringThe test case's id.
expected_sectionsstring[]The sections the case expects.
selected_sectionsstring[]The sections the selection chose within the budget, most relevant first.
statusstringThe selection's status, as in
x-context-status.recallnumber<double>Share of the expected sections that were chosen, 0 to 1.
cachedbooleanTrue when the choice came from the selection cache.
select_msinteger<int64>Milliseconds the selection took (0 when every section fit the budget and none had to be chosen).
created_bystringWho started the run.
started_atstring<date-time>When the run started.
finished_atstring<date-time>When it finished.