@roarkanalytics/sdk 6.1.0 → 6.2.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.
@@ -0,0 +1,3036 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class LiveReport extends APIResource {
9
+ /**
10
+ * Saves a report on the project's live calls. Simulations are never included.
11
+ *
12
+ * Targets are analytics measures held to a bar: a threshold metric is read as its
13
+ * pass rate (`value` is a percentage, 0-100, held AT_LEAST by default); a numeric
14
+ * metric as its average (held AT_MOST by default). Every target is read for the
15
+ * period and the period before it, so the report says whether each was met and how
16
+ * it moved.
17
+ *
18
+ * Scheduled reports are written `deliveryHour` hours into the day after each
19
+ * period ends in `timezone` (a week runs Monday to Sunday), then emailed and
20
+ * posted per `notifications`. With `generateNow` (the default) the report for the
21
+ * latest closed period is written right away and not sent.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const liveReport = await client.liveReport.create({
26
+ * name: 'x',
27
+ * });
28
+ * ```
29
+ */
30
+ create(body: LiveReportCreateParams, options?: RequestOptions): APIPromise<LiveReportCreateResponse> {
31
+ return this._client.post('/v1/live-report', { body, ...options });
32
+ }
33
+
34
+ /**
35
+ * Changes the fields sent. Set `status` to PAUSED to stop scheduled reports.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const liveReport = await client.liveReport.update(
40
+ * '5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f',
41
+ * );
42
+ * ```
43
+ */
44
+ update(
45
+ reportID: string,
46
+ body: LiveReportUpdateParams | null | undefined = {},
47
+ options?: RequestOptions,
48
+ ): APIPromise<LiveReportUpdateResponse> {
49
+ return this._client.patch(path`/v1/live-report/${reportID}`, { body, ...options });
50
+ }
51
+
52
+ /**
53
+ * Lists the project's saved live call reports, newest first.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const liveReports = await client.liveReport.list();
58
+ * ```
59
+ */
60
+ list(
61
+ query: LiveReportListParams | null | undefined = {},
62
+ options?: RequestOptions,
63
+ ): APIPromise<LiveReportListResponse> {
64
+ return this._client.get('/v1/live-report', { query, ...options });
65
+ }
66
+
67
+ /**
68
+ * Deletes the report and stops its scheduled reports.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const liveReport = await client.liveReport.delete(
73
+ * '5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f',
74
+ * );
75
+ * ```
76
+ */
77
+ delete(reportID: string, options?: RequestOptions): APIPromise<LiveReportDeleteResponse> {
78
+ return this._client.delete(path`/v1/live-report/${reportID}`, options);
79
+ }
80
+
81
+ /**
82
+ * Get a live report
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * const response = await client.liveReport.getByID(
87
+ * '5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f',
88
+ * );
89
+ * ```
90
+ */
91
+ getByID(reportID: string, options?: RequestOptions): APIPromise<LiveReportGetByIDResponse> {
92
+ return this._client.get(path`/v1/live-report/${reportID}`, options);
93
+ }
94
+
95
+ /**
96
+ * Returns one written report. `document` is null until `status` is READY. Theme
97
+ * excerpts and grader quotes (call transcript text) are included only for keys
98
+ * with transcript:read.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const response = await client.liveReport.getDocument(
103
+ * '9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b',
104
+ * { reportId: '5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f' },
105
+ * );
106
+ * ```
107
+ */
108
+ getDocument(
109
+ documentID: string,
110
+ params: LiveReportGetDocumentParams,
111
+ options?: RequestOptions,
112
+ ): APIPromise<LiveReportGetDocumentResponse> {
113
+ const { reportId } = params;
114
+ return this._client.get(path`/v1/live-report/${reportId}/document/${documentID}`, options);
115
+ }
116
+
117
+ /**
118
+ * Lists a report's documents, newest period first.
119
+ *
120
+ * @example
121
+ * ```ts
122
+ * const response =
123
+ * await client.liveReport.listDocuments('reportId');
124
+ * ```
125
+ */
126
+ listDocuments(
127
+ reportID: string,
128
+ query: LiveReportListDocumentsParams | null | undefined = {},
129
+ options?: RequestOptions,
130
+ ): APIPromise<LiveReportListDocumentsResponse> {
131
+ return this._client.get(path`/v1/live-report/${reportID}/document`, { query, ...options });
132
+ }
133
+
134
+ /**
135
+ * Writes the report now, for its latest closed period or a custom window
136
+ * (`periodStart` + `periodEnd`, at most 92 days, ended). Returns 202 with the
137
+ * document in PENDING; poll GET /v1/live-report/{reportId}/document/{documentId}
138
+ * until `status` is READY or FAILED (typically a few minutes). An identical
139
+ * request already in flight is returned as-is. A generated document is not
140
+ * emailed.
141
+ *
142
+ * @example
143
+ * ```ts
144
+ * const response = await client.liveReport.run(
145
+ * '5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f',
146
+ * );
147
+ * ```
148
+ */
149
+ run(
150
+ reportID: string,
151
+ body: LiveReportRunParams | null | undefined = {},
152
+ options?: RequestOptions,
153
+ ): APIPromise<LiveReportRunResponse> {
154
+ return this._client.post(path`/v1/live-report/${reportID}/generate`, { body, ...options });
155
+ }
156
+ }
157
+
158
+ export interface LiveReportCreateResponse {
159
+ data: LiveReportCreateResponse.Data;
160
+ }
161
+
162
+ export namespace LiveReportCreateResponse {
163
+ export interface Data {
164
+ id: string;
165
+
166
+ agentId: string | null;
167
+
168
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY';
169
+
170
+ configKey: string | null;
171
+
172
+ /**
173
+ * Managed by config as code: read-only here (edits return 409).
174
+ */
175
+ configManaged: boolean;
176
+
177
+ createdAt: string;
178
+
179
+ dashboardId: string | null;
180
+
181
+ deliveryHour: number;
182
+
183
+ description: string | null;
184
+
185
+ filters: Array<Data.Filter>;
186
+
187
+ includeTranscriptExcerpts: boolean;
188
+
189
+ name: string;
190
+
191
+ /**
192
+ * When the next scheduled report is written. Null while the report is paused.
193
+ */
194
+ nextDeliveryAt: string | null;
195
+
196
+ notifications: Data.Notifications;
197
+
198
+ projectId: string;
199
+
200
+ status: 'ACTIVE' | 'PAUSED';
201
+
202
+ targets: Array<Data.Target>;
203
+
204
+ timezone: string;
205
+
206
+ updatedAt: string;
207
+ }
208
+
209
+ export namespace Data {
210
+ export interface Filter {
211
+ /**
212
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
213
+ */
214
+ type:
215
+ | 'METRIC_PROPERTY'
216
+ | 'CALL_PROPERTY'
217
+ | 'AGENT_PROPERTY'
218
+ | 'CALL_ID'
219
+ | 'MODALITY'
220
+ | 'DATASET'
221
+ | 'METRIC_VALUE';
222
+
223
+ /**
224
+ * Defaults to EQUALS. IS_SET / IS_NOT_SET (CALL_PROPERTY only) keep conversations
225
+ * where the property is set, whatever the value, or missing (never sent, sent as
226
+ * null, or removed); they take no value.
227
+ */
228
+ operator?:
229
+ | 'EQUALS'
230
+ | 'NOT_EQUALS'
231
+ | 'GREATER_THAN'
232
+ | 'GREATER_THAN_OR_EQUAL_TO'
233
+ | 'LESS_THAN'
234
+ | 'LESS_THAN_OR_EQUAL_TO'
235
+ | 'CONTAINS'
236
+ | 'STARTS_WITH'
237
+ | 'IS_SET'
238
+ | 'IS_NOT_SET';
239
+
240
+ /**
241
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
242
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
243
+ */
244
+ property?: string;
245
+
246
+ /**
247
+ * The value to compare against (an agent id, "call" / "chat", a property value).
248
+ * Required except with IS_SET / IS_NOT_SET.
249
+ */
250
+ value?: string | number | boolean;
251
+ }
252
+
253
+ export interface Notifications {
254
+ email: Notifications.Email;
255
+
256
+ slack: Array<Notifications.Slack>;
257
+
258
+ fromConfig?: boolean;
259
+ }
260
+
261
+ export namespace Notifications {
262
+ export interface Email {
263
+ enabled: boolean;
264
+
265
+ recipients: Array<string>;
266
+ }
267
+
268
+ export interface Slack {
269
+ channelId: string;
270
+
271
+ channelName: string;
272
+
273
+ notificationConfigId: string;
274
+ }
275
+ }
276
+
277
+ export interface Target {
278
+ /**
279
+ * The metric's slug (e.g. `task_completion`) or id.
280
+ */
281
+ metric: string;
282
+
283
+ /**
284
+ * The bar, in display units. A PASS_RATE bar is a percentage, 0-100.
285
+ */
286
+ value: number;
287
+
288
+ /**
289
+ * Defaults to PASS_RATE for thresholds and booleans, AVG for anything numeric.
290
+ */
291
+ aggregation?: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
292
+
293
+ /**
294
+ * AT_LEAST (default for PASS_RATE) or AT_MOST (default for every other
295
+ * aggregation).
296
+ */
297
+ comparator?: 'AT_LEAST' | 'AT_MOST';
298
+
299
+ /**
300
+ * Shown instead of the metric's name.
301
+ */
302
+ label?: string;
303
+
304
+ /**
305
+ * PASS_RATE on a metric that isn't a threshold: the per-call condition a call
306
+ * passes on.
307
+ */
308
+ passOperator?:
309
+ | 'EQUALS'
310
+ | 'NOT_EQUALS'
311
+ | 'GREATER_THAN'
312
+ | 'GREATER_THAN_OR_EQUAL_TO'
313
+ | 'LESS_THAN'
314
+ | 'LESS_THAN_OR_EQUAL_TO';
315
+
316
+ passValue?: string | number | boolean;
317
+
318
+ /**
319
+ * Required with PERCENTILE, e.g. 95.
320
+ */
321
+ percentile?: number;
322
+ }
323
+ }
324
+ }
325
+
326
+ export interface LiveReportUpdateResponse {
327
+ data: LiveReportUpdateResponse.Data;
328
+ }
329
+
330
+ export namespace LiveReportUpdateResponse {
331
+ export interface Data {
332
+ id: string;
333
+
334
+ agentId: string | null;
335
+
336
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY';
337
+
338
+ configKey: string | null;
339
+
340
+ /**
341
+ * Managed by config as code: read-only here (edits return 409).
342
+ */
343
+ configManaged: boolean;
344
+
345
+ createdAt: string;
346
+
347
+ dashboardId: string | null;
348
+
349
+ deliveryHour: number;
350
+
351
+ description: string | null;
352
+
353
+ filters: Array<Data.Filter>;
354
+
355
+ includeTranscriptExcerpts: boolean;
356
+
357
+ name: string;
358
+
359
+ /**
360
+ * When the next scheduled report is written. Null while the report is paused.
361
+ */
362
+ nextDeliveryAt: string | null;
363
+
364
+ notifications: Data.Notifications;
365
+
366
+ projectId: string;
367
+
368
+ status: 'ACTIVE' | 'PAUSED';
369
+
370
+ targets: Array<Data.Target>;
371
+
372
+ timezone: string;
373
+
374
+ updatedAt: string;
375
+ }
376
+
377
+ export namespace Data {
378
+ export interface Filter {
379
+ /**
380
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
381
+ */
382
+ type:
383
+ | 'METRIC_PROPERTY'
384
+ | 'CALL_PROPERTY'
385
+ | 'AGENT_PROPERTY'
386
+ | 'CALL_ID'
387
+ | 'MODALITY'
388
+ | 'DATASET'
389
+ | 'METRIC_VALUE';
390
+
391
+ /**
392
+ * Defaults to EQUALS. IS_SET / IS_NOT_SET (CALL_PROPERTY only) keep conversations
393
+ * where the property is set, whatever the value, or missing (never sent, sent as
394
+ * null, or removed); they take no value.
395
+ */
396
+ operator?:
397
+ | 'EQUALS'
398
+ | 'NOT_EQUALS'
399
+ | 'GREATER_THAN'
400
+ | 'GREATER_THAN_OR_EQUAL_TO'
401
+ | 'LESS_THAN'
402
+ | 'LESS_THAN_OR_EQUAL_TO'
403
+ | 'CONTAINS'
404
+ | 'STARTS_WITH'
405
+ | 'IS_SET'
406
+ | 'IS_NOT_SET';
407
+
408
+ /**
409
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
410
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
411
+ */
412
+ property?: string;
413
+
414
+ /**
415
+ * The value to compare against (an agent id, "call" / "chat", a property value).
416
+ * Required except with IS_SET / IS_NOT_SET.
417
+ */
418
+ value?: string | number | boolean;
419
+ }
420
+
421
+ export interface Notifications {
422
+ email: Notifications.Email;
423
+
424
+ slack: Array<Notifications.Slack>;
425
+
426
+ fromConfig?: boolean;
427
+ }
428
+
429
+ export namespace Notifications {
430
+ export interface Email {
431
+ enabled: boolean;
432
+
433
+ recipients: Array<string>;
434
+ }
435
+
436
+ export interface Slack {
437
+ channelId: string;
438
+
439
+ channelName: string;
440
+
441
+ notificationConfigId: string;
442
+ }
443
+ }
444
+
445
+ export interface Target {
446
+ /**
447
+ * The metric's slug (e.g. `task_completion`) or id.
448
+ */
449
+ metric: string;
450
+
451
+ /**
452
+ * The bar, in display units. A PASS_RATE bar is a percentage, 0-100.
453
+ */
454
+ value: number;
455
+
456
+ /**
457
+ * Defaults to PASS_RATE for thresholds and booleans, AVG for anything numeric.
458
+ */
459
+ aggregation?: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
460
+
461
+ /**
462
+ * AT_LEAST (default for PASS_RATE) or AT_MOST (default for every other
463
+ * aggregation).
464
+ */
465
+ comparator?: 'AT_LEAST' | 'AT_MOST';
466
+
467
+ /**
468
+ * Shown instead of the metric's name.
469
+ */
470
+ label?: string;
471
+
472
+ /**
473
+ * PASS_RATE on a metric that isn't a threshold: the per-call condition a call
474
+ * passes on.
475
+ */
476
+ passOperator?:
477
+ | 'EQUALS'
478
+ | 'NOT_EQUALS'
479
+ | 'GREATER_THAN'
480
+ | 'GREATER_THAN_OR_EQUAL_TO'
481
+ | 'LESS_THAN'
482
+ | 'LESS_THAN_OR_EQUAL_TO';
483
+
484
+ passValue?: string | number | boolean;
485
+
486
+ /**
487
+ * Required with PERCENTILE, e.g. 95.
488
+ */
489
+ percentile?: number;
490
+ }
491
+ }
492
+ }
493
+
494
+ export interface LiveReportListResponse {
495
+ data: LiveReportListResponse.Data;
496
+ }
497
+
498
+ export namespace LiveReportListResponse {
499
+ export interface Data {
500
+ items: Array<Data.Item>;
501
+
502
+ totalCount: number;
503
+ }
504
+
505
+ export namespace Data {
506
+ export interface Item {
507
+ id: string;
508
+
509
+ agentId: string | null;
510
+
511
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY';
512
+
513
+ configKey: string | null;
514
+
515
+ /**
516
+ * Managed by config as code: read-only here (edits return 409).
517
+ */
518
+ configManaged: boolean;
519
+
520
+ createdAt: string;
521
+
522
+ dashboardId: string | null;
523
+
524
+ deliveryHour: number;
525
+
526
+ description: string | null;
527
+
528
+ filters: Array<Item.Filter>;
529
+
530
+ includeTranscriptExcerpts: boolean;
531
+
532
+ name: string;
533
+
534
+ /**
535
+ * When the next scheduled report is written. Null while the report is paused.
536
+ */
537
+ nextDeliveryAt: string | null;
538
+
539
+ notifications: Item.Notifications;
540
+
541
+ projectId: string;
542
+
543
+ status: 'ACTIVE' | 'PAUSED';
544
+
545
+ targets: Array<Item.Target>;
546
+
547
+ timezone: string;
548
+
549
+ updatedAt: string;
550
+ }
551
+
552
+ export namespace Item {
553
+ export interface Filter {
554
+ /**
555
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
556
+ */
557
+ type:
558
+ | 'METRIC_PROPERTY'
559
+ | 'CALL_PROPERTY'
560
+ | 'AGENT_PROPERTY'
561
+ | 'CALL_ID'
562
+ | 'MODALITY'
563
+ | 'DATASET'
564
+ | 'METRIC_VALUE';
565
+
566
+ /**
567
+ * Defaults to EQUALS. IS_SET / IS_NOT_SET (CALL_PROPERTY only) keep conversations
568
+ * where the property is set, whatever the value, or missing (never sent, sent as
569
+ * null, or removed); they take no value.
570
+ */
571
+ operator?:
572
+ | 'EQUALS'
573
+ | 'NOT_EQUALS'
574
+ | 'GREATER_THAN'
575
+ | 'GREATER_THAN_OR_EQUAL_TO'
576
+ | 'LESS_THAN'
577
+ | 'LESS_THAN_OR_EQUAL_TO'
578
+ | 'CONTAINS'
579
+ | 'STARTS_WITH'
580
+ | 'IS_SET'
581
+ | 'IS_NOT_SET';
582
+
583
+ /**
584
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
585
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
586
+ */
587
+ property?: string;
588
+
589
+ /**
590
+ * The value to compare against (an agent id, "call" / "chat", a property value).
591
+ * Required except with IS_SET / IS_NOT_SET.
592
+ */
593
+ value?: string | number | boolean;
594
+ }
595
+
596
+ export interface Notifications {
597
+ email: Notifications.Email;
598
+
599
+ slack: Array<Notifications.Slack>;
600
+
601
+ fromConfig?: boolean;
602
+ }
603
+
604
+ export namespace Notifications {
605
+ export interface Email {
606
+ enabled: boolean;
607
+
608
+ recipients: Array<string>;
609
+ }
610
+
611
+ export interface Slack {
612
+ channelId: string;
613
+
614
+ channelName: string;
615
+
616
+ notificationConfigId: string;
617
+ }
618
+ }
619
+
620
+ export interface Target {
621
+ /**
622
+ * The metric's slug (e.g. `task_completion`) or id.
623
+ */
624
+ metric: string;
625
+
626
+ /**
627
+ * The bar, in display units. A PASS_RATE bar is a percentage, 0-100.
628
+ */
629
+ value: number;
630
+
631
+ /**
632
+ * Defaults to PASS_RATE for thresholds and booleans, AVG for anything numeric.
633
+ */
634
+ aggregation?: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
635
+
636
+ /**
637
+ * AT_LEAST (default for PASS_RATE) or AT_MOST (default for every other
638
+ * aggregation).
639
+ */
640
+ comparator?: 'AT_LEAST' | 'AT_MOST';
641
+
642
+ /**
643
+ * Shown instead of the metric's name.
644
+ */
645
+ label?: string;
646
+
647
+ /**
648
+ * PASS_RATE on a metric that isn't a threshold: the per-call condition a call
649
+ * passes on.
650
+ */
651
+ passOperator?:
652
+ | 'EQUALS'
653
+ | 'NOT_EQUALS'
654
+ | 'GREATER_THAN'
655
+ | 'GREATER_THAN_OR_EQUAL_TO'
656
+ | 'LESS_THAN'
657
+ | 'LESS_THAN_OR_EQUAL_TO';
658
+
659
+ passValue?: string | number | boolean;
660
+
661
+ /**
662
+ * Required with PERCENTILE, e.g. 95.
663
+ */
664
+ percentile?: number;
665
+ }
666
+ }
667
+ }
668
+ }
669
+
670
+ export interface LiveReportDeleteResponse {
671
+ data: LiveReportDeleteResponse.Data;
672
+ }
673
+
674
+ export namespace LiveReportDeleteResponse {
675
+ export interface Data {
676
+ id: string;
677
+
678
+ deleted: true;
679
+ }
680
+ }
681
+
682
+ export interface LiveReportGetByIDResponse {
683
+ data: LiveReportGetByIDResponse.Data;
684
+ }
685
+
686
+ export namespace LiveReportGetByIDResponse {
687
+ export interface Data {
688
+ id: string;
689
+
690
+ agentId: string | null;
691
+
692
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY';
693
+
694
+ configKey: string | null;
695
+
696
+ /**
697
+ * Managed by config as code: read-only here (edits return 409).
698
+ */
699
+ configManaged: boolean;
700
+
701
+ createdAt: string;
702
+
703
+ dashboardId: string | null;
704
+
705
+ deliveryHour: number;
706
+
707
+ description: string | null;
708
+
709
+ filters: Array<Data.Filter>;
710
+
711
+ includeTranscriptExcerpts: boolean;
712
+
713
+ name: string;
714
+
715
+ /**
716
+ * When the next scheduled report is written. Null while the report is paused.
717
+ */
718
+ nextDeliveryAt: string | null;
719
+
720
+ notifications: Data.Notifications;
721
+
722
+ projectId: string;
723
+
724
+ status: 'ACTIVE' | 'PAUSED';
725
+
726
+ targets: Array<Data.Target>;
727
+
728
+ timezone: string;
729
+
730
+ updatedAt: string;
731
+ }
732
+
733
+ export namespace Data {
734
+ export interface Filter {
735
+ /**
736
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
737
+ */
738
+ type:
739
+ | 'METRIC_PROPERTY'
740
+ | 'CALL_PROPERTY'
741
+ | 'AGENT_PROPERTY'
742
+ | 'CALL_ID'
743
+ | 'MODALITY'
744
+ | 'DATASET'
745
+ | 'METRIC_VALUE';
746
+
747
+ /**
748
+ * Defaults to EQUALS. IS_SET / IS_NOT_SET (CALL_PROPERTY only) keep conversations
749
+ * where the property is set, whatever the value, or missing (never sent, sent as
750
+ * null, or removed); they take no value.
751
+ */
752
+ operator?:
753
+ | 'EQUALS'
754
+ | 'NOT_EQUALS'
755
+ | 'GREATER_THAN'
756
+ | 'GREATER_THAN_OR_EQUAL_TO'
757
+ | 'LESS_THAN'
758
+ | 'LESS_THAN_OR_EQUAL_TO'
759
+ | 'CONTAINS'
760
+ | 'STARTS_WITH'
761
+ | 'IS_SET'
762
+ | 'IS_NOT_SET';
763
+
764
+ /**
765
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
766
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
767
+ */
768
+ property?: string;
769
+
770
+ /**
771
+ * The value to compare against (an agent id, "call" / "chat", a property value).
772
+ * Required except with IS_SET / IS_NOT_SET.
773
+ */
774
+ value?: string | number | boolean;
775
+ }
776
+
777
+ export interface Notifications {
778
+ email: Notifications.Email;
779
+
780
+ slack: Array<Notifications.Slack>;
781
+
782
+ fromConfig?: boolean;
783
+ }
784
+
785
+ export namespace Notifications {
786
+ export interface Email {
787
+ enabled: boolean;
788
+
789
+ recipients: Array<string>;
790
+ }
791
+
792
+ export interface Slack {
793
+ channelId: string;
794
+
795
+ channelName: string;
796
+
797
+ notificationConfigId: string;
798
+ }
799
+ }
800
+
801
+ export interface Target {
802
+ /**
803
+ * The metric's slug (e.g. `task_completion`) or id.
804
+ */
805
+ metric: string;
806
+
807
+ /**
808
+ * The bar, in display units. A PASS_RATE bar is a percentage, 0-100.
809
+ */
810
+ value: number;
811
+
812
+ /**
813
+ * Defaults to PASS_RATE for thresholds and booleans, AVG for anything numeric.
814
+ */
815
+ aggregation?: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
816
+
817
+ /**
818
+ * AT_LEAST (default for PASS_RATE) or AT_MOST (default for every other
819
+ * aggregation).
820
+ */
821
+ comparator?: 'AT_LEAST' | 'AT_MOST';
822
+
823
+ /**
824
+ * Shown instead of the metric's name.
825
+ */
826
+ label?: string;
827
+
828
+ /**
829
+ * PASS_RATE on a metric that isn't a threshold: the per-call condition a call
830
+ * passes on.
831
+ */
832
+ passOperator?:
833
+ | 'EQUALS'
834
+ | 'NOT_EQUALS'
835
+ | 'GREATER_THAN'
836
+ | 'GREATER_THAN_OR_EQUAL_TO'
837
+ | 'LESS_THAN'
838
+ | 'LESS_THAN_OR_EQUAL_TO';
839
+
840
+ passValue?: string | number | boolean;
841
+
842
+ /**
843
+ * Required with PERCENTILE, e.g. 95.
844
+ */
845
+ percentile?: number;
846
+ }
847
+ }
848
+ }
849
+
850
+ export interface LiveReportGetDocumentResponse {
851
+ /**
852
+ * One written report over one period. `document` is null until `status` is READY;
853
+ * every number in it comes from the analytics engine (the same reads GET
854
+ * /v1/dashboard/{dashboardId}/data makes over the same window and filters).
855
+ */
856
+ data: LiveReportGetDocumentResponse.Data;
857
+ }
858
+
859
+ export namespace LiveReportGetDocumentResponse {
860
+ /**
861
+ * One written report over one period. `document` is null until `status` is READY;
862
+ * every number in it comes from the analytics engine (the same reads GET
863
+ * /v1/dashboard/{dashboardId}/data makes over the same window and filters).
864
+ */
865
+ export interface Data {
866
+ id: string;
867
+
868
+ announcedAt: string | null;
869
+
870
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY' | null;
871
+
872
+ completedAt: string | null;
873
+
874
+ createdAt: string;
875
+
876
+ definition: Data.Definition;
877
+
878
+ document: Data.Document | null;
879
+
880
+ errorMessage: string | null;
881
+
882
+ liveReportId: string | null;
883
+
884
+ periodEnd: string;
885
+
886
+ periodStart: string;
887
+
888
+ projectId: string;
889
+
890
+ status: 'PENDING' | 'GENERATING' | 'READY' | 'FAILED';
891
+
892
+ timezone: string;
893
+
894
+ trigger: 'SCHEDULED' | 'MANUAL';
895
+ }
896
+
897
+ export namespace Data {
898
+ export interface Definition {
899
+ agentId: string | null;
900
+
901
+ agentName: string | null;
902
+
903
+ dashboardId: string | null;
904
+
905
+ description: string | null;
906
+
907
+ filters: Array<Definition.Filter>;
908
+
909
+ includeTranscriptExcerpts: boolean;
910
+
911
+ name: string;
912
+
913
+ targets: Array<Definition.Target>;
914
+ }
915
+
916
+ export namespace Definition {
917
+ export interface Filter {
918
+ /**
919
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
920
+ */
921
+ type:
922
+ | 'METRIC_PROPERTY'
923
+ | 'CALL_PROPERTY'
924
+ | 'AGENT_PROPERTY'
925
+ | 'CALL_ID'
926
+ | 'MODALITY'
927
+ | 'DATASET'
928
+ | 'METRIC_VALUE';
929
+
930
+ /**
931
+ * Defaults to EQUALS. IS_SET / IS_NOT_SET (CALL_PROPERTY only) keep conversations
932
+ * where the property is set, whatever the value, or missing (never sent, sent as
933
+ * null, or removed); they take no value.
934
+ */
935
+ operator?:
936
+ | 'EQUALS'
937
+ | 'NOT_EQUALS'
938
+ | 'GREATER_THAN'
939
+ | 'GREATER_THAN_OR_EQUAL_TO'
940
+ | 'LESS_THAN'
941
+ | 'LESS_THAN_OR_EQUAL_TO'
942
+ | 'CONTAINS'
943
+ | 'STARTS_WITH'
944
+ | 'IS_SET'
945
+ | 'IS_NOT_SET';
946
+
947
+ /**
948
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
949
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
950
+ */
951
+ property?: string;
952
+
953
+ /**
954
+ * The value to compare against (an agent id, "call" / "chat", a property value).
955
+ * Required except with IS_SET / IS_NOT_SET.
956
+ */
957
+ value?: string | number | boolean;
958
+ }
959
+
960
+ export interface Target {
961
+ /**
962
+ * The metric's slug (e.g. `task_completion`) or id.
963
+ */
964
+ metric: string;
965
+
966
+ /**
967
+ * The bar, in display units. A PASS_RATE bar is a percentage, 0-100.
968
+ */
969
+ value: number;
970
+
971
+ /**
972
+ * Defaults to PASS_RATE for thresholds and booleans, AVG for anything numeric.
973
+ */
974
+ aggregation?: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
975
+
976
+ /**
977
+ * AT_LEAST (default for PASS_RATE) or AT_MOST (default for every other
978
+ * aggregation).
979
+ */
980
+ comparator?: 'AT_LEAST' | 'AT_MOST';
981
+
982
+ /**
983
+ * Shown instead of the metric's name.
984
+ */
985
+ label?: string;
986
+
987
+ /**
988
+ * PASS_RATE on a metric that isn't a threshold: the per-call condition a call
989
+ * passes on.
990
+ */
991
+ passOperator?:
992
+ | 'EQUALS'
993
+ | 'NOT_EQUALS'
994
+ | 'GREATER_THAN'
995
+ | 'GREATER_THAN_OR_EQUAL_TO'
996
+ | 'LESS_THAN'
997
+ | 'LESS_THAN_OR_EQUAL_TO';
998
+
999
+ passValue?: string | number | boolean;
1000
+
1001
+ /**
1002
+ * Required with PERCENTILE, e.g. 95.
1003
+ */
1004
+ percentile?: number;
1005
+ }
1006
+ }
1007
+
1008
+ export interface Document {
1009
+ agents: Array<Document.Agent>;
1010
+
1011
+ appendix: Document.Appendix;
1012
+
1013
+ charts: Array<Document.Chart>;
1014
+
1015
+ checks: Array<Document.Check>;
1016
+
1017
+ evidence: Document.Evidence;
1018
+
1019
+ executiveSummary: Document.ExecutiveSummary;
1020
+
1021
+ generatedAtIso: string;
1022
+
1023
+ headline: Document.Headline;
1024
+
1025
+ liveReportId: string | null;
1026
+
1027
+ model: string;
1028
+
1029
+ recommendations: Array<Document.Recommendation>;
1030
+
1031
+ targets: Array<Document.Target>;
1032
+
1033
+ themes: Array<Document.Theme>;
1034
+
1035
+ version: 1;
1036
+
1037
+ volume: Document.Volume;
1038
+ }
1039
+
1040
+ export namespace Document {
1041
+ export interface Agent {
1042
+ agentId: string;
1043
+
1044
+ agentName: string;
1045
+
1046
+ conversationCount: number;
1047
+
1048
+ sharePct: number;
1049
+
1050
+ targets: Array<Agent.Target>;
1051
+ }
1052
+
1053
+ export namespace Agent {
1054
+ export interface Target {
1055
+ actual: number | null;
1056
+
1057
+ actualLabel: string | null;
1058
+
1059
+ key: string;
1060
+
1061
+ status: 'MET' | 'MISSED' | 'NO_DATA';
1062
+ }
1063
+ }
1064
+
1065
+ export interface Appendix {
1066
+ methodology: string;
1067
+
1068
+ notes: Array<string>;
1069
+ }
1070
+
1071
+ export interface Chart {
1072
+ blocked: boolean;
1073
+
1074
+ description: string | null;
1075
+
1076
+ display: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
1077
+
1078
+ error: string | null;
1079
+
1080
+ interval: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
1081
+
1082
+ name: string;
1083
+
1084
+ omittedSeries: number;
1085
+
1086
+ series: Array<Chart.Sery>;
1087
+ }
1088
+
1089
+ export namespace Chart {
1090
+ export interface Sery {
1091
+ aggregation: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1092
+
1093
+ breakdownValue: string | null;
1094
+
1095
+ buckets: Array<Sery.Bucket>;
1096
+
1097
+ comparisonGroup: string | null;
1098
+
1099
+ comparisonValue: number | null;
1100
+
1101
+ measureIndex: number;
1102
+
1103
+ metric: string | null;
1104
+
1105
+ percentageOfBaseline: number | null;
1106
+
1107
+ sampleSize: number | null;
1108
+
1109
+ type: 'METRIC' | 'CONVERSATION' | 'UPTIME';
1110
+
1111
+ value: number;
1112
+ }
1113
+
1114
+ export namespace Sery {
1115
+ export interface Bucket {
1116
+ date: string;
1117
+
1118
+ value: number;
1119
+
1120
+ comparisonDate?: string;
1121
+
1122
+ comparisonValue?: number;
1123
+
1124
+ passed?: number;
1125
+
1126
+ percentageOfBaseline?: number;
1127
+
1128
+ sampleSize?: number;
1129
+ }
1130
+ }
1131
+ }
1132
+
1133
+ export interface Check {
1134
+ checkName: string;
1135
+
1136
+ comparable: boolean;
1137
+
1138
+ deltaPts: number | null;
1139
+
1140
+ evaluatedCount: number;
1141
+
1142
+ failedCount: number;
1143
+
1144
+ isTarget: boolean;
1145
+
1146
+ metricDefinitionId: string;
1147
+
1148
+ metricSlug: string;
1149
+
1150
+ passRatePct: number | null;
1151
+
1152
+ previousPassRatePct: number | null;
1153
+ }
1154
+
1155
+ export interface Evidence {
1156
+ failingConversationCount: number;
1157
+
1158
+ failingCountIsLowerBound: boolean;
1159
+
1160
+ readConversationCount: number;
1161
+
1162
+ sampled: boolean;
1163
+ }
1164
+
1165
+ export interface ExecutiveSummary {
1166
+ keyFindings: Array<ExecutiveSummary.KeyFinding>;
1167
+
1168
+ paragraphs: Array<string>;
1169
+
1170
+ sections?: Array<ExecutiveSummary.Section>;
1171
+ }
1172
+
1173
+ export namespace ExecutiveSummary {
1174
+ export interface KeyFinding {
1175
+ body: string;
1176
+
1177
+ title: string;
1178
+
1179
+ calls?: Array<KeyFinding.Call>;
1180
+ }
1181
+
1182
+ export namespace KeyFinding {
1183
+ export interface Call {
1184
+ callId: string | null;
1185
+
1186
+ conversationId: string;
1187
+
1188
+ cueMs: number | null;
1189
+
1190
+ personaName: string | null;
1191
+ }
1192
+ }
1193
+
1194
+ export interface Section {
1195
+ body: string;
1196
+
1197
+ heading: string | null;
1198
+ }
1199
+ }
1200
+
1201
+ export interface Headline {
1202
+ agentName: string | null;
1203
+
1204
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY' | null;
1205
+
1206
+ periodEndIso: string;
1207
+
1208
+ periodLabel: string;
1209
+
1210
+ periodStartIso: string;
1211
+
1212
+ reportName: string;
1213
+
1214
+ statTiles: Array<Headline.StatTile>;
1215
+
1216
+ timezone: string;
1217
+
1218
+ verdict: 'ON_TARGET' | 'OFF_TARGET' | 'NO_TARGETS' | 'NO_DATA';
1219
+
1220
+ verdictProse: string;
1221
+ }
1222
+
1223
+ export namespace Headline {
1224
+ export interface StatTile {
1225
+ deltaDirection: 'POSITIVE' | 'NEGATIVE' | 'NEUTRAL' | null;
1226
+
1227
+ label: string;
1228
+
1229
+ sub: string | null;
1230
+
1231
+ value: string;
1232
+ }
1233
+ }
1234
+
1235
+ export interface Recommendation {
1236
+ afterText: string | null;
1237
+
1238
+ beforeText: string | null;
1239
+
1240
+ body: string;
1241
+
1242
+ channel:
1243
+ | 'PROMPT'
1244
+ | 'VOICE_CONFIG'
1245
+ | 'STT'
1246
+ | 'SPEECH_MODEL'
1247
+ | 'LLM_MODEL'
1248
+ | 'INFRA'
1249
+ | 'EXTERNAL'
1250
+ | null;
1251
+
1252
+ order: number;
1253
+
1254
+ promptOptimizationFindingId: string | null;
1255
+
1256
+ severity: 'HIGH' | 'MEDIUM' | 'LOW' | null;
1257
+
1258
+ source: 'PROMPT_OPTIMIZER' | 'DEBRIEF';
1259
+
1260
+ themeSlugs: Array<string>;
1261
+
1262
+ title: string;
1263
+ }
1264
+
1265
+ export interface Target {
1266
+ actual: number | null;
1267
+
1268
+ actualLabel: string | null;
1269
+
1270
+ aggregation: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
1271
+
1272
+ comparator: 'AT_LEAST' | 'AT_MOST';
1273
+
1274
+ deltaDirection: 'POSITIVE' | 'NEGATIVE' | 'NEUTRAL' | null;
1275
+
1276
+ deltaLabel: string | null;
1277
+
1278
+ error: string | null;
1279
+
1280
+ failingConversationCount: number | null;
1281
+
1282
+ key: string;
1283
+
1284
+ label: string;
1285
+
1286
+ lifecycle: 'NEW_MISS' | 'STILL_MISSED' | 'RECOVERED' | 'HOLDING' | null;
1287
+
1288
+ metricDefinitionId: string | null;
1289
+
1290
+ metricName: string;
1291
+
1292
+ metricSlug: string;
1293
+
1294
+ percentile: number | null;
1295
+
1296
+ previous: number | null;
1297
+
1298
+ previousLabel: string | null;
1299
+
1300
+ sampleSize: number;
1301
+
1302
+ series: Array<Target.Sery>;
1303
+
1304
+ status: 'MET' | 'MISSED' | 'NO_DATA';
1305
+
1306
+ targetLabel: string;
1307
+
1308
+ targetValue: number;
1309
+
1310
+ unit: 'PERCENT' | 'VALUE';
1311
+ }
1312
+
1313
+ export namespace Target {
1314
+ export interface Sery {
1315
+ date: string;
1316
+
1317
+ sampleSize: number | null;
1318
+
1319
+ value: number | null;
1320
+ }
1321
+ }
1322
+
1323
+ export interface Theme {
1324
+ affectedConversationCount: number;
1325
+
1326
+ analysis: string;
1327
+
1328
+ checkNames: Array<string>;
1329
+
1330
+ collectorQuote: Theme.CollectorQuote | null;
1331
+
1332
+ estimatedAffectedConversationCount: number | null;
1333
+
1334
+ excerpts: Array<Theme.Excerpt>;
1335
+
1336
+ flaggedForImpact: boolean;
1337
+
1338
+ impact: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW' | null;
1339
+
1340
+ impactReason: string | null;
1341
+
1342
+ issue: Theme.Issue | null;
1343
+
1344
+ lifecycle: 'NEW' | 'PERSISTENT' | 'IMPROVING' | 'FIXED' | null;
1345
+
1346
+ memberConversationIds: Array<string>;
1347
+
1348
+ metricDefinitionIds: Array<string>;
1349
+
1350
+ prevalence: 'WIDESPREAD' | 'RECURRING' | 'ISOLATED' | null;
1351
+
1352
+ rootCauseChannel:
1353
+ | 'PROMPT'
1354
+ | 'VOICE_CONFIG'
1355
+ | 'STT'
1356
+ | 'SPEECH_MODEL'
1357
+ | 'LLM_MODEL'
1358
+ | 'INFRA'
1359
+ | 'EXTERNAL'
1360
+ | null;
1361
+
1362
+ severity: 'HIGH' | 'MEDIUM' | 'LOW';
1363
+
1364
+ slug: string;
1365
+
1366
+ title: string;
1367
+
1368
+ totalConversationCount: number;
1369
+
1370
+ memberCalls?: Array<Theme.MemberCall>;
1371
+ }
1372
+
1373
+ export namespace Theme {
1374
+ export interface CollectorQuote {
1375
+ conversationId: string;
1376
+
1377
+ metricName: string;
1378
+
1379
+ quote: string;
1380
+ }
1381
+
1382
+ export interface Excerpt {
1383
+ callId: string | null;
1384
+
1385
+ caption: string | null;
1386
+
1387
+ conversationId: string;
1388
+
1389
+ personaName: string | null;
1390
+
1391
+ scenarioName: string | null;
1392
+
1393
+ turns: Array<Excerpt.Turn>;
1394
+ }
1395
+
1396
+ export namespace Excerpt {
1397
+ export interface Turn {
1398
+ flagNote: string | null;
1399
+
1400
+ flagged: boolean;
1401
+
1402
+ offsetMs: number | null;
1403
+
1404
+ role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER';
1405
+
1406
+ text: string;
1407
+ }
1408
+ }
1409
+
1410
+ export interface Issue {
1411
+ id: string;
1412
+
1413
+ firstSeenAtIso: string | null;
1414
+
1415
+ status: string;
1416
+
1417
+ title: string;
1418
+ }
1419
+
1420
+ export interface MemberCall {
1421
+ callId: string | null;
1422
+
1423
+ conversationId: string;
1424
+
1425
+ cueMs: number | null;
1426
+
1427
+ personaName: string | null;
1428
+ }
1429
+ }
1430
+
1431
+ export interface Volume {
1432
+ conversationCount: number;
1433
+
1434
+ deltaPct: number | null;
1435
+
1436
+ endings: Array<Volume.Ending>;
1437
+
1438
+ previousConversationCount: number | null;
1439
+
1440
+ series: Array<Volume.Sery>;
1441
+ }
1442
+
1443
+ export namespace Volume {
1444
+ export interface Ending {
1445
+ count: number;
1446
+
1447
+ label: string;
1448
+
1449
+ sharePct: number;
1450
+
1451
+ value: string;
1452
+ }
1453
+
1454
+ export interface Sery {
1455
+ date: string;
1456
+
1457
+ sampleSize: number | null;
1458
+
1459
+ value: number | null;
1460
+ }
1461
+ }
1462
+ }
1463
+ }
1464
+ }
1465
+
1466
+ export interface LiveReportListDocumentsResponse {
1467
+ data: LiveReportListDocumentsResponse.Data;
1468
+ }
1469
+
1470
+ export namespace LiveReportListDocumentsResponse {
1471
+ export interface Data {
1472
+ items: Array<Data.Item>;
1473
+
1474
+ totalCount: number;
1475
+ }
1476
+
1477
+ export namespace Data {
1478
+ /**
1479
+ * One written report over one period. `document` is null until `status` is READY;
1480
+ * every number in it comes from the analytics engine (the same reads GET
1481
+ * /v1/dashboard/{dashboardId}/data makes over the same window and filters).
1482
+ */
1483
+ export interface Item {
1484
+ id: string;
1485
+
1486
+ announcedAt: string | null;
1487
+
1488
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY' | null;
1489
+
1490
+ completedAt: string | null;
1491
+
1492
+ createdAt: string;
1493
+
1494
+ definition: Item.Definition;
1495
+
1496
+ document: Item.Document | null;
1497
+
1498
+ errorMessage: string | null;
1499
+
1500
+ liveReportId: string | null;
1501
+
1502
+ periodEnd: string;
1503
+
1504
+ periodStart: string;
1505
+
1506
+ projectId: string;
1507
+
1508
+ status: 'PENDING' | 'GENERATING' | 'READY' | 'FAILED';
1509
+
1510
+ timezone: string;
1511
+
1512
+ trigger: 'SCHEDULED' | 'MANUAL';
1513
+ }
1514
+
1515
+ export namespace Item {
1516
+ export interface Definition {
1517
+ agentId: string | null;
1518
+
1519
+ agentName: string | null;
1520
+
1521
+ dashboardId: string | null;
1522
+
1523
+ description: string | null;
1524
+
1525
+ filters: Array<Definition.Filter>;
1526
+
1527
+ includeTranscriptExcerpts: boolean;
1528
+
1529
+ name: string;
1530
+
1531
+ targets: Array<Definition.Target>;
1532
+ }
1533
+
1534
+ export namespace Definition {
1535
+ export interface Filter {
1536
+ /**
1537
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
1538
+ */
1539
+ type:
1540
+ | 'METRIC_PROPERTY'
1541
+ | 'CALL_PROPERTY'
1542
+ | 'AGENT_PROPERTY'
1543
+ | 'CALL_ID'
1544
+ | 'MODALITY'
1545
+ | 'DATASET'
1546
+ | 'METRIC_VALUE';
1547
+
1548
+ /**
1549
+ * Defaults to EQUALS. IS_SET / IS_NOT_SET (CALL_PROPERTY only) keep conversations
1550
+ * where the property is set, whatever the value, or missing (never sent, sent as
1551
+ * null, or removed); they take no value.
1552
+ */
1553
+ operator?:
1554
+ | 'EQUALS'
1555
+ | 'NOT_EQUALS'
1556
+ | 'GREATER_THAN'
1557
+ | 'GREATER_THAN_OR_EQUAL_TO'
1558
+ | 'LESS_THAN'
1559
+ | 'LESS_THAN_OR_EQUAL_TO'
1560
+ | 'CONTAINS'
1561
+ | 'STARTS_WITH'
1562
+ | 'IS_SET'
1563
+ | 'IS_NOT_SET';
1564
+
1565
+ /**
1566
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
1567
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
1568
+ */
1569
+ property?: string;
1570
+
1571
+ /**
1572
+ * The value to compare against (an agent id, "call" / "chat", a property value).
1573
+ * Required except with IS_SET / IS_NOT_SET.
1574
+ */
1575
+ value?: string | number | boolean;
1576
+ }
1577
+
1578
+ export interface Target {
1579
+ /**
1580
+ * The metric's slug (e.g. `task_completion`) or id.
1581
+ */
1582
+ metric: string;
1583
+
1584
+ /**
1585
+ * The bar, in display units. A PASS_RATE bar is a percentage, 0-100.
1586
+ */
1587
+ value: number;
1588
+
1589
+ /**
1590
+ * Defaults to PASS_RATE for thresholds and booleans, AVG for anything numeric.
1591
+ */
1592
+ aggregation?: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
1593
+
1594
+ /**
1595
+ * AT_LEAST (default for PASS_RATE) or AT_MOST (default for every other
1596
+ * aggregation).
1597
+ */
1598
+ comparator?: 'AT_LEAST' | 'AT_MOST';
1599
+
1600
+ /**
1601
+ * Shown instead of the metric's name.
1602
+ */
1603
+ label?: string;
1604
+
1605
+ /**
1606
+ * PASS_RATE on a metric that isn't a threshold: the per-call condition a call
1607
+ * passes on.
1608
+ */
1609
+ passOperator?:
1610
+ | 'EQUALS'
1611
+ | 'NOT_EQUALS'
1612
+ | 'GREATER_THAN'
1613
+ | 'GREATER_THAN_OR_EQUAL_TO'
1614
+ | 'LESS_THAN'
1615
+ | 'LESS_THAN_OR_EQUAL_TO';
1616
+
1617
+ passValue?: string | number | boolean;
1618
+
1619
+ /**
1620
+ * Required with PERCENTILE, e.g. 95.
1621
+ */
1622
+ percentile?: number;
1623
+ }
1624
+ }
1625
+
1626
+ export interface Document {
1627
+ agents: Array<Document.Agent>;
1628
+
1629
+ appendix: Document.Appendix;
1630
+
1631
+ charts: Array<Document.Chart>;
1632
+
1633
+ checks: Array<Document.Check>;
1634
+
1635
+ evidence: Document.Evidence;
1636
+
1637
+ executiveSummary: Document.ExecutiveSummary;
1638
+
1639
+ generatedAtIso: string;
1640
+
1641
+ headline: Document.Headline;
1642
+
1643
+ liveReportId: string | null;
1644
+
1645
+ model: string;
1646
+
1647
+ recommendations: Array<Document.Recommendation>;
1648
+
1649
+ targets: Array<Document.Target>;
1650
+
1651
+ themes: Array<Document.Theme>;
1652
+
1653
+ version: 1;
1654
+
1655
+ volume: Document.Volume;
1656
+ }
1657
+
1658
+ export namespace Document {
1659
+ export interface Agent {
1660
+ agentId: string;
1661
+
1662
+ agentName: string;
1663
+
1664
+ conversationCount: number;
1665
+
1666
+ sharePct: number;
1667
+
1668
+ targets: Array<Agent.Target>;
1669
+ }
1670
+
1671
+ export namespace Agent {
1672
+ export interface Target {
1673
+ actual: number | null;
1674
+
1675
+ actualLabel: string | null;
1676
+
1677
+ key: string;
1678
+
1679
+ status: 'MET' | 'MISSED' | 'NO_DATA';
1680
+ }
1681
+ }
1682
+
1683
+ export interface Appendix {
1684
+ methodology: string;
1685
+
1686
+ notes: Array<string>;
1687
+ }
1688
+
1689
+ export interface Chart {
1690
+ blocked: boolean;
1691
+
1692
+ description: string | null;
1693
+
1694
+ display: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
1695
+
1696
+ error: string | null;
1697
+
1698
+ interval: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
1699
+
1700
+ name: string;
1701
+
1702
+ omittedSeries: number;
1703
+
1704
+ series: Array<Chart.Sery>;
1705
+ }
1706
+
1707
+ export namespace Chart {
1708
+ export interface Sery {
1709
+ aggregation: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
1710
+
1711
+ breakdownValue: string | null;
1712
+
1713
+ buckets: Array<Sery.Bucket>;
1714
+
1715
+ comparisonGroup: string | null;
1716
+
1717
+ comparisonValue: number | null;
1718
+
1719
+ measureIndex: number;
1720
+
1721
+ metric: string | null;
1722
+
1723
+ percentageOfBaseline: number | null;
1724
+
1725
+ sampleSize: number | null;
1726
+
1727
+ type: 'METRIC' | 'CONVERSATION' | 'UPTIME';
1728
+
1729
+ value: number;
1730
+ }
1731
+
1732
+ export namespace Sery {
1733
+ export interface Bucket {
1734
+ date: string;
1735
+
1736
+ value: number;
1737
+
1738
+ comparisonDate?: string;
1739
+
1740
+ comparisonValue?: number;
1741
+
1742
+ passed?: number;
1743
+
1744
+ percentageOfBaseline?: number;
1745
+
1746
+ sampleSize?: number;
1747
+ }
1748
+ }
1749
+ }
1750
+
1751
+ export interface Check {
1752
+ checkName: string;
1753
+
1754
+ comparable: boolean;
1755
+
1756
+ deltaPts: number | null;
1757
+
1758
+ evaluatedCount: number;
1759
+
1760
+ failedCount: number;
1761
+
1762
+ isTarget: boolean;
1763
+
1764
+ metricDefinitionId: string;
1765
+
1766
+ metricSlug: string;
1767
+
1768
+ passRatePct: number | null;
1769
+
1770
+ previousPassRatePct: number | null;
1771
+ }
1772
+
1773
+ export interface Evidence {
1774
+ failingConversationCount: number;
1775
+
1776
+ failingCountIsLowerBound: boolean;
1777
+
1778
+ readConversationCount: number;
1779
+
1780
+ sampled: boolean;
1781
+ }
1782
+
1783
+ export interface ExecutiveSummary {
1784
+ keyFindings: Array<ExecutiveSummary.KeyFinding>;
1785
+
1786
+ paragraphs: Array<string>;
1787
+
1788
+ sections?: Array<ExecutiveSummary.Section>;
1789
+ }
1790
+
1791
+ export namespace ExecutiveSummary {
1792
+ export interface KeyFinding {
1793
+ body: string;
1794
+
1795
+ title: string;
1796
+
1797
+ calls?: Array<KeyFinding.Call>;
1798
+ }
1799
+
1800
+ export namespace KeyFinding {
1801
+ export interface Call {
1802
+ callId: string | null;
1803
+
1804
+ conversationId: string;
1805
+
1806
+ cueMs: number | null;
1807
+
1808
+ personaName: string | null;
1809
+ }
1810
+ }
1811
+
1812
+ export interface Section {
1813
+ body: string;
1814
+
1815
+ heading: string | null;
1816
+ }
1817
+ }
1818
+
1819
+ export interface Headline {
1820
+ agentName: string | null;
1821
+
1822
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY' | null;
1823
+
1824
+ periodEndIso: string;
1825
+
1826
+ periodLabel: string;
1827
+
1828
+ periodStartIso: string;
1829
+
1830
+ reportName: string;
1831
+
1832
+ statTiles: Array<Headline.StatTile>;
1833
+
1834
+ timezone: string;
1835
+
1836
+ verdict: 'ON_TARGET' | 'OFF_TARGET' | 'NO_TARGETS' | 'NO_DATA';
1837
+
1838
+ verdictProse: string;
1839
+ }
1840
+
1841
+ export namespace Headline {
1842
+ export interface StatTile {
1843
+ deltaDirection: 'POSITIVE' | 'NEGATIVE' | 'NEUTRAL' | null;
1844
+
1845
+ label: string;
1846
+
1847
+ sub: string | null;
1848
+
1849
+ value: string;
1850
+ }
1851
+ }
1852
+
1853
+ export interface Recommendation {
1854
+ afterText: string | null;
1855
+
1856
+ beforeText: string | null;
1857
+
1858
+ body: string;
1859
+
1860
+ channel:
1861
+ | 'PROMPT'
1862
+ | 'VOICE_CONFIG'
1863
+ | 'STT'
1864
+ | 'SPEECH_MODEL'
1865
+ | 'LLM_MODEL'
1866
+ | 'INFRA'
1867
+ | 'EXTERNAL'
1868
+ | null;
1869
+
1870
+ order: number;
1871
+
1872
+ promptOptimizationFindingId: string | null;
1873
+
1874
+ severity: 'HIGH' | 'MEDIUM' | 'LOW' | null;
1875
+
1876
+ source: 'PROMPT_OPTIMIZER' | 'DEBRIEF';
1877
+
1878
+ themeSlugs: Array<string>;
1879
+
1880
+ title: string;
1881
+ }
1882
+
1883
+ export interface Target {
1884
+ actual: number | null;
1885
+
1886
+ actualLabel: string | null;
1887
+
1888
+ aggregation: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
1889
+
1890
+ comparator: 'AT_LEAST' | 'AT_MOST';
1891
+
1892
+ deltaDirection: 'POSITIVE' | 'NEGATIVE' | 'NEUTRAL' | null;
1893
+
1894
+ deltaLabel: string | null;
1895
+
1896
+ error: string | null;
1897
+
1898
+ failingConversationCount: number | null;
1899
+
1900
+ key: string;
1901
+
1902
+ label: string;
1903
+
1904
+ lifecycle: 'NEW_MISS' | 'STILL_MISSED' | 'RECOVERED' | 'HOLDING' | null;
1905
+
1906
+ metricDefinitionId: string | null;
1907
+
1908
+ metricName: string;
1909
+
1910
+ metricSlug: string;
1911
+
1912
+ percentile: number | null;
1913
+
1914
+ previous: number | null;
1915
+
1916
+ previousLabel: string | null;
1917
+
1918
+ sampleSize: number;
1919
+
1920
+ series: Array<Target.Sery>;
1921
+
1922
+ status: 'MET' | 'MISSED' | 'NO_DATA';
1923
+
1924
+ targetLabel: string;
1925
+
1926
+ targetValue: number;
1927
+
1928
+ unit: 'PERCENT' | 'VALUE';
1929
+ }
1930
+
1931
+ export namespace Target {
1932
+ export interface Sery {
1933
+ date: string;
1934
+
1935
+ sampleSize: number | null;
1936
+
1937
+ value: number | null;
1938
+ }
1939
+ }
1940
+
1941
+ export interface Theme {
1942
+ affectedConversationCount: number;
1943
+
1944
+ analysis: string;
1945
+
1946
+ checkNames: Array<string>;
1947
+
1948
+ collectorQuote: Theme.CollectorQuote | null;
1949
+
1950
+ estimatedAffectedConversationCount: number | null;
1951
+
1952
+ excerpts: Array<Theme.Excerpt>;
1953
+
1954
+ flaggedForImpact: boolean;
1955
+
1956
+ impact: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW' | null;
1957
+
1958
+ impactReason: string | null;
1959
+
1960
+ issue: Theme.Issue | null;
1961
+
1962
+ lifecycle: 'NEW' | 'PERSISTENT' | 'IMPROVING' | 'FIXED' | null;
1963
+
1964
+ memberConversationIds: Array<string>;
1965
+
1966
+ metricDefinitionIds: Array<string>;
1967
+
1968
+ prevalence: 'WIDESPREAD' | 'RECURRING' | 'ISOLATED' | null;
1969
+
1970
+ rootCauseChannel:
1971
+ | 'PROMPT'
1972
+ | 'VOICE_CONFIG'
1973
+ | 'STT'
1974
+ | 'SPEECH_MODEL'
1975
+ | 'LLM_MODEL'
1976
+ | 'INFRA'
1977
+ | 'EXTERNAL'
1978
+ | null;
1979
+
1980
+ severity: 'HIGH' | 'MEDIUM' | 'LOW';
1981
+
1982
+ slug: string;
1983
+
1984
+ title: string;
1985
+
1986
+ totalConversationCount: number;
1987
+
1988
+ memberCalls?: Array<Theme.MemberCall>;
1989
+ }
1990
+
1991
+ export namespace Theme {
1992
+ export interface CollectorQuote {
1993
+ conversationId: string;
1994
+
1995
+ metricName: string;
1996
+
1997
+ quote: string;
1998
+ }
1999
+
2000
+ export interface Excerpt {
2001
+ callId: string | null;
2002
+
2003
+ caption: string | null;
2004
+
2005
+ conversationId: string;
2006
+
2007
+ personaName: string | null;
2008
+
2009
+ scenarioName: string | null;
2010
+
2011
+ turns: Array<Excerpt.Turn>;
2012
+ }
2013
+
2014
+ export namespace Excerpt {
2015
+ export interface Turn {
2016
+ flagNote: string | null;
2017
+
2018
+ flagged: boolean;
2019
+
2020
+ offsetMs: number | null;
2021
+
2022
+ role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER';
2023
+
2024
+ text: string;
2025
+ }
2026
+ }
2027
+
2028
+ export interface Issue {
2029
+ id: string;
2030
+
2031
+ firstSeenAtIso: string | null;
2032
+
2033
+ status: string;
2034
+
2035
+ title: string;
2036
+ }
2037
+
2038
+ export interface MemberCall {
2039
+ callId: string | null;
2040
+
2041
+ conversationId: string;
2042
+
2043
+ cueMs: number | null;
2044
+
2045
+ personaName: string | null;
2046
+ }
2047
+ }
2048
+
2049
+ export interface Volume {
2050
+ conversationCount: number;
2051
+
2052
+ deltaPct: number | null;
2053
+
2054
+ endings: Array<Volume.Ending>;
2055
+
2056
+ previousConversationCount: number | null;
2057
+
2058
+ series: Array<Volume.Sery>;
2059
+ }
2060
+
2061
+ export namespace Volume {
2062
+ export interface Ending {
2063
+ count: number;
2064
+
2065
+ label: string;
2066
+
2067
+ sharePct: number;
2068
+
2069
+ value: string;
2070
+ }
2071
+
2072
+ export interface Sery {
2073
+ date: string;
2074
+
2075
+ sampleSize: number | null;
2076
+
2077
+ value: number | null;
2078
+ }
2079
+ }
2080
+ }
2081
+ }
2082
+ }
2083
+ }
2084
+
2085
+ export interface LiveReportRunResponse {
2086
+ /**
2087
+ * One written report over one period. `document` is null until `status` is READY;
2088
+ * every number in it comes from the analytics engine (the same reads GET
2089
+ * /v1/dashboard/{dashboardId}/data makes over the same window and filters).
2090
+ */
2091
+ data: LiveReportRunResponse.Data;
2092
+ }
2093
+
2094
+ export namespace LiveReportRunResponse {
2095
+ /**
2096
+ * One written report over one period. `document` is null until `status` is READY;
2097
+ * every number in it comes from the analytics engine (the same reads GET
2098
+ * /v1/dashboard/{dashboardId}/data makes over the same window and filters).
2099
+ */
2100
+ export interface Data {
2101
+ id: string;
2102
+
2103
+ announcedAt: string | null;
2104
+
2105
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY' | null;
2106
+
2107
+ completedAt: string | null;
2108
+
2109
+ createdAt: string;
2110
+
2111
+ definition: Data.Definition;
2112
+
2113
+ document: Data.Document | null;
2114
+
2115
+ errorMessage: string | null;
2116
+
2117
+ liveReportId: string | null;
2118
+
2119
+ periodEnd: string;
2120
+
2121
+ periodStart: string;
2122
+
2123
+ projectId: string;
2124
+
2125
+ status: 'PENDING' | 'GENERATING' | 'READY' | 'FAILED';
2126
+
2127
+ timezone: string;
2128
+
2129
+ trigger: 'SCHEDULED' | 'MANUAL';
2130
+ }
2131
+
2132
+ export namespace Data {
2133
+ export interface Definition {
2134
+ agentId: string | null;
2135
+
2136
+ agentName: string | null;
2137
+
2138
+ dashboardId: string | null;
2139
+
2140
+ description: string | null;
2141
+
2142
+ filters: Array<Definition.Filter>;
2143
+
2144
+ includeTranscriptExcerpts: boolean;
2145
+
2146
+ name: string;
2147
+
2148
+ targets: Array<Definition.Target>;
2149
+ }
2150
+
2151
+ export namespace Definition {
2152
+ export interface Filter {
2153
+ /**
2154
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
2155
+ */
2156
+ type:
2157
+ | 'METRIC_PROPERTY'
2158
+ | 'CALL_PROPERTY'
2159
+ | 'AGENT_PROPERTY'
2160
+ | 'CALL_ID'
2161
+ | 'MODALITY'
2162
+ | 'DATASET'
2163
+ | 'METRIC_VALUE';
2164
+
2165
+ /**
2166
+ * Defaults to EQUALS. IS_SET / IS_NOT_SET (CALL_PROPERTY only) keep conversations
2167
+ * where the property is set, whatever the value, or missing (never sent, sent as
2168
+ * null, or removed); they take no value.
2169
+ */
2170
+ operator?:
2171
+ | 'EQUALS'
2172
+ | 'NOT_EQUALS'
2173
+ | 'GREATER_THAN'
2174
+ | 'GREATER_THAN_OR_EQUAL_TO'
2175
+ | 'LESS_THAN'
2176
+ | 'LESS_THAN_OR_EQUAL_TO'
2177
+ | 'CONTAINS'
2178
+ | 'STARTS_WITH'
2179
+ | 'IS_SET'
2180
+ | 'IS_NOT_SET';
2181
+
2182
+ /**
2183
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
2184
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
2185
+ */
2186
+ property?: string;
2187
+
2188
+ /**
2189
+ * The value to compare against (an agent id, "call" / "chat", a property value).
2190
+ * Required except with IS_SET / IS_NOT_SET.
2191
+ */
2192
+ value?: string | number | boolean;
2193
+ }
2194
+
2195
+ export interface Target {
2196
+ /**
2197
+ * The metric's slug (e.g. `task_completion`) or id.
2198
+ */
2199
+ metric: string;
2200
+
2201
+ /**
2202
+ * The bar, in display units. A PASS_RATE bar is a percentage, 0-100.
2203
+ */
2204
+ value: number;
2205
+
2206
+ /**
2207
+ * Defaults to PASS_RATE for thresholds and booleans, AVG for anything numeric.
2208
+ */
2209
+ aggregation?: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
2210
+
2211
+ /**
2212
+ * AT_LEAST (default for PASS_RATE) or AT_MOST (default for every other
2213
+ * aggregation).
2214
+ */
2215
+ comparator?: 'AT_LEAST' | 'AT_MOST';
2216
+
2217
+ /**
2218
+ * Shown instead of the metric's name.
2219
+ */
2220
+ label?: string;
2221
+
2222
+ /**
2223
+ * PASS_RATE on a metric that isn't a threshold: the per-call condition a call
2224
+ * passes on.
2225
+ */
2226
+ passOperator?:
2227
+ | 'EQUALS'
2228
+ | 'NOT_EQUALS'
2229
+ | 'GREATER_THAN'
2230
+ | 'GREATER_THAN_OR_EQUAL_TO'
2231
+ | 'LESS_THAN'
2232
+ | 'LESS_THAN_OR_EQUAL_TO';
2233
+
2234
+ passValue?: string | number | boolean;
2235
+
2236
+ /**
2237
+ * Required with PERCENTILE, e.g. 95.
2238
+ */
2239
+ percentile?: number;
2240
+ }
2241
+ }
2242
+
2243
+ export interface Document {
2244
+ agents: Array<Document.Agent>;
2245
+
2246
+ appendix: Document.Appendix;
2247
+
2248
+ charts: Array<Document.Chart>;
2249
+
2250
+ checks: Array<Document.Check>;
2251
+
2252
+ evidence: Document.Evidence;
2253
+
2254
+ executiveSummary: Document.ExecutiveSummary;
2255
+
2256
+ generatedAtIso: string;
2257
+
2258
+ headline: Document.Headline;
2259
+
2260
+ liveReportId: string | null;
2261
+
2262
+ model: string;
2263
+
2264
+ recommendations: Array<Document.Recommendation>;
2265
+
2266
+ targets: Array<Document.Target>;
2267
+
2268
+ themes: Array<Document.Theme>;
2269
+
2270
+ version: 1;
2271
+
2272
+ volume: Document.Volume;
2273
+ }
2274
+
2275
+ export namespace Document {
2276
+ export interface Agent {
2277
+ agentId: string;
2278
+
2279
+ agentName: string;
2280
+
2281
+ conversationCount: number;
2282
+
2283
+ sharePct: number;
2284
+
2285
+ targets: Array<Agent.Target>;
2286
+ }
2287
+
2288
+ export namespace Agent {
2289
+ export interface Target {
2290
+ actual: number | null;
2291
+
2292
+ actualLabel: string | null;
2293
+
2294
+ key: string;
2295
+
2296
+ status: 'MET' | 'MISSED' | 'NO_DATA';
2297
+ }
2298
+ }
2299
+
2300
+ export interface Appendix {
2301
+ methodology: string;
2302
+
2303
+ notes: Array<string>;
2304
+ }
2305
+
2306
+ export interface Chart {
2307
+ blocked: boolean;
2308
+
2309
+ description: string | null;
2310
+
2311
+ display: 'LINE' | 'NUMBER' | 'RADAR' | 'STACKED_BAR' | 'TABLE';
2312
+
2313
+ error: string | null;
2314
+
2315
+ interval: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
2316
+
2317
+ name: string;
2318
+
2319
+ omittedSeries: number;
2320
+
2321
+ series: Array<Chart.Sery>;
2322
+ }
2323
+
2324
+ export namespace Chart {
2325
+ export interface Sery {
2326
+ aggregation: 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'PASS_RATE';
2327
+
2328
+ breakdownValue: string | null;
2329
+
2330
+ buckets: Array<Sery.Bucket>;
2331
+
2332
+ comparisonGroup: string | null;
2333
+
2334
+ comparisonValue: number | null;
2335
+
2336
+ measureIndex: number;
2337
+
2338
+ metric: string | null;
2339
+
2340
+ percentageOfBaseline: number | null;
2341
+
2342
+ sampleSize: number | null;
2343
+
2344
+ type: 'METRIC' | 'CONVERSATION' | 'UPTIME';
2345
+
2346
+ value: number;
2347
+ }
2348
+
2349
+ export namespace Sery {
2350
+ export interface Bucket {
2351
+ date: string;
2352
+
2353
+ value: number;
2354
+
2355
+ comparisonDate?: string;
2356
+
2357
+ comparisonValue?: number;
2358
+
2359
+ passed?: number;
2360
+
2361
+ percentageOfBaseline?: number;
2362
+
2363
+ sampleSize?: number;
2364
+ }
2365
+ }
2366
+ }
2367
+
2368
+ export interface Check {
2369
+ checkName: string;
2370
+
2371
+ comparable: boolean;
2372
+
2373
+ deltaPts: number | null;
2374
+
2375
+ evaluatedCount: number;
2376
+
2377
+ failedCount: number;
2378
+
2379
+ isTarget: boolean;
2380
+
2381
+ metricDefinitionId: string;
2382
+
2383
+ metricSlug: string;
2384
+
2385
+ passRatePct: number | null;
2386
+
2387
+ previousPassRatePct: number | null;
2388
+ }
2389
+
2390
+ export interface Evidence {
2391
+ failingConversationCount: number;
2392
+
2393
+ failingCountIsLowerBound: boolean;
2394
+
2395
+ readConversationCount: number;
2396
+
2397
+ sampled: boolean;
2398
+ }
2399
+
2400
+ export interface ExecutiveSummary {
2401
+ keyFindings: Array<ExecutiveSummary.KeyFinding>;
2402
+
2403
+ paragraphs: Array<string>;
2404
+
2405
+ sections?: Array<ExecutiveSummary.Section>;
2406
+ }
2407
+
2408
+ export namespace ExecutiveSummary {
2409
+ export interface KeyFinding {
2410
+ body: string;
2411
+
2412
+ title: string;
2413
+
2414
+ calls?: Array<KeyFinding.Call>;
2415
+ }
2416
+
2417
+ export namespace KeyFinding {
2418
+ export interface Call {
2419
+ callId: string | null;
2420
+
2421
+ conversationId: string;
2422
+
2423
+ cueMs: number | null;
2424
+
2425
+ personaName: string | null;
2426
+ }
2427
+ }
2428
+
2429
+ export interface Section {
2430
+ body: string;
2431
+
2432
+ heading: string | null;
2433
+ }
2434
+ }
2435
+
2436
+ export interface Headline {
2437
+ agentName: string | null;
2438
+
2439
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY' | null;
2440
+
2441
+ periodEndIso: string;
2442
+
2443
+ periodLabel: string;
2444
+
2445
+ periodStartIso: string;
2446
+
2447
+ reportName: string;
2448
+
2449
+ statTiles: Array<Headline.StatTile>;
2450
+
2451
+ timezone: string;
2452
+
2453
+ verdict: 'ON_TARGET' | 'OFF_TARGET' | 'NO_TARGETS' | 'NO_DATA';
2454
+
2455
+ verdictProse: string;
2456
+ }
2457
+
2458
+ export namespace Headline {
2459
+ export interface StatTile {
2460
+ deltaDirection: 'POSITIVE' | 'NEGATIVE' | 'NEUTRAL' | null;
2461
+
2462
+ label: string;
2463
+
2464
+ sub: string | null;
2465
+
2466
+ value: string;
2467
+ }
2468
+ }
2469
+
2470
+ export interface Recommendation {
2471
+ afterText: string | null;
2472
+
2473
+ beforeText: string | null;
2474
+
2475
+ body: string;
2476
+
2477
+ channel:
2478
+ | 'PROMPT'
2479
+ | 'VOICE_CONFIG'
2480
+ | 'STT'
2481
+ | 'SPEECH_MODEL'
2482
+ | 'LLM_MODEL'
2483
+ | 'INFRA'
2484
+ | 'EXTERNAL'
2485
+ | null;
2486
+
2487
+ order: number;
2488
+
2489
+ promptOptimizationFindingId: string | null;
2490
+
2491
+ severity: 'HIGH' | 'MEDIUM' | 'LOW' | null;
2492
+
2493
+ source: 'PROMPT_OPTIMIZER' | 'DEBRIEF';
2494
+
2495
+ themeSlugs: Array<string>;
2496
+
2497
+ title: string;
2498
+ }
2499
+
2500
+ export interface Target {
2501
+ actual: number | null;
2502
+
2503
+ actualLabel: string | null;
2504
+
2505
+ aggregation: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
2506
+
2507
+ comparator: 'AT_LEAST' | 'AT_MOST';
2508
+
2509
+ deltaDirection: 'POSITIVE' | 'NEGATIVE' | 'NEUTRAL' | null;
2510
+
2511
+ deltaLabel: string | null;
2512
+
2513
+ error: string | null;
2514
+
2515
+ failingConversationCount: number | null;
2516
+
2517
+ key: string;
2518
+
2519
+ label: string;
2520
+
2521
+ lifecycle: 'NEW_MISS' | 'STILL_MISSED' | 'RECOVERED' | 'HOLDING' | null;
2522
+
2523
+ metricDefinitionId: string | null;
2524
+
2525
+ metricName: string;
2526
+
2527
+ metricSlug: string;
2528
+
2529
+ percentile: number | null;
2530
+
2531
+ previous: number | null;
2532
+
2533
+ previousLabel: string | null;
2534
+
2535
+ sampleSize: number;
2536
+
2537
+ series: Array<Target.Sery>;
2538
+
2539
+ status: 'MET' | 'MISSED' | 'NO_DATA';
2540
+
2541
+ targetLabel: string;
2542
+
2543
+ targetValue: number;
2544
+
2545
+ unit: 'PERCENT' | 'VALUE';
2546
+ }
2547
+
2548
+ export namespace Target {
2549
+ export interface Sery {
2550
+ date: string;
2551
+
2552
+ sampleSize: number | null;
2553
+
2554
+ value: number | null;
2555
+ }
2556
+ }
2557
+
2558
+ export interface Theme {
2559
+ affectedConversationCount: number;
2560
+
2561
+ analysis: string;
2562
+
2563
+ checkNames: Array<string>;
2564
+
2565
+ collectorQuote: Theme.CollectorQuote | null;
2566
+
2567
+ estimatedAffectedConversationCount: number | null;
2568
+
2569
+ excerpts: Array<Theme.Excerpt>;
2570
+
2571
+ flaggedForImpact: boolean;
2572
+
2573
+ impact: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW' | null;
2574
+
2575
+ impactReason: string | null;
2576
+
2577
+ issue: Theme.Issue | null;
2578
+
2579
+ lifecycle: 'NEW' | 'PERSISTENT' | 'IMPROVING' | 'FIXED' | null;
2580
+
2581
+ memberConversationIds: Array<string>;
2582
+
2583
+ metricDefinitionIds: Array<string>;
2584
+
2585
+ prevalence: 'WIDESPREAD' | 'RECURRING' | 'ISOLATED' | null;
2586
+
2587
+ rootCauseChannel:
2588
+ | 'PROMPT'
2589
+ | 'VOICE_CONFIG'
2590
+ | 'STT'
2591
+ | 'SPEECH_MODEL'
2592
+ | 'LLM_MODEL'
2593
+ | 'INFRA'
2594
+ | 'EXTERNAL'
2595
+ | null;
2596
+
2597
+ severity: 'HIGH' | 'MEDIUM' | 'LOW';
2598
+
2599
+ slug: string;
2600
+
2601
+ title: string;
2602
+
2603
+ totalConversationCount: number;
2604
+
2605
+ memberCalls?: Array<Theme.MemberCall>;
2606
+ }
2607
+
2608
+ export namespace Theme {
2609
+ export interface CollectorQuote {
2610
+ conversationId: string;
2611
+
2612
+ metricName: string;
2613
+
2614
+ quote: string;
2615
+ }
2616
+
2617
+ export interface Excerpt {
2618
+ callId: string | null;
2619
+
2620
+ caption: string | null;
2621
+
2622
+ conversationId: string;
2623
+
2624
+ personaName: string | null;
2625
+
2626
+ scenarioName: string | null;
2627
+
2628
+ turns: Array<Excerpt.Turn>;
2629
+ }
2630
+
2631
+ export namespace Excerpt {
2632
+ export interface Turn {
2633
+ flagNote: string | null;
2634
+
2635
+ flagged: boolean;
2636
+
2637
+ offsetMs: number | null;
2638
+
2639
+ role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER';
2640
+
2641
+ text: string;
2642
+ }
2643
+ }
2644
+
2645
+ export interface Issue {
2646
+ id: string;
2647
+
2648
+ firstSeenAtIso: string | null;
2649
+
2650
+ status: string;
2651
+
2652
+ title: string;
2653
+ }
2654
+
2655
+ export interface MemberCall {
2656
+ callId: string | null;
2657
+
2658
+ conversationId: string;
2659
+
2660
+ cueMs: number | null;
2661
+
2662
+ personaName: string | null;
2663
+ }
2664
+ }
2665
+
2666
+ export interface Volume {
2667
+ conversationCount: number;
2668
+
2669
+ deltaPct: number | null;
2670
+
2671
+ endings: Array<Volume.Ending>;
2672
+
2673
+ previousConversationCount: number | null;
2674
+
2675
+ series: Array<Volume.Sery>;
2676
+ }
2677
+
2678
+ export namespace Volume {
2679
+ export interface Ending {
2680
+ count: number;
2681
+
2682
+ label: string;
2683
+
2684
+ sharePct: number;
2685
+
2686
+ value: string;
2687
+ }
2688
+
2689
+ export interface Sery {
2690
+ date: string;
2691
+
2692
+ sampleSize: number | null;
2693
+
2694
+ value: number | null;
2695
+ }
2696
+ }
2697
+ }
2698
+ }
2699
+ }
2700
+
2701
+ export interface LiveReportCreateParams {
2702
+ name: string;
2703
+
2704
+ agentId?: string | null;
2705
+
2706
+ cadence?: 'DAILY' | 'WEEKLY' | 'MONTHLY';
2707
+
2708
+ dashboardId?: string | null;
2709
+
2710
+ deliveryHour?: number;
2711
+
2712
+ description?: string | null;
2713
+
2714
+ filters?: Array<LiveReportCreateParams.Filter>;
2715
+
2716
+ /**
2717
+ * Write the report for the latest closed period right away. Default true.
2718
+ */
2719
+ generateNow?: boolean;
2720
+
2721
+ includeTranscriptExcerpts?: boolean;
2722
+
2723
+ notifications?: LiveReportCreateParams.Notifications;
2724
+
2725
+ status?: 'ACTIVE' | 'PAUSED';
2726
+
2727
+ targets?: Array<LiveReportCreateParams.Target>;
2728
+
2729
+ timezone?: string;
2730
+ }
2731
+
2732
+ export namespace LiveReportCreateParams {
2733
+ export interface Filter {
2734
+ /**
2735
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
2736
+ */
2737
+ type:
2738
+ | 'METRIC_PROPERTY'
2739
+ | 'CALL_PROPERTY'
2740
+ | 'AGENT_PROPERTY'
2741
+ | 'CALL_ID'
2742
+ | 'MODALITY'
2743
+ | 'DATASET'
2744
+ | 'METRIC_VALUE';
2745
+
2746
+ /**
2747
+ * Defaults to EQUALS. IS_SET / IS_NOT_SET (CALL_PROPERTY only) keep conversations
2748
+ * where the property is set, whatever the value, or missing (never sent, sent as
2749
+ * null, or removed); they take no value.
2750
+ */
2751
+ operator?:
2752
+ | 'EQUALS'
2753
+ | 'NOT_EQUALS'
2754
+ | 'GREATER_THAN'
2755
+ | 'GREATER_THAN_OR_EQUAL_TO'
2756
+ | 'LESS_THAN'
2757
+ | 'LESS_THAN_OR_EQUAL_TO'
2758
+ | 'CONTAINS'
2759
+ | 'STARTS_WITH'
2760
+ | 'IS_SET'
2761
+ | 'IS_NOT_SET';
2762
+
2763
+ /**
2764
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
2765
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
2766
+ */
2767
+ property?: string;
2768
+
2769
+ /**
2770
+ * The value to compare against (an agent id, "call" / "chat", a property value).
2771
+ * Required except with IS_SET / IS_NOT_SET.
2772
+ */
2773
+ value?: string | number | boolean;
2774
+ }
2775
+
2776
+ export interface Notifications {
2777
+ email: Notifications.Email;
2778
+
2779
+ slack: Array<Notifications.Slack>;
2780
+ }
2781
+
2782
+ export namespace Notifications {
2783
+ export interface Email {
2784
+ enabled: boolean;
2785
+
2786
+ recipients: Array<string>;
2787
+ }
2788
+
2789
+ export interface Slack {
2790
+ channelId: string;
2791
+
2792
+ channelName: string;
2793
+ }
2794
+ }
2795
+
2796
+ export interface Target {
2797
+ /**
2798
+ * The metric's slug (e.g. `task_completion`) or id.
2799
+ */
2800
+ metric: string;
2801
+
2802
+ /**
2803
+ * The bar, in display units. A PASS_RATE bar is a percentage, 0-100.
2804
+ */
2805
+ value: number;
2806
+
2807
+ /**
2808
+ * Defaults to PASS_RATE for thresholds and booleans, AVG for anything numeric.
2809
+ */
2810
+ aggregation?: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
2811
+
2812
+ /**
2813
+ * AT_LEAST (default for PASS_RATE) or AT_MOST (default for every other
2814
+ * aggregation).
2815
+ */
2816
+ comparator?: 'AT_LEAST' | 'AT_MOST';
2817
+
2818
+ /**
2819
+ * Shown instead of the metric's name.
2820
+ */
2821
+ label?: string;
2822
+
2823
+ /**
2824
+ * PASS_RATE on a metric that isn't a threshold: the per-call condition a call
2825
+ * passes on.
2826
+ */
2827
+ passOperator?:
2828
+ | 'EQUALS'
2829
+ | 'NOT_EQUALS'
2830
+ | 'GREATER_THAN'
2831
+ | 'GREATER_THAN_OR_EQUAL_TO'
2832
+ | 'LESS_THAN'
2833
+ | 'LESS_THAN_OR_EQUAL_TO';
2834
+
2835
+ passValue?: string | number | boolean;
2836
+
2837
+ /**
2838
+ * Required with PERCENTILE, e.g. 95.
2839
+ */
2840
+ percentile?: number;
2841
+ }
2842
+ }
2843
+
2844
+ export interface LiveReportUpdateParams {
2845
+ agentId?: string | null;
2846
+
2847
+ cadence?: 'DAILY' | 'WEEKLY' | 'MONTHLY';
2848
+
2849
+ dashboardId?: string | null;
2850
+
2851
+ deliveryHour?: number;
2852
+
2853
+ description?: string | null;
2854
+
2855
+ filters?: Array<LiveReportUpdateParams.Filter>;
2856
+
2857
+ includeTranscriptExcerpts?: boolean;
2858
+
2859
+ name?: string;
2860
+
2861
+ notifications?: LiveReportUpdateParams.Notifications;
2862
+
2863
+ status?: 'ACTIVE' | 'PAUSED';
2864
+
2865
+ targets?: Array<LiveReportUpdateParams.Target>;
2866
+
2867
+ timezone?: string;
2868
+ }
2869
+
2870
+ export namespace LiveReportUpdateParams {
2871
+ export interface Filter {
2872
+ /**
2873
+ * What the filter narrows on. GET /v1/analytics/schema lists each type.
2874
+ */
2875
+ type:
2876
+ | 'METRIC_PROPERTY'
2877
+ | 'CALL_PROPERTY'
2878
+ | 'AGENT_PROPERTY'
2879
+ | 'CALL_ID'
2880
+ | 'MODALITY'
2881
+ | 'DATASET'
2882
+ | 'METRIC_VALUE';
2883
+
2884
+ /**
2885
+ * Defaults to EQUALS. IS_SET / IS_NOT_SET (CALL_PROPERTY only) keep conversations
2886
+ * where the property is set, whatever the value, or missing (never sent, sent as
2887
+ * null, or removed); they take no value.
2888
+ */
2889
+ operator?:
2890
+ | 'EQUALS'
2891
+ | 'NOT_EQUALS'
2892
+ | 'GREATER_THAN'
2893
+ | 'GREATER_THAN_OR_EQUAL_TO'
2894
+ | 'LESS_THAN'
2895
+ | 'LESS_THAN_OR_EQUAL_TO'
2896
+ | 'CONTAINS'
2897
+ | 'STARTS_WITH'
2898
+ | 'IS_SET'
2899
+ | 'IS_NOT_SET';
2900
+
2901
+ /**
2902
+ * The property to compare. Required for CALL_PROPERTY and METRIC_PROPERTY; may be
2903
+ * omitted for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
2904
+ */
2905
+ property?: string;
2906
+
2907
+ /**
2908
+ * The value to compare against (an agent id, "call" / "chat", a property value).
2909
+ * Required except with IS_SET / IS_NOT_SET.
2910
+ */
2911
+ value?: string | number | boolean;
2912
+ }
2913
+
2914
+ export interface Notifications {
2915
+ email: Notifications.Email;
2916
+
2917
+ slack: Array<Notifications.Slack>;
2918
+ }
2919
+
2920
+ export namespace Notifications {
2921
+ export interface Email {
2922
+ enabled: boolean;
2923
+
2924
+ recipients: Array<string>;
2925
+ }
2926
+
2927
+ export interface Slack {
2928
+ channelId: string;
2929
+
2930
+ channelName: string;
2931
+ }
2932
+ }
2933
+
2934
+ export interface Target {
2935
+ /**
2936
+ * The metric's slug (e.g. `task_completion`) or id.
2937
+ */
2938
+ metric: string;
2939
+
2940
+ /**
2941
+ * The bar, in display units. A PASS_RATE bar is a percentage, 0-100.
2942
+ */
2943
+ value: number;
2944
+
2945
+ /**
2946
+ * Defaults to PASS_RATE for thresholds and booleans, AVG for anything numeric.
2947
+ */
2948
+ aggregation?: 'PASS_RATE' | 'AVG' | 'MEDIAN' | 'PERCENTILE' | 'MIN' | 'MAX';
2949
+
2950
+ /**
2951
+ * AT_LEAST (default for PASS_RATE) or AT_MOST (default for every other
2952
+ * aggregation).
2953
+ */
2954
+ comparator?: 'AT_LEAST' | 'AT_MOST';
2955
+
2956
+ /**
2957
+ * Shown instead of the metric's name.
2958
+ */
2959
+ label?: string;
2960
+
2961
+ /**
2962
+ * PASS_RATE on a metric that isn't a threshold: the per-call condition a call
2963
+ * passes on.
2964
+ */
2965
+ passOperator?:
2966
+ | 'EQUALS'
2967
+ | 'NOT_EQUALS'
2968
+ | 'GREATER_THAN'
2969
+ | 'GREATER_THAN_OR_EQUAL_TO'
2970
+ | 'LESS_THAN'
2971
+ | 'LESS_THAN_OR_EQUAL_TO';
2972
+
2973
+ passValue?: string | number | boolean;
2974
+
2975
+ /**
2976
+ * Required with PERCENTILE, e.g. 95.
2977
+ */
2978
+ percentile?: number;
2979
+ }
2980
+ }
2981
+
2982
+ export interface LiveReportListParams {
2983
+ /**
2984
+ * Page size, at most 100.
2985
+ */
2986
+ limit?: number;
2987
+
2988
+ offset?: number;
2989
+ }
2990
+
2991
+ export interface LiveReportGetDocumentParams {
2992
+ /**
2993
+ * The live report ID
2994
+ */
2995
+ reportId: string;
2996
+ }
2997
+
2998
+ export interface LiveReportListDocumentsParams {
2999
+ /**
3000
+ * Page size, at most 100.
3001
+ */
3002
+ limit?: number;
3003
+
3004
+ offset?: number;
3005
+ }
3006
+
3007
+ export interface LiveReportRunParams {
3008
+ /**
3009
+ * ISO 8601 end (exclusive) of a custom window. Requires periodStart.
3010
+ */
3011
+ periodEnd?: string;
3012
+
3013
+ /**
3014
+ * ISO 8601 start of a custom window. Omit both for the latest closed period.
3015
+ */
3016
+ periodStart?: string;
3017
+ }
3018
+
3019
+ export declare namespace LiveReport {
3020
+ export {
3021
+ type LiveReportCreateResponse as LiveReportCreateResponse,
3022
+ type LiveReportUpdateResponse as LiveReportUpdateResponse,
3023
+ type LiveReportListResponse as LiveReportListResponse,
3024
+ type LiveReportDeleteResponse as LiveReportDeleteResponse,
3025
+ type LiveReportGetByIDResponse as LiveReportGetByIDResponse,
3026
+ type LiveReportGetDocumentResponse as LiveReportGetDocumentResponse,
3027
+ type LiveReportListDocumentsResponse as LiveReportListDocumentsResponse,
3028
+ type LiveReportRunResponse as LiveReportRunResponse,
3029
+ type LiveReportCreateParams as LiveReportCreateParams,
3030
+ type LiveReportUpdateParams as LiveReportUpdateParams,
3031
+ type LiveReportListParams as LiveReportListParams,
3032
+ type LiveReportGetDocumentParams as LiveReportGetDocumentParams,
3033
+ type LiveReportListDocumentsParams as LiveReportListDocumentsParams,
3034
+ type LiveReportRunParams as LiveReportRunParams,
3035
+ };
3036
+ }