Table of Contents

Class ThinkingConfig

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

The thinking features configuration.

public record ThinkingConfig : IEquatable<ThinkingConfig>
Inheritance
ThinkingConfig
Implements
Derived
Inherited Members

Properties

IncludeThoughts

Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available.

[JsonPropertyName("includeThoughts")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? IncludeThoughts { get; set; }

Property Value

bool?

ThinkingBudget

Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values and allowed ranges are model dependent.

[JsonPropertyName("thinkingBudget")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? ThinkingBudget { get; set; }

Property Value

int?

ThinkingLevel

Optional. The number of thoughts tokens that the model should generate.

[JsonPropertyName("thinkingLevel")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ThinkingLevel? ThinkingLevel { get; set; }

Property Value

ThinkingLevel?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ThinkingConfig object.

public static ThinkingConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ThinkingConfig

The deserialized ThinkingConfig object, or null if deserialization fails.