Class CodeExecutionResult
Result of executing the ExecutableCode. Generated only when the CodeExecution tool is used.
public record CodeExecutionResult : IEquatable<CodeExecutionResult>
- Inheritance
-
CodeExecutionResult
- Implements
- Inherited Members
Properties
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.
[JsonPropertyName("id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Id { get; set; }
Property Value
Outcome
Outcome of the code execution.
[JsonPropertyName("outcome")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Outcome? Outcome { get; set; }
Property Value
Output
Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
[JsonPropertyName("output")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Output { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a CodeExecutionResult object.
public static CodeExecutionResult? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- CodeExecutionResult
The deserialized CodeExecutionResult object, or null if deserialization fails.