Repository navigation
Expand file tree
/
Copy pathChatMessageModel.cs
More file actions
72 lines (61 loc) · 1.76 KB
/
Copy pathChatMessageModel.cs
File metadata and controls
72 lines (61 loc) · 1.76 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace CodingSahayi;
public abstract class MessageModelBase : INotifyPropertyChanged
{
private string _role = string.Empty;
public string Role
{
get => _role;
set => SetProperty(ref _role, value);
}
public HorizontalAlignment Alignment { get; set; }
public SolidColorBrush BackgroundBrush { get; set; } = null!;
public event PropertyChangedEventHandler? PropertyChanged;
protected bool SetProperty<T>(ref T storage, T value, [CallerMemberName] string propertyName = null!)
{
if (Equals(storage, value)) return false;
storage = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
return true;
}
}
public class TextMessageModel : MessageModelBase
{
private string _content = string.Empty;
public string Content
{
get => _content;
set => SetProperty(ref _content, value);
}
}
public class ToolMessageModel : MessageModelBase
{
public string ToolCallId { get; set; } = string.Empty;
private string _toolName = string.Empty;
public string ToolName
{
get => _toolName;
set => SetProperty(ref _toolName, value);
}
private string _arguments = string.Empty;
public string Arguments
{
get => _arguments;
set => SetProperty(ref _arguments, value);
}
private string _output = string.Empty;
public string Output
{
get => _output;
set => SetProperty(ref _output, value);
}
private string _status = "Running";
public string Status
{
get => _status;
set => SetProperty(ref _status, value);
}
}