Validate grader
Validate a grader.
ParametersExpand Collapse
body FineTuningAlphaGraderValidateParams
Grader param.Field[FineTuningAlphaGraderValidateParamsGraderUnion]The grader used for the fine-tuning job.
The grader used for the fine-tuning job.
type StringCheckGrader struct{…}A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
type TextSimilarityGrader struct{…}A TextSimilarityGrader object which grades text based on similarity metrics.
A TextSimilarityGrader object which grades text based on similarity metrics.
EvaluationMetric TextSimilarityGraderEvaluationMetricThe evaluation metric to use. One of cosine, fuzzy_match, bleu,
gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5,
or rouge_l.
The evaluation metric to use. One of cosine, fuzzy_match, bleu,
gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5,
or rouge_l.
type ScoreModelGrader struct{…}A ScoreModelGrader object that uses a model to assign a score to the input.
A ScoreModelGrader object that uses a model to assign a score to the input.
Input []ScoreModelGraderInputThe input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
Content ScoreModelGraderInputContentUnionInputs 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.
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.
type ScoreModelGraderInputContentInputImage struct{…}An image input block used within EvalItem content arrays.
An image input block used within EvalItem content arrays.
type ResponseInputAudio struct{…}An audio input to the model.
An audio input to the model.
type GraderInputs []GraderInputUnionA list of inputs, each of which may be either an input text, output text, input
image, or input audio object.
A list of inputs, each of which may be either an input text, output text, input image, or input audio object.
SamplingParams ScoreModelGraderSamplingParamsOptionalThe sampling parameters for the model.
The sampling parameters for the model.
The maximum number of tokens the grader model may generate in its response.
Constrains effort on reasoning for reasoning models. Currently supported
values are none, minimal, low, medium, high, xhigh, and max.
Reducing reasoning effort can result in faster responses and fewer tokens
used on reasoning in a response. Not all reasoning models support every
value. See the
reasoning guide
for model-specific support.
Constrains effort on reasoning for reasoning models. Currently supported
values are none, minimal, low, medium, high, xhigh, and max.
Reducing reasoning effort can result in faster responses and fewer tokens
used on reasoning in a response. Not all reasoning models support every
value. See the
reasoning guide
for model-specific support.
type MultiGrader struct{…}A MultiGrader object combines the output of multiple graders to produce a single score.
A MultiGrader object combines the output of multiple graders to produce a single score.
Graders MultiGraderGradersUnionA StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
type StringCheckGrader struct{…}A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
type TextSimilarityGrader struct{…}A TextSimilarityGrader object which grades text based on similarity metrics.
A TextSimilarityGrader object which grades text based on similarity metrics.
EvaluationMetric TextSimilarityGraderEvaluationMetricThe evaluation metric to use. One of cosine, fuzzy_match, bleu,
gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5,
or rouge_l.
The evaluation metric to use. One of cosine, fuzzy_match, bleu,
gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5,
or rouge_l.
type ScoreModelGrader struct{…}A ScoreModelGrader object that uses a model to assign a score to the input.
A ScoreModelGrader object that uses a model to assign a score to the input.
Input []ScoreModelGraderInputThe input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
Content ScoreModelGraderInputContentUnionInputs 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.
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.
type ScoreModelGraderInputContentInputImage struct{…}An image input block used within EvalItem content arrays.
An image input block used within EvalItem content arrays.
type ResponseInputAudio struct{…}An audio input to the model.
An audio input to the model.
type GraderInputs []GraderInputUnionA list of inputs, each of which may be either an input text, output text, input
image, or input audio object.
A list of inputs, each of which may be either an input text, output text, input image, or input audio object.
SamplingParams ScoreModelGraderSamplingParamsOptionalThe sampling parameters for the model.
The sampling parameters for the model.
The maximum number of tokens the grader model may generate in its response.
Constrains effort on reasoning for reasoning models. Currently supported
values are none, minimal, low, medium, high, xhigh, and max.
Reducing reasoning effort can result in faster responses and fewer tokens
used on reasoning in a response. Not all reasoning models support every
value. See the
reasoning guide
for model-specific support.
Constrains effort on reasoning for reasoning models. Currently supported
values are none, minimal, low, medium, high, xhigh, and max.
Reducing reasoning effort can result in faster responses and fewer tokens
used on reasoning in a response. Not all reasoning models support every
value. See the
reasoning guide
for model-specific support.
type LabelModelGrader struct{…}A LabelModelGrader object which uses a model to assign labels to each item
in the evaluation.
A LabelModelGrader object which uses a model to assign labels to each item in the evaluation.
Input []LabelModelGraderInput
Content LabelModelGraderInputContentUnionInputs 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.
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.
type LabelModelGraderInputContentInputImage struct{…}An image input block used within EvalItem content arrays.
An image input block used within EvalItem content arrays.
type ResponseInputAudio struct{…}An audio input to the model.
An audio input to the model.
type GraderInputs []GraderInputUnionA list of inputs, each of which may be either an input text, output text, input
image, or input audio object.
A list of inputs, each of which may be either an input text, output text, input image, or input audio object.
ReturnsExpand Collapse
type FineTuningAlphaGraderValidateResponse struct{…}
Grader FineTuningAlphaGraderValidateResponseGraderUnionOptionalThe grader used for the fine-tuning job.
The grader used for the fine-tuning job.
type StringCheckGrader struct{…}A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
type TextSimilarityGrader struct{…}A TextSimilarityGrader object which grades text based on similarity metrics.
A TextSimilarityGrader object which grades text based on similarity metrics.
EvaluationMetric TextSimilarityGraderEvaluationMetricThe evaluation metric to use. One of cosine, fuzzy_match, bleu,
gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5,
or rouge_l.
The evaluation metric to use. One of cosine, fuzzy_match, bleu,
gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5,
or rouge_l.
type ScoreModelGrader struct{…}A ScoreModelGrader object that uses a model to assign a score to the input.
A ScoreModelGrader object that uses a model to assign a score to the input.
Input []ScoreModelGraderInputThe input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
Content ScoreModelGraderInputContentUnionInputs 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.
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.
type ScoreModelGraderInputContentInputImage struct{…}An image input block used within EvalItem content arrays.
An image input block used within EvalItem content arrays.
type ResponseInputAudio struct{…}An audio input to the model.
An audio input to the model.
type GraderInputs []GraderInputUnionA list of inputs, each of which may be either an input text, output text, input
image, or input audio object.
A list of inputs, each of which may be either an input text, output text, input image, or input audio object.
SamplingParams ScoreModelGraderSamplingParamsOptionalThe sampling parameters for the model.
The sampling parameters for the model.
The maximum number of tokens the grader model may generate in its response.
Constrains effort on reasoning for reasoning models. Currently supported
values are none, minimal, low, medium, high, xhigh, and max.
Reducing reasoning effort can result in faster responses and fewer tokens
used on reasoning in a response. Not all reasoning models support every
value. See the
reasoning guide
for model-specific support.
Constrains effort on reasoning for reasoning models. Currently supported
values are none, minimal, low, medium, high, xhigh, and max.
Reducing reasoning effort can result in faster responses and fewer tokens
used on reasoning in a response. Not all reasoning models support every
value. See the
reasoning guide
for model-specific support.
type MultiGrader struct{…}A MultiGrader object combines the output of multiple graders to produce a single score.
A MultiGrader object combines the output of multiple graders to produce a single score.
Graders MultiGraderGradersUnionA StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
type StringCheckGrader struct{…}A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
type TextSimilarityGrader struct{…}A TextSimilarityGrader object which grades text based on similarity metrics.
A TextSimilarityGrader object which grades text based on similarity metrics.
EvaluationMetric TextSimilarityGraderEvaluationMetricThe evaluation metric to use. One of cosine, fuzzy_match, bleu,
gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5,
or rouge_l.
The evaluation metric to use. One of cosine, fuzzy_match, bleu,
gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5,
or rouge_l.
type ScoreModelGrader struct{…}A ScoreModelGrader object that uses a model to assign a score to the input.
A ScoreModelGrader object that uses a model to assign a score to the input.
Input []ScoreModelGraderInputThe input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
Content ScoreModelGraderInputContentUnionInputs 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.
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.
type ScoreModelGraderInputContentInputImage struct{…}An image input block used within EvalItem content arrays.
An image input block used within EvalItem content arrays.
type ResponseInputAudio struct{…}An audio input to the model.
An audio input to the model.
type GraderInputs []GraderInputUnionA list of inputs, each of which may be either an input text, output text, input
image, or input audio object.
A list of inputs, each of which may be either an input text, output text, input image, or input audio object.
SamplingParams ScoreModelGraderSamplingParamsOptionalThe sampling parameters for the model.
The sampling parameters for the model.
The maximum number of tokens the grader model may generate in its response.
Constrains effort on reasoning for reasoning models. Currently supported
values are none, minimal, low, medium, high, xhigh, and max.
Reducing reasoning effort can result in faster responses and fewer tokens
used on reasoning in a response. Not all reasoning models support every
value. See the
reasoning guide
for model-specific support.
Constrains effort on reasoning for reasoning models. Currently supported
values are none, minimal, low, medium, high, xhigh, and max.
Reducing reasoning effort can result in faster responses and fewer tokens
used on reasoning in a response. Not all reasoning models support every
value. See the
reasoning guide
for model-specific support.
type LabelModelGrader struct{…}A LabelModelGrader object which uses a model to assign labels to each item
in the evaluation.
A LabelModelGrader object which uses a model to assign labels to each item in the evaluation.
Input []LabelModelGraderInput
Content LabelModelGraderInputContentUnionInputs 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.
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.
type LabelModelGraderInputContentInputImage struct{…}An image input block used within EvalItem content arrays.
An image input block used within EvalItem content arrays.
type ResponseInputAudio struct{…}An audio input to the model.
An audio input to the model.
type GraderInputs []GraderInputUnionA list of inputs, each of which may be either an input text, output text, input
image, or input audio object.
A list of inputs, each of which may be either an input text, output text, input image, or input audio object.
Validate grader
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.FineTuning.Alpha.Graders.Validate(context.TODO(), openai.FineTuningAlphaGraderValidateParams{
Grader: openai.FineTuningAlphaGraderValidateParamsGraderUnion{
OfStringCheckGrader: &openai.StringCheckGraderParam{
Input: "input",
Name: "name",
Operation: openai.StringCheckGraderOperationEq,
Reference: "reference",
},
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Grader)
}
{
"grader": {
"type": "string_check",
"name": "Example string check grader",
"input": "{{sample.output_text}}",
"reference": "{{item.label}}",
"operation": "eq"
}
}
Returns Examples
{
"grader": {
"type": "string_check",
"name": "Example string check grader",
"input": "{{sample.output_text}}",
"reference": "{{item.label}}",
"operation": "eq"
}
}