name.
LLM judges
- The prompt is a plain string in TypeScript, inline or read from a file. In YAML it is inline or
file://. name,typeandscopeare immutable once created: changing one fails that resource. To change them, give the metric a newname. Editing the prompt, labels, bounds or options creates a new version.contextswithTURNorSEGMENTmust also includeCALL, because checks and reports read the call-level value. A metric grades either each exchange or each utterance, not both:[CALL, TURN]and[CALL, SEGMENT]are valid,[TURN]and[CALL, TURN, SEGMENT]are not.
API checks
An API check is a pass/fail metric your own endpoint answers. SetcalculationType: HTTP_REQUEST and describe the request Roark sends after each call.
- URL, headers, and body can use placeholders. A placeholder that doesn’t exist fails that resource’s apply.
- The file is the source of truth for the request: a header or body you remove from the file is removed from the check, and labels you remove go back to
PassandFail. Each change creates a new version. nameandcalculationTypeare immutable. A metric can’t switch between an LLM judge and an API check: apply fails that resource instead.- Headers are stored as you write them. In TypeScript, read tokens from the environment rather than committing them.
Thresholds
A threshold checks another metric against a bar and passes or fails. SetcalculationType: THRESHOLD, name the metric it checks in sourceMetric, and give the comparison.
defineThreshold needs @roarkanalytics/sdk 6.0.0 or later.
- The comparison is immutable.
sourceMetric,sourceVariant,operator,value,aggregationMode,countThresholdandsourceParticipantRolecan’t change once the threshold exists, as in Roark. To change the bar, give the threshold a newname: apply creates the new one, and removes the old one when you prune. Only the labels can be edited in place. A value written differently but equal, such as4and4.0, is not a change. - Roark names the threshold from its comparison (for example
Response Time <= 2000 (Agent)), the same as one made in Roark. - A threshold and its source can be in the same config. Apply creates the source first, and removes the threshold first when you prune both.
- If a threshold with the same comparison already exists in the project, apply fails that resource and names the existing one: reference it by its slug instead.
metrics:, gate a simulation plan on it, alert on it, or chart its pass rate on a dashboard.
System metrics (Roark’s built-in metrics) are managed by Roark, not by you: you never define
them in config. To collect one, just reference its slug in a collector’s
metrics: list, exactly
like a custom metric. The same is true for formulas and patterns, which are not yet definable in
config: create them in Studio or through the API, then reference them by slug.For the full field reference of every kind, see the Config DSL reference schema.