CodeExecutionResultPart

public final class CodeExecutionResultPart implements Part


Represents the code execution result from the model.

Summary

Nested types

Public fields

boolean

Indicates whether the response is a thought.

final @NonNull String

The result of the execution.

final @NonNull String

The stdout from the code execution, or an error message if it failed.

final String

Public constructors

This method is deprecated. Part of the model response.

Public methods

static final @NonNull CodeExecutionResultPart
@PublicPreviewAPI
createWithThinking(
    @NonNull String outcome,
    @NonNull String output,
    boolean isThought,
    String thoughtSignature
)

Creates a CodeExecutionResultPart with advanced thinking metadata.

final boolean

Indicates if the code execution was successful

Public fields

isThought

public boolean isThought

Indicates whether the response is a thought.

outcome

public final @NonNull String outcome

The result of the execution.

output

public final @NonNull String output

The stdout from the code execution, or an error message if it failed.

thoughtSignature

public final String thoughtSignature

Public constructors

CodeExecutionResultPart

public CodeExecutionResultPart(@NonNull String outcome, @NonNull String output)

Public methods

createWithThinking

@PublicPreviewAPI
public static final @NonNull CodeExecutionResultPart createWithThinking(
    @NonNull String outcome,
    @NonNull String output,
    boolean isThought,
    String thoughtSignature
)

Creates a CodeExecutionResultPart with advanced thinking metadata.

Parameters
@NonNull String outcome

The result of the execution.

@NonNull String output

The stdout from the code execution, or an error message if it failed.

boolean isThought

Indicates whether the response is a thought.

String thoughtSignature

The signature associated with the thought, if any.

executionSucceeded

public final boolean executionSucceeded()

Indicates if the code execution was successful