Package com.google.genai.types
Class CustomCodeExecutionSpec
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.CustomCodeExecutionSpec
Specificies a metric that is computed by running user-defined Python functions remotely.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for CustomCodeExecutionSpec. -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Instantiates a builder for CustomCodeExecutionSpec.A string representing a user-defined function for evaluation.static CustomCodeExecutionSpecDeserializes a JSON string to a CustomCodeExecutionSpec object.abstract CustomCodeExecutionSpec.BuilderCreates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
-
Constructor Details
-
CustomCodeExecutionSpec
public CustomCodeExecutionSpec()
-
-
Method Details
-
evaluationFunction
A string representing a user-defined function for evaluation. Expected user to define the following function, e.g.: def evaluate(instance: dict[str, Any]) -> float: Please include this function signature in the code snippet. Instance is the evaluation instance, any fields populated in the instance are available to the function as instance[field_name]. -
builder
Instantiates a builder for CustomCodeExecutionSpec. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a CustomCodeExecutionSpec object.
-