Search Results for

    Show / Hide Table of Contents

    Class ChatChoice

    Represents the final aggregated result of a streaming chat completion from an LLM. This is not the raw 'ChatCompletionChoice' from provider APIs, but a unified domain model that accumulates and structures the complete response after streaming is finished. Returned as Generated<ChatChoice> from various chat APIs across different providers.

    Inheritance
    object
    ChatChoice
    Implements
    ITextSource
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    public sealed class ChatChoice : ITextSource

    Properties

    | Edit this page View Source

    Citation

    The final citation or source reference from the LLM. This is a provider-specific feature (Cohere only).

    Declaration
    public string Citation { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    FinishReason

    The reason why the LLM stopped generating (e.g., completed naturally, reached token limit, triggered a tool call).

    Declaration
    public FinishReason? FinishReason { get; set; }
    Property Value
    Type Description
    FinishReason?
    | Edit this page View Source

    Index

    The index of this choice in multi-choice responses (typically 0 for single responses).

    Declaration
    public int Index { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Reasoning

    The final aggregated reasoning or "thinking" content, if the LLM exposed its thought process.

    Declaration
    public string Reasoning { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Refusal

    The final refusal message if the LLM declined to generate content (e.g., due to safety policies).

    Declaration
    public string Refusal { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Role

    The role of the message author (typically Assistant for LLM responses).

    Declaration
    public ChatRole Role { get; set; }
    Property Value
    Type Description
    ChatRole
    | Edit this page View Source

    Signature

    The digital signature or verification information from the LLM response. This is a provider-specific feature (Anthropic Claude only).

    Declaration
    public string Signature { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Text

    The final aggregated conversational text content from the LLM.

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    ToolCalls

    Array of tool/function calls requested by the LLM during the conversation.

    Declaration
    public ToolCall[] ToolCalls { get; set; }
    Property Value
    Type Description
    ToolCall[]

    Methods

    | Edit this page View Source

    GetTextSource()

    Gets the main text content as the text source.

    Declaration
    public string GetTextSource()
    Returns
    Type Description
    string

    Implements

    ITextSource

    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)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation