Class ExecutableCode
Code generated by the model that is meant to be executed, and the result returned to the
model. Generated when using the CodeExecution tool, in which the code will be automatically
executed, and a corresponding CodeExecutionResult will also be generated.
public record ExecutableCode : IEquatable<ExecutableCode>
- Inheritance
-
ExecutableCode
- Implements
- Inherited Members
Properties
Code
The code to be executed.
[JsonPropertyName("code")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Code { get; set; }
Property Value
Id
Optional. Unique identifier of the ExecutableCode part. The server returns the
CodeExecutionResult with the matching id. This field is not supported in Vertex AI.
[JsonPropertyName("id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Id { get; set; }
Property Value
Language
Programming language of the code.
[JsonPropertyName("language")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Language? Language { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a ExecutableCode object.
public static ExecutableCode? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- ExecutableCode
The deserialized ExecutableCode object, or null if deserialization fails.