java/resources/graders/subresources/grader_models/index.md +0 −1013 deleted
File Deleted View Diff
1# Grader Models
2
3## Domain Types
4
5### Eval Content Item
6
7- `class EvalContentItem: A class that can be one of several variants.union`
8
9 A single content item: input text, output text, input image, or input audio.
10
11 - `String`
12
13 - `class ResponseInputText:`
14
15 A text input to the model.
16
17 - `String text`
18
19 The text input to the model.
20
21 - `JsonValue; type "input_text"constant`
22
23 The type of the input item. Always `input_text`.
24
25 - `INPUT_TEXT("input_text")`
26
27 - `OutputText`
28
29 - `String text`
30
31 The text output from the model.
32
33 - `JsonValue; type "output_text"constant`
34
35 The type of the output text. Always `output_text`.
36
37 - `OUTPUT_TEXT("output_text")`
38
39 - `InputImage`
40
41 - `String imageUrl`
42
43 The URL of the image input.
44
45 - `JsonValue; type "input_image"constant`
46
47 The type of the image input. Always `input_image`.
48
49 - `INPUT_IMAGE("input_image")`
50
51 - `Optional<String> detail`
52
53 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
54
55 - `class ResponseInputAudio:`
56
57 An audio input to the model.
58
59 - `InputAudio inputAudio`
60
61 - `String data`
62
63 Base64-encoded audio data.
64
65 - `Format format`
66
67 The format of the audio data. Currently supported formats are `mp3` and
68 `wav`.
69
70 - `MP3("mp3")`
71
72 - `WAV("wav")`
73
74 - `JsonValue; type "input_audio"constant`
75
76 The type of the input item. Always `input_audio`.
77
78 - `INPUT_AUDIO("input_audio")`
79
80### Label Model Grader
81
82- `class LabelModelGrader:`
83
84 A LabelModelGrader object which uses a model to assign labels to each item
85 in the evaluation.
86
87 - `List<Input> input`
88
89 - `Content content`
90
91 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
92
93 - `String`
94
95 - `class ResponseInputText:`
96
97 A text input to the model.
98
99 - `String text`
100
101 The text input to the model.
102
103 - `JsonValue; type "input_text"constant`
104
105 The type of the input item. Always `input_text`.
106
107 - `INPUT_TEXT("input_text")`
108
109 - `class OutputText:`
110
111 A text output from the model.
112
113 - `String text`
114
115 The text output from the model.
116
117 - `JsonValue; type "output_text"constant`
118
119 The type of the output text. Always `output_text`.
120
121 - `OUTPUT_TEXT("output_text")`
122
123 - `class InputImage:`
124
125 An image input block used within EvalItem content arrays.
126
127 - `String imageUrl`
128
129 The URL of the image input.
130
131 - `JsonValue; type "input_image"constant`
132
133 The type of the image input. Always `input_image`.
134
135 - `INPUT_IMAGE("input_image")`
136
137 - `Optional<String> detail`
138
139 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
140
141 - `class ResponseInputAudio:`
142
143 An audio input to the model.
144
145 - `InputAudio inputAudio`
146
147 - `String data`
148
149 Base64-encoded audio data.
150
151 - `Format format`
152
153 The format of the audio data. Currently supported formats are `mp3` and
154 `wav`.
155
156 - `MP3("mp3")`
157
158 - `WAV("wav")`
159
160 - `JsonValue; type "input_audio"constant`
161
162 The type of the input item. Always `input_audio`.
163
164 - `INPUT_AUDIO("input_audio")`
165
166 - `List<EvalContentItem>`
167
168 - `String`
169
170 - `class ResponseInputText:`
171
172 A text input to the model.
173
174 - `OutputText`
175
176 - `String text`
177
178 The text output from the model.
179
180 - `JsonValue; type "output_text"constant`
181
182 The type of the output text. Always `output_text`.
183
184 - `OUTPUT_TEXT("output_text")`
185
186 - `InputImage`
187
188 - `String imageUrl`
189
190 The URL of the image input.
191
192 - `JsonValue; type "input_image"constant`
193
194 The type of the image input. Always `input_image`.
195
196 - `INPUT_IMAGE("input_image")`
197
198 - `Optional<String> detail`
199
200 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
201
202 - `class ResponseInputAudio:`
203
204 An audio input to the model.
205
206 - `Role role`
207
208 The role of the message input. One of `user`, `assistant`, `system`, or
209 `developer`.
210
211 - `USER("user")`
212
213 - `ASSISTANT("assistant")`
214
215 - `SYSTEM("system")`
216
217 - `DEVELOPER("developer")`
218
219 - `Optional<Type> type`
220
221 The type of the message input. Always `message`.
222
223 - `MESSAGE("message")`
224
225 - `List<String> labels`
226
227 The labels to assign to each item in the evaluation.
228
229 - `String model`
230
231 The model to use for the evaluation. Must support structured outputs.
232
233 - `String name`
234
235 The name of the grader.
236
237 - `List<String> passingLabels`
238
239 The labels that indicate a passing result. Must be a subset of labels.
240
241 - `JsonValue; type "label_model"constant`
242
243 The object type, which is always `label_model`.
244
245 - `LABEL_MODEL("label_model")`
246
247### Multi Grader
248
249- `class MultiGrader:`
250
251 A MultiGrader object combines the output of multiple graders to produce a single score.
252
253 - `String calculateOutput`
254
255 A formula to calculate the output based on grader results.
256
257 - `Graders graders`
258
259 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
260
261 - `class StringCheckGrader:`
262
263 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
264
265 - `String input`
266
267 The input text. This may include template strings.
268
269 - `String name`
270
271 The name of the grader.
272
273 - `Operation operation`
274
275 The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
276
277 - `EQ("eq")`
278
279 - `NE("ne")`
280
281 - `LIKE("like")`
282
283 - `ILIKE("ilike")`
284
285 - `String reference`
286
287 The reference text. This may include template strings.
288
289 - `JsonValue; type "string_check"constant`
290
291 The object type, which is always `string_check`.
292
293 - `STRING_CHECK("string_check")`
294
295 - `class TextSimilarityGrader:`
296
297 A TextSimilarityGrader object which grades text based on similarity metrics.
298
299 - `EvaluationMetric evaluationMetric`
300
301 The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,
302 `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,
303 or `rouge_l`.
304
305 - `COSINE("cosine")`
306
307 - `FUZZY_MATCH("fuzzy_match")`
308
309 - `BLEU("bleu")`
310
311 - `GLEU("gleu")`
312
313 - `METEOR("meteor")`
314
315 - `ROUGE_1("rouge_1")`
316
317 - `ROUGE_2("rouge_2")`
318
319 - `ROUGE_3("rouge_3")`
320
321 - `ROUGE_4("rouge_4")`
322
323 - `ROUGE_5("rouge_5")`
324
325 - `ROUGE_L("rouge_l")`
326
327 - `String input`
328
329 The text being graded.
330
331 - `String name`
332
333 The name of the grader.
334
335 - `String reference`
336
337 The text being graded against.
338
339 - `JsonValue; type "text_similarity"constant`
340
341 The type of grader.
342
343 - `TEXT_SIMILARITY("text_similarity")`
344
345 - `class PythonGrader:`
346
347 A PythonGrader object that runs a python script on the input.
348
349 - `String name`
350
351 The name of the grader.
352
353 - `String source`
354
355 The source code of the python script.
356
357 - `JsonValue; type "python"constant`
358
359 The object type, which is always `python`.
360
361 - `PYTHON("python")`
362
363 - `Optional<String> imageTag`
364
365 The image tag to use for the python script.
366
367 - `class ScoreModelGrader:`
368
369 A ScoreModelGrader object that uses a model to assign a score to the input.
370
371 - `List<Input> input`
372
373 The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
374
375 - `Content content`
376
377 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
378
379 - `String`
380
381 - `class ResponseInputText:`
382
383 A text input to the model.
384
385 - `String text`
386
387 The text input to the model.
388
389 - `JsonValue; type "input_text"constant`
390
391 The type of the input item. Always `input_text`.
392
393 - `INPUT_TEXT("input_text")`
394
395 - `class OutputText:`
396
397 A text output from the model.
398
399 - `String text`
400
401 The text output from the model.
402
403 - `JsonValue; type "output_text"constant`
404
405 The type of the output text. Always `output_text`.
406
407 - `OUTPUT_TEXT("output_text")`
408
409 - `class InputImage:`
410
411 An image input block used within EvalItem content arrays.
412
413 - `String imageUrl`
414
415 The URL of the image input.
416
417 - `JsonValue; type "input_image"constant`
418
419 The type of the image input. Always `input_image`.
420
421 - `INPUT_IMAGE("input_image")`
422
423 - `Optional<String> detail`
424
425 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
426
427 - `class ResponseInputAudio:`
428
429 An audio input to the model.
430
431 - `InputAudio inputAudio`
432
433 - `String data`
434
435 Base64-encoded audio data.
436
437 - `Format format`
438
439 The format of the audio data. Currently supported formats are `mp3` and
440 `wav`.
441
442 - `MP3("mp3")`
443
444 - `WAV("wav")`
445
446 - `JsonValue; type "input_audio"constant`
447
448 The type of the input item. Always `input_audio`.
449
450 - `INPUT_AUDIO("input_audio")`
451
452 - `List<EvalContentItem>`
453
454 - `String`
455
456 - `class ResponseInputText:`
457
458 A text input to the model.
459
460 - `OutputText`
461
462 - `String text`
463
464 The text output from the model.
465
466 - `JsonValue; type "output_text"constant`
467
468 The type of the output text. Always `output_text`.
469
470 - `OUTPUT_TEXT("output_text")`
471
472 - `InputImage`
473
474 - `String imageUrl`
475
476 The URL of the image input.
477
478 - `JsonValue; type "input_image"constant`
479
480 The type of the image input. Always `input_image`.
481
482 - `INPUT_IMAGE("input_image")`
483
484 - `Optional<String> detail`
485
486 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
487
488 - `class ResponseInputAudio:`
489
490 An audio input to the model.
491
492 - `Role role`
493
494 The role of the message input. One of `user`, `assistant`, `system`, or
495 `developer`.
496
497 - `USER("user")`
498
499 - `ASSISTANT("assistant")`
500
501 - `SYSTEM("system")`
502
503 - `DEVELOPER("developer")`
504
505 - `Optional<Type> type`
506
507 The type of the message input. Always `message`.
508
509 - `MESSAGE("message")`
510
511 - `String model`
512
513 The model to use for the evaluation.
514
515 - `String name`
516
517 The name of the grader.
518
519 - `JsonValue; type "score_model"constant`
520
521 The object type, which is always `score_model`.
522
523 - `SCORE_MODEL("score_model")`
524
525 - `Optional<List<Double>> range`
526
527 The range of the score. Defaults to `[0, 1]`.
528
529 - `Optional<SamplingParams> samplingParams`
530
531 The sampling parameters for the model.
532
533 - `Optional<Long> maxCompletionsTokens`
534
535 The maximum number of tokens the grader model may generate in its response.
536
537 - `Optional<ReasoningEffort> reasoningEffort`
538
539 Constrains effort on reasoning for
540 [reasoning models](https://platform.openai.com/docs/guides/reasoning).
541 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing
542 reasoning effort can result in faster responses and fewer tokens used
543 on reasoning in a response.
544
545 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
546 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
547 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
548 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
549
550 - `NONE("none")`
551
552 - `MINIMAL("minimal")`
553
554 - `LOW("low")`
555
556 - `MEDIUM("medium")`
557
558 - `HIGH("high")`
559
560 - `XHIGH("xhigh")`
561
562 - `Optional<Long> seed`
563
564 A seed value to initialize the randomness, during sampling.
565
566 - `Optional<Double> temperature`
567
568 A higher temperature increases randomness in the outputs.
569
570 - `Optional<Double> topP`
571
572 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
573
574 - `class LabelModelGrader:`
575
576 A LabelModelGrader object which uses a model to assign labels to each item
577 in the evaluation.
578
579 - `List<Input> input`
580
581 - `Content content`
582
583 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
584
585 - `String`
586
587 - `class ResponseInputText:`
588
589 A text input to the model.
590
591 - `class OutputText:`
592
593 A text output from the model.
594
595 - `String text`
596
597 The text output from the model.
598
599 - `JsonValue; type "output_text"constant`
600
601 The type of the output text. Always `output_text`.
602
603 - `OUTPUT_TEXT("output_text")`
604
605 - `class InputImage:`
606
607 An image input block used within EvalItem content arrays.
608
609 - `String imageUrl`
610
611 The URL of the image input.
612
613 - `JsonValue; type "input_image"constant`
614
615 The type of the image input. Always `input_image`.
616
617 - `INPUT_IMAGE("input_image")`
618
619 - `Optional<String> detail`
620
621 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
622
623 - `class ResponseInputAudio:`
624
625 An audio input to the model.
626
627 - `List<EvalContentItem>`
628
629 - `String`
630
631 - `class ResponseInputText:`
632
633 A text input to the model.
634
635 - `OutputText`
636
637 - `InputImage`
638
639 - `class ResponseInputAudio:`
640
641 An audio input to the model.
642
643 - `Role role`
644
645 The role of the message input. One of `user`, `assistant`, `system`, or
646 `developer`.
647
648 - `USER("user")`
649
650 - `ASSISTANT("assistant")`
651
652 - `SYSTEM("system")`
653
654 - `DEVELOPER("developer")`
655
656 - `Optional<Type> type`
657
658 The type of the message input. Always `message`.
659
660 - `MESSAGE("message")`
661
662 - `List<String> labels`
663
664 The labels to assign to each item in the evaluation.
665
666 - `String model`
667
668 The model to use for the evaluation. Must support structured outputs.
669
670 - `String name`
671
672 The name of the grader.
673
674 - `List<String> passingLabels`
675
676 The labels that indicate a passing result. Must be a subset of labels.
677
678 - `JsonValue; type "label_model"constant`
679
680 The object type, which is always `label_model`.
681
682 - `LABEL_MODEL("label_model")`
683
684 - `String name`
685
686 The name of the grader.
687
688 - `JsonValue; type "multi"constant`
689
690 The object type, which is always `multi`.
691
692 - `MULTI("multi")`
693
694### Python Grader
695
696- `class PythonGrader:`
697
698 A PythonGrader object that runs a python script on the input.
699
700 - `String name`
701
702 The name of the grader.
703
704 - `String source`
705
706 The source code of the python script.
707
708 - `JsonValue; type "python"constant`
709
710 The object type, which is always `python`.
711
712 - `PYTHON("python")`
713
714 - `Optional<String> imageTag`
715
716 The image tag to use for the python script.
717
718### Score Model Grader
719
720- `class ScoreModelGrader:`
721
722 A ScoreModelGrader object that uses a model to assign a score to the input.
723
724 - `List<Input> input`
725
726 The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
727
728 - `Content content`
729
730 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
731
732 - `String`
733
734 - `class ResponseInputText:`
735
736 A text input to the model.
737
738 - `String text`
739
740 The text input to the model.
741
742 - `JsonValue; type "input_text"constant`
743
744 The type of the input item. Always `input_text`.
745
746 - `INPUT_TEXT("input_text")`
747
748 - `class OutputText:`
749
750 A text output from the model.
751
752 - `String text`
753
754 The text output from the model.
755
756 - `JsonValue; type "output_text"constant`
757
758 The type of the output text. Always `output_text`.
759
760 - `OUTPUT_TEXT("output_text")`
761
762 - `class InputImage:`
763
764 An image input block used within EvalItem content arrays.
765
766 - `String imageUrl`
767
768 The URL of the image input.
769
770 - `JsonValue; type "input_image"constant`
771
772 The type of the image input. Always `input_image`.
773
774 - `INPUT_IMAGE("input_image")`
775
776 - `Optional<String> detail`
777
778 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
779
780 - `class ResponseInputAudio:`
781
782 An audio input to the model.
783
784 - `InputAudio inputAudio`
785
786 - `String data`
787
788 Base64-encoded audio data.
789
790 - `Format format`
791
792 The format of the audio data. Currently supported formats are `mp3` and
793 `wav`.
794
795 - `MP3("mp3")`
796
797 - `WAV("wav")`
798
799 - `JsonValue; type "input_audio"constant`
800
801 The type of the input item. Always `input_audio`.
802
803 - `INPUT_AUDIO("input_audio")`
804
805 - `List<EvalContentItem>`
806
807 - `String`
808
809 - `class ResponseInputText:`
810
811 A text input to the model.
812
813 - `OutputText`
814
815 - `String text`
816
817 The text output from the model.
818
819 - `JsonValue; type "output_text"constant`
820
821 The type of the output text. Always `output_text`.
822
823 - `OUTPUT_TEXT("output_text")`
824
825 - `InputImage`
826
827 - `String imageUrl`
828
829 The URL of the image input.
830
831 - `JsonValue; type "input_image"constant`
832
833 The type of the image input. Always `input_image`.
834
835 - `INPUT_IMAGE("input_image")`
836
837 - `Optional<String> detail`
838
839 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
840
841 - `class ResponseInputAudio:`
842
843 An audio input to the model.
844
845 - `Role role`
846
847 The role of the message input. One of `user`, `assistant`, `system`, or
848 `developer`.
849
850 - `USER("user")`
851
852 - `ASSISTANT("assistant")`
853
854 - `SYSTEM("system")`
855
856 - `DEVELOPER("developer")`
857
858 - `Optional<Type> type`
859
860 The type of the message input. Always `message`.
861
862 - `MESSAGE("message")`
863
864 - `String model`
865
866 The model to use for the evaluation.
867
868 - `String name`
869
870 The name of the grader.
871
872 - `JsonValue; type "score_model"constant`
873
874 The object type, which is always `score_model`.
875
876 - `SCORE_MODEL("score_model")`
877
878 - `Optional<List<Double>> range`
879
880 The range of the score. Defaults to `[0, 1]`.
881
882 - `Optional<SamplingParams> samplingParams`
883
884 The sampling parameters for the model.
885
886 - `Optional<Long> maxCompletionsTokens`
887
888 The maximum number of tokens the grader model may generate in its response.
889
890 - `Optional<ReasoningEffort> reasoningEffort`
891
892 Constrains effort on reasoning for
893 [reasoning models](https://platform.openai.com/docs/guides/reasoning).
894 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing
895 reasoning effort can result in faster responses and fewer tokens used
896 on reasoning in a response.
897
898 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
899 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
900 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
901 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
902
903 - `NONE("none")`
904
905 - `MINIMAL("minimal")`
906
907 - `LOW("low")`
908
909 - `MEDIUM("medium")`
910
911 - `HIGH("high")`
912
913 - `XHIGH("xhigh")`
914
915 - `Optional<Long> seed`
916
917 A seed value to initialize the randomness, during sampling.
918
919 - `Optional<Double> temperature`
920
921 A higher temperature increases randomness in the outputs.
922
923 - `Optional<Double> topP`
924
925 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
926
927### String Check Grader
928
929- `class StringCheckGrader:`
930
931 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
932
933 - `String input`
934
935 The input text. This may include template strings.
936
937 - `String name`
938
939 The name of the grader.
940
941 - `Operation operation`
942
943 The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
944
945 - `EQ("eq")`
946
947 - `NE("ne")`
948
949 - `LIKE("like")`
950
951 - `ILIKE("ilike")`
952
953 - `String reference`
954
955 The reference text. This may include template strings.
956
957 - `JsonValue; type "string_check"constant`
958
959 The object type, which is always `string_check`.
960
961 - `STRING_CHECK("string_check")`
962
963### Text Similarity Grader
964
965- `class TextSimilarityGrader:`
966
967 A TextSimilarityGrader object which grades text based on similarity metrics.
968
969 - `EvaluationMetric evaluationMetric`
970
971 The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,
972 `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,
973 or `rouge_l`.
974
975 - `COSINE("cosine")`
976
977 - `FUZZY_MATCH("fuzzy_match")`
978
979 - `BLEU("bleu")`
980
981 - `GLEU("gleu")`
982
983 - `METEOR("meteor")`
984
985 - `ROUGE_1("rouge_1")`
986
987 - `ROUGE_2("rouge_2")`
988
989 - `ROUGE_3("rouge_3")`
990
991 - `ROUGE_4("rouge_4")`
992
993 - `ROUGE_5("rouge_5")`
994
995 - `ROUGE_L("rouge_l")`
996
997 - `String input`
998
999 The text being graded.
1000
1001 - `String name`
1002
1003 The name of the grader.
1004
1005 - `String reference`
1006
1007 The text being graded against.
1008
1009 - `JsonValue; type "text_similarity"constant`
1010
1011 The type of grader.
1012
1013 - `TEXT_SIMILARITY("text_similarity")`