@roarkanalytics/sdk 0.331.2 → 0.333.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.
@@ -5,6 +5,16 @@ export declare class Evaluation extends APIResource {
5
5
  * Create a evaluation job for a single call or dataset of calls
6
6
  */
7
7
  createJob(body: EvaluationCreateJobParams, options?: Core.RequestOptions): Core.APIPromise<EvaluationCreateJobResponse>;
8
+ /**
9
+ * Returns a specific evaluator with its blocks and configuration.
10
+ */
11
+ getEvaluatorById(evaluatorId: string, options?: Core.RequestOptions): Core.APIPromise<EvaluationGetEvaluatorByIDResponse>;
12
+ /**
13
+ * Returns a list of evaluators with their blocks and configuration for the
14
+ * authenticated project.
15
+ */
16
+ getEvaluators(query?: EvaluationGetEvaluatorsParams, options?: Core.RequestOptions): Core.APIPromise<EvaluationGetEvaluatorsResponse>;
17
+ getEvaluators(options?: Core.RequestOptions): Core.APIPromise<EvaluationGetEvaluatorsResponse>;
8
18
  /**
9
19
  * Retrieve details of a specific evaluation job
10
20
  */
@@ -30,6 +40,698 @@ export declare namespace EvaluationCreateJobResponse {
30
40
  status: 'PENDING' | 'PROCESSING' | 'SUCCESS' | 'FAILURE';
31
41
  }
32
42
  }
43
+ /**
44
+ * Evaluator with its configured blocks
45
+ */
46
+ export interface EvaluationGetEvaluatorByIDResponse {
47
+ /**
48
+ * Unique identifier for the evaluator
49
+ */
50
+ id: string;
51
+ /**
52
+ * Array of evaluation blocks configured for this evaluator
53
+ */
54
+ blocks: Array<EvaluationGetEvaluatorByIDResponse.UnionMember0 | EvaluationGetEvaluatorByIDResponse.UnionMember1 | EvaluationGetEvaluatorByIDResponse.UnionMember2 | EvaluationGetEvaluatorByIDResponse.UnionMember3 | EvaluationGetEvaluatorByIDResponse.UnionMember4 | EvaluationGetEvaluatorByIDResponse.UnionMember5 | EvaluationGetEvaluatorByIDResponse.UnionMember6 | EvaluationGetEvaluatorByIDResponse.UnionMember7 | EvaluationGetEvaluatorByIDResponse.UnionMember8>;
55
+ /**
56
+ * ISO timestamp when the evaluator was created
57
+ */
58
+ createdAt: string;
59
+ /**
60
+ * Optional description of the evaluator
61
+ */
62
+ description: string | null;
63
+ /**
64
+ * Name of the evaluator
65
+ */
66
+ name: string;
67
+ /**
68
+ * Unique slug identifier for the evaluator
69
+ */
70
+ slug: string;
71
+ /**
72
+ * ISO timestamp when the evaluator was last updated
73
+ */
74
+ updatedAt: string;
75
+ }
76
+ export declare namespace EvaluationGetEvaluatorByIDResponse {
77
+ interface UnionMember0 {
78
+ /**
79
+ * Unique identifier for the block
80
+ */
81
+ id: string;
82
+ blockType: 'CUSTOM_PROMPT';
83
+ /**
84
+ * Optional description of what this block evaluates
85
+ */
86
+ description: string | null;
87
+ /**
88
+ * Name of the metric this prompt evaluates
89
+ */
90
+ metricName: string;
91
+ /**
92
+ * Display name of the evaluation block
93
+ */
94
+ name: string;
95
+ /**
96
+ * Order in which this block is executed
97
+ */
98
+ orderIndex: number;
99
+ /**
100
+ * The prompt to evaluate the call against
101
+ */
102
+ prompt: string;
103
+ /**
104
+ * Minimum score threshold to pass evaluation (0-1)
105
+ */
106
+ threshold: number;
107
+ /**
108
+ * Weight of this block in the overall evaluation score (0-100)
109
+ */
110
+ weight: number;
111
+ }
112
+ interface UnionMember1 {
113
+ /**
114
+ * Unique identifier for the block
115
+ */
116
+ id: string;
117
+ blockType: 'DATAFIELD_CHECK';
118
+ /**
119
+ * Optional description of what this block evaluates
120
+ */
121
+ description: string | null;
122
+ /**
123
+ * Criteria for evaluating the property
124
+ */
125
+ evaluationCriteria: string;
126
+ /**
127
+ * Whether this property must be present
128
+ */
129
+ isRequired: boolean;
130
+ /**
131
+ * Display name of the evaluation block
132
+ */
133
+ name: string;
134
+ /**
135
+ * Order in which this block is executed
136
+ */
137
+ orderIndex: number;
138
+ /**
139
+ * Name of the property to check
140
+ */
141
+ propertyName: string;
142
+ /**
143
+ * Minimum score threshold to pass evaluation (0-1)
144
+ */
145
+ threshold: number;
146
+ /**
147
+ * Expected type of the property value
148
+ */
149
+ valueType: string;
150
+ /**
151
+ * Weight of this block in the overall evaluation score (0-100)
152
+ */
153
+ weight: number;
154
+ }
155
+ interface UnionMember2 {
156
+ /**
157
+ * Unique identifier for the block
158
+ */
159
+ id: string;
160
+ blockType: 'EMOTION';
161
+ /**
162
+ * Optional description of what this block evaluates
163
+ */
164
+ description: string | null;
165
+ /**
166
+ * Display name of the evaluation block
167
+ */
168
+ name: string;
169
+ /**
170
+ * Order in which this block is executed
171
+ */
172
+ orderIndex: number;
173
+ /**
174
+ * The emotion to detect (e.g., "joy", "anger", "sadness")
175
+ */
176
+ selectedEmotion: string;
177
+ /**
178
+ * Minimum confidence threshold for emotion detection (0-1)
179
+ */
180
+ threshold: number;
181
+ /**
182
+ * Weight of this block in the overall evaluation score (0-100)
183
+ */
184
+ weight: number;
185
+ }
186
+ interface UnionMember3 {
187
+ /**
188
+ * Unique identifier for the block
189
+ */
190
+ id: string;
191
+ blockType: 'LATENCY';
192
+ /**
193
+ * Optional description of what this block evaluates
194
+ */
195
+ description: string | null;
196
+ /**
197
+ * Maximum number of silence periods allowed
198
+ */
199
+ maxAllowedSilences: number;
200
+ /**
201
+ * Minimum duration of silence in milliseconds to be considered
202
+ */
203
+ minSilenceDuration: number;
204
+ /**
205
+ * Display name of the evaluation block
206
+ */
207
+ name: string;
208
+ /**
209
+ * Order in which this block is executed
210
+ */
211
+ orderIndex: number;
212
+ /**
213
+ * Maximum allowed latency score
214
+ */
215
+ threshold: number;
216
+ /**
217
+ * Weight of this block in the overall evaluation score (0-100)
218
+ */
219
+ weight: number;
220
+ }
221
+ interface UnionMember4 {
222
+ /**
223
+ * Unique identifier for the block
224
+ */
225
+ id: string;
226
+ blockType: 'POLITENESS';
227
+ /**
228
+ * Optional description of what this block evaluates
229
+ */
230
+ description: string | null;
231
+ /**
232
+ * Display name of the evaluation block
233
+ */
234
+ name: string;
235
+ /**
236
+ * Order in which this block is executed
237
+ */
238
+ orderIndex: number;
239
+ /**
240
+ * Minimum politeness score threshold (0-1)
241
+ */
242
+ threshold: number;
243
+ /**
244
+ * Weight of this block in the overall evaluation score (0-100)
245
+ */
246
+ weight: number;
247
+ }
248
+ interface UnionMember5 {
249
+ /**
250
+ * Unique identifier for the block
251
+ */
252
+ id: string;
253
+ blockType: 'SENTIMENT';
254
+ /**
255
+ * Optional description of what this block evaluates
256
+ */
257
+ description: string | null;
258
+ /**
259
+ * Display name of the evaluation block
260
+ */
261
+ name: string;
262
+ /**
263
+ * Order in which this block is executed
264
+ */
265
+ orderIndex: number;
266
+ /**
267
+ * Minimum sentiment score threshold (0-1)
268
+ */
269
+ threshold: number;
270
+ /**
271
+ * Weight of this block in the overall evaluation score (0-100)
272
+ */
273
+ weight: number;
274
+ }
275
+ interface UnionMember6 {
276
+ /**
277
+ * Unique identifier for the block
278
+ */
279
+ id: string;
280
+ blockType: 'TOOL_CALLS';
281
+ /**
282
+ * Optional description of what this block evaluates
283
+ */
284
+ description: string | null;
285
+ /**
286
+ * Condition that must be met for tool invocation
287
+ */
288
+ invocationCondition: string | null;
289
+ /**
290
+ * Minimum number of times the tool should be invoked
291
+ */
292
+ minInvocationCount: number | null;
293
+ /**
294
+ * Display name of the evaluation block
295
+ */
296
+ name: string;
297
+ /**
298
+ * Order in which this block is executed
299
+ */
300
+ orderIndex: number;
301
+ /**
302
+ * Whether the tool should be invoked
303
+ */
304
+ shouldBeInvoked: boolean;
305
+ /**
306
+ * ID of the tool definition
307
+ */
308
+ toolDefinitionId: string;
309
+ /**
310
+ * Weight of this block in the overall evaluation score (0-100)
311
+ */
312
+ weight: number;
313
+ }
314
+ interface UnionMember7 {
315
+ /**
316
+ * Unique identifier for the block
317
+ */
318
+ id: string;
319
+ blockType: 'TOXICITY';
320
+ /**
321
+ * Optional description of what this block evaluates
322
+ */
323
+ description: string | null;
324
+ /**
325
+ * Display name of the evaluation block
326
+ */
327
+ name: string;
328
+ /**
329
+ * Order in which this block is executed
330
+ */
331
+ orderIndex: number;
332
+ /**
333
+ * Maximum allowed toxicity score (0-1)
334
+ */
335
+ threshold: number;
336
+ /**
337
+ * Weight of this block in the overall evaluation score (0-100)
338
+ */
339
+ weight: number;
340
+ }
341
+ interface UnionMember8 {
342
+ /**
343
+ * Unique identifier for the block
344
+ */
345
+ id: string;
346
+ blockType: 'VOCAL_CUE';
347
+ /**
348
+ * Optional description of what this block evaluates
349
+ */
350
+ description: string | null;
351
+ /**
352
+ * Display name of the evaluation block
353
+ */
354
+ name: string;
355
+ /**
356
+ * Order in which this block is executed
357
+ */
358
+ orderIndex: number;
359
+ /**
360
+ * The vocal cue to detect (e.g., "pace", "tone", "volume")
361
+ */
362
+ selectedCue: string;
363
+ /**
364
+ * Minimum confidence threshold for vocal cue detection (0-1)
365
+ */
366
+ threshold: number;
367
+ /**
368
+ * Weight of this block in the overall evaluation score (0-100)
369
+ */
370
+ weight: number;
371
+ }
372
+ }
373
+ /**
374
+ * Response containing evaluators and pagination info
375
+ */
376
+ export interface EvaluationGetEvaluatorsResponse {
377
+ /**
378
+ * Array of evaluators with their blocks
379
+ */
380
+ data: Array<EvaluationGetEvaluatorsResponse.Data>;
381
+ /**
382
+ * Pagination information
383
+ */
384
+ pagination: EvaluationGetEvaluatorsResponse.Pagination;
385
+ }
386
+ export declare namespace EvaluationGetEvaluatorsResponse {
387
+ /**
388
+ * Evaluator with its configured blocks
389
+ */
390
+ interface Data {
391
+ /**
392
+ * Unique identifier for the evaluator
393
+ */
394
+ id: string;
395
+ /**
396
+ * Array of evaluation blocks configured for this evaluator
397
+ */
398
+ blocks: Array<Data.UnionMember0 | Data.UnionMember1 | Data.UnionMember2 | Data.UnionMember3 | Data.UnionMember4 | Data.UnionMember5 | Data.UnionMember6 | Data.UnionMember7 | Data.UnionMember8>;
399
+ /**
400
+ * ISO timestamp when the evaluator was created
401
+ */
402
+ createdAt: string;
403
+ /**
404
+ * Optional description of the evaluator
405
+ */
406
+ description: string | null;
407
+ /**
408
+ * Name of the evaluator
409
+ */
410
+ name: string;
411
+ /**
412
+ * Unique slug identifier for the evaluator
413
+ */
414
+ slug: string;
415
+ /**
416
+ * ISO timestamp when the evaluator was last updated
417
+ */
418
+ updatedAt: string;
419
+ }
420
+ namespace Data {
421
+ interface UnionMember0 {
422
+ /**
423
+ * Unique identifier for the block
424
+ */
425
+ id: string;
426
+ blockType: 'CUSTOM_PROMPT';
427
+ /**
428
+ * Optional description of what this block evaluates
429
+ */
430
+ description: string | null;
431
+ /**
432
+ * Name of the metric this prompt evaluates
433
+ */
434
+ metricName: string;
435
+ /**
436
+ * Display name of the evaluation block
437
+ */
438
+ name: string;
439
+ /**
440
+ * Order in which this block is executed
441
+ */
442
+ orderIndex: number;
443
+ /**
444
+ * The prompt to evaluate the call against
445
+ */
446
+ prompt: string;
447
+ /**
448
+ * Minimum score threshold to pass evaluation (0-1)
449
+ */
450
+ threshold: number;
451
+ /**
452
+ * Weight of this block in the overall evaluation score (0-100)
453
+ */
454
+ weight: number;
455
+ }
456
+ interface UnionMember1 {
457
+ /**
458
+ * Unique identifier for the block
459
+ */
460
+ id: string;
461
+ blockType: 'DATAFIELD_CHECK';
462
+ /**
463
+ * Optional description of what this block evaluates
464
+ */
465
+ description: string | null;
466
+ /**
467
+ * Criteria for evaluating the property
468
+ */
469
+ evaluationCriteria: string;
470
+ /**
471
+ * Whether this property must be present
472
+ */
473
+ isRequired: boolean;
474
+ /**
475
+ * Display name of the evaluation block
476
+ */
477
+ name: string;
478
+ /**
479
+ * Order in which this block is executed
480
+ */
481
+ orderIndex: number;
482
+ /**
483
+ * Name of the property to check
484
+ */
485
+ propertyName: string;
486
+ /**
487
+ * Minimum score threshold to pass evaluation (0-1)
488
+ */
489
+ threshold: number;
490
+ /**
491
+ * Expected type of the property value
492
+ */
493
+ valueType: string;
494
+ /**
495
+ * Weight of this block in the overall evaluation score (0-100)
496
+ */
497
+ weight: number;
498
+ }
499
+ interface UnionMember2 {
500
+ /**
501
+ * Unique identifier for the block
502
+ */
503
+ id: string;
504
+ blockType: 'EMOTION';
505
+ /**
506
+ * Optional description of what this block evaluates
507
+ */
508
+ description: string | null;
509
+ /**
510
+ * Display name of the evaluation block
511
+ */
512
+ name: string;
513
+ /**
514
+ * Order in which this block is executed
515
+ */
516
+ orderIndex: number;
517
+ /**
518
+ * The emotion to detect (e.g., "joy", "anger", "sadness")
519
+ */
520
+ selectedEmotion: string;
521
+ /**
522
+ * Minimum confidence threshold for emotion detection (0-1)
523
+ */
524
+ threshold: number;
525
+ /**
526
+ * Weight of this block in the overall evaluation score (0-100)
527
+ */
528
+ weight: number;
529
+ }
530
+ interface UnionMember3 {
531
+ /**
532
+ * Unique identifier for the block
533
+ */
534
+ id: string;
535
+ blockType: 'LATENCY';
536
+ /**
537
+ * Optional description of what this block evaluates
538
+ */
539
+ description: string | null;
540
+ /**
541
+ * Maximum number of silence periods allowed
542
+ */
543
+ maxAllowedSilences: number;
544
+ /**
545
+ * Minimum duration of silence in milliseconds to be considered
546
+ */
547
+ minSilenceDuration: number;
548
+ /**
549
+ * Display name of the evaluation block
550
+ */
551
+ name: string;
552
+ /**
553
+ * Order in which this block is executed
554
+ */
555
+ orderIndex: number;
556
+ /**
557
+ * Maximum allowed latency score
558
+ */
559
+ threshold: number;
560
+ /**
561
+ * Weight of this block in the overall evaluation score (0-100)
562
+ */
563
+ weight: number;
564
+ }
565
+ interface UnionMember4 {
566
+ /**
567
+ * Unique identifier for the block
568
+ */
569
+ id: string;
570
+ blockType: 'POLITENESS';
571
+ /**
572
+ * Optional description of what this block evaluates
573
+ */
574
+ description: string | null;
575
+ /**
576
+ * Display name of the evaluation block
577
+ */
578
+ name: string;
579
+ /**
580
+ * Order in which this block is executed
581
+ */
582
+ orderIndex: number;
583
+ /**
584
+ * Minimum politeness score threshold (0-1)
585
+ */
586
+ threshold: number;
587
+ /**
588
+ * Weight of this block in the overall evaluation score (0-100)
589
+ */
590
+ weight: number;
591
+ }
592
+ interface UnionMember5 {
593
+ /**
594
+ * Unique identifier for the block
595
+ */
596
+ id: string;
597
+ blockType: 'SENTIMENT';
598
+ /**
599
+ * Optional description of what this block evaluates
600
+ */
601
+ description: string | null;
602
+ /**
603
+ * Display name of the evaluation block
604
+ */
605
+ name: string;
606
+ /**
607
+ * Order in which this block is executed
608
+ */
609
+ orderIndex: number;
610
+ /**
611
+ * Minimum sentiment score threshold (0-1)
612
+ */
613
+ threshold: number;
614
+ /**
615
+ * Weight of this block in the overall evaluation score (0-100)
616
+ */
617
+ weight: number;
618
+ }
619
+ interface UnionMember6 {
620
+ /**
621
+ * Unique identifier for the block
622
+ */
623
+ id: string;
624
+ blockType: 'TOOL_CALLS';
625
+ /**
626
+ * Optional description of what this block evaluates
627
+ */
628
+ description: string | null;
629
+ /**
630
+ * Condition that must be met for tool invocation
631
+ */
632
+ invocationCondition: string | null;
633
+ /**
634
+ * Minimum number of times the tool should be invoked
635
+ */
636
+ minInvocationCount: number | null;
637
+ /**
638
+ * Display name of the evaluation block
639
+ */
640
+ name: string;
641
+ /**
642
+ * Order in which this block is executed
643
+ */
644
+ orderIndex: number;
645
+ /**
646
+ * Whether the tool should be invoked
647
+ */
648
+ shouldBeInvoked: boolean;
649
+ /**
650
+ * ID of the tool definition
651
+ */
652
+ toolDefinitionId: string;
653
+ /**
654
+ * Weight of this block in the overall evaluation score (0-100)
655
+ */
656
+ weight: number;
657
+ }
658
+ interface UnionMember7 {
659
+ /**
660
+ * Unique identifier for the block
661
+ */
662
+ id: string;
663
+ blockType: 'TOXICITY';
664
+ /**
665
+ * Optional description of what this block evaluates
666
+ */
667
+ description: string | null;
668
+ /**
669
+ * Display name of the evaluation block
670
+ */
671
+ name: string;
672
+ /**
673
+ * Order in which this block is executed
674
+ */
675
+ orderIndex: number;
676
+ /**
677
+ * Maximum allowed toxicity score (0-1)
678
+ */
679
+ threshold: number;
680
+ /**
681
+ * Weight of this block in the overall evaluation score (0-100)
682
+ */
683
+ weight: number;
684
+ }
685
+ interface UnionMember8 {
686
+ /**
687
+ * Unique identifier for the block
688
+ */
689
+ id: string;
690
+ blockType: 'VOCAL_CUE';
691
+ /**
692
+ * Optional description of what this block evaluates
693
+ */
694
+ description: string | null;
695
+ /**
696
+ * Display name of the evaluation block
697
+ */
698
+ name: string;
699
+ /**
700
+ * Order in which this block is executed
701
+ */
702
+ orderIndex: number;
703
+ /**
704
+ * The vocal cue to detect (e.g., "pace", "tone", "volume")
705
+ */
706
+ selectedCue: string;
707
+ /**
708
+ * Minimum confidence threshold for vocal cue detection (0-1)
709
+ */
710
+ threshold: number;
711
+ /**
712
+ * Weight of this block in the overall evaluation score (0-100)
713
+ */
714
+ weight: number;
715
+ }
716
+ }
717
+ /**
718
+ * Pagination information
719
+ */
720
+ interface Pagination {
721
+ /**
722
+ * Whether there are more evaluators to fetch
723
+ */
724
+ hasMore: boolean;
725
+ /**
726
+ * Cursor for the next page, null if no more pages
727
+ */
728
+ nextCursor: string | null;
729
+ /**
730
+ * Total number of evaluators
731
+ */
732
+ total: number;
733
+ }
734
+ }
33
735
  export interface EvaluationGetJobResponse {
34
736
  /**
35
737
  * Evaluation job response payload
@@ -485,6 +1187,16 @@ export declare namespace EvaluationCreateJobParams {
485
1187
  }
486
1188
  }
487
1189
  }
1190
+ export interface EvaluationGetEvaluatorsParams {
1191
+ /**
1192
+ * Cursor for pagination - evaluator ID to start after
1193
+ */
1194
+ after?: string;
1195
+ /**
1196
+ * Maximum number of evaluators to return (default: 20, max: 50)
1197
+ */
1198
+ limit?: string;
1199
+ }
488
1200
  export interface EvaluationGetJobRunsParams {
489
1201
  /**
490
1202
  * Number of items to return per page
@@ -496,6 +1208,6 @@ export interface EvaluationGetJobRunsParams {
496
1208
  nextCursor?: string;
497
1209
  }
498
1210
  export declare namespace Evaluation {
499
- export { type EvaluationCreateJobResponse as EvaluationCreateJobResponse, type EvaluationGetJobResponse as EvaluationGetJobResponse, type EvaluationGetJobRunsResponse as EvaluationGetJobRunsResponse, type EvaluationCreateJobParams as EvaluationCreateJobParams, type EvaluationGetJobRunsParams as EvaluationGetJobRunsParams, };
1211
+ export { type EvaluationCreateJobResponse as EvaluationCreateJobResponse, type EvaluationGetEvaluatorByIDResponse as EvaluationGetEvaluatorByIDResponse, type EvaluationGetEvaluatorsResponse as EvaluationGetEvaluatorsResponse, type EvaluationGetJobResponse as EvaluationGetJobResponse, type EvaluationGetJobRunsResponse as EvaluationGetJobRunsResponse, type EvaluationCreateJobParams as EvaluationCreateJobParams, type EvaluationGetEvaluatorsParams as EvaluationGetEvaluatorsParams, type EvaluationGetJobRunsParams as EvaluationGetJobRunsParams, };
500
1212
  }
501
1213
  //# sourceMappingURL=evaluation.d.ts.map