@roarkanalytics/sdk 4.23.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,13 @@ export class SimulationRunPlan extends APIResource {
13
13
  * plan or from an inline configuration, and takes runtime variables. Create a plan
14
14
  * here when you want a reusable, named one to run later.
15
15
  *
16
+ * Send `template` instead of a full configuration to save one of the built-in
17
+ * templates as a plan. It takes the same fields as the template variant of POST
18
+ * /v1/simulation/run, builds the same plan, and never starts it.
19
+ *
20
+ * To compare one property, attach the flow once and send `comparisonProperty` with
21
+ * the `comparisonValues` to run: the plan attaches the flow once per value.
22
+ *
16
23
  * @example
17
24
  * ```ts
18
25
  * const simulationRunPlan =
@@ -288,6 +295,13 @@ export namespace SimulationRunPlanCreateResponse {
288
295
  */
289
296
  silenceTimeoutSeconds: number;
290
297
 
298
+ /**
299
+ * The built-in template this plan was created from, as listed by GET
300
+ * /v1/simulation/template. `null` for a plan described field by field. Recorded
301
+ * once at creation: the plan does not follow later changes to the template.
302
+ */
303
+ template: string | null;
304
+
291
305
  /**
292
306
  * Total number of test cases generated from the plan configuration
293
307
  */
@@ -661,6 +675,13 @@ export namespace SimulationRunPlanUpdateResponse {
661
675
  */
662
676
  silenceTimeoutSeconds: number;
663
677
 
678
+ /**
679
+ * The built-in template this plan was created from, as listed by GET
680
+ * /v1/simulation/template. `null` for a plan described field by field. Recorded
681
+ * once at creation: the plan does not follow later changes to the template.
682
+ */
683
+ template: string | null;
684
+
664
685
  /**
665
686
  * Total number of test cases generated from the plan configuration
666
687
  */
@@ -998,6 +1019,13 @@ export namespace SimulationRunPlanListResponse {
998
1019
  */
999
1020
  silenceTimeoutSeconds: number;
1000
1021
 
1022
+ /**
1023
+ * The built-in template this plan was created from, as listed by GET
1024
+ * /v1/simulation/template. `null` for a plan described field by field. Recorded
1025
+ * once at creation: the plan does not follow later changes to the template.
1026
+ */
1027
+ template: string | null;
1028
+
1001
1029
  /**
1002
1030
  * Total number of test cases generated from the plan configuration
1003
1031
  */
@@ -1363,6 +1391,13 @@ export namespace SimulationRunPlanGetByIDResponse {
1363
1391
  */
1364
1392
  silenceTimeoutSeconds: number;
1365
1393
 
1394
+ /**
1395
+ * The built-in template this plan was created from, as listed by GET
1396
+ * /v1/simulation/template. `null` for a plan described field by field. Recorded
1397
+ * once at creation: the plan does not follow later changes to the template.
1398
+ */
1399
+ template: string | null;
1400
+
1366
1401
  /**
1367
1402
  * Total number of test cases generated from the plan configuration
1368
1403
  */
@@ -1525,390 +1560,789 @@ export namespace SimulationRunPlanGetByIDResponse {
1525
1560
  }
1526
1561
  }
1527
1562
 
1528
- export interface SimulationRunPlanCreateParams {
1529
- /**
1530
- * Agent endpoints to include in this run plan
1531
- */
1532
- agentEndpoints: Array<SimulationRunPlanCreateParams.AgentEndpoint>;
1533
-
1534
- /**
1535
- * Direction of the simulation (INBOUND or OUTBOUND)
1536
- */
1537
- direction: 'INBOUND' | 'OUTBOUND';
1538
-
1539
- /**
1540
- * Maximum duration in seconds for each simulation
1541
- */
1542
- maxSimulationDurationSeconds: number;
1543
-
1544
- /**
1545
- * Name of the run plan
1546
- */
1547
- name: string;
1548
-
1549
- /**
1550
- * @deprecated Deprecated: use POST /v1/simulation/run, which starts a run and
1551
- * accepts runtime `variables` as well. This flag runs the plan with only the
1552
- * values pinned on it.
1553
- */
1554
- autoRun?: boolean;
1555
-
1556
- /**
1557
- * The reference value of `comparisonProperty`, for example `NONE` for
1558
- * `BACKGROUND_NOISE` or `NORMAL` for `SPEECH_PACE`: shown first in the results.
1559
- * Must be a value that property can take. Whether a value did significantly worse
1560
- * does not depend on it: that is decided against every other value combined (see
1561
- * `sweepAttribution`).
1562
- *
1563
- * Stored rather than assumed, so the report can say "compared against US accent"
1564
- * instead of implying Roark decided which value is normal. Most properties have an
1565
- * obvious baseline and the dashboard prefills it; `GENDER` has none, so choose the
1566
- * one you are testing against.
1567
- */
1568
- comparisonBaseline?: string | null;
1569
-
1570
- /**
1571
- * The property this run plan investigates: the one thing its arms differ by.
1572
- *
1573
- * Set it and the run report compares the arms on that property, so a run answers
1574
- * "what did background noise cost" rather than just "what did each arm score".
1575
- * Every value is a field already recorded on each call, so the report can label an
1576
- * arm `CRYING_BABY` rather than repeating a flow variant's title.
1577
- *
1578
- * Omit it and the report still compares when it can: it detects which property
1579
- * varies across the arms. Setting it is what tells the written summary what you
1580
- * were trying to find out, which detection cannot infer.
1581
- */
1582
- comparisonProperty?:
1583
- | 'ACCENT'
1584
- | 'AGE'
1585
- | 'BACKGROUND_NOISE'
1586
- | 'BACKGROUND_NOISE_VOLUME'
1587
- | 'BASE_EMOTION'
1588
- | 'CONFIRMATION_STYLE'
1589
- | 'GENDER'
1590
- | 'INTENT_CLARITY'
1591
- | 'LANGUAGE'
1592
- | 'INTERRUPTION'
1593
- | 'MEMORY_RELIABILITY'
1594
- | 'RESPONSE_TIMING'
1595
- | 'SPEECH_CLARITY'
1596
- | 'SPEECH_PACE'
1597
- | null;
1598
-
1599
- /**
1600
- * Which values of `comparisonProperty` to run. This is what the plan costs: the
1601
- * flow is attached once per value, so ten values is ten times the calls of one.
1602
- *
1603
- * Omit it to run every value the property has, which for `ACCENT` is more than
1604
- * twenty. Send a subset to narrow the sweep, for example three accents you
1605
- * actually serve. A `comparisonBaseline` outside this set is rejected, because it
1606
- * would anchor every difference to an arm the run never made.
1607
- *
1608
- * Not stored as a field: the arms are the values. Reading the plan back returns
1609
- * them as its flow attachments.
1610
- */
1611
- comparisonValues?: Array<string>;
1612
-
1613
- /**
1614
- * Description of the run plan
1615
- */
1616
- description?: string;
1563
+ export type SimulationRunPlanCreateParams =
1564
+ | SimulationRunPlanCreateParams.CreateRunPlanFromConfig
1565
+ | SimulationRunPlanCreateParams.CreateRunPlanFromTemplate;
1617
1566
 
1618
- /**
1619
- * Phrases that trigger end of call. Empty array disables the feature.
1620
- */
1621
- endCallPhrases?: Array<string>;
1567
+ export declare namespace SimulationRunPlanCreateParams {
1568
+ export interface CreateRunPlanFromConfig {
1569
+ /**
1570
+ * Agent endpoints to include in this run plan
1571
+ */
1572
+ agentEndpoints: Array<CreateRunPlanFromConfig.AgentEndpoint>;
1622
1573
 
1623
- /**
1624
- * Semantic conditions that trigger end of call. The LLM evaluates the conversation
1625
- * against these conditions. Empty array disables the feature.
1626
- */
1627
- endCallReasons?: Array<string>;
1574
+ /**
1575
+ * Direction of the simulation (INBOUND or OUTBOUND)
1576
+ */
1577
+ direction: 'INBOUND' | 'OUTBOUND';
1628
1578
 
1629
- /**
1630
- * Merge the customer's own recording of the real call into each simulation, so
1631
- * metrics can be scored against the live leg as well as the simulated one. This is
1632
- * the API equivalent of the dashboard's live-enrichment toggle.
1633
- *
1634
- * With this on, the run provisions a phone number and holds each call open for up
1635
- * to 15 minutes waiting for a matching call to be posted to POST /v1/call. A call
1636
- * matches on the provisioned number (`roarkPhoneNumber` on the job) with a start
1637
- * time inside the simulation window. If nothing arrives, the simulation still
1638
- * completes and any `LIVE`-sourced metric produces no value.
1639
- *
1640
- * Required by any metric whose `requiresLiveConversation` is true: without it that
1641
- * metric is silently skipped.
1642
- */
1643
- enrichWithLiveConversation?: boolean;
1579
+ /**
1580
+ * Maximum duration in seconds for each simulation
1581
+ */
1582
+ maxSimulationDurationSeconds: number;
1644
1583
 
1645
- /**
1646
- * Execution mode (PARALLEL or SEQUENTIAL)
1647
- */
1648
- executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';
1584
+ /**
1585
+ * Name of the run plan
1586
+ */
1587
+ name: string;
1649
1588
 
1650
- /**
1651
- * Customer flows to include in this run plan. The same flow can appear more than
1652
- * once with a different persona override, different variables, or different
1653
- * `overrides`: attaching it once per value of one property is how you compare that
1654
- * property without a template.
1655
- */
1656
- flows?: Array<SimulationRunPlanCreateParams.Flow>;
1589
+ /**
1590
+ * @deprecated Deprecated: use POST /v1/simulation/run, which starts a run and
1591
+ * accepts runtime `variables` as well. This flag runs the plan with only the
1592
+ * values pinned on it.
1593
+ */
1594
+ autoRun?: boolean;
1657
1595
 
1658
- /**
1659
- * Let the run add metrics by itself off the attached flows, on top of the
1660
- * `metrics` named here.
1661
- *
1662
- * Two attach this way today: Agent Expectations wherever an attached flow has
1663
- * agent expectations written on it, and Keypad Entry wherever one has steps where
1664
- * the agent is expected to press keys. Both grade something authored on the flow
1665
- * that nothing else measures, which is why it is on by default.
1666
- *
1667
- * Set false when the `metrics` list is meant to be exhaustive: a plan testing only
1668
- * whether the caller can complete the flow may not want the agent graded on its
1669
- * expectations as well. False also pins the plan against any automatic metric
1670
- * Roark adds later.
1671
- */
1672
- includeAutomaticMetrics?: boolean;
1596
+ /**
1597
+ * The reference value of `comparisonProperty`, for example `NONE` for
1598
+ * `BACKGROUND_NOISE` or `NORMAL` for `SPEECH_PACE`: shown first in the results.
1599
+ * Must be a value that property can take. Whether a value did significantly worse
1600
+ * does not depend on it: that is decided against every other value combined (see
1601
+ * `sweepAttribution`).
1602
+ *
1603
+ * Stored rather than assumed, so the report can say "compared against US accent"
1604
+ * instead of implying Roark decided which value is normal. Omit it and the
1605
+ * property's own norm is used, as the dashboard prefills it, or none when your
1606
+ * `comparisonValues` leave the norm out. `GENDER` has no norm, so choose the one
1607
+ * you are testing against.
1608
+ */
1609
+ comparisonBaseline?: string | null;
1673
1610
 
1674
- /**
1675
- * Also collect each attached flow's own metrics, on top of the `metrics` named
1676
- * here.
1677
- *
1678
- * Default true, which is what you want when you brought your own flows and their
1679
- * graders. Set false for a run whose metric list is meant to be exhaustive: a
1680
- * template like Load Testing or Voicemail deliberately grades a narrow set, and
1681
- * inheriting every flow metric on top multiplies analysis cost across the volume
1682
- * without adding signal.
1683
- *
1684
- * GET /v1/simulation/template returns the value each template expects.
1685
- */
1686
- includeFlowMetrics?: boolean;
1611
+ /**
1612
+ * The property this run plan investigates: the one thing its arms differ by.
1613
+ *
1614
+ * Set it and the run report compares the arms on that property, so a run answers
1615
+ * "what did background noise cost" rather than just "what did each arm score".
1616
+ * Every value is a field already recorded on each call, so the report can label an
1617
+ * arm `CRYING_BABY` rather than repeating a flow variant's title.
1618
+ *
1619
+ * Omit it and the report still compares when it can: it detects which property
1620
+ * varies across the arms. Setting it is what tells the written summary what you
1621
+ * were trying to find out, which detection cannot infer.
1622
+ */
1623
+ comparisonProperty?:
1624
+ | 'ACCENT'
1625
+ | 'AGE'
1626
+ | 'BACKGROUND_NOISE'
1627
+ | 'BACKGROUND_NOISE_VOLUME'
1628
+ | 'BASE_EMOTION'
1629
+ | 'CONFIRMATION_STYLE'
1630
+ | 'GENDER'
1631
+ | 'INTENT_CLARITY'
1632
+ | 'LANGUAGE'
1633
+ | 'INTERRUPTION'
1634
+ | 'MEMORY_RELIABILITY'
1635
+ | 'RESPONSE_TIMING'
1636
+ | 'SPEECH_CLARITY'
1637
+ | 'SPEECH_PACE'
1638
+ | null;
1687
1639
 
1688
- /**
1689
- * Number of iterations to run for each test case (1-10000)
1690
- */
1691
- iterationCount?: number;
1640
+ /**
1641
+ * The arms to run, for a plan that sweeps `comparisonProperty`. This is what the
1642
+ * plan costs: the flow is attached once per arm, so ten arms is ten times the
1643
+ * calls of one.
1644
+ *
1645
+ * Attach each flow once, as you would without a comparison: the plan builds the
1646
+ * arms, running the happy path or edge cases you selected under every arm. Built
1647
+ * arms need at least 5 calls per arm (`iterationCount` times the test cases per
1648
+ * arm), or the plan is refused with `400`. Flows that all carry `overrides` on
1649
+ * `comparisonProperty` already are the arms and are kept as you wrote them; a mix
1650
+ * of flows with and without one is refused.
1651
+ *
1652
+ * Each entry is one arm. A bare value runs it plain: `"CITY"`. An object runs the
1653
+ * value with something pinned on that arm only, such as a noise level per bed:
1654
+ * `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }` plays OFFICE at 60% while
1655
+ * the other beds keep the default. List a value more than once with different pins
1656
+ * to run it as several arms: DRIVING at 0.7 and DRIVING at 1 are two arms,
1657
+ * reported as `Driving (70% noise)` and `Driving (100% noise)`, and `"DRIVING"`
1658
+ * beside them keeps the plain arm too. The sweep still varies one property; what
1659
+ * an arm pins is part of "everything else" for that arm only, so the report still
1660
+ * compares the arms on `comparisonProperty`.
1661
+ *
1662
+ * Omit it to run every value the property has, plain, which for `ACCENT` is more
1663
+ * than twenty. A `comparisonBaseline` outside the values listed is rejected,
1664
+ * because it would anchor every difference to an arm the run never made. A value
1665
+ * the property cannot take, a pin the sweep cannot account for, or the same arm
1666
+ * listed twice is rejected with `400`.
1667
+ *
1668
+ * Not stored as a field: the arms are the values. Reading the plan back returns
1669
+ * them as its flow attachments, each with its pins as `overrides`.
1670
+ */
1671
+ comparisonValues?: Array<string | CreateRunPlanFromConfig.ComparisonArm>;
1692
1672
 
1693
- /**
1694
- * Maximum number of concurrent simulation jobs
1695
- */
1696
- maxConcurrentJobs?: number;
1673
+ /**
1674
+ * Description of the run plan
1675
+ */
1676
+ description?: string;
1697
1677
 
1698
- /**
1699
- * How many more times to run a test case when the agent under test never responds:
1700
- * it never speaks on a call or never replies in a chat (0-10). 0 turns retries
1701
- * off. Failed checks and failures on Roark’s side are never retried.
1702
- *
1703
- * Each retry is a separate attempt, billed like any other, so a plan retrying N
1704
- * times can place up to N + 1 calls per test case. Every silent attempt stays on
1705
- * the run with its own call; the run settles once each test case has a final
1706
- * attempt, and the agent never spoke verdict is judged on each test case’s last
1707
- * attempt.
1708
- */
1709
- maxNoResponseRetries?: number;
1678
+ /**
1679
+ * Phrases that trigger end of call. Empty array disables the feature.
1680
+ */
1681
+ endCallPhrases?: Array<string>;
1710
1682
 
1711
- /**
1712
- * Metric definitions to include in this run plan. Reference each by `id` (UUID) or
1713
- * `slug`.
1714
- *
1715
- * Optional when the attached `flows` carry the grading: metrics a flow declares
1716
- * itself (with `includeFlowMetrics`), or the Agent Expectations and Keypad Entry
1717
- * metrics a run adds for flows with expectations or expected keypad entries (with
1718
- * `includeAutomaticMetrics`). A plan with nothing to grade is rejected with a 400.
1719
- */
1720
- metrics?: Array<SimulationRunPlanCreateParams.Metric>;
1683
+ /**
1684
+ * Semantic conditions that trigger end of call. The LLM evaluates the conversation
1685
+ * against these conditions. Empty array disables the feature.
1686
+ */
1687
+ endCallReasons?: Array<string>;
1721
1688
 
1722
- /**
1723
- * Seconds a retry waits before it dials (30-600). Only used when
1724
- * `maxNoResponseRetries` is above 0.
1725
- */
1726
- noResponseRetryBackoffSeconds?: number;
1689
+ /**
1690
+ * Merge the customer's own recording of the real call into each simulation, so
1691
+ * metrics can be scored against the live leg as well as the simulated one. This is
1692
+ * the API equivalent of the dashboard's live-enrichment toggle.
1693
+ *
1694
+ * With this on, the run provisions a phone number and holds each call open for up
1695
+ * to 15 minutes waiting for a matching call to be posted to POST /v1/call. A call
1696
+ * matches on the provisioned number (`roarkPhoneNumber` on the job) with a start
1697
+ * time inside the simulation window. If nothing arrives, the simulation still
1698
+ * completes and any `LIVE`-sourced metric produces no value.
1699
+ *
1700
+ * Required by any metric whose `requiresLiveConversation` is true: without it that
1701
+ * metric is silently skipped.
1702
+ */
1703
+ enrichWithLiveConversation?: boolean;
1727
1704
 
1728
- /**
1729
- * Personas to include in this run plan. Required with `scenarios`; ignored with
1730
- * `flows`, where each variant carries its own persona.
1731
- */
1732
- personas?: Array<SimulationRunPlanCreateParams.Persona>;
1705
+ /**
1706
+ * Execution mode (PARALLEL or SEQUENTIAL)
1707
+ */
1708
+ executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';
1733
1709
 
1734
- /**
1735
- * @deprecated Deprecated: use `flows` instead. Scenarios to include in this run
1736
- * plan. The same scenario ID can appear multiple times with different variables.
1737
- */
1738
- scenarios?: Array<SimulationRunPlanCreateParams.Scenario>;
1710
+ /**
1711
+ * Customer flows to include in this run plan. The same flow can appear more than
1712
+ * once with a different persona override, different variables, or different
1713
+ * `overrides`: attaching it once per value of one property is how you compare that
1714
+ * property without a template.
1715
+ */
1716
+ flows?: Array<CreateRunPlanFromConfig.Flow>;
1739
1717
 
1740
- /**
1741
- * Timeout in seconds for silence detection
1742
- */
1743
- silenceTimeoutSeconds?: number;
1744
- }
1718
+ /**
1719
+ * Let the run add metrics by itself off the attached flows, on top of the
1720
+ * `metrics` named here.
1721
+ *
1722
+ * Two attach this way today: Agent Expectations wherever an attached flow has
1723
+ * agent expectations written on it, and Keypad Entry wherever one has steps where
1724
+ * the agent is expected to press keys. Both grade something authored on the flow
1725
+ * that nothing else measures, which is why it is on by default.
1726
+ *
1727
+ * Set false when the `metrics` list is meant to be exhaustive: a plan testing only
1728
+ * whether the caller can complete the flow may not want the agent graded on its
1729
+ * expectations as well. False also pins the plan against any automatic metric
1730
+ * Roark adds later.
1731
+ */
1732
+ includeAutomaticMetrics?: boolean;
1745
1733
 
1746
- export namespace SimulationRunPlanCreateParams {
1747
- export interface AgentEndpoint {
1748
- id: string;
1749
- }
1734
+ /**
1735
+ * Also collect each attached flow's own metrics, on top of the `metrics` named
1736
+ * here.
1737
+ *
1738
+ * Default true, which is what you want when you brought your own flows and their
1739
+ * graders. Set false for a run whose metric list is meant to be exhaustive: a
1740
+ * template like Load Testing or Voicemail deliberately grades a narrow set, and
1741
+ * inheriting every flow metric on top multiplies analysis cost across the volume
1742
+ * without adding signal.
1743
+ *
1744
+ * GET /v1/simulation/template returns the value each template expects.
1745
+ */
1746
+ includeFlowMetrics?: boolean;
1750
1747
 
1751
- /**
1752
- * One customer flow attached to a run plan, and which of its ways of running you
1753
- * cover.
1754
- *
1755
- * Attaching the same flow more than once with different overrides is how you fan
1756
- * it out across personas or values.
1757
- */
1758
- export interface Flow {
1759
1748
  /**
1760
- * The customer flow to run.
1749
+ * Number of iterations to run for each test case (1-10000)
1761
1750
  */
1762
- id?: string;
1751
+ iterationCount?: number;
1763
1752
 
1764
1753
  /**
1765
- * `"ALL"` runs every edge case the flow has when the run starts, so one added
1766
- * later is covered. An array runs only the ones you name, each able to carry its
1767
- * own persona override and values.
1754
+ * Maximum number of concurrent simulation jobs
1768
1755
  */
1769
- edgeCases?: 'ALL' | Array<Flow.UnionMember1>;
1756
+ maxConcurrentJobs?: number;
1770
1757
 
1771
1758
  /**
1772
- * Run the flow's happy path. Resolved when the run starts, so it follows the flow.
1759
+ * How many more times to run a test case when the agent under test never responds:
1760
+ * it never speaks on a call or never replies in a chat (0-10). 0 turns retries
1761
+ * off. Failed checks and failures on Roark’s side are never retried.
1762
+ *
1763
+ * Each retry is a separate attempt, billed like any other, so a plan retrying N
1764
+ * times can place up to N + 1 calls per test case. Every silent attempt stays on
1765
+ * the run with its own call; the run settles once each test case has a final
1766
+ * attempt, and the agent never spoke verdict is judged on each test case’s last
1767
+ * attempt.
1773
1768
  */
1774
- happyPath?: boolean;
1769
+ maxNoResponseRetries?: number;
1775
1770
 
1776
1771
  /**
1777
- * Persona and environment properties to change for this attachment only, without
1778
- * editing the persona or the environment themselves. Each entry patches the
1779
- * per-run snapshot this attachment records, so the flow runs as a caller with that
1780
- * accent, or over that background noise, and everything else stays as authored.
1772
+ * Metric definitions to include in this run plan. Reference each by `id` (UUID) or
1773
+ * `slug`.
1781
1774
  *
1782
- * This is how you attach the same flow twice and vary one thing between them,
1783
- * which is what a sweep template builds for you. One value per property; a
1784
- * property named twice is rejected.
1775
+ * Optional when the attached `flows` carry the grading: metrics a flow declares
1776
+ * itself (with `includeFlowMetrics`), or the Agent Expectations and Keypad Entry
1777
+ * metrics a run adds for flows with expectations or expected keypad entries (with
1778
+ * `includeAutomaticMetrics`). A plan with nothing to grade is rejected with a 400.
1785
1779
  */
1786
- overrides?: Array<Flow.Override>;
1780
+ metrics?: Array<CreateRunPlanFromConfig.Metric>;
1787
1781
 
1788
1782
  /**
1789
- * Runs everything this attachment resolves as that persona instead of its own.
1783
+ * Seconds a retry waits before it dials (30-600). Only used when
1784
+ * `maxNoResponseRetries` is above 0.
1790
1785
  */
1791
- personaOverrideId?: string | null;
1786
+ noResponseRetryBackoffSeconds?: number;
1792
1787
 
1793
1788
  /**
1794
- * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
1795
- * you keep in version control: a curated flow’s id differs between deployments,
1796
- * its slug does not. Your own flows have no slug and are named by `id`.
1789
+ * Personas to include in this run plan. Required with `scenarios`; ignored with
1790
+ * `flows`, where each variant carries its own persona.
1797
1791
  */
1798
- slug?: string;
1792
+ personas?: Array<CreateRunPlanFromConfig.Persona>;
1799
1793
 
1800
1794
  /**
1801
- * Values for everything it resolves.
1795
+ * @deprecated Deprecated: use `flows` instead. Scenarios to include in this run
1796
+ * plan. The same scenario ID can appear multiple times with different variables.
1802
1797
  */
1803
- variables?: { [key: string]: string };
1804
- }
1798
+ scenarios?: Array<CreateRunPlanFromConfig.Scenario>;
1805
1799
 
1806
- export namespace Flow {
1807
- export interface UnionMember1 {
1800
+ /**
1801
+ * Timeout in seconds for silence detection
1802
+ */
1803
+ silenceTimeoutSeconds?: number;
1804
+ }
1805
+
1806
+ export namespace CreateRunPlanFromConfig {
1807
+ export interface AgentEndpoint {
1808
+ id: string;
1809
+ }
1810
+
1811
+ /**
1812
+ * One arm of a sweep: the swept value it runs, and what it pins besides that
1813
+ * value. The OFFICE arm of a BACKGROUND_NOISE sweep playing at 60% while the other
1814
+ * beds keep their level is `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }`.
1815
+ * The report compares the arms on the swept property only, so each sweep may pin
1816
+ * just what its experiment calls for: a BACKGROUND_NOISE sweep may pin
1817
+ * `backgroundNoiseVolume`, and no other sweep pins anything yet. A pin the sweep
1818
+ * cannot account for is rejected with `400`.
1819
+ */
1820
+ export interface ComparisonArm {
1808
1821
  /**
1809
- * The edge case to run.
1822
+ * The swept value this arm runs, a value of `comparisonProperty`.
1823
+ */
1824
+ value: string;
1825
+
1826
+ /**
1827
+ * The noise level this arm plays at, 0 to 1. The environment default is 0.1. Only
1828
+ * a `BACKGROUND_NOISE` sweep may pin it.
1829
+ */
1830
+ backgroundNoiseVolume?: number;
1831
+ }
1832
+
1833
+ /**
1834
+ * One customer flow attached to a run plan, and which of its ways of running you
1835
+ * cover.
1836
+ *
1837
+ * Attaching the same flow more than once with different overrides is how you fan
1838
+ * it out across personas or values.
1839
+ */
1840
+ export interface Flow {
1841
+ /**
1842
+ * The customer flow to run.
1810
1843
  */
1811
1844
  id?: string;
1812
1845
 
1813
1846
  /**
1814
- * Run this one as that persona instead of its own.
1847
+ * `"ALL"` runs every edge case the flow has when the run starts, so one added
1848
+ * later is covered. An array runs only the ones you name, each able to carry its
1849
+ * own persona override and values.
1850
+ */
1851
+ edgeCases?: 'ALL' | Array<Flow.UnionMember1>;
1852
+
1853
+ /**
1854
+ * Run the flow's happy path. Resolved when the run starts, so it follows the flow.
1855
+ */
1856
+ happyPath?: boolean;
1857
+
1858
+ /**
1859
+ * Persona and environment properties to change for this attachment only, without
1860
+ * editing the persona or the environment themselves. Each entry patches the
1861
+ * per-run snapshot this attachment records, so the flow runs as a caller with that
1862
+ * accent, or over that background noise, and everything else stays as authored.
1863
+ *
1864
+ * This is how you attach the same flow twice and vary one thing between them,
1865
+ * which is what a sweep template builds for you. One value per property; a
1866
+ * property named twice is rejected.
1867
+ */
1868
+ overrides?: Array<Flow.Override>;
1869
+
1870
+ /**
1871
+ * Runs everything this attachment resolves as that persona instead of its own.
1815
1872
  */
1816
1873
  personaOverrideId?: string | null;
1817
1874
 
1818
1875
  /**
1819
- * The edge case to run, by its stable slug, matched within this flow. Use instead
1820
- * of `id` for a run you keep in version control: a curated edge case’s id differs
1821
- * between deployments and changes outright if it is renamed. Your own edge cases
1822
- * have no slug and are named by `id`.
1876
+ * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
1877
+ * you keep in version control: a curated flow’s id differs between deployments,
1878
+ * its slug does not. Your own flows have no slug and are named by `id`.
1823
1879
  */
1824
1880
  slug?: string;
1825
1881
 
1826
1882
  /**
1827
- * Values for this one only.
1883
+ * Values for everything it resolves.
1828
1884
  */
1829
1885
  variables?: { [key: string]: string };
1830
1886
  }
1831
1887
 
1832
- /**
1833
- * One persona or environment property, changed for this flow attachment only.
1834
- */
1835
- export interface Override {
1836
- property:
1837
- | 'ACCENT'
1838
- | 'AGE'
1839
- | 'BACKGROUND_NOISE'
1840
- | 'BACKGROUND_NOISE_VOLUME'
1841
- | 'BASE_EMOTION'
1842
- | 'CONFIRMATION_STYLE'
1843
- | 'GENDER'
1844
- | 'INTENT_CLARITY'
1845
- | 'LANGUAGE'
1846
- | 'INTERRUPTION'
1847
- | 'MEMORY_RELIABILITY'
1848
- | 'RESPONSE_TIMING'
1849
- | 'SPEECH_CLARITY'
1850
- | 'SPEECH_PACE';
1888
+ export namespace Flow {
1889
+ export interface UnionMember1 {
1890
+ /**
1891
+ * The edge case to run.
1892
+ */
1893
+ id?: string;
1851
1894
 
1852
- value: string;
1895
+ /**
1896
+ * Run this one as that persona instead of its own.
1897
+ */
1898
+ personaOverrideId?: string | null;
1899
+
1900
+ /**
1901
+ * The edge case to run, by its stable slug, matched within this flow. Use instead
1902
+ * of `id` for a run you keep in version control: a curated edge case’s id differs
1903
+ * between deployments and changes outright if it is renamed. Your own edge cases
1904
+ * have no slug and are named by `id`.
1905
+ */
1906
+ slug?: string;
1907
+
1908
+ /**
1909
+ * Values for this one only.
1910
+ */
1911
+ variables?: { [key: string]: string };
1912
+ }
1913
+
1914
+ /**
1915
+ * One persona or environment property, changed for this flow attachment only.
1916
+ */
1917
+ export interface Override {
1918
+ property:
1919
+ | 'ACCENT'
1920
+ | 'AGE'
1921
+ | 'BACKGROUND_NOISE'
1922
+ | 'BACKGROUND_NOISE_VOLUME'
1923
+ | 'BASE_EMOTION'
1924
+ | 'CONFIRMATION_STYLE'
1925
+ | 'GENDER'
1926
+ | 'INTENT_CLARITY'
1927
+ | 'LANGUAGE'
1928
+ | 'INTERRUPTION'
1929
+ | 'MEMORY_RELIABILITY'
1930
+ | 'RESPONSE_TIMING'
1931
+ | 'SPEECH_CLARITY'
1932
+ | 'SPEECH_PACE';
1933
+
1934
+ value: string;
1935
+ }
1936
+ }
1937
+
1938
+ export interface Metric {
1939
+ /**
1940
+ * Metric definition UUID. Provide either this or `slug`, not both.
1941
+ */
1942
+ id?: string;
1943
+
1944
+ /**
1945
+ * Which side of an enriched run this metric is scored on. Only meaningful with
1946
+ * `enrichWithLiveConversation: true`, where a run has both a simulated
1947
+ * conversation and the customer's own live recording of it.
1948
+ *
1949
+ * Defaults to `SIMULATED`. Use `LIVE` for a metric that must be measured against
1950
+ * the real recording (audio quality, provider latency) rather than the simulated
1951
+ * leg. `null` means the same as omitting it, so a plan read back from GET can be
1952
+ * sent straight to PUT.
1953
+ */
1954
+ conversationSource?: 'SIMULATED' | 'LIVE' | null;
1955
+
1956
+ /**
1957
+ * Alias of `slug` accepted for backwards compatibility. Use `slug` for new
1958
+ * integrations.
1959
+ */
1960
+ metricId?: string;
1961
+
1962
+ /**
1963
+ * THE BAR, and the only thing that decides pass/fail. The share of the run's
1964
+ * simulations that must pass this check, 0-100.
1965
+ *
1966
+ * Applied to this check alone and never pooled: silence duration at 40 and word
1967
+ * count at 80 means the run fails unless 40% of sims clear silence AND 80% clear
1968
+ * word count. Omit or `null` for the 80% default.
1969
+ */
1970
+ minPassRate?: number | null;
1971
+
1972
+ /**
1973
+ * Stable metric slug (e.g. `customer_satisfaction`). Provide either this or `id`,
1974
+ * not both.
1975
+ */
1976
+ slug?: string;
1977
+ }
1978
+
1979
+ export interface Persona {
1980
+ id: string;
1981
+ }
1982
+
1983
+ export interface Scenario {
1984
+ /**
1985
+ * Scenario ID
1986
+ */
1987
+ id: string;
1988
+
1989
+ /**
1990
+ * Template variables for this scenario instance. The same scenario can appear
1991
+ * multiple times with different variables.
1992
+ */
1993
+ variables?: { [key: string]: string };
1853
1994
  }
1854
1995
  }
1855
1996
 
1856
- export interface Metric {
1997
+ export interface CreateRunPlanFromTemplate {
1857
1998
  /**
1858
- * Metric definition UUID. Provide either this or `slug`, not both.
1999
+ * The agent endpoints to call. No template can know these.
1859
2000
  */
1860
- id?: string;
2001
+ agentEndpoints: Array<CreateRunPlanFromTemplate.AgentEndpoint>;
1861
2002
 
1862
2003
  /**
1863
- * Which side of an enriched run this metric is scored on. Only meaningful with
1864
- * `enrichWithLiveConversation: true`, where a run has both a simulated
1865
- * conversation and the customer's own live recording of it.
2004
+ * Direction of the simulation (INBOUND or OUTBOUND)
2005
+ */
2006
+ direction: 'INBOUND' | 'OUTBOUND';
2007
+
2008
+ /**
2009
+ * The template to run, as listed by GET /v1/simulation/template.
2010
+ */
2011
+ template: string;
2012
+
2013
+ /**
2014
+ * Metrics to collect on top of the template's own, referenced by `id` or `slug`
2015
+ * like a plan's `metrics`. The template's metrics and checks always run; naming
2016
+ * one of them here again keeps it once, with the success criteria you set on it.
2017
+ */
2018
+ additionalMetrics?: Array<CreateRunPlanFromTemplate.AdditionalMetric>;
2019
+
2020
+ /**
2021
+ * The sweep's reference value, shown first in the results. Defaults to the
2022
+ * template's own baseline, as returned by GET /v1/simulation/template. Whether a
2023
+ * value did significantly worse does not depend on it: that is decided against
2024
+ * every other value combined.
1866
2025
  *
1867
- * Defaults to `SIMULATED`. Use `LIVE` for a metric that must be measured against
1868
- * the real recording (audio quality, provider latency) rather than the simulated
1869
- * leg. `null` means the same as omitting it, so a plan read back from GET can be
1870
- * sent straight to PUT.
2026
+ * Send it with `comparisonValues` and it must be one of them, or the request is
2027
+ * rejected: anchoring every difference to an arm the run never made would measure
2028
+ * it against nothing. Leave it out and the template's own baseline is used, and
2029
+ * quietly dropped if your narrowing excluded it, since that one you did not
2030
+ * choose.
1871
2031
  */
1872
- conversationSource?: 'SIMULATED' | 'LIVE' | null;
2032
+ comparisonBaseline?: string | null;
1873
2033
 
1874
2034
  /**
1875
- * Alias of `slug` accepted for backwards compatibility. Use `slug` for new
1876
- * integrations.
2035
+ * The arms of the sweep to run, for a template that sweeps one (GET
2036
+ * /v1/simulation/template returns `sweep.property` for those that do). This is
2037
+ * what the run costs: the flow is called once per arm, so ten arms is ten times
2038
+ * the calls of one.
2039
+ *
2040
+ * Omit it to run every value the property has, plain, which for `accent-handling`
2041
+ * is more than twenty. Send a subset to narrow it, for example the three accents
2042
+ * you actually serve. An object entry pins something on that arm only, such as a
2043
+ * noise level per bed on `background-noise-robustness`:
2044
+ * `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }` plays OFFICE at 60% while
2045
+ * the other beds keep the default. See `POST /v1/simulation/plan`.
1877
2046
  */
1878
- metricId?: string;
2047
+ comparisonValues?: Array<string | CreateRunPlanFromTemplate.ComparisonArm>;
1879
2048
 
1880
2049
  /**
1881
- * THE BAR, and the only thing that decides pass/fail. The share of the run's
1882
- * simulations that must pass this check, 0-100.
2050
+ * Phrases that trigger end of call. Empty array disables the feature.
2051
+ */
2052
+ endCallPhrases?: Array<string>;
2053
+
2054
+ /**
2055
+ * Semantic conditions that trigger end of call. The LLM evaluates the conversation
2056
+ * against these conditions. Defaults to the template's `defaultEndCallReasons`, as
2057
+ * returned by GET /v1/simulation/template. Pass an empty array to run with none.
2058
+ */
2059
+ endCallReasons?: Array<string>;
2060
+
2061
+ /**
2062
+ * Merge the customer's own recording of the real call into each simulation, so
2063
+ * metrics can be scored against the live leg as well as the simulated one. This is
2064
+ * the API equivalent of the dashboard's live-enrichment toggle.
1883
2065
  *
1884
- * Applied to this check alone and never pooled: silence duration at 40 and word
1885
- * count at 80 means the run fails unless 40% of sims clear silence AND 80% clear
1886
- * word count. Omit or `null` for the 80% default.
2066
+ * With this on, the run provisions a phone number and holds each call open for up
2067
+ * to 15 minutes waiting for a matching call to be posted to POST /v1/call. A call
2068
+ * matches on the provisioned number (`roarkPhoneNumber` on the job) with a start
2069
+ * time inside the simulation window. If nothing arrives, the simulation still
2070
+ * completes and any `LIVE`-sourced metric produces no value.
2071
+ *
2072
+ * Required by any metric whose `requiresLiveConversation` is true: without it that
2073
+ * metric is silently skipped.
1887
2074
  */
1888
- minPassRate?: number | null;
2075
+ enrichWithLiveConversation?: boolean;
1889
2076
 
1890
2077
  /**
1891
- * Stable metric slug (e.g. `customer_satisfaction`). Provide either this or `id`,
1892
- * not both.
2078
+ * For `question-answer-check`: the environment the calls run in.
1893
2079
  */
1894
- slug?: string;
1895
- }
2080
+ environmentId?: string;
1896
2081
 
1897
- export interface Persona {
1898
- id: string;
2082
+ /**
2083
+ * Execution mode (PARALLEL or SEQUENTIAL)
2084
+ */
2085
+ executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';
2086
+
2087
+ /**
2088
+ * The flows to run, in the same shape a run plan takes them.
2089
+ *
2090
+ * Required when the template lists no flows of its own: it presets what to
2091
+ * measure, and this says what to measure it on. Optional when it does, where these
2092
+ * REPLACE the ones it would have run, so you can narrow a suite to the cases you
2093
+ * care about. Either way, GET /v1/simulation/template lists the flows and variant
2094
+ * ids each template covers.
2095
+ *
2096
+ * On a template that sweeps a property, every value runs exactly what you select
2097
+ * here: the happy path, the edge cases you name, or `edgeCases: "ALL"`. Each
2098
+ * selected case is a call per value per iteration, so naming three edge cases
2099
+ * triples the run.
2100
+ */
2101
+ flows?: Array<CreateRunPlanFromTemplate.Flow>;
2102
+
2103
+ /**
2104
+ * Runs per test case (1-10000). Defaults to 1, or to 6 for a template that sweeps
2105
+ * a property. A sweep needs at least 5 calls per value (test cases per value times
2106
+ * iterations) to compare its values, and a lower count is refused with 400.
2107
+ */
2108
+ iterationCount?: number;
2109
+
2110
+ /**
2111
+ * Maximum number of concurrent simulation jobs
2112
+ */
2113
+ maxConcurrentJobs?: number;
2114
+
2115
+ /**
2116
+ * How many more times to run a test case when the agent under test never responds:
2117
+ * it never speaks on a call or never replies in a chat (0-10). 0 turns retries
2118
+ * off. Failed checks and failures on Roark’s side are never retried.
2119
+ *
2120
+ * Each retry is a separate attempt, billed like any other, so a plan retrying N
2121
+ * times can place up to N + 1 calls per test case. Every silent attempt stays on
2122
+ * the run with its own call; the run settles once each test case has a final
2123
+ * attempt, and the agent never spoke verdict is judged on each test case’s last
2124
+ * attempt.
2125
+ */
2126
+ maxNoResponseRetries?: number;
2127
+
2128
+ /**
2129
+ * Defaults to the template's `defaultMaxSimulationDurationSeconds`, as returned by
2130
+ * GET /v1/simulation/template.
2131
+ */
2132
+ maxSimulationDurationSeconds?: number;
2133
+
2134
+ /**
2135
+ * Name of the run plan. Defaults to the template's name and the date.
2136
+ */
2137
+ name?: string;
2138
+
2139
+ /**
2140
+ * Seconds a retry waits before it dials (30-600). Only used when
2141
+ * `maxNoResponseRetries` is above 0.
2142
+ */
2143
+ noResponseRetryBackoffSeconds?: number;
2144
+
2145
+ /**
2146
+ * For `question-answer-check`: the persona that asks the questions.
2147
+ */
2148
+ personaId?: string;
2149
+
2150
+ /**
2151
+ * For the `question-answer-check` template: the questions to ask and the answer
2152
+ * expected for each. Every question runs as its own graded call.
2153
+ */
2154
+ questions?: Array<CreateRunPlanFromTemplate.Question>;
2155
+
2156
+ /**
2157
+ * Timeout in seconds for silence detection
2158
+ */
2159
+ silenceTimeoutSeconds?: number;
1899
2160
  }
1900
2161
 
1901
- export interface Scenario {
2162
+ export namespace CreateRunPlanFromTemplate {
2163
+ export interface AgentEndpoint {
2164
+ id: string;
2165
+ }
2166
+
2167
+ export interface AdditionalMetric {
2168
+ /**
2169
+ * Metric definition UUID. Provide either this or `slug`, not both.
2170
+ */
2171
+ id?: string;
2172
+
2173
+ /**
2174
+ * Which side of an enriched run this metric is scored on. Only meaningful with
2175
+ * `enrichWithLiveConversation: true`, where a run has both a simulated
2176
+ * conversation and the customer's own live recording of it.
2177
+ *
2178
+ * Defaults to `SIMULATED`. Use `LIVE` for a metric that must be measured against
2179
+ * the real recording (audio quality, provider latency) rather than the simulated
2180
+ * leg. `null` means the same as omitting it, so a plan read back from GET can be
2181
+ * sent straight to PUT.
2182
+ */
2183
+ conversationSource?: 'SIMULATED' | 'LIVE' | null;
2184
+
2185
+ /**
2186
+ * Alias of `slug` accepted for backwards compatibility. Use `slug` for new
2187
+ * integrations.
2188
+ */
2189
+ metricId?: string;
2190
+
2191
+ /**
2192
+ * THE BAR, and the only thing that decides pass/fail. The share of the run's
2193
+ * simulations that must pass this check, 0-100.
2194
+ *
2195
+ * Applied to this check alone and never pooled: silence duration at 40 and word
2196
+ * count at 80 means the run fails unless 40% of sims clear silence AND 80% clear
2197
+ * word count. Omit or `null` for the 80% default.
2198
+ */
2199
+ minPassRate?: number | null;
2200
+
2201
+ /**
2202
+ * Stable metric slug (e.g. `customer_satisfaction`). Provide either this or `id`,
2203
+ * not both.
2204
+ */
2205
+ slug?: string;
2206
+ }
2207
+
1902
2208
  /**
1903
- * Scenario ID
2209
+ * One arm of a sweep: the swept value it runs, and what it pins besides that
2210
+ * value. The OFFICE arm of a BACKGROUND_NOISE sweep playing at 60% while the other
2211
+ * beds keep their level is `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }`.
2212
+ * The report compares the arms on the swept property only, so each sweep may pin
2213
+ * just what its experiment calls for: a BACKGROUND_NOISE sweep may pin
2214
+ * `backgroundNoiseVolume`, and no other sweep pins anything yet. A pin the sweep
2215
+ * cannot account for is rejected with `400`.
1904
2216
  */
1905
- id: string;
2217
+ export interface ComparisonArm {
2218
+ /**
2219
+ * The swept value this arm runs, a value of `comparisonProperty`.
2220
+ */
2221
+ value: string;
2222
+
2223
+ /**
2224
+ * The noise level this arm plays at, 0 to 1. The environment default is 0.1. Only
2225
+ * a `BACKGROUND_NOISE` sweep may pin it.
2226
+ */
2227
+ backgroundNoiseVolume?: number;
2228
+ }
1906
2229
 
1907
2230
  /**
1908
- * Template variables for this scenario instance. The same scenario can appear
1909
- * multiple times with different variables.
2231
+ * One customer flow attached to a run plan, and which of its ways of running you
2232
+ * cover.
2233
+ *
2234
+ * Attaching the same flow more than once with different overrides is how you fan
2235
+ * it out across personas or values.
1910
2236
  */
1911
- variables?: { [key: string]: string };
2237
+ export interface Flow {
2238
+ /**
2239
+ * The customer flow to run.
2240
+ */
2241
+ id?: string;
2242
+
2243
+ /**
2244
+ * `"ALL"` runs every edge case the flow has when the run starts, so one added
2245
+ * later is covered. An array runs only the ones you name, each able to carry its
2246
+ * own persona override and values.
2247
+ */
2248
+ edgeCases?: 'ALL' | Array<Flow.UnionMember1>;
2249
+
2250
+ /**
2251
+ * Run the flow's happy path. Resolved when the run starts, so it follows the flow.
2252
+ */
2253
+ happyPath?: boolean;
2254
+
2255
+ /**
2256
+ * Persona and environment properties to change for this attachment only, without
2257
+ * editing the persona or the environment themselves. Each entry patches the
2258
+ * per-run snapshot this attachment records, so the flow runs as a caller with that
2259
+ * accent, or over that background noise, and everything else stays as authored.
2260
+ *
2261
+ * This is how you attach the same flow twice and vary one thing between them,
2262
+ * which is what a sweep template builds for you. One value per property; a
2263
+ * property named twice is rejected.
2264
+ */
2265
+ overrides?: Array<Flow.Override>;
2266
+
2267
+ /**
2268
+ * Runs everything this attachment resolves as that persona instead of its own.
2269
+ */
2270
+ personaOverrideId?: string | null;
2271
+
2272
+ /**
2273
+ * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
2274
+ * you keep in version control: a curated flow’s id differs between deployments,
2275
+ * its slug does not. Your own flows have no slug and are named by `id`.
2276
+ */
2277
+ slug?: string;
2278
+
2279
+ /**
2280
+ * Values for everything it resolves.
2281
+ */
2282
+ variables?: { [key: string]: string };
2283
+ }
2284
+
2285
+ export namespace Flow {
2286
+ export interface UnionMember1 {
2287
+ /**
2288
+ * The edge case to run.
2289
+ */
2290
+ id?: string;
2291
+
2292
+ /**
2293
+ * Run this one as that persona instead of its own.
2294
+ */
2295
+ personaOverrideId?: string | null;
2296
+
2297
+ /**
2298
+ * The edge case to run, by its stable slug, matched within this flow. Use instead
2299
+ * of `id` for a run you keep in version control: a curated edge case’s id differs
2300
+ * between deployments and changes outright if it is renamed. Your own edge cases
2301
+ * have no slug and are named by `id`.
2302
+ */
2303
+ slug?: string;
2304
+
2305
+ /**
2306
+ * Values for this one only.
2307
+ */
2308
+ variables?: { [key: string]: string };
2309
+ }
2310
+
2311
+ /**
2312
+ * One persona or environment property, changed for this flow attachment only.
2313
+ */
2314
+ export interface Override {
2315
+ property:
2316
+ | 'ACCENT'
2317
+ | 'AGE'
2318
+ | 'BACKGROUND_NOISE'
2319
+ | 'BACKGROUND_NOISE_VOLUME'
2320
+ | 'BASE_EMOTION'
2321
+ | 'CONFIRMATION_STYLE'
2322
+ | 'GENDER'
2323
+ | 'INTENT_CLARITY'
2324
+ | 'LANGUAGE'
2325
+ | 'INTERRUPTION'
2326
+ | 'MEMORY_RELIABILITY'
2327
+ | 'RESPONSE_TIMING'
2328
+ | 'SPEECH_CLARITY'
2329
+ | 'SPEECH_PACE';
2330
+
2331
+ value: string;
2332
+ }
2333
+ }
2334
+
2335
+ export interface Question {
2336
+ /**
2337
+ * The question the caller asks the agent.
2338
+ */
2339
+ ask: string;
2340
+
2341
+ /**
2342
+ * The answer the agent must give, judged against the transcript.
2343
+ */
2344
+ expect: string;
2345
+ }
1912
2346
  }
1913
2347
  }
1914
2348
 
@@ -1937,10 +2371,11 @@ export interface SimulationRunPlanUpdateParams {
1937
2371
  * The property this plan investigates. Send `null` to clear the comparison; omit
1938
2372
  * the field to leave it unchanged. See `POST /v1/simulation/plan`.
1939
2373
  *
1940
- * The pair moves together. Sending `comparisonProperty` also sets
1941
- * `comparisonBaseline` to whatever this request carries, or to `null` if it
1942
- * carries none, because a baseline is a value of one specific property and keeping
1943
- * the old one would store a pair that is not valid.
2374
+ * The pair moves together. Sending `comparisonProperty` without
2375
+ * `comparisonBaseline` keeps the stored baseline when the property is unchanged
2376
+ * and the baseline is still one of the values being run. Otherwise it becomes the
2377
+ * new property's norm, or `null` when that norm is not being run either, because a
2378
+ * baseline is a value of one specific property.
1944
2379
  */
1945
2380
  comparisonProperty?:
1946
2381
  | 'ACCENT'
@@ -1960,13 +2395,14 @@ export interface SimulationRunPlanUpdateParams {
1960
2395
  | null;
1961
2396
 
1962
2397
  /**
1963
- * Which values of `comparisonProperty` to run. See `POST /v1/simulation/plan`.
2398
+ * The arms to run. See `POST /v1/simulation/plan`.
1964
2399
  *
1965
- * Omitting it keeps the arms the plan already has, so an edit that only renames
1966
- * the plan never widens a sweep you deliberately narrowed, and never multiplies
1967
- * what it costs.
2400
+ * Omitting it keeps the arms the plan already has, pins included, so an edit that
2401
+ * only renames the plan never widens a sweep you deliberately narrowed, and never
2402
+ * multiplies what it costs. Send it with `comparisonProperty` and `flows`, which
2403
+ * the arms are rebuilt from.
1968
2404
  */
1969
- comparisonValues?: Array<string>;
2405
+ comparisonValues?: Array<string | SimulationRunPlanUpdateParams.ComparisonArm>;
1970
2406
 
1971
2407
  /**
1972
2408
  * Description of the run plan
@@ -2095,6 +2531,28 @@ export namespace SimulationRunPlanUpdateParams {
2095
2531
  id: string;
2096
2532
  }
2097
2533
 
2534
+ /**
2535
+ * One arm of a sweep: the swept value it runs, and what it pins besides that
2536
+ * value. The OFFICE arm of a BACKGROUND_NOISE sweep playing at 60% while the other
2537
+ * beds keep their level is `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }`.
2538
+ * The report compares the arms on the swept property only, so each sweep may pin
2539
+ * just what its experiment calls for: a BACKGROUND_NOISE sweep may pin
2540
+ * `backgroundNoiseVolume`, and no other sweep pins anything yet. A pin the sweep
2541
+ * cannot account for is rejected with `400`.
2542
+ */
2543
+ export interface ComparisonArm {
2544
+ /**
2545
+ * The swept value this arm runs, a value of `comparisonProperty`.
2546
+ */
2547
+ value: string;
2548
+
2549
+ /**
2550
+ * The noise level this arm plays at, 0 to 1. The environment default is 0.1. Only
2551
+ * a `BACKGROUND_NOISE` sweep may pin it.
2552
+ */
2553
+ backgroundNoiseVolume?: number;
2554
+ }
2555
+
2098
2556
  /**
2099
2557
  * One customer flow attached to a run plan, and which of its ways of running you
2100
2558
  * cover.