Table of Contents

Class ChatMessage

Namespace
Glitch9.AIDevKit
public abstract class ChatMessage
Inheritance
object
ChatMessage
Derived
Extension Methods

Constructors

ChatMessage(ChatContent)

protected ChatMessage(ChatContent content = null)

Parameters

content ChatContent

Properties

Content

The contents of the user message.

public ChatContent Content { get; set; }

Property Value

ChatContent

Name

Optional. An optional name for the participant. Provides the model information to differentiate between participants of the same role.

public string Name { get; set; }

Property Value

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.

public abstract ChatRole Role { get; }

Property Value

ChatRole

Timestamp

public UnixTime Timestamp { get; }

Property Value

UnixTime

Methods

Create(ChatRole, ChatContent)

public static ChatMessage Create(ChatRole role, ChatContent content = null)

Parameters

role ChatRole
content ChatContent

Returns

ChatMessage

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

implicit operator string(ChatMessage)

public static implicit operator string(ChatMessage message)

Parameters

message ChatMessage

Returns

string

implicit operator ChatMessage(string)

public static implicit operator ChatMessage(string message)

Parameters

message string

Returns

ChatMessage