Search Results for

    Show / Hide Table of Contents

    Class TokenCount

    Used to set 'max_tokens', 'max_completions_tokens', 'max_output_tokens', etc. Must be greater than or equal to 1024. Set it null to disable the limit.

    Inheritance
    object
    SerializableNullable<int>
    NullableRangedInt<TokenCount>
    TokenCount
    Implements
    INullable
    IEquatable<TokenCount>
    IComparable<TokenCount>
    Inherited Members
    NullableRangedInt<TokenCount>.CompareTo(TokenCount)
    NullableRangedInt<TokenCount>.Equals(TokenCount)
    NullableRangedInt<TokenCount>.Equals(object)
    NullableRangedInt<TokenCount>.GetHashCode()
    SerializableNullable<int>.hasValue
    SerializableNullable<int>.value
    SerializableNullable<int>.HasValue
    SerializableNullable<int>.Value
    SerializableNullable<int>.Clear()
    SerializableNullable<int>.ToString()
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    [Serializable]
    [JsonConverter(typeof(NullableRangedIntConverter<TokenCount>))]
    public class TokenCount : NullableRangedInt<TokenCount>, INullable, IEquatable<TokenCount>, IComparable<TokenCount>

    Constructors

    | Edit this page View Source

    TokenCount()

    Declaration
    public TokenCount()
    | Edit this page View Source

    TokenCount(TokenCountPreset)

    Declaration
    public TokenCount(TokenCountPreset preset)
    Parameters
    Type Name Description
    TokenCountPreset preset
    | Edit this page View Source

    TokenCount(int)

    Declaration
    public TokenCount(int value)
    Parameters
    Type Name Description
    int value

    Fields

    | Edit this page View Source

    Long

    Declaration
    public const int Long = 4096
    Field Value
    Type Description
    int
    | Edit this page View Source

    Medium

    Declaration
    public const int Medium = 2048
    Field Value
    Type Description
    int
    | Edit this page View Source

    Short

    Declaration
    public const int Short = 1024
    Field Value
    Type Description
    int
    | Edit this page View Source

    VeryLong

    Declaration
    public const int VeryLong = 8192
    Field Value
    Type Description
    int

    Properties

    | Edit this page View Source

    Default

    Declaration
    public override int Default { get; }
    Property Value
    Type Description
    int
    Overrides
    NullableRangedInt<TokenCount>.Default
    | Edit this page View Source

    Max

    Declaration
    public override int Max { get; }
    Property Value
    Type Description
    int
    Overrides
    NullableRangedInt<TokenCount>.Max
    | Edit this page View Source

    Min

    Declaration
    public override int Min { get; }
    Property Value
    Type Description
    int
    Overrides
    NullableRangedInt<TokenCount>.Min

    Methods

    | Edit this page View Source

    CheckIfDefaultPreset(int)

    Declaration
    public static bool CheckIfDefaultPreset(int value)
    Parameters
    Type Name Description
    int value
    Returns
    Type Description
    bool

    Operators

    | Edit this page View Source

    implicit operator int?(TokenCount)

    Declaration
    public static implicit operator int?(TokenCount p)
    Parameters
    Type Name Description
    TokenCount p
    Returns
    Type Description
    int?
    | Edit this page View Source

    implicit operator TokenCount(TokenCountPreset)

    Declaration
    public static implicit operator TokenCount(TokenCountPreset preset)
    Parameters
    Type Name Description
    TokenCountPreset preset
    Returns
    Type Description
    TokenCount
    | Edit this page View Source

    implicit operator TokenCount(int)

    Declaration
    public static implicit operator TokenCount(int v)
    Parameters
    Type Name Description
    int v
    Returns
    Type Description
    TokenCount

    Implements

    INullable
    IEquatable<T>
    IComparable<T>

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    CoreLibTypeExtensions.HasValue(INullable)
    SerializableNullableExtensions.GetValueOrDefault<T>(SerializableNullable<T>, T)
    SerializableNullableExtensions.GetValueOrNull<T>(SerializableNullable<T>)
    SerializableNullableExtensions.HasValue<T>(SerializableNullable<T>)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation