2023-08-28 03:50:10 +00:00
|
|
|
namespace BotSharp.Abstraction.Routing.Models;
|
2023-08-22 04:49:42 +00:00
|
|
|
|
|
|
|
|
public class RoutingArgs
|
|
|
|
|
{
|
2023-09-26 16:18:42 +00:00
|
|
|
[JsonPropertyName("function")]
|
2023-10-13 20:08:59 +00:00
|
|
|
public string Function { get; set; }
|
2023-09-26 16:18:42 +00:00
|
|
|
|
|
|
|
|
[JsonPropertyName("reason")]
|
2023-10-12 21:42:39 +00:00
|
|
|
public string Reason { get; set; } = "the reason why you select this function or agent";
|
2023-09-26 16:18:42 +00:00
|
|
|
|
|
|
|
|
[JsonPropertyName("answer")]
|
2023-10-13 20:08:59 +00:00
|
|
|
public string Answer { get; set; } = "the content of response to user";
|
2023-09-26 16:18:42 +00:00
|
|
|
|
2023-10-12 21:42:39 +00:00
|
|
|
[JsonPropertyName("next_action_agent")]
|
2023-10-13 20:08:59 +00:00
|
|
|
public string AgentName { get; set; } = "agent for next action based on user latest response";
|
2023-10-12 21:42:39 +00:00
|
|
|
|
|
|
|
|
[JsonPropertyName("user_goal_agent")]
|
2023-10-13 20:08:59 +00:00
|
|
|
public string OriginalAgent { get; set; } = "agent who can achieve user original goal";
|
2023-08-22 04:49:42 +00:00
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
2023-09-26 16:18:42 +00:00
|
|
|
var route = string.IsNullOrEmpty(AgentName) ? "" : $"<Route to {AgentName.ToUpper()} because {Reason}>";
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(Answer))
|
|
|
|
|
{
|
|
|
|
|
return $"[{Function} {route}]";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return $"[{Function} {route}] => {Answer}";
|
|
|
|
|
}
|
2023-08-22 04:49:42 +00:00
|
|
|
}
|
|
|
|
|
}
|