[update] Non empty code style constraint (default value constraint), change CreateTime to CreatedTime.
This commit is contained in:
parent
513007b7ce
commit
ccd7c23da9
|
|
@ -3,11 +3,11 @@ namespace BotSharp.Abstraction.Loggers.Models;
|
|||
public class AgentQueueChangedLogModel
|
||||
{
|
||||
[JsonPropertyName("conversation_id")]
|
||||
public string ConversationId { get; set; }
|
||||
public string ConversationId { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("log")]
|
||||
public string Log { get; set; }
|
||||
public string Log { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("created_at")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
public DateTime CreatedTime { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ namespace BotSharp.Abstraction.Loggers.Models;
|
|||
public class ContentLogOutputModel
|
||||
{
|
||||
[JsonPropertyName("conversation_id")]
|
||||
public string ConversationId { get; set; }
|
||||
public string ConversationId { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("message_id")]
|
||||
public string MessageId { get; set; }
|
||||
public string MessageId { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
|
@ -15,14 +15,14 @@ public class ContentLogOutputModel
|
|||
public string? AgentId { get; set; }
|
||||
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
public string Role { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("source")]
|
||||
public string Source { get; set; }
|
||||
public string Source { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("content")]
|
||||
public string Content { get; set; }
|
||||
public string Content { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("created_at")]
|
||||
public DateTime CreateTime { get; set; } = DateTime.UtcNow;
|
||||
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,18 +2,15 @@ namespace BotSharp.Abstraction.Loggers.Models;
|
|||
|
||||
public class ConversationStateLogModel
|
||||
{
|
||||
[JsonPropertyName("conversation_id")]
|
||||
public string ConversationId { get; set; }
|
||||
[JsonPropertyName("conversation_id")] public string ConversationId { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("agent_id")]
|
||||
public string AgentId { get; set; }
|
||||
[JsonPropertyName("agent_id")] public string AgentId { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("message_id")]
|
||||
public string MessageId { get; set; }
|
||||
[JsonPropertyName("message_id")] public string MessageId { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("states")]
|
||||
public Dictionary<string, string> States { get; set; }
|
||||
public Dictionary<string, string> States { get; set; } = [];
|
||||
|
||||
[JsonPropertyName("created_at")]
|
||||
public DateTime CreateTime { get; set; } = DateTime.UtcNow;
|
||||
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -759,7 +759,7 @@ public partial class FileRepository
|
|||
var log = JsonSerializer.Deserialize<ContentLogOutputModel>(text);
|
||||
if (log == null) continue;
|
||||
|
||||
if (log.CreateTime >= refTime)
|
||||
if (log.CreatedTime >= refTime)
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
|
|
@ -774,7 +774,7 @@ public partial class FileRepository
|
|||
var log = JsonSerializer.Deserialize<ConversationStateLogModel>(text);
|
||||
if (log == null) continue;
|
||||
|
||||
if (log.CreateTime >= refTime)
|
||||
if (log.CreatedTime >= refTime)
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace BotSharp.Core.Repository
|
|||
|
||||
logs.Add(log);
|
||||
}
|
||||
return logs.OrderBy(x => x.CreateTime).ToList();
|
||||
return logs.OrderBy(x => x.CreatedTime).ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ namespace BotSharp.Core.Repository
|
|||
|
||||
logs.Add(log);
|
||||
}
|
||||
return logs.OrderBy(x => x.CreateTime).ToList();
|
||||
return logs.OrderBy(x => x.CreatedTime).ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ public class StreamingLogHook : ConversationHookBase, IContentGeneratingHook, IR
|
|||
Role = input.Message.Role,
|
||||
Content = input.Log,
|
||||
Source = input.Source,
|
||||
CreateTime = DateTime.UtcNow
|
||||
CreatedTime = DateTime.UtcNow
|
||||
};
|
||||
|
||||
var json = JsonSerializer.Serialize(output, _options.JsonSerializerOptions);
|
||||
|
|
@ -488,7 +488,7 @@ public class StreamingLogHook : ConversationHookBase, IContentGeneratingHook, IR
|
|||
AgentId = agentId,
|
||||
MessageId = message.MessageId,
|
||||
States = states,
|
||||
CreateTime = DateTime.UtcNow
|
||||
CreatedTime = DateTime.UtcNow
|
||||
};
|
||||
|
||||
var convSettings = _services.GetRequiredService<ConversationSetting>();
|
||||
|
|
@ -527,7 +527,7 @@ public class StreamingLogHook : ConversationHookBase, IContentGeneratingHook, IR
|
|||
{
|
||||
ConversationId = conversationId,
|
||||
Log = log,
|
||||
CreateTime = DateTime.UtcNow
|
||||
CreatedTime = DateTime.UtcNow
|
||||
};
|
||||
|
||||
return JsonSerializer.Serialize(model, _options.JsonSerializerOptions);
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public partial class MongoRepository
|
|||
Role = log.Role,
|
||||
Source = log.Source,
|
||||
Content = log.Content,
|
||||
CreatedTime = log.CreateTime
|
||||
CreatedTime = log.CreatedTime
|
||||
};
|
||||
|
||||
_dc.ContentLogs.InsertOne(logDoc);
|
||||
|
|
@ -94,9 +94,9 @@ public partial class MongoRepository
|
|||
Role = x.Role,
|
||||
Source = x.Source,
|
||||
Content = x.Content,
|
||||
CreateTime = x.CreatedTime
|
||||
CreatedTime = x.CreatedTime
|
||||
})
|
||||
.OrderBy(x => x.CreateTime)
|
||||
.OrderBy(x => x.CreatedTime)
|
||||
.ToList();
|
||||
return logs;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ public partial class MongoRepository
|
|||
AgentId= log.AgentId,
|
||||
MessageId = log.MessageId,
|
||||
States = log.States,
|
||||
CreatedTime = log.CreateTime
|
||||
CreatedTime = log.CreatedTime
|
||||
};
|
||||
|
||||
_dc.StateLogs.InsertOne(logDoc);
|
||||
|
|
@ -133,9 +133,9 @@ public partial class MongoRepository
|
|||
AgentId = x.AgentId,
|
||||
MessageId = x.MessageId,
|
||||
States = x.States,
|
||||
CreateTime = x.CreatedTime
|
||||
CreatedTime = x.CreatedTime
|
||||
})
|
||||
.OrderBy(x => x.CreateTime)
|
||||
.OrderBy(x => x.CreatedTime)
|
||||
.ToList();
|
||||
return logs;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue