Search Results for

    Show / Hide Table of Contents

    Class Message

    Inheritance
    object
    ConversationItem
    Message
    ThreadMessage
    ResponseMessage
    SystemMessage
    ToolMessage
    UserMessage
    Implements
    IPrompt
    IValidatable
    IHasId<string>
    Inherited Members
    ConversationItem.Id
    ConversationItem.Type
    ConversationItem.Status
    ConversationItem.GetPromptText()
    ConversationItem.IsValid()
    ConversationItem.Validate()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    [JsonConverter(typeof(MessageConverter))]
    public abstract class Message : ConversationItem, IPrompt, IValidatable, IHasId<string>

    Constructors

    | Edit this page View Source

    Message()

    Declaration
    protected Message()
    | Edit this page View Source

    Message(MessageContent)

    Declaration
    protected Message(MessageContent content = null)
    Parameters
    Type Name Description
    MessageContent content

    Properties

    | Edit this page View Source

    Content

    The contents of the user message.

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

    CreatedAt

    Declaration
    public UnixTime CreatedAt { get; }
    Property Value
    Type Description
    UnixTime
    | Edit this page View Source

    DisplayMessage

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

    Name

    Optional. An optional name for the participant. Provides the model information to differentiate between participants of the same role.

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

    Role

    The role of the messages author.

    Role is abstract and overridden in derived classes to enforce consistency.
    This avoids relying on constructor or deserialization logic to set the role.
    JSON.NET does not call parameterized constructors or set get-only properties during deserialization.

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

    ThreadId

    The conversation thread that this message belongs to.

    Declaration
    public string ThreadId { get; set; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    Create(ChatRole, MessageContent, ToolCall[], UnixTime?, string)

    Declaration
    public static Message Create(ChatRole role, MessageContent content = null, ToolCall[] toolCalls = null, UnixTime? createdAt = null, string threadId = null)
    Parameters
    Type Name Description
    ChatRole role
    MessageContent content
    ToolCall[] toolCalls
    UnixTime? createdAt
    string threadId
    Returns
    Type Description
    Message
    | 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 string(Message)

    Declaration
    public static implicit operator string(Message message)
    Parameters
    Type Name Description
    Message message
    Returns
    Type Description
    string
    | Edit this page View Source

    implicit operator Message(Prompt)

    Declaration
    public static implicit operator Message(Prompt prompt)
    Parameters
    Type Name Description
    Prompt prompt
    Returns
    Type Description
    Message
    | Edit this page View Source

    implicit operator Message(string)

    Declaration
    public static implicit operator Message(string message)
    Parameters
    Type Name Description
    string message
    Returns
    Type Description
    Message

    Implements

    IPrompt
    IValidatable
    IHasId<TId>

    Extension Methods

    UnifiedApiCallerExtensions.GENResponse(ConversationItem)
    CollectionExtensions.Add(Message, Object)
    CollectionExtensions.AddAttachment(Message, IFile)
    CollectionExtensions.AddAttachments(Message, IEnumerable<IFile>)
    CollectionExtensions.AddRange(Message, IEnumerable<Object>)
    ThreadMessageExtensions.ToThreadMessageRequest(Message)
    UnifiedApiCallerExtensions.CountTokens(Message)
    UnifiedApiCallerExtensions.GENCompletion(Message)
    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.GetIdOrNull(IHasId<string>)
    CoreLibTypeExtensions.IsNullOrEmptyId(IHasId<string>)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation