2023-06-27 18:31:13 +00:00
|
|
|
namespace BotSharp.Abstraction.Conversations.Models;
|
|
|
|
|
|
|
|
|
|
public class RoleDialogModel
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2023-07-27 15:07:39 +00:00
|
|
|
/// user, system, assistant, function
|
2023-06-27 18:31:13 +00:00
|
|
|
/// </summary>
|
|
|
|
|
public string Role { get; set; }
|
2023-08-07 20:17:54 +00:00
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
2023-07-21 20:15:09 +00:00
|
|
|
public string Content { get; set; }
|
2023-06-27 18:31:13 +00:00
|
|
|
|
2023-07-27 15:07:39 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Function name if LLM response function call
|
|
|
|
|
/// </summary>
|
2023-07-28 04:27:12 +00:00
|
|
|
public string? FunctionName { get; set; }
|
2023-07-27 21:56:57 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Function execution result
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string? ExecutionResult { get; set; }
|
2023-07-27 15:07:39 +00:00
|
|
|
|
2023-08-14 17:00:01 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// When function callback has been executed, system will pass result to LLM again,
|
|
|
|
|
/// Set this property to True to stop calling LLM.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool StopSubsequentInteraction { get;set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Channel name
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Channel { get; set; }
|
|
|
|
|
|
2023-07-21 01:55:40 +00:00
|
|
|
public RoleDialogModel(string role, string text)
|
|
|
|
|
{
|
|
|
|
|
Role = role;
|
2023-07-21 20:15:09 +00:00
|
|
|
Content = text;
|
2023-07-21 01:55:40 +00:00
|
|
|
}
|
|
|
|
|
|
2023-06-27 18:31:13 +00:00
|
|
|
public override string ToString()
|
|
|
|
|
{
|
2023-07-21 20:15:09 +00:00
|
|
|
return $"{Role}: {Content}";
|
2023-06-27 18:31:13 +00:00
|
|
|
}
|
|
|
|
|
}
|