Class TokensInfo
Tokens info with a list of tokens and the corresponding list of token ids.
public record TokensInfo : IEquatable<TokensInfo>
- Inheritance
-
TokensInfo
- Implements
- Inherited Members
Properties
Role
Optional fields for the role from the corresponding Content.
[JsonPropertyName("role")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Role { get; set; }
Property Value
TokenIds
A list of token ids from the input.
[JsonPropertyName("tokenIds")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonConverter(typeof(StringToNullableLongListConverter))]
public List<long>? TokenIds { get; set; }
Property Value
Tokens
A list of tokens from the input.
[JsonPropertyName("tokens")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<byte[]>? Tokens { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a TokensInfo object.
public static TokensInfo? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- TokensInfo
The deserialized TokensInfo object, or null if deserialization fails.