AI DevKit
Search Results for

    Show / Hide Table of Contents

    Class ThreadMessage

    Represents a message within a thread.

    Inheritance
    object
    ChatMessage
    ThreadMessage
    Inherited Members
    ChatMessage.Content
    ChatMessage.Name
    ChatMessage.Timestamp
    ChatMessage.Create(ChatRole, ChatContent)
    ChatMessage.ToString()
    Namespace: Glitch9.AIDevKit.OpenAI
    Assembly: .dll
    Syntax
    [Serializable]
    public class ThreadMessage : ChatMessage

    Constructors

    ThreadMessage()

    Declaration
    public ThreadMessage()

    ThreadMessage(ChatRole, string)

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

    Properties

    AssistantId

    If applicable, the Assistant that authored this message.

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

    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[]

    Id

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

    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 Dictionary<string, string> Metadata { get; set; }
    Property Value
    Type Description
    Dictionary<string, string>

    Object

    The OpenAI object type

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

    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
    ChatMessage.Role

    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

    ThreadId

    The Thread that this message belongs to.

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

    ToolCallId

    [Required] Tool call that this message is responding to.

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

    Tools

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

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

    Extension Methods

    ConverterExtensions.ToAnthropicMessage(ChatMessage)
    ChatMessageExtensions.IsNullOrEmpty(ChatMessage)
    ThreadMessageExtensions.ToThreadMessageRequest(ChatMessage)
    ThreadMessageExtensions.ToChatMessage(ThreadMessage)
    In this article
    Back to top Generated by DocFX