Class ChatMessage
Inheritance
object
ChatMessage
Assembly: .dll
Syntax
public abstract class ChatMessage
Constructors
ChatMessage(ChatContent)
Declaration
protected ChatMessage(ChatContent content = null)
Parameters
Properties
Content
The contents of the user message.
Declaration
public ChatContent Content { get; set; }
Property Value
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
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
Timestamp
Declaration
public UnixTime Timestamp { get; }
Property Value
Type |
Description |
UnixTime |
|
Methods
Create(ChatRole, ChatContent)
Declaration
public static ChatMessage Create(ChatRole role, ChatContent content = null)
Parameters
Returns
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type |
Description |
string |
A string that represents the current object.
|
Overrides
object.ToString()
Operators
implicit operator string(ChatMessage)
Declaration
public static implicit operator string(ChatMessage message)
Parameters
Returns
implicit operator ChatMessage(string)
Declaration
public static implicit operator ChatMessage(string message)
Parameters
Type |
Name |
Description |
string |
message |
|
Returns
Extension Methods