using BotSharp.Abstraction.Routing.Models;
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; }
public string CurrentAgentId { get; set; }
///
/// Function name if LLM response function call
///
public string? FunctionName { get; set; }
public string? FunctionArgs { get; set; }
///
/// Function execution result, this result will be seen by LLM.
///
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.
///
public object ExecutionData { get; set; }
///
/// Stop conversation completion
///
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}";
}
}
}