BotSharp/src/Infrastructure/BotSharp.Abstraction/Routing/Models/RoutingArgs.cs

31 lines
798 B
C#
Raw Normal View History

2023-08-28 03:50:10 +00:00
namespace BotSharp.Abstraction.Routing.Models;
public class RoutingArgs
{
2023-09-26 16:18:42 +00:00
[JsonPropertyName("function")]
public string Function { get; set; } = string.Empty;
[JsonPropertyName("reason")]
public string Reason { get; set; } = string.Empty;
[JsonPropertyName("answer")]
2023-10-12 03:26:27 +00:00
public string Answer { get; set; } = string.Empty;
2023-09-26 16:18:42 +00:00
2023-09-24 21:32:58 +00:00
[JsonPropertyName("agent")]
2023-10-12 03:26:27 +00:00
public string AgentName { get; set; } = string.Empty;
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}";
}
}
}