Package com.google.genai.types
Class ExecutableCode
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ExecutableCode
Model-generated code executed server-side, results returned to the model.
Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutableCode.Builderbuilder()Instantiates a builder for ExecutableCode.code()Required.static ExecutableCodeDeserializes a JSON string to a ExecutableCode object.id()Unique identifier of the `ExecutableCode` part.language()Required.abstract ExecutableCode.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
-
ExecutableCode
public ExecutableCode()
-
-
Method Details
-
code
Required. The code to be executed. -
language
Required. Programming language of the `code`. -
id
Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`. -
builder
Instantiates a builder for ExecutableCode. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a ExecutableCode object.
-