Class EvaluationParserConfig.CustomCodeParserConfig (3.94.0)

public static final class EvaluationParserConfig.CustomCodeParserConfig extends GeneratedMessage implements EvaluationParserConfig.CustomCodeParserConfigOrBuilder

Configuration for parsing the LLM response using custom code.

Protobuf type google.cloud.aiplatform.v1beta1.EvaluationParserConfig.CustomCodeParserConfig

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessage > EvaluationParserConfig.CustomCodeParserConfig

Static Fields

PARSING_FUNCTION_FIELD_NUMBER

public static final int PARSING_FUNCTION_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static EvaluationParserConfig.CustomCodeParserConfig getDefaultInstance()
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static EvaluationParserConfig.CustomCodeParserConfig.Builder newBuilder()
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig.Builder

newBuilder(EvaluationParserConfig.CustomCodeParserConfig prototype)

public static EvaluationParserConfig.CustomCodeParserConfig.Builder newBuilder(EvaluationParserConfig.CustomCodeParserConfig prototype)
Parameter
Name Description
prototype EvaluationParserConfig.CustomCodeParserConfig
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig.Builder

parseDelimitedFrom(InputStream input)

public static EvaluationParserConfig.CustomCodeParserConfig parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static EvaluationParserConfig.CustomCodeParserConfig parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static EvaluationParserConfig.CustomCodeParserConfig parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<EvaluationParserConfig.CustomCodeParserConfig> parser()
Returns
Type Description
Parser<CustomCodeParserConfig>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public EvaluationParserConfig.CustomCodeParserConfig getDefaultInstanceForType()
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig

getParserForType()

public Parser<EvaluationParserConfig.CustomCodeParserConfig> getParserForType()
Returns
Type Description
Parser<CustomCodeParserConfig>
Overrides

getParsingFunction()

public String getParsingFunction()

Required. Python function for parsing results. The function should be defined within this string.

The function takes a list of strings (LLM responses) and should return either a list of dictionaries (for rubrics) or a single dictionary (for a metric result).

Example function signature: def parse(responses: list[str]) -> list[dict[str, Any]] | dict[str, Any]:

When parsing rubrics, return a list of dictionaries, where each dictionary represents a Rubric. Example for rubrics: [ { "content": {"property": {"description": "The response is factual."}}, "type": "FACTUALITY", "importance": "HIGH" }, { "content": {"property": {"description": "The response is fluent."}}, "type": "FLUENCY", "importance": "MEDIUM" } ]

When parsing critique results, return a dictionary representing a MetricResult. Example for a metric result: { "score": 0.8, "explanation": "The model followed most instructions.", "rubric_verdicts": [...] }

... code for result extraction and aggregation

optional string parsing_function = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The parsingFunction.

getParsingFunctionBytes()

public ByteString getParsingFunctionBytes()

Required. Python function for parsing results. The function should be defined within this string.

The function takes a list of strings (LLM responses) and should return either a list of dictionaries (for rubrics) or a single dictionary (for a metric result).

Example function signature: def parse(responses: list[str]) -> list[dict[str, Any]] | dict[str, Any]:

When parsing rubrics, return a list of dictionaries, where each dictionary represents a Rubric. Example for rubrics: [ { "content": {"property": {"description": "The response is factual."}}, "type": "FACTUALITY", "importance": "HIGH" }, { "content": {"property": {"description": "The response is fluent."}}, "type": "FLUENCY", "importance": "MEDIUM" } ]

When parsing critique results, return a dictionary representing a MetricResult. Example for a metric result: { "score": 0.8, "explanation": "The model followed most instructions.", "rubric_verdicts": [...] }

... code for result extraction and aggregation

optional string parsing_function = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for parsingFunction.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasParsingFunction()

public boolean hasParsingFunction()

Required. Python function for parsing results. The function should be defined within this string.

The function takes a list of strings (LLM responses) and should return either a list of dictionaries (for rubrics) or a single dictionary (for a metric result).

Example function signature: def parse(responses: list[str]) -> list[dict[str, Any]] | dict[str, Any]:

When parsing rubrics, return a list of dictionaries, where each dictionary represents a Rubric. Example for rubrics: [ { "content": {"property": {"description": "The response is factual."}}, "type": "FACTUALITY", "importance": "HIGH" }, { "content": {"property": {"description": "The response is fluent."}}, "type": "FLUENCY", "importance": "MEDIUM" } ]

When parsing critique results, return a dictionary representing a MetricResult. Example for a metric result: { "score": 0.8, "explanation": "The model followed most instructions.", "rubric_verdicts": [...] }

... code for result extraction and aggregation

optional string parsing_function = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the parsingFunction field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public EvaluationParserConfig.CustomCodeParserConfig.Builder newBuilderForType()
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

protected EvaluationParserConfig.CustomCodeParserConfig.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig.Builder
Overrides

toBuilder()

public EvaluationParserConfig.CustomCodeParserConfig.Builder toBuilder()
Returns
Type Description
EvaluationParserConfig.CustomCodeParserConfig.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException