Package com.google.genai.types
Class ExecutableCode
-
- All Implemented Interfaces:
public abstract class ExecutableCode extends JsonSerializable
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 Modifier and Type Class Description public abstract classExecutableCode.BuilderBuilder for ExecutableCode.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description ExecutableCode()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>code()Required. abstract Optional<Language>language()Required. abstract Optional<String>id()Unique identifier of the `ExecutableCode` part. static ExecutableCode.Builderbuilder()Instantiates a builder for ExecutableCode. abstract ExecutableCode.BuildertoBuilder()Creates a builder with the same values as this instance. static ExecutableCodefromJson(String jsonString)Deserializes a JSON string to a ExecutableCode 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
-
id
abstract Optional<String> id()
Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.
-
builder
static ExecutableCode.Builder builder()
Instantiates a builder for ExecutableCode.
-
toBuilder
abstract ExecutableCode.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static ExecutableCode fromJson(String jsonString)
Deserializes a JSON string to a ExecutableCode object.
-
-
-
-