using BotSharp.Abstraction.Functions.Models; using BotSharp.Abstraction.Plugins.Models; using BotSharp.Abstraction.Repositories.Filters; namespace BotSharp.Abstraction.Agents; /// /// Agent management service /// public interface IAgentService { Task CreateAgent(Agent agent); Task RefreshAgents(); Task> GetAgents(AgentFilter filter); /// /// Load agent configurations and trigger hooks /// /// /// Task LoadAgent(string id, bool loadUtility = true); /// /// Inherit from an agent /// /// /// Task InheritAgent(Agent agent); string RenderedInstruction(Agent agent); string RenderedTemplate(Agent agent, string templateName); bool RenderFunction(Agent agent, FunctionDef def); FunctionParametersDef? RenderFunctionProperty(Agent agent, FunctionDef def); /// /// Get agent detail without trigger any hook. /// /// /// Original agent information Task GetAgent(string id); Task DeleteAgent(string id); Task UpdateAgent(Agent agent, AgentField updateField); /// /// Path existing templates of agent, cannot create new or delete templates /// /// /// Task PatchAgentTemplate(Agent agent); Task UpdateAgentFromFile(string id); string GetDataDir(); string GetAgentDataDir(string agentId); Task> GetUserAgents(string userId); PluginDef GetPlugin(string agentId); }