Table of Contents

Class ExecutableCode

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the CodeExecutionTool tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated.

public class ExecutableCode
Inheritance
ExecutableCode
Inherited Members
Extension Methods

Constructors

ExecutableCode()

Initializes a new instance of the ExecutableCode class for JSON deserialization.

public ExecutableCode()

ExecutableCode(string, Language)

Initializes a new instance of the ExecutableCode class with the specified code and language.

public ExecutableCode(string code, Language language = Language.LANGUAGE_UNSPECIFIED)

Parameters

code string

The code to be executed.

language Language

The programming language of the code.

Properties

Code

Required. The code to be executed.

[JsonPropertyName("code")]
public string Code { get; set; }

Property Value

string

Id

Identifier that pairs this code with its CodeExecutionResult.

[JsonPropertyName("id")]
public string? Id { get; set; }

Property Value

string

Language

Required. Programming language of the code.

[JsonPropertyName("language")]
public Language Language { get; set; }

Property Value

Language

See Also