namespace BotSharp.Abstraction.Conversations.Models; public class RoleDialogModel { /// /// user, system, assistant, function /// public string Role { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public string Content { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string CurrentAgentId { get; set; } /// /// Function name if LLM response function call /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? FunctionName { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? FunctionArgs { get; set; } /// /// Function execution result, this result will be seen by LLM. /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? ExecutionResult { get; set; } /// /// Function execution structured data, this data won't pass to LLM. /// It's ideal to render in rich content in UI. /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public object ExecutionData { get; set; } /// /// Stop conversation completion /// [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public bool StopCompletion { get; set; } public RoleDialogModel(string role, string text) { Role = role; Content = text; } public override string ToString() { if (Role == AgentRole.Function) { return $"{Role}: {FunctionName} => {ExecutionResult}"; } else { return $"{Role}: {Content}"; } } }