@roarkanalytics/sdk 0.332.0 → 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.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/resources/evaluation.d.ts +701 -5
- package/resources/evaluation.d.ts.map +1 -1
- package/resources/evaluation.js.map +1 -1
- package/resources/evaluation.mjs.map +1 -1
- package/src/resources/evaluation.ts +943 -55
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -18,79 +18,961 @@ export class Evaluation extends APIResource {
|
|
|
18
18
|
/**
|
|
19
19
|
* Returns a specific evaluator with its blocks and configuration.
|
|
20
20
|
*/
|
|
21
|
-
getEvaluatorById(
|
|
21
|
+
getEvaluatorById(
|
|
22
|
+
evaluatorId: string,
|
|
23
|
+
options?: Core.RequestOptions,
|
|
24
|
+
): Core.APIPromise<EvaluationGetEvaluatorByIDResponse> {
|
|
22
25
|
return this._client.get(`/v1/evaluation/evaluators/${evaluatorId}`, options);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
/**
|
|
26
|
-
* Returns a list of evaluators with their blocks and configuration for the
|
|
27
|
-
* authenticated project.
|
|
28
|
-
*/
|
|
29
|
-
getEvaluators(
|
|
30
|
-
query?: EvaluationGetEvaluatorsParams,
|
|
31
|
-
options?: Core.RequestOptions,
|
|
32
|
-
): Core.APIPromise<
|
|
33
|
-
getEvaluators(options?: Core.RequestOptions): Core.APIPromise<
|
|
34
|
-
getEvaluators(
|
|
35
|
-
query: EvaluationGetEvaluatorsParams | Core.RequestOptions = {},
|
|
36
|
-
options?: Core.RequestOptions,
|
|
37
|
-
): Core.APIPromise<
|
|
38
|
-
if (isRequestOptions(query)) {
|
|
39
|
-
return this.getEvaluators({}, query);
|
|
28
|
+
/**
|
|
29
|
+
* Returns a list of evaluators with their blocks and configuration for the
|
|
30
|
+
* authenticated project.
|
|
31
|
+
*/
|
|
32
|
+
getEvaluators(
|
|
33
|
+
query?: EvaluationGetEvaluatorsParams,
|
|
34
|
+
options?: Core.RequestOptions,
|
|
35
|
+
): Core.APIPromise<EvaluationGetEvaluatorsResponse>;
|
|
36
|
+
getEvaluators(options?: Core.RequestOptions): Core.APIPromise<EvaluationGetEvaluatorsResponse>;
|
|
37
|
+
getEvaluators(
|
|
38
|
+
query: EvaluationGetEvaluatorsParams | Core.RequestOptions = {},
|
|
39
|
+
options?: Core.RequestOptions,
|
|
40
|
+
): Core.APIPromise<EvaluationGetEvaluatorsResponse> {
|
|
41
|
+
if (isRequestOptions(query)) {
|
|
42
|
+
return this.getEvaluators({}, query);
|
|
43
|
+
}
|
|
44
|
+
return this._client.get('/v1/evaluation/evaluators', { query, ...options });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Retrieve details of a specific evaluation job
|
|
49
|
+
*/
|
|
50
|
+
getJob(jobId: string, options?: Core.RequestOptions): Core.APIPromise<EvaluationGetJobResponse> {
|
|
51
|
+
return this._client.get(`/v1/evaluation/job/${jobId}`, options);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Retrieve paginated details of a specific evaluation job runs
|
|
56
|
+
*/
|
|
57
|
+
getJobRuns(
|
|
58
|
+
jobId: string,
|
|
59
|
+
query?: EvaluationGetJobRunsParams,
|
|
60
|
+
options?: Core.RequestOptions,
|
|
61
|
+
): Core.APIPromise<EvaluationGetJobRunsResponse>;
|
|
62
|
+
getJobRuns(jobId: string, options?: Core.RequestOptions): Core.APIPromise<EvaluationGetJobRunsResponse>;
|
|
63
|
+
getJobRuns(
|
|
64
|
+
jobId: string,
|
|
65
|
+
query: EvaluationGetJobRunsParams | Core.RequestOptions = {},
|
|
66
|
+
options?: Core.RequestOptions,
|
|
67
|
+
): Core.APIPromise<EvaluationGetJobRunsResponse> {
|
|
68
|
+
if (isRequestOptions(query)) {
|
|
69
|
+
return this.getJobRuns(jobId, {}, query);
|
|
70
|
+
}
|
|
71
|
+
return this._client.get(`/v1/evaluation/job/${jobId}/runs`, { query, ...options });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface EvaluationCreateJobResponse {
|
|
76
|
+
data: EvaluationCreateJobResponse.Data;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export namespace EvaluationCreateJobResponse {
|
|
80
|
+
export interface Data {
|
|
81
|
+
/**
|
|
82
|
+
* ID of the evaluation job
|
|
83
|
+
*/
|
|
84
|
+
jobId: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Status of the evaluation job
|
|
88
|
+
*/
|
|
89
|
+
status: 'PENDING' | 'PROCESSING' | 'SUCCESS' | 'FAILURE';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Evaluator with its configured blocks
|
|
95
|
+
*/
|
|
96
|
+
export interface EvaluationGetEvaluatorByIDResponse {
|
|
97
|
+
/**
|
|
98
|
+
* Unique identifier for the evaluator
|
|
99
|
+
*/
|
|
100
|
+
id: string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Array of evaluation blocks configured for this evaluator
|
|
104
|
+
*/
|
|
105
|
+
blocks: Array<
|
|
106
|
+
| EvaluationGetEvaluatorByIDResponse.UnionMember0
|
|
107
|
+
| EvaluationGetEvaluatorByIDResponse.UnionMember1
|
|
108
|
+
| EvaluationGetEvaluatorByIDResponse.UnionMember2
|
|
109
|
+
| EvaluationGetEvaluatorByIDResponse.UnionMember3
|
|
110
|
+
| EvaluationGetEvaluatorByIDResponse.UnionMember4
|
|
111
|
+
| EvaluationGetEvaluatorByIDResponse.UnionMember5
|
|
112
|
+
| EvaluationGetEvaluatorByIDResponse.UnionMember6
|
|
113
|
+
| EvaluationGetEvaluatorByIDResponse.UnionMember7
|
|
114
|
+
| EvaluationGetEvaluatorByIDResponse.UnionMember8
|
|
115
|
+
>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* ISO timestamp when the evaluator was created
|
|
119
|
+
*/
|
|
120
|
+
createdAt: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Optional description of the evaluator
|
|
124
|
+
*/
|
|
125
|
+
description: string | null;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Name of the evaluator
|
|
129
|
+
*/
|
|
130
|
+
name: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Unique slug identifier for the evaluator
|
|
134
|
+
*/
|
|
135
|
+
slug: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* ISO timestamp when the evaluator was last updated
|
|
139
|
+
*/
|
|
140
|
+
updatedAt: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export namespace EvaluationGetEvaluatorByIDResponse {
|
|
144
|
+
export interface UnionMember0 {
|
|
145
|
+
/**
|
|
146
|
+
* Unique identifier for the block
|
|
147
|
+
*/
|
|
148
|
+
id: string;
|
|
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
|
+
blockType: 'DATAFIELD_CHECK';
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Optional description of what this block evaluates
|
|
198
|
+
*/
|
|
199
|
+
description: string | null;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Criteria for evaluating the property
|
|
203
|
+
*/
|
|
204
|
+
evaluationCriteria: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Whether this property must be present
|
|
208
|
+
*/
|
|
209
|
+
isRequired: boolean;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Display name of the evaluation block
|
|
213
|
+
*/
|
|
214
|
+
name: string;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Order in which this block is executed
|
|
218
|
+
*/
|
|
219
|
+
orderIndex: number;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Name of the property to check
|
|
223
|
+
*/
|
|
224
|
+
propertyName: string;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Minimum score threshold to pass evaluation (0-1)
|
|
228
|
+
*/
|
|
229
|
+
threshold: number;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Expected type of the property value
|
|
233
|
+
*/
|
|
234
|
+
valueType: string;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
238
|
+
*/
|
|
239
|
+
weight: number;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface UnionMember2 {
|
|
243
|
+
/**
|
|
244
|
+
* Unique identifier for the block
|
|
245
|
+
*/
|
|
246
|
+
id: string;
|
|
247
|
+
|
|
248
|
+
blockType: 'EMOTION';
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Optional description of what this block evaluates
|
|
252
|
+
*/
|
|
253
|
+
description: string | null;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Display name of the evaluation block
|
|
257
|
+
*/
|
|
258
|
+
name: string;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Order in which this block is executed
|
|
262
|
+
*/
|
|
263
|
+
orderIndex: number;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* The emotion to detect (e.g., "joy", "anger", "sadness")
|
|
267
|
+
*/
|
|
268
|
+
selectedEmotion: string;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Minimum confidence threshold for emotion detection (0-1)
|
|
272
|
+
*/
|
|
273
|
+
threshold: number;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
277
|
+
*/
|
|
278
|
+
weight: number;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface UnionMember3 {
|
|
282
|
+
/**
|
|
283
|
+
* Unique identifier for the block
|
|
284
|
+
*/
|
|
285
|
+
id: string;
|
|
286
|
+
|
|
287
|
+
blockType: 'LATENCY';
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Optional description of what this block evaluates
|
|
291
|
+
*/
|
|
292
|
+
description: string | null;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Maximum number of silence periods allowed
|
|
296
|
+
*/
|
|
297
|
+
maxAllowedSilences: number;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Minimum duration of silence in milliseconds to be considered
|
|
301
|
+
*/
|
|
302
|
+
minSilenceDuration: number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Display name of the evaluation block
|
|
306
|
+
*/
|
|
307
|
+
name: string;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Order in which this block is executed
|
|
311
|
+
*/
|
|
312
|
+
orderIndex: number;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Maximum allowed latency score
|
|
316
|
+
*/
|
|
317
|
+
threshold: number;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
321
|
+
*/
|
|
322
|
+
weight: number;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export interface UnionMember4 {
|
|
326
|
+
/**
|
|
327
|
+
* Unique identifier for the block
|
|
328
|
+
*/
|
|
329
|
+
id: string;
|
|
330
|
+
|
|
331
|
+
blockType: 'POLITENESS';
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Optional description of what this block evaluates
|
|
335
|
+
*/
|
|
336
|
+
description: string | null;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Display name of the evaluation block
|
|
340
|
+
*/
|
|
341
|
+
name: string;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Order in which this block is executed
|
|
345
|
+
*/
|
|
346
|
+
orderIndex: number;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Minimum politeness score threshold (0-1)
|
|
350
|
+
*/
|
|
351
|
+
threshold: number;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
355
|
+
*/
|
|
356
|
+
weight: number;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export interface UnionMember5 {
|
|
360
|
+
/**
|
|
361
|
+
* Unique identifier for the block
|
|
362
|
+
*/
|
|
363
|
+
id: string;
|
|
364
|
+
|
|
365
|
+
blockType: 'SENTIMENT';
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Optional description of what this block evaluates
|
|
369
|
+
*/
|
|
370
|
+
description: string | null;
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Display name of the evaluation block
|
|
374
|
+
*/
|
|
375
|
+
name: string;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Order in which this block is executed
|
|
379
|
+
*/
|
|
380
|
+
orderIndex: number;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Minimum sentiment score threshold (0-1)
|
|
384
|
+
*/
|
|
385
|
+
threshold: number;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
389
|
+
*/
|
|
390
|
+
weight: number;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export interface UnionMember6 {
|
|
394
|
+
/**
|
|
395
|
+
* Unique identifier for the block
|
|
396
|
+
*/
|
|
397
|
+
id: string;
|
|
398
|
+
|
|
399
|
+
blockType: 'TOOL_CALLS';
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Optional description of what this block evaluates
|
|
403
|
+
*/
|
|
404
|
+
description: string | null;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Condition that must be met for tool invocation
|
|
408
|
+
*/
|
|
409
|
+
invocationCondition: string | null;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Minimum number of times the tool should be invoked
|
|
413
|
+
*/
|
|
414
|
+
minInvocationCount: number | null;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Display name of the evaluation block
|
|
418
|
+
*/
|
|
419
|
+
name: string;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Order in which this block is executed
|
|
423
|
+
*/
|
|
424
|
+
orderIndex: number;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Whether the tool should be invoked
|
|
428
|
+
*/
|
|
429
|
+
shouldBeInvoked: boolean;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* ID of the tool definition
|
|
433
|
+
*/
|
|
434
|
+
toolDefinitionId: string;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
438
|
+
*/
|
|
439
|
+
weight: number;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface UnionMember7 {
|
|
443
|
+
/**
|
|
444
|
+
* Unique identifier for the block
|
|
445
|
+
*/
|
|
446
|
+
id: string;
|
|
447
|
+
|
|
448
|
+
blockType: 'TOXICITY';
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Optional description of what this block evaluates
|
|
452
|
+
*/
|
|
453
|
+
description: string | null;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Display name of the evaluation block
|
|
457
|
+
*/
|
|
458
|
+
name: string;
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Order in which this block is executed
|
|
462
|
+
*/
|
|
463
|
+
orderIndex: number;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Maximum allowed toxicity score (0-1)
|
|
467
|
+
*/
|
|
468
|
+
threshold: number;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
472
|
+
*/
|
|
473
|
+
weight: number;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface UnionMember8 {
|
|
477
|
+
/**
|
|
478
|
+
* Unique identifier for the block
|
|
479
|
+
*/
|
|
480
|
+
id: string;
|
|
481
|
+
|
|
482
|
+
blockType: 'VOCAL_CUE';
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Optional description of what this block evaluates
|
|
486
|
+
*/
|
|
487
|
+
description: string | null;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Display name of the evaluation block
|
|
491
|
+
*/
|
|
492
|
+
name: string;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Order in which this block is executed
|
|
496
|
+
*/
|
|
497
|
+
orderIndex: number;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* The vocal cue to detect (e.g., "pace", "tone", "volume")
|
|
501
|
+
*/
|
|
502
|
+
selectedCue: string;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Minimum confidence threshold for vocal cue detection (0-1)
|
|
506
|
+
*/
|
|
507
|
+
threshold: number;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
511
|
+
*/
|
|
512
|
+
weight: number;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Response containing evaluators and pagination info
|
|
518
|
+
*/
|
|
519
|
+
export interface EvaluationGetEvaluatorsResponse {
|
|
520
|
+
/**
|
|
521
|
+
* Array of evaluators with their blocks
|
|
522
|
+
*/
|
|
523
|
+
data: Array<EvaluationGetEvaluatorsResponse.Data>;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Pagination information
|
|
527
|
+
*/
|
|
528
|
+
pagination: EvaluationGetEvaluatorsResponse.Pagination;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export namespace EvaluationGetEvaluatorsResponse {
|
|
532
|
+
/**
|
|
533
|
+
* Evaluator with its configured blocks
|
|
534
|
+
*/
|
|
535
|
+
export interface Data {
|
|
536
|
+
/**
|
|
537
|
+
* Unique identifier for the evaluator
|
|
538
|
+
*/
|
|
539
|
+
id: string;
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Array of evaluation blocks configured for this evaluator
|
|
543
|
+
*/
|
|
544
|
+
blocks: Array<
|
|
545
|
+
| Data.UnionMember0
|
|
546
|
+
| Data.UnionMember1
|
|
547
|
+
| Data.UnionMember2
|
|
548
|
+
| Data.UnionMember3
|
|
549
|
+
| Data.UnionMember4
|
|
550
|
+
| Data.UnionMember5
|
|
551
|
+
| Data.UnionMember6
|
|
552
|
+
| Data.UnionMember7
|
|
553
|
+
| Data.UnionMember8
|
|
554
|
+
>;
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* ISO timestamp when the evaluator was created
|
|
558
|
+
*/
|
|
559
|
+
createdAt: string;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Optional description of the evaluator
|
|
563
|
+
*/
|
|
564
|
+
description: string | null;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Name of the evaluator
|
|
568
|
+
*/
|
|
569
|
+
name: string;
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Unique slug identifier for the evaluator
|
|
573
|
+
*/
|
|
574
|
+
slug: string;
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* ISO timestamp when the evaluator was last updated
|
|
578
|
+
*/
|
|
579
|
+
updatedAt: string;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export namespace Data {
|
|
583
|
+
export interface UnionMember0 {
|
|
584
|
+
/**
|
|
585
|
+
* Unique identifier for the block
|
|
586
|
+
*/
|
|
587
|
+
id: string;
|
|
588
|
+
|
|
589
|
+
blockType: 'CUSTOM_PROMPT';
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Optional description of what this block evaluates
|
|
593
|
+
*/
|
|
594
|
+
description: string | null;
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Name of the metric this prompt evaluates
|
|
598
|
+
*/
|
|
599
|
+
metricName: string;
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Display name of the evaluation block
|
|
603
|
+
*/
|
|
604
|
+
name: string;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Order in which this block is executed
|
|
608
|
+
*/
|
|
609
|
+
orderIndex: number;
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* The prompt to evaluate the call against
|
|
613
|
+
*/
|
|
614
|
+
prompt: string;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Minimum score threshold to pass evaluation (0-1)
|
|
618
|
+
*/
|
|
619
|
+
threshold: number;
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
623
|
+
*/
|
|
624
|
+
weight: number;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export interface UnionMember1 {
|
|
628
|
+
/**
|
|
629
|
+
* Unique identifier for the block
|
|
630
|
+
*/
|
|
631
|
+
id: string;
|
|
632
|
+
|
|
633
|
+
blockType: 'DATAFIELD_CHECK';
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Optional description of what this block evaluates
|
|
637
|
+
*/
|
|
638
|
+
description: string | null;
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Criteria for evaluating the property
|
|
642
|
+
*/
|
|
643
|
+
evaluationCriteria: string;
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Whether this property must be present
|
|
647
|
+
*/
|
|
648
|
+
isRequired: boolean;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Display name of the evaluation block
|
|
652
|
+
*/
|
|
653
|
+
name: string;
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Order in which this block is executed
|
|
657
|
+
*/
|
|
658
|
+
orderIndex: number;
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Name of the property to check
|
|
662
|
+
*/
|
|
663
|
+
propertyName: string;
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Minimum score threshold to pass evaluation (0-1)
|
|
667
|
+
*/
|
|
668
|
+
threshold: number;
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Expected type of the property value
|
|
672
|
+
*/
|
|
673
|
+
valueType: string;
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
677
|
+
*/
|
|
678
|
+
weight: number;
|
|
40
679
|
}
|
|
41
|
-
return this._client.get('/v1/evaluation/evaluators', { query, ...options });
|
|
42
|
-
}
|
|
43
680
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
681
|
+
export interface UnionMember2 {
|
|
682
|
+
/**
|
|
683
|
+
* Unique identifier for the block
|
|
684
|
+
*/
|
|
685
|
+
id: string;
|
|
50
686
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
687
|
+
blockType: 'EMOTION';
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Optional description of what this block evaluates
|
|
691
|
+
*/
|
|
692
|
+
description: string | null;
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Display name of the evaluation block
|
|
696
|
+
*/
|
|
697
|
+
name: string;
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Order in which this block is executed
|
|
701
|
+
*/
|
|
702
|
+
orderIndex: number;
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* The emotion to detect (e.g., "joy", "anger", "sadness")
|
|
706
|
+
*/
|
|
707
|
+
selectedEmotion: string;
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Minimum confidence threshold for emotion detection (0-1)
|
|
711
|
+
*/
|
|
712
|
+
threshold: number;
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
716
|
+
*/
|
|
717
|
+
weight: number;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export interface UnionMember3 {
|
|
721
|
+
/**
|
|
722
|
+
* Unique identifier for the block
|
|
723
|
+
*/
|
|
724
|
+
id: string;
|
|
725
|
+
|
|
726
|
+
blockType: 'LATENCY';
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Optional description of what this block evaluates
|
|
730
|
+
*/
|
|
731
|
+
description: string | null;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Maximum number of silence periods allowed
|
|
735
|
+
*/
|
|
736
|
+
maxAllowedSilences: number;
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Minimum duration of silence in milliseconds to be considered
|
|
740
|
+
*/
|
|
741
|
+
minSilenceDuration: number;
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Display name of the evaluation block
|
|
745
|
+
*/
|
|
746
|
+
name: string;
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Order in which this block is executed
|
|
750
|
+
*/
|
|
751
|
+
orderIndex: number;
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* Maximum allowed latency score
|
|
755
|
+
*/
|
|
756
|
+
threshold: number;
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
760
|
+
*/
|
|
761
|
+
weight: number;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
export interface UnionMember4 {
|
|
765
|
+
/**
|
|
766
|
+
* Unique identifier for the block
|
|
767
|
+
*/
|
|
768
|
+
id: string;
|
|
769
|
+
|
|
770
|
+
blockType: 'POLITENESS';
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Optional description of what this block evaluates
|
|
774
|
+
*/
|
|
775
|
+
description: string | null;
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* Display name of the evaluation block
|
|
779
|
+
*/
|
|
780
|
+
name: string;
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* Order in which this block is executed
|
|
784
|
+
*/
|
|
785
|
+
orderIndex: number;
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Minimum politeness score threshold (0-1)
|
|
789
|
+
*/
|
|
790
|
+
threshold: number;
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
794
|
+
*/
|
|
795
|
+
weight: number;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
export interface UnionMember5 {
|
|
799
|
+
/**
|
|
800
|
+
* Unique identifier for the block
|
|
801
|
+
*/
|
|
802
|
+
id: string;
|
|
803
|
+
|
|
804
|
+
blockType: 'SENTIMENT';
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Optional description of what this block evaluates
|
|
808
|
+
*/
|
|
809
|
+
description: string | null;
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Display name of the evaluation block
|
|
813
|
+
*/
|
|
814
|
+
name: string;
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Order in which this block is executed
|
|
818
|
+
*/
|
|
819
|
+
orderIndex: number;
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* Minimum sentiment score threshold (0-1)
|
|
823
|
+
*/
|
|
824
|
+
threshold: number;
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
828
|
+
*/
|
|
829
|
+
weight: number;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export interface UnionMember6 {
|
|
833
|
+
/**
|
|
834
|
+
* Unique identifier for the block
|
|
835
|
+
*/
|
|
836
|
+
id: string;
|
|
837
|
+
|
|
838
|
+
blockType: 'TOOL_CALLS';
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* Optional description of what this block evaluates
|
|
842
|
+
*/
|
|
843
|
+
description: string | null;
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Condition that must be met for tool invocation
|
|
847
|
+
*/
|
|
848
|
+
invocationCondition: string | null;
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* Minimum number of times the tool should be invoked
|
|
852
|
+
*/
|
|
853
|
+
minInvocationCount: number | null;
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* Display name of the evaluation block
|
|
857
|
+
*/
|
|
858
|
+
name: string;
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Order in which this block is executed
|
|
862
|
+
*/
|
|
863
|
+
orderIndex: number;
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Whether the tool should be invoked
|
|
867
|
+
*/
|
|
868
|
+
shouldBeInvoked: boolean;
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* ID of the tool definition
|
|
872
|
+
*/
|
|
873
|
+
toolDefinitionId: string;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
877
|
+
*/
|
|
878
|
+
weight: number;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export interface UnionMember7 {
|
|
882
|
+
/**
|
|
883
|
+
* Unique identifier for the block
|
|
884
|
+
*/
|
|
885
|
+
id: string;
|
|
886
|
+
|
|
887
|
+
blockType: 'TOXICITY';
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Optional description of what this block evaluates
|
|
891
|
+
*/
|
|
892
|
+
description: string | null;
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Display name of the evaluation block
|
|
896
|
+
*/
|
|
897
|
+
name: string;
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Order in which this block is executed
|
|
901
|
+
*/
|
|
902
|
+
orderIndex: number;
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* Maximum allowed toxicity score (0-1)
|
|
906
|
+
*/
|
|
907
|
+
threshold: number;
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
911
|
+
*/
|
|
912
|
+
weight: number;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export interface UnionMember8 {
|
|
916
|
+
/**
|
|
917
|
+
* Unique identifier for the block
|
|
918
|
+
*/
|
|
919
|
+
id: string;
|
|
920
|
+
|
|
921
|
+
blockType: 'VOCAL_CUE';
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Optional description of what this block evaluates
|
|
925
|
+
*/
|
|
926
|
+
description: string | null;
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Display name of the evaluation block
|
|
930
|
+
*/
|
|
931
|
+
name: string;
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* Order in which this block is executed
|
|
935
|
+
*/
|
|
936
|
+
orderIndex: number;
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* The vocal cue to detect (e.g., "pace", "tone", "volume")
|
|
940
|
+
*/
|
|
941
|
+
selectedCue: string;
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* Minimum confidence threshold for vocal cue detection (0-1)
|
|
945
|
+
*/
|
|
946
|
+
threshold: number;
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Weight of this block in the overall evaluation score (0-100)
|
|
950
|
+
*/
|
|
951
|
+
weight: number;
|
|
67
952
|
}
|
|
68
|
-
return this._client.get(`/v1/evaluation/job/${jobId}/runs`, { query, ...options });
|
|
69
953
|
}
|
|
70
|
-
}
|
|
71
954
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
955
|
+
/**
|
|
956
|
+
* Pagination information
|
|
957
|
+
*/
|
|
958
|
+
export interface Pagination {
|
|
959
|
+
/**
|
|
960
|
+
* Whether there are more evaluators to fetch
|
|
961
|
+
*/
|
|
962
|
+
hasMore: boolean;
|
|
75
963
|
|
|
76
|
-
export namespace EvaluationCreateJobResponse {
|
|
77
|
-
export interface Data {
|
|
78
964
|
/**
|
|
79
|
-
*
|
|
965
|
+
* Cursor for the next page, null if no more pages
|
|
80
966
|
*/
|
|
81
|
-
|
|
967
|
+
nextCursor: string | null;
|
|
82
968
|
|
|
83
969
|
/**
|
|
84
|
-
*
|
|
970
|
+
* Total number of evaluators
|
|
85
971
|
*/
|
|
86
|
-
|
|
972
|
+
total: number;
|
|
87
973
|
}
|
|
88
974
|
}
|
|
89
975
|
|
|
90
|
-
export type EvaluationGetEvaluatorByIDResponse = unknown;
|
|
91
|
-
|
|
92
|
-
export type EvaluationGetEvaluatorsResponse = unknown;
|
|
93
|
-
|
|
94
976
|
export interface EvaluationGetJobResponse {
|
|
95
977
|
/**
|
|
96
978
|
* Evaluation job response payload
|
|
@@ -658,8 +1540,14 @@ export namespace EvaluationCreateJobParams {
|
|
|
658
1540
|
}
|
|
659
1541
|
|
|
660
1542
|
export interface EvaluationGetEvaluatorsParams {
|
|
1543
|
+
/**
|
|
1544
|
+
* Cursor for pagination - evaluator ID to start after
|
|
1545
|
+
*/
|
|
661
1546
|
after?: string;
|
|
662
1547
|
|
|
1548
|
+
/**
|
|
1549
|
+
* Maximum number of evaluators to return (default: 20, max: 50)
|
|
1550
|
+
*/
|
|
663
1551
|
limit?: string;
|
|
664
1552
|
}
|
|
665
1553
|
|