添加项目文件。

This commit is contained in:
yangwx
2025-03-12 20:02:52 +08:00
parent 4d34907fa7
commit 3ccd6d9a39
32 changed files with 1833 additions and 0 deletions

30
Models/ChatMessage.cs Normal file
View File

@@ -0,0 +1,30 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace YwxApp.AiChat.Models
{
public class ChatMessage : INotifyPropertyChanged
{
public enum MessageRole { User, Assistant }
private MessageRole _role;
public MessageRole Role
{
get => _role;
set { _role = value; OnPropertyChanged(); }
}
private string _content;
public string Content
{
get => _content;
set { _content = value; OnPropertyChanged(); }
}
public event PropertyChangedEventHandler? PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string? name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
}