@roarkanalytics/sdk 2.23.0 → 2.24.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +18 -23
  3. package/client.d.mts +6 -6
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -6
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +2 -2
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/call.d.mts +0 -20
  12. package/resources/call.d.mts.map +1 -1
  13. package/resources/call.d.ts +0 -20
  14. package/resources/call.d.ts.map +1 -1
  15. package/resources/evaluation.d.mts +0 -2783
  16. package/resources/evaluation.d.mts.map +1 -1
  17. package/resources/evaluation.d.ts +0 -2783
  18. package/resources/evaluation.d.ts.map +1 -1
  19. package/resources/evaluation.js +0 -46
  20. package/resources/evaluation.js.map +1 -1
  21. package/resources/evaluation.mjs +0 -46
  22. package/resources/evaluation.mjs.map +1 -1
  23. package/resources/index.d.mts +3 -3
  24. package/resources/index.d.mts.map +1 -1
  25. package/resources/index.d.ts +3 -3
  26. package/resources/index.d.ts.map +1 -1
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs +2 -2
  29. package/resources/index.mjs.map +1 -1
  30. package/resources/integrations.d.mts +0 -110
  31. package/resources/integrations.d.mts.map +1 -1
  32. package/resources/integrations.d.ts +0 -110
  33. package/resources/integrations.d.ts.map +1 -1
  34. package/resources/integrations.js +0 -37
  35. package/resources/integrations.js.map +1 -1
  36. package/resources/integrations.mjs +0 -37
  37. package/resources/integrations.mjs.map +1 -1
  38. package/resources/metric.d.mts +1 -1
  39. package/resources/metric.d.ts +1 -1
  40. package/resources/simulation-job.d.mts +10 -0
  41. package/resources/simulation-job.d.mts.map +1 -1
  42. package/resources/simulation-job.d.ts +10 -0
  43. package/resources/simulation-job.d.ts.map +1 -1
  44. package/resources/simulation-persona.d.mts +30 -0
  45. package/resources/simulation-persona.d.mts.map +1 -1
  46. package/resources/simulation-persona.d.ts +30 -0
  47. package/resources/simulation-persona.d.ts.map +1 -1
  48. package/resources/simulation-run-plan-job.d.mts +40 -4
  49. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  50. package/resources/simulation-run-plan-job.d.ts +40 -4
  51. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  52. package/resources/simulation-run-plan-job.js +4 -3
  53. package/resources/simulation-run-plan-job.js.map +1 -1
  54. package/resources/simulation-run-plan-job.mjs +4 -3
  55. package/resources/simulation-run-plan-job.mjs.map +1 -1
  56. package/resources/simulation-run-plan.d.mts +90 -16
  57. package/resources/simulation-run-plan.d.mts.map +1 -1
  58. package/resources/simulation-run-plan.d.ts +90 -16
  59. package/resources/simulation-run-plan.d.ts.map +1 -1
  60. package/resources/simulation-run-plan.js +2 -2
  61. package/resources/simulation-run-plan.mjs +2 -2
  62. package/resources/simulation-scenario.d.mts +27 -7
  63. package/resources/simulation-scenario.d.mts.map +1 -1
  64. package/resources/simulation-scenario.d.ts +27 -7
  65. package/resources/simulation-scenario.d.ts.map +1 -1
  66. package/src/client.ts +6 -44
  67. package/src/resources/call.ts +0 -20
  68. package/src/resources/evaluation.ts +1 -3570
  69. package/src/resources/index.ts +3 -22
  70. package/src/resources/integrations.ts +1 -131
  71. package/src/resources/metric.ts +1 -1
  72. package/src/resources/simulation-job.ts +12 -0
  73. package/src/resources/simulation-persona.ts +36 -0
  74. package/src/resources/simulation-run-plan-job.ts +45 -3
  75. package/src/resources/simulation-run-plan.ts +102 -16
  76. package/src/resources/simulation-scenario.ts +49 -3
  77. package/src/version.ts +1 -1
  78. package/version.d.mts +1 -1
  79. package/version.d.ts +1 -1
  80. package/version.js +1 -1
  81. package/version.mjs +1 -1
@@ -1,3574 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
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
4
 
8
- export class Evaluation extends APIResource {
9
- /**
10
- * Creates a new evaluator with the specified blocks and configuration.
11
- */
12
- createEvaluator(
13
- body: EvaluationCreateEvaluatorParams,
14
- options?: RequestOptions,
15
- ): APIPromise<EvaluationCreateEvaluatorResponse> {
16
- return this._client.post('/v1/evaluation/evaluators', { body, ...options });
17
- }
18
-
19
- /**
20
- * Create a evaluation job for a single call or dataset of calls
21
- */
22
- createJob(
23
- body: EvaluationCreateJobParams,
24
- options?: RequestOptions,
25
- ): APIPromise<EvaluationCreateJobResponse> {
26
- return this._client.post('/v1/evaluation/job', { body, ...options });
27
- }
28
-
29
- /**
30
- * Returns a specific evaluator with its blocks and configuration.
31
- */
32
- getEvaluatorByID(
33
- evaluatorID: string,
34
- options?: RequestOptions,
35
- ): APIPromise<EvaluationGetEvaluatorByIDResponse> {
36
- return this._client.get(path`/v1/evaluation/evaluators/${evaluatorID}`, options);
37
- }
38
-
39
- /**
40
- * Retrieve details of a specific evaluation job
41
- */
42
- getJob(jobID: string, options?: RequestOptions): APIPromise<EvaluationGetJobResponse> {
43
- return this._client.get(path`/v1/evaluation/job/${jobID}`, options);
44
- }
45
-
46
- /**
47
- * Returns a list of evaluators with their blocks and configuration for the
48
- * authenticated project.
49
- */
50
- listEvaluators(
51
- query: EvaluationListEvaluatorsParams | null | undefined = {},
52
- options?: RequestOptions,
53
- ): APIPromise<EvaluationListEvaluatorsResponse> {
54
- return this._client.get('/v1/evaluation/evaluators', { query, ...options });
55
- }
56
-
57
- /**
58
- * Retrieve paginated details of a specific evaluation job runs
59
- */
60
- listJobRuns(
61
- jobID: string,
62
- query: EvaluationListJobRunsParams | null | undefined = {},
63
- options?: RequestOptions,
64
- ): APIPromise<EvaluationListJobRunsResponse> {
65
- return this._client.get(path`/v1/evaluation/job/${jobID}/runs`, { query, ...options });
66
- }
67
-
68
- /**
69
- * Updates an existing evaluator. When blocks are provided: blocks with an id
70
- * update existing blocks, blocks without an id create new blocks, and existing
71
- * blocks not included in the array are deleted.
72
- */
73
- updateEvaluator(
74
- evaluatorID: string,
75
- body: EvaluationUpdateEvaluatorParams | null | undefined = {},
76
- options?: RequestOptions,
77
- ): APIPromise<EvaluationUpdateEvaluatorResponse> {
78
- return this._client.put(path`/v1/evaluation/evaluators/${evaluatorID}`, { body, ...options });
79
- }
80
- }
81
-
82
- export interface EvaluationCreateEvaluatorResponse {
83
- /**
84
- * Evaluator with its configured blocks
85
- */
86
- data: EvaluationCreateEvaluatorResponse.Data;
87
- }
88
-
89
- export namespace EvaluationCreateEvaluatorResponse {
90
- /**
91
- * Evaluator with its configured blocks
92
- */
93
- export interface Data {
94
- /**
95
- * Unique identifier for the evaluator
96
- */
97
- id: string;
98
-
99
- /**
100
- * Array of evaluation blocks configured for this evaluator
101
- */
102
- blocks: Array<
103
- | Data.UnionMember0
104
- | Data.UnionMember1
105
- | Data.UnionMember2
106
- | Data.UnionMember3
107
- | Data.UnionMember4
108
- | Data.UnionMember5
109
- | Data.UnionMember6
110
- | Data.UnionMember7
111
- | Data.UnionMember8
112
- >;
113
-
114
- /**
115
- * ISO timestamp when the evaluator was created
116
- */
117
- createdAt: string;
118
-
119
- /**
120
- * Optional description of the evaluator
121
- */
122
- description: string | null;
123
-
124
- /**
125
- * Name of the evaluator
126
- */
127
- name: string;
128
-
129
- /**
130
- * Unique slug identifier for the evaluator
131
- */
132
- slug: string;
133
-
134
- /**
135
- * ISO timestamp when the evaluator was last updated
136
- */
137
- updatedAt: string;
138
- }
139
-
140
- export namespace Data {
141
- export interface UnionMember0 {
142
- /**
143
- * Unique identifier for the block
144
- */
145
- id: string;
146
-
147
- /**
148
- * Block type identifier
149
- */
150
- blockType: 'CUSTOM_PROMPT';
151
-
152
- /**
153
- * Optional description of what this block evaluates
154
- */
155
- description: string | null;
156
-
157
- /**
158
- * Name of the metric this prompt evaluates
159
- */
160
- metricName: string;
161
-
162
- /**
163
- * Display name of the evaluation block
164
- */
165
- name: string;
166
-
167
- /**
168
- * Order in which this block is executed
169
- */
170
- orderIndex: number;
171
-
172
- /**
173
- * The prompt to evaluate the call against
174
- */
175
- prompt: string;
176
-
177
- /**
178
- * Minimum score threshold to pass evaluation (0-1)
179
- */
180
- threshold: number;
181
-
182
- /**
183
- * Weight of this block in the overall evaluation score (0-100)
184
- */
185
- weight: number;
186
- }
187
-
188
- export interface UnionMember1 {
189
- /**
190
- * Unique identifier for the block
191
- */
192
- id: string;
193
-
194
- /**
195
- * Block type identifier
196
- */
197
- blockType: 'DATAFIELD_CHECK';
198
-
199
- /**
200
- * Optional description of what this block evaluates
201
- */
202
- description: string | null;
203
-
204
- /**
205
- * Criteria for evaluating the property
206
- */
207
- evaluationCriteria: string;
208
-
209
- /**
210
- * Whether this property must be present
211
- */
212
- isRequired: boolean;
213
-
214
- /**
215
- * Display name of the evaluation block
216
- */
217
- name: string;
218
-
219
- /**
220
- * Order in which this block is executed
221
- */
222
- orderIndex: number;
223
-
224
- /**
225
- * Name of the property to check
226
- */
227
- propertyName: string;
228
-
229
- /**
230
- * Minimum score threshold to pass evaluation (0-1)
231
- */
232
- threshold: number;
233
-
234
- /**
235
- * Expected type of the property value
236
- */
237
- valueType: string;
238
-
239
- /**
240
- * Weight of this block in the overall evaluation score (0-100)
241
- */
242
- weight: number;
243
- }
244
-
245
- export interface UnionMember2 {
246
- /**
247
- * Unique identifier for the block
248
- */
249
- id: string;
250
-
251
- /**
252
- * Block type identifier
253
- */
254
- blockType: 'EMOTION';
255
-
256
- /**
257
- * Optional description of what this block evaluates
258
- */
259
- description: string | null;
260
-
261
- /**
262
- * Display name of the evaluation block
263
- */
264
- name: string;
265
-
266
- /**
267
- * Order in which this block is executed
268
- */
269
- orderIndex: number;
270
-
271
- /**
272
- * The emotion to detect (e.g., "joy", "anger", "sadness")
273
- */
274
- selectedEmotion: string;
275
-
276
- /**
277
- * Minimum confidence threshold for emotion detection (0-1)
278
- */
279
- threshold: number;
280
-
281
- /**
282
- * Weight of this block in the overall evaluation score (0-100)
283
- */
284
- weight: number;
285
- }
286
-
287
- export interface UnionMember3 {
288
- /**
289
- * Unique identifier for the block
290
- */
291
- id: string;
292
-
293
- /**
294
- * Block type identifier
295
- */
296
- blockType: 'LATENCY';
297
-
298
- /**
299
- * Optional description of what this block evaluates
300
- */
301
- description: string | null;
302
-
303
- /**
304
- * Maximum number of silence periods allowed
305
- */
306
- maxAllowedSilences: number;
307
-
308
- /**
309
- * Minimum duration of silence in milliseconds to be considered
310
- */
311
- minSilenceDuration: number;
312
-
313
- /**
314
- * Display name of the evaluation block
315
- */
316
- name: string;
317
-
318
- /**
319
- * Order in which this block is executed
320
- */
321
- orderIndex: number;
322
-
323
- /**
324
- * Maximum allowed latency score
325
- */
326
- threshold: number;
327
-
328
- /**
329
- * Weight of this block in the overall evaluation score (0-100)
330
- */
331
- weight: number;
332
- }
333
-
334
- export interface UnionMember4 {
335
- /**
336
- * Unique identifier for the block
337
- */
338
- id: string;
339
-
340
- /**
341
- * Block type identifier
342
- */
343
- blockType: 'POLITENESS';
344
-
345
- /**
346
- * Optional description of what this block evaluates
347
- */
348
- description: string | null;
349
-
350
- /**
351
- * Display name of the evaluation block
352
- */
353
- name: string;
354
-
355
- /**
356
- * Order in which this block is executed
357
- */
358
- orderIndex: number;
359
-
360
- /**
361
- * Minimum politeness score threshold (0-1)
362
- */
363
- threshold: number;
364
-
365
- /**
366
- * Weight of this block in the overall evaluation score (0-100)
367
- */
368
- weight: number;
369
- }
370
-
371
- export interface UnionMember5 {
372
- /**
373
- * Unique identifier for the block
374
- */
375
- id: string;
376
-
377
- /**
378
- * Block type identifier
379
- */
380
- blockType: 'SENTIMENT';
381
-
382
- /**
383
- * Optional description of what this block evaluates
384
- */
385
- description: string | null;
386
-
387
- /**
388
- * Display name of the evaluation block
389
- */
390
- name: string;
391
-
392
- /**
393
- * Order in which this block is executed
394
- */
395
- orderIndex: number;
396
-
397
- /**
398
- * Minimum sentiment score threshold (0-1)
399
- */
400
- threshold: number;
401
-
402
- /**
403
- * Weight of this block in the overall evaluation score (0-100)
404
- */
405
- weight: number;
406
- }
407
-
408
- export interface UnionMember6 {
409
- /**
410
- * Unique identifier for the block
411
- */
412
- id: string;
413
-
414
- /**
415
- * Block type identifier
416
- */
417
- blockType: 'TOOL_CALLS';
418
-
419
- /**
420
- * Optional description of what this block evaluates
421
- */
422
- description: string | null;
423
-
424
- /**
425
- * Condition that must be met for tool invocation
426
- */
427
- invocationCondition: string | null;
428
-
429
- /**
430
- * Minimum number of times the tool should be invoked
431
- */
432
- minInvocationCount: number | null;
433
-
434
- /**
435
- * Display name of the evaluation block
436
- */
437
- name: string;
438
-
439
- /**
440
- * Order in which this block is executed
441
- */
442
- orderIndex: number;
443
-
444
- /**
445
- * Whether the tool should be invoked
446
- */
447
- shouldBeInvoked: boolean;
448
-
449
- /**
450
- * ID of the tool definition
451
- */
452
- toolDefinitionId: string;
453
-
454
- /**
455
- * Weight of this block in the overall evaluation score (0-100)
456
- */
457
- weight: number;
458
- }
459
-
460
- export interface UnionMember7 {
461
- /**
462
- * Unique identifier for the block
463
- */
464
- id: string;
465
-
466
- /**
467
- * Block type identifier
468
- */
469
- blockType: 'TOXICITY';
470
-
471
- /**
472
- * Optional description of what this block evaluates
473
- */
474
- description: string | null;
475
-
476
- /**
477
- * Display name of the evaluation block
478
- */
479
- name: string;
480
-
481
- /**
482
- * Order in which this block is executed
483
- */
484
- orderIndex: number;
485
-
486
- /**
487
- * Maximum allowed toxicity score (0-1)
488
- */
489
- threshold: number;
490
-
491
- /**
492
- * Weight of this block in the overall evaluation score (0-100)
493
- */
494
- weight: number;
495
- }
496
-
497
- export interface UnionMember8 {
498
- /**
499
- * Unique identifier for the block
500
- */
501
- id: string;
502
-
503
- /**
504
- * Block type identifier
505
- */
506
- blockType: 'VOCAL_CUE';
507
-
508
- /**
509
- * Optional description of what this block evaluates
510
- */
511
- description: string | null;
512
-
513
- /**
514
- * Display name of the evaluation block
515
- */
516
- name: string;
517
-
518
- /**
519
- * Order in which this block is executed
520
- */
521
- orderIndex: number;
522
-
523
- /**
524
- * The vocal cue to detect (e.g., "pace", "tone", "volume")
525
- */
526
- selectedCue: string;
527
-
528
- /**
529
- * Minimum confidence threshold for vocal cue detection (0-1)
530
- */
531
- threshold: number;
532
-
533
- /**
534
- * Weight of this block in the overall evaluation score (0-100)
535
- */
536
- weight: number;
537
- }
538
- }
539
- }
540
-
541
- export interface EvaluationCreateJobResponse {
542
- data: EvaluationCreateJobResponse.Data;
543
- }
544
-
545
- export namespace EvaluationCreateJobResponse {
546
- export interface Data {
547
- /**
548
- * ID of the evaluation job
549
- */
550
- jobId: string;
551
-
552
- /**
553
- * Status of the evaluation job
554
- */
555
- status: 'PENDING' | 'PROCESSING' | 'SUCCESS' | 'FAILURE';
556
-
557
- /**
558
- * ID of the call being evaluated (only present for single call evaluations)
559
- */
560
- callId?: string;
561
- }
562
- }
563
-
564
- /**
565
- * Evaluator with its configured blocks
566
- */
567
- export interface EvaluationGetEvaluatorByIDResponse {
568
- /**
569
- * Unique identifier for the evaluator
570
- */
571
- id: string;
572
-
573
- /**
574
- * Array of evaluation blocks configured for this evaluator
575
- */
576
- blocks: Array<
577
- | EvaluationGetEvaluatorByIDResponse.UnionMember0
578
- | EvaluationGetEvaluatorByIDResponse.UnionMember1
579
- | EvaluationGetEvaluatorByIDResponse.UnionMember2
580
- | EvaluationGetEvaluatorByIDResponse.UnionMember3
581
- | EvaluationGetEvaluatorByIDResponse.UnionMember4
582
- | EvaluationGetEvaluatorByIDResponse.UnionMember5
583
- | EvaluationGetEvaluatorByIDResponse.UnionMember6
584
- | EvaluationGetEvaluatorByIDResponse.UnionMember7
585
- | EvaluationGetEvaluatorByIDResponse.UnionMember8
586
- >;
587
-
588
- /**
589
- * ISO timestamp when the evaluator was created
590
- */
591
- createdAt: string;
592
-
593
- /**
594
- * Optional description of the evaluator
595
- */
596
- description: string | null;
597
-
598
- /**
599
- * Name of the evaluator
600
- */
601
- name: string;
602
-
603
- /**
604
- * Unique slug identifier for the evaluator
605
- */
606
- slug: string;
607
-
608
- /**
609
- * ISO timestamp when the evaluator was last updated
610
- */
611
- updatedAt: string;
612
- }
613
-
614
- export namespace EvaluationGetEvaluatorByIDResponse {
615
- export interface UnionMember0 {
616
- /**
617
- * Unique identifier for the block
618
- */
619
- id: string;
620
-
621
- /**
622
- * Block type identifier
623
- */
624
- blockType: 'CUSTOM_PROMPT';
625
-
626
- /**
627
- * Optional description of what this block evaluates
628
- */
629
- description: string | null;
630
-
631
- /**
632
- * Name of the metric this prompt evaluates
633
- */
634
- metricName: string;
635
-
636
- /**
637
- * Display name of the evaluation block
638
- */
639
- name: string;
640
-
641
- /**
642
- * Order in which this block is executed
643
- */
644
- orderIndex: number;
645
-
646
- /**
647
- * The prompt to evaluate the call against
648
- */
649
- prompt: string;
650
-
651
- /**
652
- * Minimum score threshold to pass evaluation (0-1)
653
- */
654
- threshold: number;
655
-
656
- /**
657
- * Weight of this block in the overall evaluation score (0-100)
658
- */
659
- weight: number;
660
- }
661
-
662
- export interface UnionMember1 {
663
- /**
664
- * Unique identifier for the block
665
- */
666
- id: string;
667
-
668
- /**
669
- * Block type identifier
670
- */
671
- blockType: 'DATAFIELD_CHECK';
672
-
673
- /**
674
- * Optional description of what this block evaluates
675
- */
676
- description: string | null;
677
-
678
- /**
679
- * Criteria for evaluating the property
680
- */
681
- evaluationCriteria: string;
682
-
683
- /**
684
- * Whether this property must be present
685
- */
686
- isRequired: boolean;
687
-
688
- /**
689
- * Display name of the evaluation block
690
- */
691
- name: string;
692
-
693
- /**
694
- * Order in which this block is executed
695
- */
696
- orderIndex: number;
697
-
698
- /**
699
- * Name of the property to check
700
- */
701
- propertyName: string;
702
-
703
- /**
704
- * Minimum score threshold to pass evaluation (0-1)
705
- */
706
- threshold: number;
707
-
708
- /**
709
- * Expected type of the property value
710
- */
711
- valueType: string;
712
-
713
- /**
714
- * Weight of this block in the overall evaluation score (0-100)
715
- */
716
- weight: number;
717
- }
718
-
719
- export interface UnionMember2 {
720
- /**
721
- * Unique identifier for the block
722
- */
723
- id: string;
724
-
725
- /**
726
- * Block type identifier
727
- */
728
- blockType: 'EMOTION';
729
-
730
- /**
731
- * Optional description of what this block evaluates
732
- */
733
- description: string | null;
734
-
735
- /**
736
- * Display name of the evaluation block
737
- */
738
- name: string;
739
-
740
- /**
741
- * Order in which this block is executed
742
- */
743
- orderIndex: number;
744
-
745
- /**
746
- * The emotion to detect (e.g., "joy", "anger", "sadness")
747
- */
748
- selectedEmotion: string;
749
-
750
- /**
751
- * Minimum confidence threshold for emotion detection (0-1)
752
- */
753
- threshold: number;
754
-
755
- /**
756
- * Weight of this block in the overall evaluation score (0-100)
757
- */
758
- weight: number;
759
- }
760
-
761
- export interface UnionMember3 {
762
- /**
763
- * Unique identifier for the block
764
- */
765
- id: string;
766
-
767
- /**
768
- * Block type identifier
769
- */
770
- blockType: 'LATENCY';
771
-
772
- /**
773
- * Optional description of what this block evaluates
774
- */
775
- description: string | null;
776
-
777
- /**
778
- * Maximum number of silence periods allowed
779
- */
780
- maxAllowedSilences: number;
781
-
782
- /**
783
- * Minimum duration of silence in milliseconds to be considered
784
- */
785
- minSilenceDuration: number;
786
-
787
- /**
788
- * Display name of the evaluation block
789
- */
790
- name: string;
791
-
792
- /**
793
- * Order in which this block is executed
794
- */
795
- orderIndex: number;
796
-
797
- /**
798
- * Maximum allowed latency score
799
- */
800
- threshold: number;
801
-
802
- /**
803
- * Weight of this block in the overall evaluation score (0-100)
804
- */
805
- weight: number;
806
- }
807
-
808
- export interface UnionMember4 {
809
- /**
810
- * Unique identifier for the block
811
- */
812
- id: string;
813
-
814
- /**
815
- * Block type identifier
816
- */
817
- blockType: 'POLITENESS';
818
-
819
- /**
820
- * Optional description of what this block evaluates
821
- */
822
- description: string | null;
823
-
824
- /**
825
- * Display name of the evaluation block
826
- */
827
- name: string;
828
-
829
- /**
830
- * Order in which this block is executed
831
- */
832
- orderIndex: number;
833
-
834
- /**
835
- * Minimum politeness score threshold (0-1)
836
- */
837
- threshold: number;
838
-
839
- /**
840
- * Weight of this block in the overall evaluation score (0-100)
841
- */
842
- weight: number;
843
- }
844
-
845
- export interface UnionMember5 {
846
- /**
847
- * Unique identifier for the block
848
- */
849
- id: string;
850
-
851
- /**
852
- * Block type identifier
853
- */
854
- blockType: 'SENTIMENT';
855
-
856
- /**
857
- * Optional description of what this block evaluates
858
- */
859
- description: string | null;
860
-
861
- /**
862
- * Display name of the evaluation block
863
- */
864
- name: string;
865
-
866
- /**
867
- * Order in which this block is executed
868
- */
869
- orderIndex: number;
870
-
871
- /**
872
- * Minimum sentiment score threshold (0-1)
873
- */
874
- threshold: number;
875
-
876
- /**
877
- * Weight of this block in the overall evaluation score (0-100)
878
- */
879
- weight: number;
880
- }
881
-
882
- export interface UnionMember6 {
883
- /**
884
- * Unique identifier for the block
885
- */
886
- id: string;
887
-
888
- /**
889
- * Block type identifier
890
- */
891
- blockType: 'TOOL_CALLS';
892
-
893
- /**
894
- * Optional description of what this block evaluates
895
- */
896
- description: string | null;
897
-
898
- /**
899
- * Condition that must be met for tool invocation
900
- */
901
- invocationCondition: string | null;
902
-
903
- /**
904
- * Minimum number of times the tool should be invoked
905
- */
906
- minInvocationCount: number | null;
907
-
908
- /**
909
- * Display name of the evaluation block
910
- */
911
- name: string;
912
-
913
- /**
914
- * Order in which this block is executed
915
- */
916
- orderIndex: number;
917
-
918
- /**
919
- * Whether the tool should be invoked
920
- */
921
- shouldBeInvoked: boolean;
922
-
923
- /**
924
- * ID of the tool definition
925
- */
926
- toolDefinitionId: string;
927
-
928
- /**
929
- * Weight of this block in the overall evaluation score (0-100)
930
- */
931
- weight: number;
932
- }
933
-
934
- export interface UnionMember7 {
935
- /**
936
- * Unique identifier for the block
937
- */
938
- id: string;
939
-
940
- /**
941
- * Block type identifier
942
- */
943
- blockType: 'TOXICITY';
944
-
945
- /**
946
- * Optional description of what this block evaluates
947
- */
948
- description: string | null;
949
-
950
- /**
951
- * Display name of the evaluation block
952
- */
953
- name: string;
954
-
955
- /**
956
- * Order in which this block is executed
957
- */
958
- orderIndex: number;
959
-
960
- /**
961
- * Maximum allowed toxicity score (0-1)
962
- */
963
- threshold: number;
964
-
965
- /**
966
- * Weight of this block in the overall evaluation score (0-100)
967
- */
968
- weight: number;
969
- }
970
-
971
- export interface UnionMember8 {
972
- /**
973
- * Unique identifier for the block
974
- */
975
- id: string;
976
-
977
- /**
978
- * Block type identifier
979
- */
980
- blockType: 'VOCAL_CUE';
981
-
982
- /**
983
- * Optional description of what this block evaluates
984
- */
985
- description: string | null;
986
-
987
- /**
988
- * Display name of the evaluation block
989
- */
990
- name: string;
991
-
992
- /**
993
- * Order in which this block is executed
994
- */
995
- orderIndex: number;
996
-
997
- /**
998
- * The vocal cue to detect (e.g., "pace", "tone", "volume")
999
- */
1000
- selectedCue: string;
1001
-
1002
- /**
1003
- * Minimum confidence threshold for vocal cue detection (0-1)
1004
- */
1005
- threshold: number;
1006
-
1007
- /**
1008
- * Weight of this block in the overall evaluation score (0-100)
1009
- */
1010
- weight: number;
1011
- }
1012
- }
1013
-
1014
- export interface EvaluationGetJobResponse {
1015
- /**
1016
- * Evaluation job response payload
1017
- */
1018
- data: EvaluationGetJobResponse.Data;
1019
- }
1020
-
1021
- export namespace EvaluationGetJobResponse {
1022
- /**
1023
- * Evaluation job response payload
1024
- */
1025
- export interface Data {
1026
- /**
1027
- * ID of the evaluation job
1028
- */
1029
- id: string;
1030
-
1031
- /**
1032
- * Status of the evaluation job
1033
- */
1034
- status: 'PENDING' | 'PROCESSING' | 'SUCCESS' | 'FAILURE';
1035
-
1036
- /**
1037
- * Call being evaluated
1038
- */
1039
- call?: Data.Call;
1040
-
1041
- /**
1042
- * Dataset being evaluated
1043
- */
1044
- dataset?: Data.Dataset;
1045
- }
1046
-
1047
- export namespace Data {
1048
- /**
1049
- * Call being evaluated
1050
- */
1051
- export interface Call {
1052
- /**
1053
- * ID of the call being evaluated
1054
- */
1055
- id: string | null;
1056
- }
1057
-
1058
- /**
1059
- * Dataset being evaluated
1060
- */
1061
- export interface Dataset {
1062
- /**
1063
- * ID of the dataset
1064
- */
1065
- id: string | null;
1066
-
1067
- /**
1068
- * Calls in the dataset
1069
- */
1070
- calls: Array<Dataset.Call>;
1071
- }
1072
-
1073
- export namespace Dataset {
1074
- export interface Call {
1075
- /**
1076
- * ID of the call
1077
- */
1078
- id: string | null;
1079
- }
1080
- }
1081
- }
1082
- }
1083
-
1084
- /**
1085
- * Response containing evaluators and pagination info
1086
- */
1087
- export interface EvaluationListEvaluatorsResponse {
1088
- /**
1089
- * Array of evaluators with their blocks
1090
- */
1091
- data: Array<EvaluationListEvaluatorsResponse.Data>;
1092
-
1093
- /**
1094
- * Pagination information
1095
- */
1096
- pagination: EvaluationListEvaluatorsResponse.Pagination;
1097
- }
1098
-
1099
- export namespace EvaluationListEvaluatorsResponse {
1100
- /**
1101
- * Evaluator with its configured blocks
1102
- */
1103
- export interface Data {
1104
- /**
1105
- * Unique identifier for the evaluator
1106
- */
1107
- id: string;
1108
-
1109
- /**
1110
- * Array of evaluation blocks configured for this evaluator
1111
- */
1112
- blocks: Array<
1113
- | Data.UnionMember0
1114
- | Data.UnionMember1
1115
- | Data.UnionMember2
1116
- | Data.UnionMember3
1117
- | Data.UnionMember4
1118
- | Data.UnionMember5
1119
- | Data.UnionMember6
1120
- | Data.UnionMember7
1121
- | Data.UnionMember8
1122
- >;
1123
-
1124
- /**
1125
- * ISO timestamp when the evaluator was created
1126
- */
1127
- createdAt: string;
1128
-
1129
- /**
1130
- * Optional description of the evaluator
1131
- */
1132
- description: string | null;
1133
-
1134
- /**
1135
- * Name of the evaluator
1136
- */
1137
- name: string;
1138
-
1139
- /**
1140
- * Unique slug identifier for the evaluator
1141
- */
1142
- slug: string;
1143
-
1144
- /**
1145
- * ISO timestamp when the evaluator was last updated
1146
- */
1147
- updatedAt: string;
1148
- }
1149
-
1150
- export namespace Data {
1151
- export interface UnionMember0 {
1152
- /**
1153
- * Unique identifier for the block
1154
- */
1155
- id: string;
1156
-
1157
- /**
1158
- * Block type identifier
1159
- */
1160
- blockType: 'CUSTOM_PROMPT';
1161
-
1162
- /**
1163
- * Optional description of what this block evaluates
1164
- */
1165
- description: string | null;
1166
-
1167
- /**
1168
- * Name of the metric this prompt evaluates
1169
- */
1170
- metricName: string;
1171
-
1172
- /**
1173
- * Display name of the evaluation block
1174
- */
1175
- name: string;
1176
-
1177
- /**
1178
- * Order in which this block is executed
1179
- */
1180
- orderIndex: number;
1181
-
1182
- /**
1183
- * The prompt to evaluate the call against
1184
- */
1185
- prompt: string;
1186
-
1187
- /**
1188
- * Minimum score threshold to pass evaluation (0-1)
1189
- */
1190
- threshold: number;
1191
-
1192
- /**
1193
- * Weight of this block in the overall evaluation score (0-100)
1194
- */
1195
- weight: number;
1196
- }
1197
-
1198
- export interface UnionMember1 {
1199
- /**
1200
- * Unique identifier for the block
1201
- */
1202
- id: string;
1203
-
1204
- /**
1205
- * Block type identifier
1206
- */
1207
- blockType: 'DATAFIELD_CHECK';
1208
-
1209
- /**
1210
- * Optional description of what this block evaluates
1211
- */
1212
- description: string | null;
1213
-
1214
- /**
1215
- * Criteria for evaluating the property
1216
- */
1217
- evaluationCriteria: string;
1218
-
1219
- /**
1220
- * Whether this property must be present
1221
- */
1222
- isRequired: boolean;
1223
-
1224
- /**
1225
- * Display name of the evaluation block
1226
- */
1227
- name: string;
1228
-
1229
- /**
1230
- * Order in which this block is executed
1231
- */
1232
- orderIndex: number;
1233
-
1234
- /**
1235
- * Name of the property to check
1236
- */
1237
- propertyName: string;
1238
-
1239
- /**
1240
- * Minimum score threshold to pass evaluation (0-1)
1241
- */
1242
- threshold: number;
1243
-
1244
- /**
1245
- * Expected type of the property value
1246
- */
1247
- valueType: string;
1248
-
1249
- /**
1250
- * Weight of this block in the overall evaluation score (0-100)
1251
- */
1252
- weight: number;
1253
- }
1254
-
1255
- export interface UnionMember2 {
1256
- /**
1257
- * Unique identifier for the block
1258
- */
1259
- id: string;
1260
-
1261
- /**
1262
- * Block type identifier
1263
- */
1264
- blockType: 'EMOTION';
1265
-
1266
- /**
1267
- * Optional description of what this block evaluates
1268
- */
1269
- description: string | null;
1270
-
1271
- /**
1272
- * Display name of the evaluation block
1273
- */
1274
- name: string;
1275
-
1276
- /**
1277
- * Order in which this block is executed
1278
- */
1279
- orderIndex: number;
1280
-
1281
- /**
1282
- * The emotion to detect (e.g., "joy", "anger", "sadness")
1283
- */
1284
- selectedEmotion: string;
1285
-
1286
- /**
1287
- * Minimum confidence threshold for emotion detection (0-1)
1288
- */
1289
- threshold: number;
1290
-
1291
- /**
1292
- * Weight of this block in the overall evaluation score (0-100)
1293
- */
1294
- weight: number;
1295
- }
1296
-
1297
- export interface UnionMember3 {
1298
- /**
1299
- * Unique identifier for the block
1300
- */
1301
- id: string;
1302
-
1303
- /**
1304
- * Block type identifier
1305
- */
1306
- blockType: 'LATENCY';
1307
-
1308
- /**
1309
- * Optional description of what this block evaluates
1310
- */
1311
- description: string | null;
1312
-
1313
- /**
1314
- * Maximum number of silence periods allowed
1315
- */
1316
- maxAllowedSilences: number;
1317
-
1318
- /**
1319
- * Minimum duration of silence in milliseconds to be considered
1320
- */
1321
- minSilenceDuration: number;
1322
-
1323
- /**
1324
- * Display name of the evaluation block
1325
- */
1326
- name: string;
1327
-
1328
- /**
1329
- * Order in which this block is executed
1330
- */
1331
- orderIndex: number;
1332
-
1333
- /**
1334
- * Maximum allowed latency score
1335
- */
1336
- threshold: number;
1337
-
1338
- /**
1339
- * Weight of this block in the overall evaluation score (0-100)
1340
- */
1341
- weight: number;
1342
- }
1343
-
1344
- export interface UnionMember4 {
1345
- /**
1346
- * Unique identifier for the block
1347
- */
1348
- id: string;
1349
-
1350
- /**
1351
- * Block type identifier
1352
- */
1353
- blockType: 'POLITENESS';
1354
-
1355
- /**
1356
- * Optional description of what this block evaluates
1357
- */
1358
- description: string | null;
1359
-
1360
- /**
1361
- * Display name of the evaluation block
1362
- */
1363
- name: string;
1364
-
1365
- /**
1366
- * Order in which this block is executed
1367
- */
1368
- orderIndex: number;
1369
-
1370
- /**
1371
- * Minimum politeness score threshold (0-1)
1372
- */
1373
- threshold: number;
1374
-
1375
- /**
1376
- * Weight of this block in the overall evaluation score (0-100)
1377
- */
1378
- weight: number;
1379
- }
1380
-
1381
- export interface UnionMember5 {
1382
- /**
1383
- * Unique identifier for the block
1384
- */
1385
- id: string;
1386
-
1387
- /**
1388
- * Block type identifier
1389
- */
1390
- blockType: 'SENTIMENT';
1391
-
1392
- /**
1393
- * Optional description of what this block evaluates
1394
- */
1395
- description: string | null;
1396
-
1397
- /**
1398
- * Display name of the evaluation block
1399
- */
1400
- name: string;
1401
-
1402
- /**
1403
- * Order in which this block is executed
1404
- */
1405
- orderIndex: number;
1406
-
1407
- /**
1408
- * Minimum sentiment score threshold (0-1)
1409
- */
1410
- threshold: number;
1411
-
1412
- /**
1413
- * Weight of this block in the overall evaluation score (0-100)
1414
- */
1415
- weight: number;
1416
- }
1417
-
1418
- export interface UnionMember6 {
1419
- /**
1420
- * Unique identifier for the block
1421
- */
1422
- id: string;
1423
-
1424
- /**
1425
- * Block type identifier
1426
- */
1427
- blockType: 'TOOL_CALLS';
1428
-
1429
- /**
1430
- * Optional description of what this block evaluates
1431
- */
1432
- description: string | null;
1433
-
1434
- /**
1435
- * Condition that must be met for tool invocation
1436
- */
1437
- invocationCondition: string | null;
1438
-
1439
- /**
1440
- * Minimum number of times the tool should be invoked
1441
- */
1442
- minInvocationCount: number | null;
1443
-
1444
- /**
1445
- * Display name of the evaluation block
1446
- */
1447
- name: string;
1448
-
1449
- /**
1450
- * Order in which this block is executed
1451
- */
1452
- orderIndex: number;
1453
-
1454
- /**
1455
- * Whether the tool should be invoked
1456
- */
1457
- shouldBeInvoked: boolean;
1458
-
1459
- /**
1460
- * ID of the tool definition
1461
- */
1462
- toolDefinitionId: string;
1463
-
1464
- /**
1465
- * Weight of this block in the overall evaluation score (0-100)
1466
- */
1467
- weight: number;
1468
- }
1469
-
1470
- export interface UnionMember7 {
1471
- /**
1472
- * Unique identifier for the block
1473
- */
1474
- id: string;
1475
-
1476
- /**
1477
- * Block type identifier
1478
- */
1479
- blockType: 'TOXICITY';
1480
-
1481
- /**
1482
- * Optional description of what this block evaluates
1483
- */
1484
- description: string | null;
1485
-
1486
- /**
1487
- * Display name of the evaluation block
1488
- */
1489
- name: string;
1490
-
1491
- /**
1492
- * Order in which this block is executed
1493
- */
1494
- orderIndex: number;
1495
-
1496
- /**
1497
- * Maximum allowed toxicity score (0-1)
1498
- */
1499
- threshold: number;
1500
-
1501
- /**
1502
- * Weight of this block in the overall evaluation score (0-100)
1503
- */
1504
- weight: number;
1505
- }
1506
-
1507
- export interface UnionMember8 {
1508
- /**
1509
- * Unique identifier for the block
1510
- */
1511
- id: string;
1512
-
1513
- /**
1514
- * Block type identifier
1515
- */
1516
- blockType: 'VOCAL_CUE';
1517
-
1518
- /**
1519
- * Optional description of what this block evaluates
1520
- */
1521
- description: string | null;
1522
-
1523
- /**
1524
- * Display name of the evaluation block
1525
- */
1526
- name: string;
1527
-
1528
- /**
1529
- * Order in which this block is executed
1530
- */
1531
- orderIndex: number;
1532
-
1533
- /**
1534
- * The vocal cue to detect (e.g., "pace", "tone", "volume")
1535
- */
1536
- selectedCue: string;
1537
-
1538
- /**
1539
- * Minimum confidence threshold for vocal cue detection (0-1)
1540
- */
1541
- threshold: number;
1542
-
1543
- /**
1544
- * Weight of this block in the overall evaluation score (0-100)
1545
- */
1546
- weight: number;
1547
- }
1548
- }
1549
-
1550
- /**
1551
- * Pagination information
1552
- */
1553
- export interface Pagination {
1554
- /**
1555
- * Whether there are more evaluators to fetch
1556
- */
1557
- hasMore: boolean;
1558
-
1559
- /**
1560
- * Cursor for the next page, null if no more pages
1561
- */
1562
- nextCursor: string | null;
1563
-
1564
- /**
1565
- * Total number of evaluators
1566
- */
1567
- total: number;
1568
- }
1569
- }
1570
-
1571
- export interface EvaluationListJobRunsResponse {
1572
- /**
1573
- * Evaluation job runs response payload
1574
- */
1575
- data: EvaluationListJobRunsResponse.Data;
1576
- }
1577
-
1578
- export namespace EvaluationListJobRunsResponse {
1579
- /**
1580
- * Evaluation job runs response payload
1581
- */
1582
- export interface Data {
1583
- /**
1584
- * Evaluator runs of the evaluation job
1585
- */
1586
- data: Array<Data.Data> | null;
1587
-
1588
- /**
1589
- * Pagination information
1590
- */
1591
- pagination: Data.Pagination | null;
1592
- }
1593
-
1594
- export namespace Data {
1595
- export interface Data {
1596
- /**
1597
- * All block runs for this evaluator, including skipped ones
1598
- */
1599
- blockRuns: Array<Data.BlockRun>;
1600
-
1601
- evaluator: Data.Evaluator;
1602
-
1603
- evidence: Array<Data.Evidence>;
1604
-
1605
- metrics: Array<Data.Metric>;
1606
-
1607
- /**
1608
- * Status of the evaluator run
1609
- */
1610
- status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
1611
-
1612
- /**
1613
- * ID of the evaluator run
1614
- */
1615
- id?: string;
1616
-
1617
- /**
1618
- * When the evaluator run completed
1619
- */
1620
- completedAt?: string | null;
1621
-
1622
- /**
1623
- * Result of the evaluator run based on score threshold (IRRELEVANT is mapped to
1624
- * SKIPPED)
1625
- */
1626
- result?: 'SUCCESS' | 'FAILURE' | 'SKIPPED' | null;
1627
-
1628
- /**
1629
- * Score of the evaluation run (0-1)
1630
- */
1631
- score?: number | null;
1632
-
1633
- /**
1634
- * When the evaluator run started
1635
- */
1636
- startedAt?: string | null;
1637
-
1638
- /**
1639
- * Summary of the evaluation run
1640
- */
1641
- summary?: string | null;
1642
- }
1643
-
1644
- export namespace Data {
1645
- export interface BlockRun {
1646
- /**
1647
- * ID of the block definition
1648
- */
1649
- blockDefinitionId: string;
1650
-
1651
- /**
1652
- * Name of the evaluation block
1653
- */
1654
- blockName: string;
1655
-
1656
- /**
1657
- * ID of the block run instance
1658
- */
1659
- blockRunId: string;
1660
-
1661
- /**
1662
- * When the block run was created
1663
- */
1664
- createdAt: string;
1665
-
1666
- /**
1667
- * Reason for the outcome (pass/fail explanation or skip reason)
1668
- */
1669
- reason: string | null;
1670
-
1671
- /**
1672
- * Result of the block run
1673
- */
1674
- result: 'PASSED' | 'FAILED' | 'SKIPPED' | null;
1675
-
1676
- /**
1677
- * Score of the block run (0-1)
1678
- */
1679
- score: number | null;
1680
-
1681
- /**
1682
- * Status of the block run
1683
- */
1684
- status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';
1685
- }
1686
-
1687
- export interface Evaluator {
1688
- /**
1689
- * ID of the evaluator
1690
- */
1691
- id: string;
1692
-
1693
- /**
1694
- * Name of the evaluator
1695
- */
1696
- name: string;
1697
-
1698
- /**
1699
- * Weight of the evaluator
1700
- */
1701
- weight?: number;
1702
- }
1703
-
1704
- export interface Evidence {
1705
- /**
1706
- * Comment text of the evidence
1707
- */
1708
- commentText: string | null;
1709
-
1710
- /**
1711
- * Created at of the evidence
1712
- */
1713
- createdAt: string;
1714
-
1715
- /**
1716
- * Is positive of the evidence
1717
- */
1718
- isPositive: boolean;
1719
-
1720
- /**
1721
- * Snippet text of the evidence
1722
- */
1723
- snippetText: string;
1724
- }
1725
-
1726
- export interface Metric {
1727
- /**
1728
- * Boolean value of the metric
1729
- */
1730
- booleanValue: boolean | null;
1731
-
1732
- /**
1733
- * Confidence level of the metric (0-1)
1734
- */
1735
- confidence: number | null;
1736
-
1737
- /**
1738
- * Created at of the metric
1739
- */
1740
- createdAt: string;
1741
-
1742
- /**
1743
- * Name of the metric
1744
- */
1745
- name: string;
1746
-
1747
- /**
1748
- * Numeric value of the metric
1749
- */
1750
- numericValue: number | null;
1751
-
1752
- /**
1753
- * Reasoning of the metric
1754
- */
1755
- reasoning: string | null;
1756
-
1757
- /**
1758
- * Role of the metric
1759
- */
1760
- role: string;
1761
-
1762
- /**
1763
- * Text value of the metric
1764
- */
1765
- textValue: string | null;
1766
-
1767
- /**
1768
- * Value type of the metric
1769
- */
1770
- valueType: string;
1771
- }
1772
- }
1773
-
1774
- /**
1775
- * Pagination information
1776
- */
1777
- export interface Pagination {
1778
- /**
1779
- * Whether there are more items to fetch
1780
- */
1781
- hasMore: boolean;
1782
-
1783
- /**
1784
- * Cursor for the next page of items
1785
- */
1786
- nextCursor: string | null;
1787
-
1788
- /**
1789
- * Total number of items
1790
- */
1791
- total: number;
1792
- }
1793
- }
1794
- }
1795
-
1796
- export interface EvaluationUpdateEvaluatorResponse {
1797
- /**
1798
- * Evaluator with its configured blocks
1799
- */
1800
- data: EvaluationUpdateEvaluatorResponse.Data;
1801
- }
1802
-
1803
- export namespace EvaluationUpdateEvaluatorResponse {
1804
- /**
1805
- * Evaluator with its configured blocks
1806
- */
1807
- export interface Data {
1808
- /**
1809
- * Unique identifier for the evaluator
1810
- */
1811
- id: string;
1812
-
1813
- /**
1814
- * Array of evaluation blocks configured for this evaluator
1815
- */
1816
- blocks: Array<
1817
- | Data.UnionMember0
1818
- | Data.UnionMember1
1819
- | Data.UnionMember2
1820
- | Data.UnionMember3
1821
- | Data.UnionMember4
1822
- | Data.UnionMember5
1823
- | Data.UnionMember6
1824
- | Data.UnionMember7
1825
- | Data.UnionMember8
1826
- >;
1827
-
1828
- /**
1829
- * ISO timestamp when the evaluator was created
1830
- */
1831
- createdAt: string;
1832
-
1833
- /**
1834
- * Optional description of the evaluator
1835
- */
1836
- description: string | null;
1837
-
1838
- /**
1839
- * Name of the evaluator
1840
- */
1841
- name: string;
1842
-
1843
- /**
1844
- * Unique slug identifier for the evaluator
1845
- */
1846
- slug: string;
1847
-
1848
- /**
1849
- * ISO timestamp when the evaluator was last updated
1850
- */
1851
- updatedAt: string;
1852
- }
1853
-
1854
- export namespace Data {
1855
- export interface UnionMember0 {
1856
- /**
1857
- * Unique identifier for the block
1858
- */
1859
- id: string;
1860
-
1861
- /**
1862
- * Block type identifier
1863
- */
1864
- blockType: 'CUSTOM_PROMPT';
1865
-
1866
- /**
1867
- * Optional description of what this block evaluates
1868
- */
1869
- description: string | null;
1870
-
1871
- /**
1872
- * Name of the metric this prompt evaluates
1873
- */
1874
- metricName: string;
1875
-
1876
- /**
1877
- * Display name of the evaluation block
1878
- */
1879
- name: string;
1880
-
1881
- /**
1882
- * Order in which this block is executed
1883
- */
1884
- orderIndex: number;
1885
-
1886
- /**
1887
- * The prompt to evaluate the call against
1888
- */
1889
- prompt: string;
1890
-
1891
- /**
1892
- * Minimum score threshold to pass evaluation (0-1)
1893
- */
1894
- threshold: number;
1895
-
1896
- /**
1897
- * Weight of this block in the overall evaluation score (0-100)
1898
- */
1899
- weight: number;
1900
- }
1901
-
1902
- export interface UnionMember1 {
1903
- /**
1904
- * Unique identifier for the block
1905
- */
1906
- id: string;
1907
-
1908
- /**
1909
- * Block type identifier
1910
- */
1911
- blockType: 'DATAFIELD_CHECK';
1912
-
1913
- /**
1914
- * Optional description of what this block evaluates
1915
- */
1916
- description: string | null;
1917
-
1918
- /**
1919
- * Criteria for evaluating the property
1920
- */
1921
- evaluationCriteria: string;
1922
-
1923
- /**
1924
- * Whether this property must be present
1925
- */
1926
- isRequired: boolean;
1927
-
1928
- /**
1929
- * Display name of the evaluation block
1930
- */
1931
- name: string;
1932
-
1933
- /**
1934
- * Order in which this block is executed
1935
- */
1936
- orderIndex: number;
1937
-
1938
- /**
1939
- * Name of the property to check
1940
- */
1941
- propertyName: string;
1942
-
1943
- /**
1944
- * Minimum score threshold to pass evaluation (0-1)
1945
- */
1946
- threshold: number;
1947
-
1948
- /**
1949
- * Expected type of the property value
1950
- */
1951
- valueType: string;
1952
-
1953
- /**
1954
- * Weight of this block in the overall evaluation score (0-100)
1955
- */
1956
- weight: number;
1957
- }
1958
-
1959
- export interface UnionMember2 {
1960
- /**
1961
- * Unique identifier for the block
1962
- */
1963
- id: string;
1964
-
1965
- /**
1966
- * Block type identifier
1967
- */
1968
- blockType: 'EMOTION';
1969
-
1970
- /**
1971
- * Optional description of what this block evaluates
1972
- */
1973
- description: string | null;
1974
-
1975
- /**
1976
- * Display name of the evaluation block
1977
- */
1978
- name: string;
1979
-
1980
- /**
1981
- * Order in which this block is executed
1982
- */
1983
- orderIndex: number;
1984
-
1985
- /**
1986
- * The emotion to detect (e.g., "joy", "anger", "sadness")
1987
- */
1988
- selectedEmotion: string;
1989
-
1990
- /**
1991
- * Minimum confidence threshold for emotion detection (0-1)
1992
- */
1993
- threshold: number;
1994
-
1995
- /**
1996
- * Weight of this block in the overall evaluation score (0-100)
1997
- */
1998
- weight: number;
1999
- }
2000
-
2001
- export interface UnionMember3 {
2002
- /**
2003
- * Unique identifier for the block
2004
- */
2005
- id: string;
2006
-
2007
- /**
2008
- * Block type identifier
2009
- */
2010
- blockType: 'LATENCY';
2011
-
2012
- /**
2013
- * Optional description of what this block evaluates
2014
- */
2015
- description: string | null;
2016
-
2017
- /**
2018
- * Maximum number of silence periods allowed
2019
- */
2020
- maxAllowedSilences: number;
2021
-
2022
- /**
2023
- * Minimum duration of silence in milliseconds to be considered
2024
- */
2025
- minSilenceDuration: number;
2026
-
2027
- /**
2028
- * Display name of the evaluation block
2029
- */
2030
- name: string;
2031
-
2032
- /**
2033
- * Order in which this block is executed
2034
- */
2035
- orderIndex: number;
2036
-
2037
- /**
2038
- * Maximum allowed latency score
2039
- */
2040
- threshold: number;
2041
-
2042
- /**
2043
- * Weight of this block in the overall evaluation score (0-100)
2044
- */
2045
- weight: number;
2046
- }
2047
-
2048
- export interface UnionMember4 {
2049
- /**
2050
- * Unique identifier for the block
2051
- */
2052
- id: string;
2053
-
2054
- /**
2055
- * Block type identifier
2056
- */
2057
- blockType: 'POLITENESS';
2058
-
2059
- /**
2060
- * Optional description of what this block evaluates
2061
- */
2062
- description: string | null;
2063
-
2064
- /**
2065
- * Display name of the evaluation block
2066
- */
2067
- name: string;
2068
-
2069
- /**
2070
- * Order in which this block is executed
2071
- */
2072
- orderIndex: number;
2073
-
2074
- /**
2075
- * Minimum politeness score threshold (0-1)
2076
- */
2077
- threshold: number;
2078
-
2079
- /**
2080
- * Weight of this block in the overall evaluation score (0-100)
2081
- */
2082
- weight: number;
2083
- }
2084
-
2085
- export interface UnionMember5 {
2086
- /**
2087
- * Unique identifier for the block
2088
- */
2089
- id: string;
2090
-
2091
- /**
2092
- * Block type identifier
2093
- */
2094
- blockType: 'SENTIMENT';
2095
-
2096
- /**
2097
- * Optional description of what this block evaluates
2098
- */
2099
- description: string | null;
2100
-
2101
- /**
2102
- * Display name of the evaluation block
2103
- */
2104
- name: string;
2105
-
2106
- /**
2107
- * Order in which this block is executed
2108
- */
2109
- orderIndex: number;
2110
-
2111
- /**
2112
- * Minimum sentiment score threshold (0-1)
2113
- */
2114
- threshold: number;
2115
-
2116
- /**
2117
- * Weight of this block in the overall evaluation score (0-100)
2118
- */
2119
- weight: number;
2120
- }
2121
-
2122
- export interface UnionMember6 {
2123
- /**
2124
- * Unique identifier for the block
2125
- */
2126
- id: string;
2127
-
2128
- /**
2129
- * Block type identifier
2130
- */
2131
- blockType: 'TOOL_CALLS';
2132
-
2133
- /**
2134
- * Optional description of what this block evaluates
2135
- */
2136
- description: string | null;
2137
-
2138
- /**
2139
- * Condition that must be met for tool invocation
2140
- */
2141
- invocationCondition: string | null;
2142
-
2143
- /**
2144
- * Minimum number of times the tool should be invoked
2145
- */
2146
- minInvocationCount: number | null;
2147
-
2148
- /**
2149
- * Display name of the evaluation block
2150
- */
2151
- name: string;
2152
-
2153
- /**
2154
- * Order in which this block is executed
2155
- */
2156
- orderIndex: number;
2157
-
2158
- /**
2159
- * Whether the tool should be invoked
2160
- */
2161
- shouldBeInvoked: boolean;
2162
-
2163
- /**
2164
- * ID of the tool definition
2165
- */
2166
- toolDefinitionId: string;
2167
-
2168
- /**
2169
- * Weight of this block in the overall evaluation score (0-100)
2170
- */
2171
- weight: number;
2172
- }
2173
-
2174
- export interface UnionMember7 {
2175
- /**
2176
- * Unique identifier for the block
2177
- */
2178
- id: string;
2179
-
2180
- /**
2181
- * Block type identifier
2182
- */
2183
- blockType: 'TOXICITY';
2184
-
2185
- /**
2186
- * Optional description of what this block evaluates
2187
- */
2188
- description: string | null;
2189
-
2190
- /**
2191
- * Display name of the evaluation block
2192
- */
2193
- name: string;
2194
-
2195
- /**
2196
- * Order in which this block is executed
2197
- */
2198
- orderIndex: number;
2199
-
2200
- /**
2201
- * Maximum allowed toxicity score (0-1)
2202
- */
2203
- threshold: number;
2204
-
2205
- /**
2206
- * Weight of this block in the overall evaluation score (0-100)
2207
- */
2208
- weight: number;
2209
- }
2210
-
2211
- export interface UnionMember8 {
2212
- /**
2213
- * Unique identifier for the block
2214
- */
2215
- id: string;
2216
-
2217
- /**
2218
- * Block type identifier
2219
- */
2220
- blockType: 'VOCAL_CUE';
2221
-
2222
- /**
2223
- * Optional description of what this block evaluates
2224
- */
2225
- description: string | null;
2226
-
2227
- /**
2228
- * Display name of the evaluation block
2229
- */
2230
- name: string;
2231
-
2232
- /**
2233
- * Order in which this block is executed
2234
- */
2235
- orderIndex: number;
2236
-
2237
- /**
2238
- * The vocal cue to detect (e.g., "pace", "tone", "volume")
2239
- */
2240
- selectedCue: string;
2241
-
2242
- /**
2243
- * Minimum confidence threshold for vocal cue detection (0-1)
2244
- */
2245
- threshold: number;
2246
-
2247
- /**
2248
- * Weight of this block in the overall evaluation score (0-100)
2249
- */
2250
- weight: number;
2251
- }
2252
- }
2253
- }
2254
-
2255
- export interface EvaluationCreateEvaluatorParams {
2256
- /**
2257
- * Array of evaluation blocks (at least one required)
2258
- */
2259
- blocks: Array<
2260
- | EvaluationCreateEvaluatorParams.CreateCustomPromptBlockInput
2261
- | EvaluationCreateEvaluatorParams.CreateDatafieldCheckBlockInput
2262
- | EvaluationCreateEvaluatorParams.CreateEmotionBlockInput
2263
- | EvaluationCreateEvaluatorParams.CreateLatencyBlockInput
2264
- | EvaluationCreateEvaluatorParams.CreatePolitenessBlockInput
2265
- | EvaluationCreateEvaluatorParams.CreateSentimentBlockInput
2266
- | EvaluationCreateEvaluatorParams.CreateToolCallsBlockInput
2267
- | EvaluationCreateEvaluatorParams.CreateToxicityBlockInput
2268
- | EvaluationCreateEvaluatorParams.CreateVocalCueBlockInput
2269
- >;
2270
-
2271
- /**
2272
- * Name of the evaluator
2273
- */
2274
- name: string;
2275
-
2276
- /**
2277
- * Optional description of the evaluator
2278
- */
2279
- description?: string | null;
2280
- }
2281
-
2282
- export namespace EvaluationCreateEvaluatorParams {
2283
- export interface CreateCustomPromptBlockInput {
2284
- blockType: 'CUSTOM_PROMPT';
2285
-
2286
- /**
2287
- * Name of the metric this prompt evaluates
2288
- */
2289
- metricName: string;
2290
-
2291
- /**
2292
- * Display name of the evaluation block
2293
- */
2294
- name: string;
2295
-
2296
- /**
2297
- * The prompt to evaluate the call against
2298
- */
2299
- prompt: string;
2300
-
2301
- /**
2302
- * Optional description of what this block evaluates
2303
- */
2304
- description?: string | null;
2305
-
2306
- /**
2307
- * Input dimensions for the block (auto-assigned if not provided)
2308
- */
2309
- inputDimensions?: Array<string>;
2310
-
2311
- /**
2312
- * Order in which this block is executed (defaults to array position)
2313
- */
2314
- orderIndex?: number;
2315
-
2316
- /**
2317
- * Condition to skip this block evaluation
2318
- */
2319
- skipCondition?: string | null;
2320
-
2321
- /**
2322
- * Minimum score threshold to pass evaluation (0-1, default: 0.7)
2323
- */
2324
- threshold?: number;
2325
-
2326
- /**
2327
- * Weight of this block in the overall evaluation score (0-100, default: 50)
2328
- */
2329
- weight?: number;
2330
- }
2331
-
2332
- export interface CreateDatafieldCheckBlockInput {
2333
- blockType: 'DATAFIELD_CHECK';
2334
-
2335
- /**
2336
- * Criteria for evaluating the property
2337
- */
2338
- evaluationCriteria: string;
2339
-
2340
- /**
2341
- * Display name of the evaluation block
2342
- */
2343
- name: string;
2344
-
2345
- /**
2346
- * Name of the property to check
2347
- */
2348
- propertyName: string;
2349
-
2350
- /**
2351
- * Optional description of what this block evaluates
2352
- */
2353
- description?: string | null;
2354
-
2355
- /**
2356
- * Input dimensions for the block (auto-assigned if not provided)
2357
- */
2358
- inputDimensions?: Array<string>;
2359
-
2360
- /**
2361
- * Whether this property must be present
2362
- */
2363
- isRequired?: boolean;
2364
-
2365
- /**
2366
- * Order in which this block is executed (defaults to array position)
2367
- */
2368
- orderIndex?: number;
2369
-
2370
- /**
2371
- * Condition to skip this block evaluation
2372
- */
2373
- skipCondition?: string | null;
2374
-
2375
- /**
2376
- * Minimum score threshold to pass evaluation (0-1, default: 0.8)
2377
- */
2378
- threshold?: number;
2379
-
2380
- /**
2381
- * Expected type of the property value
2382
- */
2383
- valueType?: string;
2384
-
2385
- /**
2386
- * Weight of this block in the overall evaluation score (0-100, default: 50)
2387
- */
2388
- weight?: number;
2389
- }
2390
-
2391
- export interface CreateEmotionBlockInput {
2392
- blockType: 'EMOTION';
2393
-
2394
- /**
2395
- * Display name of the evaluation block
2396
- */
2397
- name: string;
2398
-
2399
- /**
2400
- * Optional description of what this block evaluates
2401
- */
2402
- description?: string | null;
2403
-
2404
- /**
2405
- * Input dimensions for the block (auto-assigned if not provided)
2406
- */
2407
- inputDimensions?: Array<string>;
2408
-
2409
- /**
2410
- * Order in which this block is executed (defaults to array position)
2411
- */
2412
- orderIndex?: number;
2413
-
2414
- /**
2415
- * The emotion to detect (e.g., "joy", "anger", "sadness")
2416
- */
2417
- selectedEmotion?: string;
2418
-
2419
- /**
2420
- * Condition to skip this block evaluation
2421
- */
2422
- skipCondition?: string | null;
2423
-
2424
- /**
2425
- * Minimum confidence threshold for emotion detection (0-1, default: 0.7)
2426
- */
2427
- threshold?: number;
2428
-
2429
- /**
2430
- * Weight of this block in the overall evaluation score (0-100, default: 50)
2431
- */
2432
- weight?: number;
2433
- }
2434
-
2435
- export interface CreateLatencyBlockInput {
2436
- blockType: 'LATENCY';
2437
-
2438
- /**
2439
- * Display name of the evaluation block
2440
- */
2441
- name: string;
2442
-
2443
- /**
2444
- * Optional description of what this block evaluates
2445
- */
2446
- description?: string | null;
2447
-
2448
- /**
2449
- * Input dimensions for the block (auto-assigned if not provided)
2450
- */
2451
- inputDimensions?: Array<string>;
2452
-
2453
- /**
2454
- * Maximum number of silence periods allowed
2455
- */
2456
- maxAllowedSilences?: number;
2457
-
2458
- /**
2459
- * Minimum duration of silence in milliseconds to be considered
2460
- */
2461
- minSilenceDuration?: number;
2462
-
2463
- /**
2464
- * Order in which this block is executed (defaults to array position)
2465
- */
2466
- orderIndex?: number;
2467
-
2468
- /**
2469
- * Condition to skip this block evaluation
2470
- */
2471
- skipCondition?: string | null;
2472
-
2473
- /**
2474
- * Maximum allowed latency score
2475
- */
2476
- threshold?: number;
2477
-
2478
- /**
2479
- * Weight of this block in the overall evaluation score (0-100, default: 50)
2480
- */
2481
- weight?: number;
2482
- }
2483
-
2484
- export interface CreatePolitenessBlockInput {
2485
- blockType: 'POLITENESS';
2486
-
2487
- /**
2488
- * Display name of the evaluation block
2489
- */
2490
- name: string;
2491
-
2492
- /**
2493
- * Optional description of what this block evaluates
2494
- */
2495
- description?: string | null;
2496
-
2497
- /**
2498
- * Input dimensions for the block (auto-assigned if not provided)
2499
- */
2500
- inputDimensions?: Array<string>;
2501
-
2502
- /**
2503
- * Order in which this block is executed (defaults to array position)
2504
- */
2505
- orderIndex?: number;
2506
-
2507
- /**
2508
- * Condition to skip this block evaluation
2509
- */
2510
- skipCondition?: string | null;
2511
-
2512
- /**
2513
- * Minimum politeness score threshold (0-1, default: 0.7)
2514
- */
2515
- threshold?: number;
2516
-
2517
- /**
2518
- * Weight of this block in the overall evaluation score (0-100, default: 50)
2519
- */
2520
- weight?: number;
2521
- }
2522
-
2523
- export interface CreateSentimentBlockInput {
2524
- blockType: 'SENTIMENT';
2525
-
2526
- /**
2527
- * Display name of the evaluation block
2528
- */
2529
- name: string;
2530
-
2531
- /**
2532
- * Optional description of what this block evaluates
2533
- */
2534
- description?: string | null;
2535
-
2536
- /**
2537
- * Input dimensions for the block (auto-assigned if not provided)
2538
- */
2539
- inputDimensions?: Array<string>;
2540
-
2541
- /**
2542
- * Order in which this block is executed (defaults to array position)
2543
- */
2544
- orderIndex?: number;
2545
-
2546
- /**
2547
- * Condition to skip this block evaluation
2548
- */
2549
- skipCondition?: string | null;
2550
-
2551
- /**
2552
- * Minimum sentiment score threshold (0-1, default: 0.7)
2553
- */
2554
- threshold?: number;
2555
-
2556
- /**
2557
- * Weight of this block in the overall evaluation score (0-100, default: 50)
2558
- */
2559
- weight?: number;
2560
- }
2561
-
2562
- export interface CreateToolCallsBlockInput {
2563
- blockType: 'TOOL_CALLS';
2564
-
2565
- /**
2566
- * Display name of the evaluation block
2567
- */
2568
- name: string;
2569
-
2570
- /**
2571
- * ID of the tool definition
2572
- */
2573
- toolDefinitionId: string;
2574
-
2575
- /**
2576
- * Optional description of what this block evaluates
2577
- */
2578
- description?: string | null;
2579
-
2580
- /**
2581
- * Input dimensions for the block (auto-assigned if not provided)
2582
- */
2583
- inputDimensions?: Array<string>;
2584
-
2585
- /**
2586
- * Condition that must be met for tool invocation
2587
- */
2588
- invocationCondition?: string | null;
2589
-
2590
- /**
2591
- * Minimum number of times the tool should be invoked
2592
- */
2593
- minInvocationCount?: number | null;
2594
-
2595
- /**
2596
- * Order in which this block is executed (defaults to array position)
2597
- */
2598
- orderIndex?: number;
2599
-
2600
- /**
2601
- * Whether the tool should be invoked
2602
- */
2603
- shouldBeInvoked?: boolean;
2604
-
2605
- /**
2606
- * Condition to skip this block evaluation
2607
- */
2608
- skipCondition?: string | null;
2609
-
2610
- /**
2611
- * Weight of this block in the overall evaluation score (0-100, default: 50)
2612
- */
2613
- weight?: number;
2614
- }
2615
-
2616
- export interface CreateToxicityBlockInput {
2617
- blockType: 'TOXICITY';
2618
-
2619
- /**
2620
- * Display name of the evaluation block
2621
- */
2622
- name: string;
2623
-
2624
- /**
2625
- * Optional description of what this block evaluates
2626
- */
2627
- description?: string | null;
2628
-
2629
- /**
2630
- * Input dimensions for the block (auto-assigned if not provided)
2631
- */
2632
- inputDimensions?: Array<string>;
2633
-
2634
- /**
2635
- * Order in which this block is executed (defaults to array position)
2636
- */
2637
- orderIndex?: number;
2638
-
2639
- /**
2640
- * Condition to skip this block evaluation
2641
- */
2642
- skipCondition?: string | null;
2643
-
2644
- /**
2645
- * Maximum allowed toxicity score (0-1, default: 0.7)
2646
- */
2647
- threshold?: number;
2648
-
2649
- /**
2650
- * Weight of this block in the overall evaluation score (0-100, default: 50)
2651
- */
2652
- weight?: number;
2653
- }
2654
-
2655
- export interface CreateVocalCueBlockInput {
2656
- blockType: 'VOCAL_CUE';
2657
-
2658
- /**
2659
- * Display name of the evaluation block
2660
- */
2661
- name: string;
2662
-
2663
- /**
2664
- * Optional description of what this block evaluates
2665
- */
2666
- description?: string | null;
2667
-
2668
- /**
2669
- * Input dimensions for the block (auto-assigned if not provided)
2670
- */
2671
- inputDimensions?: Array<string>;
2672
-
2673
- /**
2674
- * Order in which this block is executed (defaults to array position)
2675
- */
2676
- orderIndex?: number;
2677
-
2678
- /**
2679
- * The vocal cue to detect (e.g., "pace", "tone", "volume")
2680
- */
2681
- selectedCue?: string;
2682
-
2683
- /**
2684
- * Condition to skip this block evaluation
2685
- */
2686
- skipCondition?: string | null;
2687
-
2688
- /**
2689
- * Minimum confidence threshold for vocal cue detection (0-1, default: 0.7)
2690
- */
2691
- threshold?: number;
2692
-
2693
- /**
2694
- * Weight of this block in the overall evaluation score (0-100, default: 50)
2695
- */
2696
- weight?: number;
2697
- }
2698
- }
2699
-
2700
- export interface EvaluationCreateJobParams {
2701
- /**
2702
- * List of evaluators slugs to evaluate the calls or "all" to evaluate all
2703
- * evaluators
2704
- */
2705
- evaluators: Array<string> | 'all';
2706
-
2707
- /**
2708
- * Call input to evaluate
2709
- */
2710
- call?: EvaluationCreateJobParams.Call;
2711
-
2712
- /**
2713
- * ID of an existing call to evaluate
2714
- */
2715
- callId?: string;
2716
-
2717
- dataset?: EvaluationCreateJobParams.Dataset;
2718
- }
2719
-
2720
- export namespace EvaluationCreateJobParams {
2721
- /**
2722
- * Call input to evaluate
2723
- */
2724
- export interface Call {
2725
- /**
2726
- * Direction of the call (INBOUND or OUTBOUND)
2727
- */
2728
- callDirection: 'INBOUND' | 'OUTBOUND';
2729
-
2730
- /**
2731
- * Interface type of the call (PHONE or WEB)
2732
- */
2733
- interfaceType: 'PHONE' | 'WEB';
2734
-
2735
- /**
2736
- * Exactly two participants in the call
2737
- */
2738
- participants: Array<Call.Participant>;
2739
-
2740
- /**
2741
- * URL of source recording (must be an accessible WAV, MP3, or MP4 file). Can be a
2742
- * signed URL.
2743
- */
2744
- recordingUrl: string;
2745
-
2746
- /**
2747
- * When the call started (ISO 8601 format)
2748
- */
2749
- startedAt: string;
2750
-
2751
- /**
2752
- * Additional context on why the call terminated with the endedStatus
2753
- */
2754
- endedReason?: string;
2755
-
2756
- /**
2757
- * High-level call end status, indicating how the call terminated
2758
- */
2759
- endedStatus?:
2760
- | 'PARTICIPANTS_DID_NOT_SPEAK'
2761
- | 'AGENT_DID_NOT_ANSWER'
2762
- | 'AGENT_DID_NOT_SPEAK'
2763
- | 'AGENT_STOPPED_SPEAKING'
2764
- | 'AGENT_ENDED_CALL'
2765
- | 'AGENT_TRANSFERRED_CALL'
2766
- | 'AGENT_BUSY'
2767
- | 'AGENT_ERROR'
2768
- | 'CUSTOMER_ENDED_CALL'
2769
- | 'VOICE_MAIL_REACHED'
2770
- | 'SILENCE_TIME_OUT'
2771
- | 'PHONE_CALL_PROVIDER_CONNECTION_ERROR'
2772
- | 'CUSTOMER_DID_NOT_ANSWER'
2773
- | 'CUSTOMER_DID_NOT_SPEAK'
2774
- | 'CUSTOMER_STOPPED_SPEAKING'
2775
- | 'CUSTOMER_BUSY'
2776
- | 'DIAL_ERROR'
2777
- | 'MAX_DURATION_REACHED'
2778
- | 'UNKNOWN';
2779
-
2780
- /**
2781
- * Whether this is a test call
2782
- */
2783
- isTest?: boolean;
2784
-
2785
- /**
2786
- * Custom properties to include with the call. These can be used for filtering and
2787
- * will show in the call details page
2788
- */
2789
- properties?: { [key: string]: unknown };
2790
-
2791
- /**
2792
- * Retell call ID if call is being imported from Retell
2793
- */
2794
- retellCallId?: string;
2795
-
2796
- /**
2797
- * URL of source stereo recording. Must be accessible. Can be a signed URL. While
2798
- * optional it allows for a richer audio player. Supported formats: WAV, MP3, MP4.
2799
- */
2800
- stereoRecordingUrl?: string;
2801
-
2802
- /**
2803
- * List of tool invocations made during the call
2804
- */
2805
- toolInvocations?: Array<Call.ToolInvocation>;
2806
-
2807
- /**
2808
- * Vapi call ID if call is being imported from Vapi
2809
- */
2810
- vapiCallId?: string;
2811
- }
2812
-
2813
- export namespace Call {
2814
- export interface Participant {
2815
- role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER';
2816
-
2817
- isSimulated?: boolean;
2818
-
2819
- name?: string | null;
2820
-
2821
- participantId?: string | null;
2822
-
2823
- phoneNumber?: string | null;
2824
-
2825
- spokeFirst?: boolean;
2826
- }
2827
-
2828
- export interface ToolInvocation {
2829
- /**
2830
- * Name of the tool that was invoked
2831
- */
2832
- name: string;
2833
-
2834
- /**
2835
- * Parameters provided to the tool during invocation
2836
- */
2837
- parameters: { [key: string]: ToolInvocation.UnionMember0 | unknown };
2838
-
2839
- /**
2840
- * Result returned by the tool after execution. Can be a string or a JSON object
2841
- */
2842
- result: string | { [key: string]: unknown };
2843
-
2844
- /**
2845
- * Offset in milliseconds from the start of the call when the tool was invoked
2846
- */
2847
- startOffsetMs: number;
2848
-
2849
- /**
2850
- * Description of when the tool should be invoked
2851
- */
2852
- description?: string;
2853
-
2854
- /**
2855
- * Offset in milliseconds from the start of the call when the tool execution
2856
- * completed. Used to calculate duration of the tool execution
2857
- */
2858
- endOffsetMs?: number;
2859
- }
2860
-
2861
- export namespace ToolInvocation {
2862
- export interface UnionMember0 {
2863
- description?: string;
2864
-
2865
- type?: 'string' | 'number' | 'boolean';
2866
-
2867
- value?: unknown;
2868
- }
2869
- }
2870
- }
2871
-
2872
- export interface Dataset {
2873
- /**
2874
- * List of calls input to evaluate
2875
- */
2876
- calls: Array<Dataset.Call>;
2877
-
2878
- /**
2879
- * Name of the dataset
2880
- */
2881
- name: string;
2882
- }
2883
-
2884
- export namespace Dataset {
2885
- export interface Call {
2886
- /**
2887
- * Direction of the call (INBOUND or OUTBOUND)
2888
- */
2889
- callDirection: 'INBOUND' | 'OUTBOUND';
2890
-
2891
- /**
2892
- * Interface type of the call (PHONE or WEB)
2893
- */
2894
- interfaceType: 'PHONE' | 'WEB';
2895
-
2896
- /**
2897
- * Exactly two participants in the call
2898
- */
2899
- participants: Array<Call.Participant>;
2900
-
2901
- /**
2902
- * URL of source recording (must be an accessible WAV, MP3, or MP4 file). Can be a
2903
- * signed URL.
2904
- */
2905
- recordingUrl: string;
2906
-
2907
- /**
2908
- * When the call started (ISO 8601 format)
2909
- */
2910
- startedAt: string;
2911
-
2912
- /**
2913
- * Additional context on why the call terminated with the endedStatus
2914
- */
2915
- endedReason?: string;
2916
-
2917
- /**
2918
- * High-level call end status, indicating how the call terminated
2919
- */
2920
- endedStatus?:
2921
- | 'PARTICIPANTS_DID_NOT_SPEAK'
2922
- | 'AGENT_DID_NOT_ANSWER'
2923
- | 'AGENT_DID_NOT_SPEAK'
2924
- | 'AGENT_STOPPED_SPEAKING'
2925
- | 'AGENT_ENDED_CALL'
2926
- | 'AGENT_TRANSFERRED_CALL'
2927
- | 'AGENT_BUSY'
2928
- | 'AGENT_ERROR'
2929
- | 'CUSTOMER_ENDED_CALL'
2930
- | 'VOICE_MAIL_REACHED'
2931
- | 'SILENCE_TIME_OUT'
2932
- | 'PHONE_CALL_PROVIDER_CONNECTION_ERROR'
2933
- | 'CUSTOMER_DID_NOT_ANSWER'
2934
- | 'CUSTOMER_DID_NOT_SPEAK'
2935
- | 'CUSTOMER_STOPPED_SPEAKING'
2936
- | 'CUSTOMER_BUSY'
2937
- | 'DIAL_ERROR'
2938
- | 'MAX_DURATION_REACHED'
2939
- | 'UNKNOWN';
2940
-
2941
- /**
2942
- * Whether this is a test call
2943
- */
2944
- isTest?: boolean;
2945
-
2946
- /**
2947
- * Custom properties to include with the call. These can be used for filtering and
2948
- * will show in the call details page
2949
- */
2950
- properties?: { [key: string]: unknown };
2951
-
2952
- /**
2953
- * Retell call ID if call is being imported from Retell
2954
- */
2955
- retellCallId?: string;
2956
-
2957
- /**
2958
- * URL of source stereo recording. Must be accessible. Can be a signed URL. While
2959
- * optional it allows for a richer audio player. Supported formats: WAV, MP3, MP4.
2960
- */
2961
- stereoRecordingUrl?: string;
2962
-
2963
- /**
2964
- * List of tool invocations made during the call
2965
- */
2966
- toolInvocations?: Array<Call.ToolInvocation>;
2967
-
2968
- /**
2969
- * Vapi call ID if call is being imported from Vapi
2970
- */
2971
- vapiCallId?: string;
2972
- }
2973
-
2974
- export namespace Call {
2975
- export interface Participant {
2976
- role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER';
2977
-
2978
- isSimulated?: boolean;
2979
-
2980
- name?: string | null;
2981
-
2982
- participantId?: string | null;
2983
-
2984
- phoneNumber?: string | null;
2985
-
2986
- spokeFirst?: boolean;
2987
- }
2988
-
2989
- export interface ToolInvocation {
2990
- /**
2991
- * Name of the tool that was invoked
2992
- */
2993
- name: string;
2994
-
2995
- /**
2996
- * Parameters provided to the tool during invocation
2997
- */
2998
- parameters: { [key: string]: ToolInvocation.UnionMember0 | unknown };
2999
-
3000
- /**
3001
- * Result returned by the tool after execution. Can be a string or a JSON object
3002
- */
3003
- result: string | { [key: string]: unknown };
3004
-
3005
- /**
3006
- * Offset in milliseconds from the start of the call when the tool was invoked
3007
- */
3008
- startOffsetMs: number;
3009
-
3010
- /**
3011
- * Description of when the tool should be invoked
3012
- */
3013
- description?: string;
3014
-
3015
- /**
3016
- * Offset in milliseconds from the start of the call when the tool execution
3017
- * completed. Used to calculate duration of the tool execution
3018
- */
3019
- endOffsetMs?: number;
3020
- }
3021
-
3022
- export namespace ToolInvocation {
3023
- export interface UnionMember0 {
3024
- description?: string;
3025
-
3026
- type?: 'string' | 'number' | 'boolean';
3027
-
3028
- value?: unknown;
3029
- }
3030
- }
3031
- }
3032
- }
3033
- }
3034
-
3035
- export interface EvaluationListEvaluatorsParams {
3036
- /**
3037
- * Cursor for pagination - evaluator ID to start after
3038
- */
3039
- after?: string;
3040
-
3041
- /**
3042
- * Maximum number of evaluators to return (default: 20, max: 50)
3043
- */
3044
- limit?: string;
3045
- }
3046
-
3047
- export interface EvaluationListJobRunsParams {
3048
- /**
3049
- * Number of items to return per page
3050
- */
3051
- limit?: string;
3052
-
3053
- /**
3054
- * Cursor for the next page of items
3055
- */
3056
- nextCursor?: string;
3057
- }
3058
-
3059
- export interface EvaluationUpdateEvaluatorParams {
3060
- /**
3061
- * Updated array of evaluation blocks. Include id to update, omit id to create.
3062
- * Existing blocks not in the array will be deleted.
3063
- */
3064
- blocks?: Array<
3065
- | EvaluationUpdateEvaluatorParams.CreateCustomPromptBlockInput
3066
- | EvaluationUpdateEvaluatorParams.CreateDatafieldCheckBlockInput
3067
- | EvaluationUpdateEvaluatorParams.CreateEmotionBlockInput
3068
- | EvaluationUpdateEvaluatorParams.CreateLatencyBlockInput
3069
- | EvaluationUpdateEvaluatorParams.CreatePolitenessBlockInput
3070
- | EvaluationUpdateEvaluatorParams.CreateSentimentBlockInput
3071
- | EvaluationUpdateEvaluatorParams.CreateToolCallsBlockInput
3072
- | EvaluationUpdateEvaluatorParams.CreateToxicityBlockInput
3073
- | EvaluationUpdateEvaluatorParams.CreateVocalCueBlockInput
3074
- >;
3075
-
3076
- /**
3077
- * New description for the evaluator
3078
- */
3079
- description?: string | null;
3080
-
3081
- /**
3082
- * New name for the evaluator
3083
- */
3084
- name?: string;
3085
- }
3086
-
3087
- export namespace EvaluationUpdateEvaluatorParams {
3088
- export interface CreateCustomPromptBlockInput {
3089
- blockType: 'CUSTOM_PROMPT';
3090
-
3091
- /**
3092
- * Name of the metric this prompt evaluates
3093
- */
3094
- metricName: string;
3095
-
3096
- /**
3097
- * Display name of the evaluation block
3098
- */
3099
- name: string;
3100
-
3101
- /**
3102
- * The prompt to evaluate the call against
3103
- */
3104
- prompt: string;
3105
-
3106
- /**
3107
- * ID of an existing block to update. Omit to create a new block. Existing blocks
3108
- * not included will be deleted.
3109
- */
3110
- id?: string;
3111
-
3112
- /**
3113
- * Optional description of what this block evaluates
3114
- */
3115
- description?: string | null;
3116
-
3117
- /**
3118
- * Input dimensions for the block (auto-assigned if not provided)
3119
- */
3120
- inputDimensions?: Array<string>;
3121
-
3122
- /**
3123
- * Order in which this block is executed (defaults to array position)
3124
- */
3125
- orderIndex?: number;
3126
-
3127
- /**
3128
- * Condition to skip this block evaluation
3129
- */
3130
- skipCondition?: string | null;
3131
-
3132
- /**
3133
- * Minimum score threshold to pass evaluation (0-1, default: 0.7)
3134
- */
3135
- threshold?: number;
3136
-
3137
- /**
3138
- * Weight of this block in the overall evaluation score (0-100, default: 50)
3139
- */
3140
- weight?: number;
3141
- }
3142
-
3143
- export interface CreateDatafieldCheckBlockInput {
3144
- blockType: 'DATAFIELD_CHECK';
3145
-
3146
- /**
3147
- * Criteria for evaluating the property
3148
- */
3149
- evaluationCriteria: string;
3150
-
3151
- /**
3152
- * Display name of the evaluation block
3153
- */
3154
- name: string;
3155
-
3156
- /**
3157
- * Name of the property to check
3158
- */
3159
- propertyName: string;
3160
-
3161
- /**
3162
- * ID of an existing block to update. Omit to create a new block. Existing blocks
3163
- * not included will be deleted.
3164
- */
3165
- id?: string;
3166
-
3167
- /**
3168
- * Optional description of what this block evaluates
3169
- */
3170
- description?: string | null;
3171
-
3172
- /**
3173
- * Input dimensions for the block (auto-assigned if not provided)
3174
- */
3175
- inputDimensions?: Array<string>;
3176
-
3177
- /**
3178
- * Whether this property must be present
3179
- */
3180
- isRequired?: boolean;
3181
-
3182
- /**
3183
- * Order in which this block is executed (defaults to array position)
3184
- */
3185
- orderIndex?: number;
3186
-
3187
- /**
3188
- * Condition to skip this block evaluation
3189
- */
3190
- skipCondition?: string | null;
3191
-
3192
- /**
3193
- * Minimum score threshold to pass evaluation (0-1, default: 0.8)
3194
- */
3195
- threshold?: number;
3196
-
3197
- /**
3198
- * Expected type of the property value
3199
- */
3200
- valueType?: string;
3201
-
3202
- /**
3203
- * Weight of this block in the overall evaluation score (0-100, default: 50)
3204
- */
3205
- weight?: number;
3206
- }
3207
-
3208
- export interface CreateEmotionBlockInput {
3209
- blockType: 'EMOTION';
3210
-
3211
- /**
3212
- * Display name of the evaluation block
3213
- */
3214
- name: string;
3215
-
3216
- /**
3217
- * ID of an existing block to update. Omit to create a new block. Existing blocks
3218
- * not included will be deleted.
3219
- */
3220
- id?: string;
3221
-
3222
- /**
3223
- * Optional description of what this block evaluates
3224
- */
3225
- description?: string | null;
3226
-
3227
- /**
3228
- * Input dimensions for the block (auto-assigned if not provided)
3229
- */
3230
- inputDimensions?: Array<string>;
3231
-
3232
- /**
3233
- * Order in which this block is executed (defaults to array position)
3234
- */
3235
- orderIndex?: number;
3236
-
3237
- /**
3238
- * The emotion to detect (e.g., "joy", "anger", "sadness")
3239
- */
3240
- selectedEmotion?: string;
3241
-
3242
- /**
3243
- * Condition to skip this block evaluation
3244
- */
3245
- skipCondition?: string | null;
3246
-
3247
- /**
3248
- * Minimum confidence threshold for emotion detection (0-1, default: 0.7)
3249
- */
3250
- threshold?: number;
3251
-
3252
- /**
3253
- * Weight of this block in the overall evaluation score (0-100, default: 50)
3254
- */
3255
- weight?: number;
3256
- }
3257
-
3258
- export interface CreateLatencyBlockInput {
3259
- blockType: 'LATENCY';
3260
-
3261
- /**
3262
- * Display name of the evaluation block
3263
- */
3264
- name: string;
3265
-
3266
- /**
3267
- * ID of an existing block to update. Omit to create a new block. Existing blocks
3268
- * not included will be deleted.
3269
- */
3270
- id?: string;
3271
-
3272
- /**
3273
- * Optional description of what this block evaluates
3274
- */
3275
- description?: string | null;
3276
-
3277
- /**
3278
- * Input dimensions for the block (auto-assigned if not provided)
3279
- */
3280
- inputDimensions?: Array<string>;
3281
-
3282
- /**
3283
- * Maximum number of silence periods allowed
3284
- */
3285
- maxAllowedSilences?: number;
3286
-
3287
- /**
3288
- * Minimum duration of silence in milliseconds to be considered
3289
- */
3290
- minSilenceDuration?: number;
3291
-
3292
- /**
3293
- * Order in which this block is executed (defaults to array position)
3294
- */
3295
- orderIndex?: number;
3296
-
3297
- /**
3298
- * Condition to skip this block evaluation
3299
- */
3300
- skipCondition?: string | null;
3301
-
3302
- /**
3303
- * Maximum allowed latency score
3304
- */
3305
- threshold?: number;
3306
-
3307
- /**
3308
- * Weight of this block in the overall evaluation score (0-100, default: 50)
3309
- */
3310
- weight?: number;
3311
- }
3312
-
3313
- export interface CreatePolitenessBlockInput {
3314
- blockType: 'POLITENESS';
3315
-
3316
- /**
3317
- * Display name of the evaluation block
3318
- */
3319
- name: string;
3320
-
3321
- /**
3322
- * ID of an existing block to update. Omit to create a new block. Existing blocks
3323
- * not included will be deleted.
3324
- */
3325
- id?: string;
3326
-
3327
- /**
3328
- * Optional description of what this block evaluates
3329
- */
3330
- description?: string | null;
3331
-
3332
- /**
3333
- * Input dimensions for the block (auto-assigned if not provided)
3334
- */
3335
- inputDimensions?: Array<string>;
3336
-
3337
- /**
3338
- * Order in which this block is executed (defaults to array position)
3339
- */
3340
- orderIndex?: number;
3341
-
3342
- /**
3343
- * Condition to skip this block evaluation
3344
- */
3345
- skipCondition?: string | null;
3346
-
3347
- /**
3348
- * Minimum politeness score threshold (0-1, default: 0.7)
3349
- */
3350
- threshold?: number;
3351
-
3352
- /**
3353
- * Weight of this block in the overall evaluation score (0-100, default: 50)
3354
- */
3355
- weight?: number;
3356
- }
3357
-
3358
- export interface CreateSentimentBlockInput {
3359
- blockType: 'SENTIMENT';
3360
-
3361
- /**
3362
- * Display name of the evaluation block
3363
- */
3364
- name: string;
3365
-
3366
- /**
3367
- * ID of an existing block to update. Omit to create a new block. Existing blocks
3368
- * not included will be deleted.
3369
- */
3370
- id?: string;
3371
-
3372
- /**
3373
- * Optional description of what this block evaluates
3374
- */
3375
- description?: string | null;
3376
-
3377
- /**
3378
- * Input dimensions for the block (auto-assigned if not provided)
3379
- */
3380
- inputDimensions?: Array<string>;
3381
-
3382
- /**
3383
- * Order in which this block is executed (defaults to array position)
3384
- */
3385
- orderIndex?: number;
3386
-
3387
- /**
3388
- * Condition to skip this block evaluation
3389
- */
3390
- skipCondition?: string | null;
3391
-
3392
- /**
3393
- * Minimum sentiment score threshold (0-1, default: 0.7)
3394
- */
3395
- threshold?: number;
3396
-
3397
- /**
3398
- * Weight of this block in the overall evaluation score (0-100, default: 50)
3399
- */
3400
- weight?: number;
3401
- }
3402
-
3403
- export interface CreateToolCallsBlockInput {
3404
- blockType: 'TOOL_CALLS';
3405
-
3406
- /**
3407
- * Display name of the evaluation block
3408
- */
3409
- name: string;
3410
-
3411
- /**
3412
- * ID of the tool definition
3413
- */
3414
- toolDefinitionId: string;
3415
-
3416
- /**
3417
- * ID of an existing block to update. Omit to create a new block. Existing blocks
3418
- * not included will be deleted.
3419
- */
3420
- id?: string;
3421
-
3422
- /**
3423
- * Optional description of what this block evaluates
3424
- */
3425
- description?: string | null;
3426
-
3427
- /**
3428
- * Input dimensions for the block (auto-assigned if not provided)
3429
- */
3430
- inputDimensions?: Array<string>;
3431
-
3432
- /**
3433
- * Condition that must be met for tool invocation
3434
- */
3435
- invocationCondition?: string | null;
3436
-
3437
- /**
3438
- * Minimum number of times the tool should be invoked
3439
- */
3440
- minInvocationCount?: number | null;
3441
-
3442
- /**
3443
- * Order in which this block is executed (defaults to array position)
3444
- */
3445
- orderIndex?: number;
3446
-
3447
- /**
3448
- * Whether the tool should be invoked
3449
- */
3450
- shouldBeInvoked?: boolean;
3451
-
3452
- /**
3453
- * Condition to skip this block evaluation
3454
- */
3455
- skipCondition?: string | null;
3456
-
3457
- /**
3458
- * Weight of this block in the overall evaluation score (0-100, default: 50)
3459
- */
3460
- weight?: number;
3461
- }
3462
-
3463
- export interface CreateToxicityBlockInput {
3464
- blockType: 'TOXICITY';
3465
-
3466
- /**
3467
- * Display name of the evaluation block
3468
- */
3469
- name: string;
3470
-
3471
- /**
3472
- * ID of an existing block to update. Omit to create a new block. Existing blocks
3473
- * not included will be deleted.
3474
- */
3475
- id?: string;
3476
-
3477
- /**
3478
- * Optional description of what this block evaluates
3479
- */
3480
- description?: string | null;
3481
-
3482
- /**
3483
- * Input dimensions for the block (auto-assigned if not provided)
3484
- */
3485
- inputDimensions?: Array<string>;
3486
-
3487
- /**
3488
- * Order in which this block is executed (defaults to array position)
3489
- */
3490
- orderIndex?: number;
3491
-
3492
- /**
3493
- * Condition to skip this block evaluation
3494
- */
3495
- skipCondition?: string | null;
3496
-
3497
- /**
3498
- * Maximum allowed toxicity score (0-1, default: 0.7)
3499
- */
3500
- threshold?: number;
3501
-
3502
- /**
3503
- * Weight of this block in the overall evaluation score (0-100, default: 50)
3504
- */
3505
- weight?: number;
3506
- }
3507
-
3508
- export interface CreateVocalCueBlockInput {
3509
- blockType: 'VOCAL_CUE';
3510
-
3511
- /**
3512
- * Display name of the evaluation block
3513
- */
3514
- name: string;
3515
-
3516
- /**
3517
- * ID of an existing block to update. Omit to create a new block. Existing blocks
3518
- * not included will be deleted.
3519
- */
3520
- id?: string;
3521
-
3522
- /**
3523
- * Optional description of what this block evaluates
3524
- */
3525
- description?: string | null;
3526
-
3527
- /**
3528
- * Input dimensions for the block (auto-assigned if not provided)
3529
- */
3530
- inputDimensions?: Array<string>;
3531
-
3532
- /**
3533
- * Order in which this block is executed (defaults to array position)
3534
- */
3535
- orderIndex?: number;
3536
-
3537
- /**
3538
- * The vocal cue to detect (e.g., "pace", "tone", "volume")
3539
- */
3540
- selectedCue?: string;
3541
-
3542
- /**
3543
- * Condition to skip this block evaluation
3544
- */
3545
- skipCondition?: string | null;
3546
-
3547
- /**
3548
- * Minimum confidence threshold for vocal cue detection (0-1, default: 0.7)
3549
- */
3550
- threshold?: number;
3551
-
3552
- /**
3553
- * Weight of this block in the overall evaluation score (0-100, default: 50)
3554
- */
3555
- weight?: number;
3556
- }
3557
- }
3558
-
3559
- export declare namespace Evaluation {
3560
- export {
3561
- type EvaluationCreateEvaluatorResponse as EvaluationCreateEvaluatorResponse,
3562
- type EvaluationCreateJobResponse as EvaluationCreateJobResponse,
3563
- type EvaluationGetEvaluatorByIDResponse as EvaluationGetEvaluatorByIDResponse,
3564
- type EvaluationGetJobResponse as EvaluationGetJobResponse,
3565
- type EvaluationListEvaluatorsResponse as EvaluationListEvaluatorsResponse,
3566
- type EvaluationListJobRunsResponse as EvaluationListJobRunsResponse,
3567
- type EvaluationUpdateEvaluatorResponse as EvaluationUpdateEvaluatorResponse,
3568
- type EvaluationCreateEvaluatorParams as EvaluationCreateEvaluatorParams,
3569
- type EvaluationCreateJobParams as EvaluationCreateJobParams,
3570
- type EvaluationListEvaluatorsParams as EvaluationListEvaluatorsParams,
3571
- type EvaluationListJobRunsParams as EvaluationListJobRunsParams,
3572
- type EvaluationUpdateEvaluatorParams as EvaluationUpdateEvaluatorParams,
3573
- };
3574
- }
5
+ export class Evaluation extends APIResource {}