using BotSharp.Abstraction.Routing.Models; namespace BotSharp.Abstraction.Agents.Models; public class Agent { public string Id { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; public DateTime CreatedDateTime { get; set; } public DateTime UpdatedDateTime { get; set; } /// /// Instruction /// [JsonIgnore] public string Instruction { get; set; } /// /// Templates /// [JsonIgnore] public List Templates { get; set; } /// /// Samples /// [JsonIgnore] public string Samples { get; set; } /// /// Functions /// [JsonIgnore] public List Functions { get; set; } /// /// Responses /// [JsonIgnore] public List Responses { get; set; } /// /// Domain knowledges /// [JsonIgnore] public string Knowledges { get; set; } public bool IsPublic { get; set; } /// /// Allow to be routed /// public bool AllowRouting { get; set; } public bool Disabled { get; set; } /// /// Profile by channel /// public List Profiles { get; set; } = new List(); public List RoutingRules { get; set; } = new List(); public override string ToString() => $"{Name} {Id}"; public static Agent Clone(Agent agent) { return new Agent { Id = agent.Id, Name = agent.Name, Description = agent.Description, Instruction = agent.Instruction, Functions = agent.Functions, Responses = agent.Responses, Samples = agent.Samples, Knowledges = agent.Knowledges, IsPublic = agent.IsPublic, Disabled = agent.Disabled, AllowRouting = agent.AllowRouting, Profiles = agent.Profiles, RoutingRules = agent.RoutingRules, CreatedDateTime = agent.CreatedDateTime, UpdatedDateTime = agent.UpdatedDateTime, }; } public Agent SetInstruction(string instruction) { Instruction = instruction; return this; } public Agent SetTemplates(List templates) { Templates = templates ?? new List(); return this; } public Agent SetFunctions(List functions) { Functions = functions ?? new List(); return this; } public Agent SetResponses(List responses) { Responses = responses ?? new List(); ; return this; } public Agent SetId(string id) { Id = id; return this; } public Agent SetName(string name) { Name = name; return this; } public Agent SetDescription(string description) { Description = description; return this; } public Agent SetIsPublic(bool isPublic) { IsPublic = isPublic; return this; } public Agent SetDisabled(bool disabled) { Disabled = disabled; return this; } public Agent SetAllowRouting(bool allowRouting) { AllowRouting = allowRouting; return this; } public Agent SetProfiles(List profiles) { Profiles = profiles ?? new List(); return this; } public Agent SetRoutingRules(List rules) { RoutingRules = rules ?? new List(); return this; } }