Search Results for

    Show / Hide Table of Contents

    Class ThreadMessage

    Represents a message within a thread.

    Inheritance
    object
    ConversationItem
    Message
    ThreadMessage
    Implements
    IPrompt
    IValidatable
    IHasId<string>
    IResult
    IResponseMessageProvider
    Inherited Members
    Message.Content
    Message.ThreadId
    Message.Name
    Message.CreatedAt
    Message.DisplayMessage
    Message.Create(ChatRole, MessageContent, ToolCall[], UnixTime?, string)
    Message.ToString()
    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.OpenAI
    Assembly: Glitch9.AIDevKit.Provider.OpenAI.dll
    Syntax
    [Serializable]
    [JsonConverter(typeof(ThreadMessageConverter))]
    public class ThreadMessage : Message, IPrompt, IValidatable, IHasId<string>, IResult, IResponseMessageProvider

    Constructors

    | Edit this page View Source

    ThreadMessage()

    Declaration
    public ThreadMessage()
    | Edit this page View Source

    ThreadMessage(ChatRole, string)

    Declaration
    public ThreadMessage(ChatRole role, string content = null)
    Parameters
    Type Name Description
    ChatRole role
    string content

    Properties

    | Edit this page View Source

    AssistantId

    If applicable, the Assistant that authored this message.

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

    Attachments

    A list of files attached to the message, and the tools they were added to.

    Declaration
    public Attachment[] Attachments { get; set; }
    Property Value
    Type Description
    Attachment[]
    | Edit this page View Source

    Metadata

    Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

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

    Object

    The OpenAI object type

    Declaration
    public string Object { 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 override ChatRole Role { get; }
    Property Value
    Type Description
    ChatRole
    Overrides
    Message.Role
    | Edit this page View Source

    RunId

    The Run associated with the creation of this message. Value is null when messages are created manually using the create message or create thread endpoints.

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

    ToolCallId

    Required. Tool call that this message is responding to.

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

    Tools

    A list of tool calls (functions) the model wants to use.

    Declaration
    public ToolCall[] Tools { get; set; }
    Property Value
    Type Description
    ToolCall[]
    | Edit this page View Source

    Usage

    Usage metadata for the message.

    Declaration
    public Usage Usage { get; set; }
    Property Value
    Type Description
    Usage

    Methods

    | Edit this page View Source

    CreateRequest(string)

    Declaration
    public static ThreadMessageRequest CreateRequest(string textPrompt)
    Parameters
    Type Name Description
    string textPrompt
    Returns
    Type Description
    ThreadMessageRequest
    | Edit this page View Source

    CreateRequest(string, params File<Texture2D>[])

    Declaration
    public static ThreadMessageRequest CreateRequest(string textPrompt, params File<Texture2D>[] imageFiles)
    Parameters
    Type Name Description
    string textPrompt
    File<Texture2D>[] imageFiles
    Returns
    Type Description
    ThreadMessageRequest
    | Edit this page View Source

    CreateRequest(string, params string[])

    Declaration
    public static ThreadMessageRequest CreateRequest(string textPrompt, params string[] imageUrls)
    Parameters
    Type Name Description
    string textPrompt
    string[] imageUrls
    Returns
    Type Description
    ThreadMessageRequest
    | Edit this page View Source

    GetResponseMessage()

    Declaration
    public ResponseMessage GetResponseMessage()
    Returns
    Type Description
    ResponseMessage
    | Edit this page View Source

    SetRole(ChatRole)

    Declaration
    public void SetRole(ChatRole role)
    Parameters
    Type Name Description
    ChatRole role

    Implements

    IPrompt
    IValidatable
    IHasId<TId>
    IResult
    IResponseMessageProvider

    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)
    ThreadMessageExtensions.ToGenerated(ThreadMessage)
    ThreadMessageExtensions.ToMessage(ThreadMessage)
    ThreadMessageExtensions.ToResponse(ThreadMessage, ResponseStatus)
    ThreadMessageExtensions.ToResponseMessage(ThreadMessage)
    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