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 class ExecutableCode.Builder

      Builder for ExecutableCode.

    • Constructor Summary

      Constructors 
      Constructor Description
      ExecutableCode()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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.Builder builder() Instantiates a builder for ExecutableCode.
      abstract ExecutableCode.Builder toBuilder() Creates a builder with the same values as this instance.
      static ExecutableCode fromJson(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