Class ThreadMessage
Represents a message within a thread.
Inheritance
ThreadMessage
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
|
Edit this page
View Source
ThreadMessage(ChatRole, string)
Declaration
public ThreadMessage(ChatRole role, string content = null)
Parameters
Properties
|
Edit this page
View Source
AssistantId
If applicable, the Assistant that authored this message.
Declaration
public string AssistantId { get; set; }
Property Value
|
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
|
Edit this page
View Source
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
|
Edit this page
View Source
Object
Declaration
public string Object { get; set; }
Property Value
|
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
Overrides
|
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
|
Edit this page
View Source
Required. Tool call that this message is responding to.
Declaration
public string ToolCallId { get; set; }
Property Value
|
Edit this page
View Source
A list of tool calls (functions) the model wants to use.
Declaration
public ToolCall[] Tools { get; set; }
Property Value
|
Edit this page
View Source
Usage
Usage metadata for the message.
Declaration
public Usage Usage { get; set; }
Property Value
Methods
|
Edit this page
View Source
CreateRequest(string)
Declaration
public static ThreadMessageRequest CreateRequest(string textPrompt)
Parameters
| Type |
Name |
Description |
| string |
textPrompt |
|
Returns
|
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
|
Edit this page
View Source
CreateRequest(string, params string[])
Declaration
public static ThreadMessageRequest CreateRequest(string textPrompt, params string[] imageUrls)
Parameters
Returns
|
Edit this page
View Source
GetResponseMessage()
Declaration
public ResponseMessage GetResponseMessage()
Returns
|
Edit this page
View Source
SetRole(ChatRole)
Declaration
public void SetRole(ChatRole role)
Parameters
Implements
Extension Methods