Class CodeExecutionResult.Builder

java.lang.Object
com.google.genai.types.CodeExecutionResult.Builder
Enclosing class:
CodeExecutionResult

public abstract static class CodeExecutionResult.Builder extends Object
Builder for CodeExecutionResult.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • outcome

      public abstract CodeExecutionResult.Builder outcome(Outcome outcome)
      Setter for outcome.

      outcome: Required. Outcome of the code execution.

    • clearOutcome

      @CanIgnoreReturnValue public CodeExecutionResult.Builder clearOutcome()
      Clears the value of outcome field.
    • outcome

      @CanIgnoreReturnValue public CodeExecutionResult.Builder outcome(Outcome.Known knownType)
      Setter for outcome given a known enum.

      outcome: Required. Outcome of the code execution.

    • outcome

      @CanIgnoreReturnValue public CodeExecutionResult.Builder outcome(String outcome)
      Setter for outcome given a string.

      outcome: Required. Outcome of the code execution.

    • output

      public abstract CodeExecutionResult.Builder output(String output)
      Setter for output.

      output: Optional. Contains stdout when code execution is successful, stderr or other description otherwise.

    • clearOutput

      @CanIgnoreReturnValue public CodeExecutionResult.Builder clearOutput()
      Clears the value of output field.
    • id

      public abstract CodeExecutionResult.Builder id(String id)
      Setter for id.

      id: Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id. This field is not supported in Vertex AI.

    • clearId

      @CanIgnoreReturnValue public CodeExecutionResult.Builder clearId()
      Clears the value of id field.
    • build

      public abstract CodeExecutionResult build()