Class GraderValidateParams.Grader
-
- All Implemented Interfaces:
public final class GraderValidateParams.GraderThe grader used for the fine-tuning job.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceGraderValidateParams.Grader.VisitorAn interface that defines how to map each variant of Grader to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<StringCheckGrader>stringCheck()A StringCheckGrader object that performs a string comparison between input and reference using a specified operation. final Optional<TextSimilarityGrader>textSimilarity()A TextSimilarityGrader object which grades text based on similarity metrics. final Optional<PythonGrader>python()A PythonGrader object that runs a python script on the input. final Optional<ScoreModelGrader>scoreModel()A ScoreModelGrader object that uses a model to assign a score to the input. final Optional<MultiGrader>multi()A MultiGrader object combines the output of multiple graders to produce a single score. final BooleanisStringCheck()final BooleanisTextSimilarity()final BooleanisPython()final BooleanisScoreModel()final BooleanisMulti()final StringCheckGraderasStringCheck()A StringCheckGrader object that performs a string comparison between input and reference using a specified operation. final TextSimilarityGraderasTextSimilarity()A TextSimilarityGrader object which grades text based on similarity metrics. final PythonGraderasPython()A PythonGrader object that runs a python script on the input. final ScoreModelGraderasScoreModel()A ScoreModelGrader object that uses a model to assign a score to the input. final MultiGraderasMulti()A MultiGrader object combines the output of multiple graders to produce a single score. final Optional<JsonValue>_json()final <T extends Any> Taccept(GraderValidateParams.Grader.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final GraderValidateParams.Gradervalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static GraderValidateParams.GraderofStringCheck(StringCheckGrader stringCheck)A StringCheckGrader object that performs a string comparison between input and reference using a specified operation. final static GraderValidateParams.GraderofTextSimilarity(TextSimilarityGrader textSimilarity)A TextSimilarityGrader object which grades text based on similarity metrics. final static GraderValidateParams.GraderofPython(PythonGrader python)A PythonGrader object that runs a python script on the input. final static GraderValidateParams.GraderofScoreModel(ScoreModelGrader scoreModel)A ScoreModelGrader object that uses a model to assign a score to the input. final static GraderValidateParams.GraderofMulti(MultiGrader multi)A MultiGrader object combines the output of multiple graders to produce a single score. -
-
Method Detail
-
stringCheck
final Optional<StringCheckGrader> stringCheck()
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
-
textSimilarity
final Optional<TextSimilarityGrader> textSimilarity()
A TextSimilarityGrader object which grades text based on similarity metrics.
-
python
final Optional<PythonGrader> python()
A PythonGrader object that runs a python script on the input.
-
scoreModel
final Optional<ScoreModelGrader> scoreModel()
A ScoreModelGrader object that uses a model to assign a score to the input.
-
multi
final Optional<MultiGrader> multi()
A MultiGrader object combines the output of multiple graders to produce a single score.
-
isStringCheck
final Boolean isStringCheck()
-
isTextSimilarity
final Boolean isTextSimilarity()
-
isScoreModel
final Boolean isScoreModel()
-
asStringCheck
final StringCheckGrader asStringCheck()
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
-
asTextSimilarity
final TextSimilarityGrader asTextSimilarity()
A TextSimilarityGrader object which grades text based on similarity metrics.
-
asPython
final PythonGrader asPython()
A PythonGrader object that runs a python script on the input.
-
asScoreModel
final ScoreModelGrader asScoreModel()
A ScoreModelGrader object that uses a model to assign a score to the input.
-
asMulti
final MultiGrader asMulti()
A MultiGrader object combines the output of multiple graders to produce a single score.
-
accept
final <T extends Any> T accept(GraderValidateParams.Grader.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = grader.accept(new Grader.Visitor<Optional<String>>() { @Override public Optional<String> visitStringCheck(StringCheckGrader stringCheck) { return Optional.of(stringCheck.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final GraderValidateParams.Grader validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofStringCheck
final static GraderValidateParams.Grader ofStringCheck(StringCheckGrader stringCheck)
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
-
ofTextSimilarity
final static GraderValidateParams.Grader ofTextSimilarity(TextSimilarityGrader textSimilarity)
A TextSimilarityGrader object which grades text based on similarity metrics.
-
ofPython
final static GraderValidateParams.Grader ofPython(PythonGrader python)
A PythonGrader object that runs a python script on the input.
-
ofScoreModel
final static GraderValidateParams.Grader ofScoreModel(ScoreModelGrader scoreModel)
A ScoreModelGrader object that uses a model to assign a score to the input.
-
ofMulti
final static GraderValidateParams.Grader ofMulti(MultiGrader multi)
A MultiGrader object combines the output of multiple graders to produce a single score.
-
-
-
-