CodeExecutionResultPart

class CodeExecutionResultPart : Part


Represents the code execution result from the model.

Summary

Public companion functions

CodeExecutionResultPart
@PublicPreviewAPI
createWithThinking(
    outcome: String,
    output: String,
    isThought: Boolean,
    thoughtSignature: String?
)

Creates a CodeExecutionResultPart with advanced thinking metadata.

Public constructors

CodeExecutionResultPart(outcome: String, output: String)

This function is deprecated. Part of the model response.

Public functions

Boolean

Indicates if the code execution was successful

Public properties

open Boolean

Indicates whether the response is a thought.

String

The result of the execution.

String

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

String?

Public companion functions

createWithThinking

@PublicPreviewAPI
fun createWithThinking(
    outcome: String,
    output: String,
    isThought: Boolean,
    thoughtSignature: String?
): CodeExecutionResultPart

Creates a CodeExecutionResultPart with advanced thinking metadata.

Parameters
outcome: String

The result of the execution.

output: String

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

isThought: Boolean

Indicates whether the response is a thought.

thoughtSignature: String?

The signature associated with the thought, if any.

Public constructors

CodeExecutionResultPart

CodeExecutionResultPart(outcome: String, output: String)

Public functions

executionSucceeded

fun executionSucceeded(): Boolean

Indicates if the code execution was successful

Public properties

isThought

open val isThoughtBoolean

Indicates whether the response is a thought.

outcome

val outcomeString

The result of the execution.

output

val outputString

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

thoughtSignature

val thoughtSignatureString?