Class ExecutableCode

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ExecutableCode

public abstract class ExecutableCode extends JsonSerializable
Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE].
  • Constructor Details

    • ExecutableCode

      public ExecutableCode()
  • Method Details

    • code

      public abstract Optional<String> code()
      Required. The code to be executed.
    • language

      public abstract Optional<Language> language()
      Required. Programming language of the `code`.
    • builder

      public static ExecutableCode.Builder builder()
      Instantiates a builder for ExecutableCode.
    • toBuilder

      public abstract ExecutableCode.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static ExecutableCode fromJson(String jsonString)
      Deserializes a JSON string to a ExecutableCode object.