refactor: 移除代码补全兼容逻辑并优化 DTO 可空类型处理

This commit is contained in:
ccnetcore
2025-08-16 19:20:58 +08:00
parent e60d8eceb7
commit 4e42e2202e
5 changed files with 10 additions and 68 deletions

View File

@@ -51,16 +51,17 @@ public class ThorChatMessage
/// <summary>
/// 发出的消息内容计算用于json序列号和反序列化Content 和 Contents 不能同时赋值,只能二选一
/// 如果是工具调用,还真可能为空
/// </summary>
[JsonPropertyName("content")]
public object ContentCalculated
public object? ContentCalculated
{
get
{
if (Content is not null && Contents is not null)
{
throw new ValidationException("Messages 中 Content 和 Contents 字段不能同时有值");
}
// if (Content is not null && Contents is not null)
// {
// throw new ValidationException("Messages 中 Content 和 Contents 字段不能同时有值");
// }
if (Content is not null)
{