2023-09-03 04:11:53 +00:00
|
|
|
namespace BotSharp.Abstraction.Routing;
|
|
|
|
|
|
|
|
|
|
public interface IRoutingService
|
|
|
|
|
{
|
2023-10-30 16:48:18 +00:00
|
|
|
Agent Router { get; }
|
2024-02-28 20:40:59 +00:00
|
|
|
IRoutingContext Context { get; }
|
2024-01-26 04:32:48 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get routable agents
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="profiles">router's profile</param>
|
|
|
|
|
/// <returns></returns>
|
2024-01-24 23:02:59 +00:00
|
|
|
RoutableAgent[] GetRoutableAgents(List<string> profiles);
|
2024-01-26 04:32:48 +00:00
|
|
|
|
2024-01-26 22:23:10 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Get rules by agent name
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">agent name</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
RoutingRule[] GetRulesByAgentName(string name);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get rules by agent id
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">agent id </param>
|
|
|
|
|
/// <returns></returns>
|
2023-11-01 01:48:12 +00:00
|
|
|
RoutingRule[] GetRulesByAgentId(string id);
|
2024-01-26 22:23:10 +00:00
|
|
|
|
2024-01-27 01:14:14 +00:00
|
|
|
List<RoutingHandlerDef> GetHandlers(Agent router);
|
2024-10-29 19:59:46 +00:00
|
|
|
|
|
|
|
|
//void ResetRecursiveCounter();
|
|
|
|
|
//int GetRecursiveCounter();
|
|
|
|
|
//void SetRecursiveCounter(int counter);
|
|
|
|
|
|
2024-09-12 10:49:45 +00:00
|
|
|
Task<bool> InvokeAgent(string agentId, List<RoleDialogModel> dialogs);
|
|
|
|
|
Task<bool> InvokeFunction(string name, RoleDialogModel messages);
|
|
|
|
|
Task<RoleDialogModel> InstructLoop(RoleDialogModel message, List<RoleDialogModel> dialogs);
|
2023-11-16 18:20:43 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Talk to a specific Agent directly, bypassing the Router
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="agent"></param>
|
|
|
|
|
/// <param name="message"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-01-24 23:02:59 +00:00
|
|
|
Task<RoleDialogModel> InstructDirect(Agent agent, RoleDialogModel message);
|
2024-02-05 04:22:43 +00:00
|
|
|
|
2024-08-01 18:18:34 +00:00
|
|
|
Task<string> GetConversationContent(List<RoleDialogModel> dialogs, int maxDialogCount = 100);
|
2024-03-21 22:04:45 +00:00
|
|
|
|
2024-04-24 21:45:18 +00:00
|
|
|
(bool, string) HasMissingRequiredField(RoleDialogModel message, out string agentId);
|
2023-09-03 04:11:53 +00:00
|
|
|
}
|