Search Results for

    Show / Hide Table of Contents

    Class ChatCompletion

    Response from a LLM (Large Language Model) for a chat completion request.

    This class contains a list of ChatCompletionChoice objects, each representing a message generated by the model in response to a chat prompt.
    Message can be accessed through the ChatCompletionChoice (e.g., Choices[0].Message).
    If 'n' used in the request is greater than 1, this can contain multiple choices. Otherwise, it will always contain a single choice.

    If this is a streamed response, the ChatCompletionChoice objects will contain MessageDelta instead of Message.

    Inheritance
    object
    OpenAIObject
    ChatCompletionBase<ChatCompletionChoice>
    ChatCompletion
    XAIChatCompletion
    Inherited Members
    ChatCompletionBase<ChatCompletionChoice>.CreatedAt
    ChatCompletionBase<ChatCompletionChoice>.Metadata
    ChatCompletionBase<ChatCompletionChoice>.Model
    ChatCompletionBase<ChatCompletionChoice>.Usage
    ChatCompletionBase<ChatCompletionChoice>.Choices
    ChatCompletionBase<ChatCompletionChoice>.SystemFingerprint
    OpenAIObject.Id
    OpenAIObject.Object
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Glitch9.AIDevKit.OpenAI
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    public class ChatCompletion : ChatCompletionBase<ChatCompletionChoice>

    Methods

    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Operators

    | Edit this page View Source

    implicit operator MessageContent(ChatCompletion)

    Declaration
    public static implicit operator MessageContent(ChatCompletion chat)
    Parameters
    Type Name Description
    ChatCompletion chat
    Returns
    Type Description
    MessageContent
    | Edit this page View Source

    implicit operator string(ChatCompletion)

    Declaration
    public static implicit operator string(ChatCompletion chat)
    Parameters
    Type Name Description
    ChatCompletion chat
    Returns
    Type Description
    string

    Extension Methods

    ChatCompletionExtensions.FirstContent(ChatCompletion)
    ResponseMapper.ToResponse(ChatCompletion)
    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