namespace Service.AgentFramework; /// /// Agent 执行结果的标准化输出模型 /// /// 数据类型 public record AgentResult { /// /// Agent 执行的主要数据结果 /// public T Data { get; init; } = default!; /// /// 多轮提炼后的总结信息(3-5 句,包含关键指标) /// public string Summary { get; init; } = string.Empty; /// /// Agent 执行的步骤链(用于可视化和调试) /// public List Steps { get; init; } = new(); /// /// 元数据(统计信息、性能指标等) /// public Dictionary Metadata { get; init; } = new(); /// /// 执行是否成功 /// public bool Success { get; init; } = true; /// /// 错误信息(如果有的话) /// public string? Error { get; init; } } /// /// Agent 执行步骤 /// public record ExecutionStep { /// /// 步骤名称 /// public string Name { get; init; } = string.Empty; /// /// 步骤描述 /// public string Description { get; init; } = string.Empty; /// /// 步骤状态:Pending, Running, Completed, Failed /// public string Status { get; init; } = "Pending"; /// /// 执行耗时(毫秒) /// public long DurationMs { get; init; } /// /// 步骤输出数据(可选) /// public object? Output { get; init; } /// /// 错误信息(如果步骤失败) /// public string? Error { get; init; } } /// /// 分类结果模型 /// public record ClassificationResult { /// /// 原始摘要 /// public string Reason { get; init; } = string.Empty; /// /// 分类名称 /// public string Classify { get; init; } = string.Empty; /// /// 交易类型 /// public TransactionType Type { get; init; } /// /// AI 置信度评分 (0-1) /// public double Confidence { get; init; } /// /// 影响的交易记录 ID /// public List TransactionIds { get; init; } = new(); /// /// 参考的相似记录 /// public List References { get; init; } = new(); } /// /// 账单解析结果模型 /// public record TransactionParseResult { /// /// 金额 /// public decimal Amount { get; init; } /// /// 摘要 /// public string Reason { get; init; } = string.Empty; /// /// 日期 /// public DateTime Date { get; init; } /// /// 交易类型 /// public TransactionType Type { get; init; } /// /// 分类 /// public string? Classify { get; init; } }