Class Message
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
|
Edit this page
View Source
Message(MessageContent)
Declaration
protected Message(MessageContent content = null)
Parameters
Properties
|
Edit this page
View Source
Content
The contents of the user message.
Declaration
public MessageContent Content { get; set; }
Property Value
|
Edit this page
View Source
CreatedAt
Declaration
public UnixTime CreatedAt { get; }
Property Value
|
Edit this page
View Source
DisplayMessage
Declaration
public string DisplayMessage { get; set; }
Property Value
|
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
|
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
|
Edit this page
View Source
ThreadId
The conversation thread that this message belongs to.
Declaration
public string ThreadId { get; set; }
Property Value
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
Returns
|
Edit this page
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
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
|
Edit this page
View Source
implicit operator Message(Prompt)
Declaration
public static implicit operator Message(Prompt prompt)
Parameters
| Type |
Name |
Description |
| Prompt |
prompt |
|
Returns
|
Edit this page
View Source
implicit operator Message(string)
Declaration
public static implicit operator Message(string message)
Parameters
| Type |
Name |
Description |
| string |
message |
|
Returns
Implements
Extension Methods