BotSharp/src/Infrastructure/BotSharp.Abstraction/Routing/Models/RoutingArgs.cs
Haiping Chen 8003fc39f0 Rollback.
2023-10-11 22:26:27 -05:00

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}";
}
}
}