You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/AI/Service/MessageNotifier.cs

27 lines
792 B
C#

1 month ago
using AI.Interface;
namespace AI.Service
{
/// <summary>
/// 消息通知器,用于在 Filter 和 ViewModel 之间传递工具调用通知
/// </summary>
public class MessageNotifier : IMessageNotifier
{
/// <summary>
/// 当工具调用发生时触发此事件
/// </summary>
public event EventHandler<string>? ToolCallReceived;
/// <summary>
/// 通知添加一条工具调用消息到 UI仅显示不进入 AI 上下文)
/// </summary>
/// <param name="message">消息内容</param>
public void NotifyToolCall(string message)
{
// 触发事件,让订阅者(如 MainWindowViewModel处理
ToolCallReceived?.Invoke(this, message);
}
}
}