Class CountTokensConfig
Config for the count_tokens method.
public record CountTokensConfig : IEquatable<CountTokensConfig>
- Inheritance
-
CountTokensConfig
- Implements
- Inherited Members
Properties
GenerationConfig
Configuration that the model uses to generate the response. Not supported by the Gemini Developer API.
[JsonPropertyName("generationConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GenerationConfig? GenerationConfig { get; set; }
Property Value
HttpOptions
Used to override HTTP request options.
[JsonPropertyName("httpOptions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpOptions? HttpOptions { get; set; }
Property Value
SystemInstruction
Instructions for the model to steer it toward better performance.
[JsonPropertyName("systemInstruction")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Content? SystemInstruction { get; set; }
Property Value
Tools
Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model.
[JsonPropertyName("tools")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Tool>? Tools { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a CountTokensConfig object.
public static CountTokensConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- CountTokensConfig
The deserialized CountTokensConfig object, or null if deserialization fails.