Class UserMessage
Inheritance
object
UserMessage
Assembly: .dll
Syntax
public class UserMessage : ChatMessage
Constructors
UserMessage()
Declaration
UserMessage(ChatContent)
Declaration
public UserMessage(ChatContent content)
Parameters
Properties
AttachedFiles
[Local-only. This is not sent to the model.]
A list of files attached to the user message.
This property serves two purposes:
- To temporarily hold files before sending them to the model.
- To locally store files that are part of the user message.
Declaration
public List<IFile> AttachedFiles { get; set; }
Property Value
Type |
Description |
List<IFile> |
|
Moderations
[Local-only. This is not sent to the model.]
A list of safety ratings (moderations) for the user message.
This property serves two purposes:
- To temporarily hold moderation results for local processing (e.g., blocking messages, filtering content, UI display).
- To locally store safety ratings that are part of the user message.
Declaration
public List<SafetyRating> Moderations { 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 override ChatRole Role { get; }
Property Value
Overrides
Methods
AttachFiles(params IFile[])
Adds a file to the user message's attachments.
Declaration
public void AttachFiles(params IFile[] files)
Parameters
Type |
Name |
Description |
IFile[] |
files |
|
AttachFiles(IEnumerable<IFile>)
Adds multiple files to the user message's attachments.
Declaration
public void AttachFiles(IEnumerable<IFile> files)
Parameters
Type |
Name |
Description |
IEnumerable<IFile> |
files |
|
SetMessageText(string)
Declaration
public void SetMessageText(string text)
Parameters
Type |
Name |
Description |
string |
text |
|
Operators
implicit operator string(UserMessage)
Declaration
public static implicit operator string(UserMessage message)
Parameters
Returns
Extension Methods