-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathMessage.cs
More file actions
32 lines (28 loc) · 929 Bytes
/
Message.cs
File metadata and controls
32 lines (28 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using MaIN.Domain.Models;
namespace MaIN.Domain.Entities;
public class Message
{
public const string UnprocessedMessageProperty = "UnprocessedMessage";
public Message()
{
if (Type == MessageType.LocalLLM)
{
Properties.Add(UnprocessedMessageProperty, string.Empty);
}
}
public required string Role { get; set; }
public required string Content { get; set; }
public required MessageType Type { get; set; }
public List<LLMTokenValue> Tokens { get; set; } = [];
public bool Tool { get; init; }
public DateTime Time { get; set; }
public byte[]? Image { get; init; }
public byte[]? Speech { get; set; }
public List<FileInfo>? Files { get; set; }
public Dictionary<string, string> Properties { get; set; } = [];
public Message MarkProcessed()
{
Properties.Remove(UnprocessedMessageProperty);
return this;
}
}