61 lines
1.8 KiB
C#
61 lines
1.8 KiB
C#
namespace BotSharp.Abstraction.Routing.Models;
|
|
|
|
public class RoutingArgs
|
|
{
|
|
[JsonPropertyName("function")]
|
|
public string Function { get; set; }
|
|
|
|
/// <summary>
|
|
/// The reason why you select this function or agent
|
|
/// </summary>
|
|
[JsonPropertyName("next_action_reason")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public string? NextActionReason { get; set; }
|
|
|
|
[JsonPropertyName("reason")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public string? Reason { get; set; }
|
|
|
|
[JsonPropertyName("conversation_end")]
|
|
public bool ConversationEnd { get; set; }
|
|
|
|
/// <summary>
|
|
/// The content of replying to user
|
|
/// </summary>
|
|
[JsonPropertyName("response")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public string Response { get; set; }
|
|
|
|
/// <summary>
|
|
/// Agent for next action based on user latest response
|
|
/// </summary>
|
|
[JsonPropertyName("next_action_agent")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public string AgentName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Agent who can achieve user original goal
|
|
/// </summary>
|
|
[JsonPropertyName("user_goal_agent")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public string OriginalAgent { get; set; }
|
|
|
|
[JsonPropertyName("user_goal_description")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public string UserGoal { get; set; }
|
|
|
|
public override string ToString()
|
|
{
|
|
var route = string.IsNullOrEmpty(AgentName) ? "" : $"<Route to {AgentName.ToUpper()} because {NextActionReason}>";
|
|
|
|
if (string.IsNullOrEmpty(Response))
|
|
{
|
|
return $"[{Function} {route}]";
|
|
}
|
|
else
|
|
{
|
|
return $"[{Function} {route}] => {Response}";
|
|
}
|
|
}
|
|
}
|