CodeBasedEvaluatorDefinition Class

public final class CodeBasedEvaluatorDefinition
extends EvaluatorDefinition

Code-based evaluator definition using python code.

Constructor Summary

Constructor Description
CodeBasedEvaluatorDefinition()

Creates an instance of CodeBasedEvaluatorDefinition class.

CodeBasedEvaluatorDefinition(String codeText)

Creates an instance of CodeBasedEvaluatorDefinition class.

Method Summary

Modifier and Type Method and Description
static CodeBasedEvaluatorDefinition fromJson(JsonReader jsonReader)

Reads an instance of CodeBasedEvaluatorDefinition from the JsonReader.

String getBlobUrl()

Get the blobUrl property: The blob URI for the evaluator storage.

String getCodeText()

Get the codeText property: Inline code text for the evaluator.

String getEntryPoint()

Get the entryPoint property: The entry point Python file name for the uploaded evaluator code (e.g.

String getImageTag()

Get the imageTag property: The container image tag to use for evaluator code execution.

EvaluatorDefinitionType getType()

Get the type property: The type of evaluator definition.

CodeBasedEvaluatorDefinition setBlobUrl(String blobUrl)

Set the blobUrl property: The blob URI for the evaluator storage.

CodeBasedEvaluatorDefinition setCodeText(String codeText)

Set the codeText property: Inline code text for the evaluator.

CodeBasedEvaluatorDefinition setDataSchema(Map<String,BinaryData> dataSchema)

Set the dataSchema property: The JSON schema (Draft 2020-12) for the evaluator's input data.

CodeBasedEvaluatorDefinition setEntryPoint(String entryPoint)

Set the entryPoint property: The entry point Python file name for the uploaded evaluator code (e.g.

CodeBasedEvaluatorDefinition setImageTag(String imageTag)

Set the imageTag property: The container image tag to use for evaluator code execution.

CodeBasedEvaluatorDefinition setInitializationParameters(Map<String,BinaryData> initializationParameters)

Set the initializationParameters property: The JSON schema (Draft 2020-12) for the evaluator's input parameters.

CodeBasedEvaluatorDefinition setMetrics(Map<String,EvaluatorMetric> metrics)

Set the metrics property: List of output metrics produced by this evaluator.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from EvaluatorDefinition

Methods inherited from java.lang.Object

Constructor Details

CodeBasedEvaluatorDefinition

public CodeBasedEvaluatorDefinition()

Creates an instance of CodeBasedEvaluatorDefinition class.

CodeBasedEvaluatorDefinition

public CodeBasedEvaluatorDefinition(String codeText)

Creates an instance of CodeBasedEvaluatorDefinition class.

Parameters:

codeText - the codeText value to set.

Method Details

fromJson

public static CodeBasedEvaluatorDefinition fromJson(JsonReader jsonReader)

Reads an instance of CodeBasedEvaluatorDefinition from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of CodeBasedEvaluatorDefinition if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the CodeBasedEvaluatorDefinition.

getBlobUrl

public String getBlobUrl()

Get the blobUrl property: The blob URI for the evaluator storage.

Returns:

the blobUrl value.

getCodeText

public String getCodeText()

Get the codeText property: Inline code text for the evaluator.

Returns:

the codeText value.

getEntryPoint

public String getEntryPoint()

Get the entryPoint property: The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py').

Returns:

the entryPoint value.

getImageTag

public String getImageTag()

Get the imageTag property: The container image tag to use for evaluator code execution.

Returns:

the imageTag value.

getType

public EvaluatorDefinitionType getType()

Get the type property: The type of evaluator definition.

Overrides:

CodeBasedEvaluatorDefinition.getType()

Returns:

the type value.

setBlobUrl

public CodeBasedEvaluatorDefinition setBlobUrl(String blobUrl)

Set the blobUrl property: The blob URI for the evaluator storage.

Parameters:

blobUrl - the blobUrl value to set.

Returns:

the CodeBasedEvaluatorDefinition object itself.

setCodeText

public CodeBasedEvaluatorDefinition setCodeText(String codeText)

Set the codeText property: Inline code text for the evaluator.

Parameters:

codeText - the codeText value to set.

Returns:

the CodeBasedEvaluatorDefinition object itself.

setDataSchema

public CodeBasedEvaluatorDefinition setDataSchema(Map<String,BinaryData> dataSchema)

Set the dataSchema property: The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like type, properties, required.

Overrides:

CodeBasedEvaluatorDefinition.setDataSchema(Map<String,BinaryData> dataSchema)

Parameters:

dataSchema

setEntryPoint

public CodeBasedEvaluatorDefinition setEntryPoint(String entryPoint)

Set the entryPoint property: The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py').

Parameters:

entryPoint - the entryPoint value to set.

Returns:

the CodeBasedEvaluatorDefinition object itself.

setImageTag

public CodeBasedEvaluatorDefinition setImageTag(String imageTag)

Set the imageTag property: The container image tag to use for evaluator code execution.

Parameters:

imageTag - the imageTag value to set.

Returns:

the CodeBasedEvaluatorDefinition object itself.

setInitializationParameters

public CodeBasedEvaluatorDefinition setInitializationParameters(Map<String,BinaryData> initializationParameters)

Set the initializationParameters property: The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters like type, properties, required.

Overrides:

CodeBasedEvaluatorDefinition.setInitializationParameters(Map<String,BinaryData> initializationParameters)

Parameters:

initializationParameters

setMetrics

public CodeBasedEvaluatorDefinition setMetrics(Map<String,EvaluatorMetric> metrics)

Set the metrics property: List of output metrics produced by this evaluator.

Overrides:

CodeBasedEvaluatorDefinition.setMetrics(Map<String,EvaluatorMetric> metrics)

Parameters:

metrics

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

CodeBasedEvaluatorDefinition.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to