ExecutableCodePart

public final class ExecutableCodePart implements Part


Represents the code that was executed by the model.

Summary

Nested types

public static class ExecutableCodePart.Companion

Public fields

final @NonNull String

The source code to be executed.

boolean

Indicates whether the response is a thought.

final @NonNull String

The programming language of the code.

final String

Public constructors

This method is deprecated. Part of the model response.

Public methods

static final @NonNull ExecutableCodePart
@PublicPreviewAPI
createWithThinking(
    @NonNull String language,
    @NonNull String code,
    boolean isThought,
    String thoughtSignature
)

Creates an ExecutableCodePart with advanced thinking metadata.

Public fields

code

public final @NonNull String code

The source code to be executed.

isThought

public boolean isThought

Indicates whether the response is a thought.

language

public final @NonNull String language

The programming language of the code.

thoughtSignature

public final String thoughtSignature

Public constructors

ExecutableCodePart

public ExecutableCodePart(@NonNull String language, @NonNull String code)

Public methods

createWithThinking

@PublicPreviewAPI
public static final @NonNull ExecutableCodePart createWithThinking(
    @NonNull String language,
    @NonNull String code,
    boolean isThought,
    String thoughtSignature
)

Creates an ExecutableCodePart with advanced thinking metadata.

Parameters
@NonNull String language

The programming language of the code.

@NonNull String code

The source code to be executed.

boolean isThought

Indicates whether the response is a thought.

String thoughtSignature

The signature associated with the thought, if any.