Class CountTokensResponse
Response for counting tokens.
public record CountTokensResponse : IEquatable<CountTokensResponse>
- Inheritance
-
CountTokensResponse
- Implements
- Inherited Members
Properties
CachedContentTokenCount
Number of tokens in the cached part of the prompt (the cached content).
[JsonPropertyName("cachedContentTokenCount")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? CachedContentTokenCount { get; set; }
Property Value
- int?
SdkHttpResponse
Used to retain the full HTTP response.
[JsonPropertyName("sdkHttpResponse")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpResponse? SdkHttpResponse { get; set; }
Property Value
TotalTokens
Total number of tokens.
[JsonPropertyName("totalTokens")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? TotalTokens { get; set; }
Property Value
- int?
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a CountTokensResponse object.
public static CountTokensResponse? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- CountTokensResponse
The deserialized CountTokensResponse object, or null if deserialization fails.