Class CodeExecutionResult

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

public abstract class CodeExecutionResult extends JsonSerializable
Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode].
  • Constructor Details

    • CodeExecutionResult

      public CodeExecutionResult()
  • Method Details

    • outcome

      public abstract Optional<Outcome> outcome()
      Required. Outcome of the code execution.
    • output

      public abstract Optional<String> output()
      Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
    • builder

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

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

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