Package com.google.genai.types
Class CustomCodeExecutionSpec
-
- All Implemented Interfaces:
public abstract class CustomCodeExecutionSpec extends JsonSerializable
Specificies a metric that is computed by running user-defined Python functions remotely.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classCustomCodeExecutionSpec.BuilderBuilder for CustomCodeExecutionSpec.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description CustomCodeExecutionSpec()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>evaluationFunction()A string representing a user-defined function for evaluation. static CustomCodeExecutionSpec.Builderbuilder()Instantiates a builder for CustomCodeExecutionSpec. abstract CustomCodeExecutionSpec.BuildertoBuilder()Creates a builder with the same values as this instance. static CustomCodeExecutionSpecfromJson(String jsonString)Deserializes a JSON string to a CustomCodeExecutionSpec object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
evaluationFunction
abstract Optional<String> 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
static CustomCodeExecutionSpec.Builder builder()
Instantiates a builder for CustomCodeExecutionSpec.
-
toBuilder
abstract CustomCodeExecutionSpec.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static CustomCodeExecutionSpec fromJson(String jsonString)
Deserializes a JSON string to a CustomCodeExecutionSpec object.
-
-
-
-