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.
Implements
Inherited Members
Namespace: Glitch9.AIDevKit
Assembly: Glitch9.AIDevKit.dll
Syntax
public sealed class ChatChoice : ITextSource
Properties
| Edit this page View SourceCitation
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 |
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? |
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 |
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 |
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 |
Role
The role of the message author (typically Assistant for LLM responses).
Declaration
public ChatRole Role { get; set; }
Property Value
| Type | Description |
|---|---|
| ChatRole |
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 |
Text
The final aggregated conversational text content from the LLM.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
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 SourceGetTextSource()
Gets the main text content as the text source.
Declaration
public string GetTextSource()
Returns
| Type | Description |
|---|---|
| string |