31 lines
798 B
C#
31 lines
798 B
C#
namespace BotSharp.Abstraction.Routing.Models;
|
|
|
|
public class RoutingArgs
|
|
{
|
|
[JsonPropertyName("function")]
|
|
public string Function { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("reason")]
|
|
public string Reason { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("answer")]
|
|
public string Answer { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("agent")]
|
|
public string AgentName { get; set; } = string.Empty;
|
|
|
|
public override string ToString()
|
|
{
|
|
var route = string.IsNullOrEmpty(AgentName) ? "" : $"<Route to {AgentName.ToUpper()} because {Reason}>";
|
|
|
|
if (string.IsNullOrEmpty(Answer))
|
|
{
|
|
return $"[{Function} {route}]";
|
|
}
|
|
else
|
|
{
|
|
return $"[{Function} {route}] => {Answer}";
|
|
}
|
|
}
|
|
}
|