Package com.google.genai.types
Class CodeExecutionResult
-
- All Implemented Interfaces:
public abstract class CodeExecutionResult extends JsonSerializable
Result of executing the `ExecutableCode`.
Generated only when the `CodeExecution` tool is used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classCodeExecutionResult.BuilderBuilder for CodeExecutionResult.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description CodeExecutionResult()
-
Method Summary
Modifier and Type Method Description abstract Optional<Outcome>outcome()Required. abstract Optional<String>output()Optional. abstract Optional<String>id()The identifier of the `ExecutableCode` part this result is for. static CodeExecutionResult.Builderbuilder()Instantiates a builder for CodeExecutionResult. abstract CodeExecutionResult.BuildertoBuilder()Creates a builder with the same values as this instance. static CodeExecutionResultfromJson(String jsonString)Deserializes a JSON string to a CodeExecutionResult object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
output
abstract Optional<String> output()
Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
-
id
abstract Optional<String> id()
The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.
-
builder
static CodeExecutionResult.Builder builder()
Instantiates a builder for CodeExecutionResult.
-
toBuilder
abstract CodeExecutionResult.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static CodeExecutionResult fromJson(String jsonString)
Deserializes a JSON string to a CodeExecutionResult object.
-
-
-
-