using BotSharp.Abstraction.Agents.Models; using BotSharp.Abstraction.Functions.Models; using BotSharp.Abstraction.Routing.Models; namespace BotSharp.OpenAPI.ViewModels.Agents; public class AgentCreationModel { public string Name { get; set; } public string Description { get; set; } public string Type { get; set; } = AgentType.Task; /// /// LLM default system instructions /// public string Instruction { get; set; } = string.Empty; /// /// /// public List ChannelInstructions { get; set; } = new(); /// /// LLM extensible Instructions in addition to the default Instructions /// public List Templates { get; set; } = new(); /// /// LLM callable function definition /// public List Functions { get; set; } = new(); /// /// Response template /// public List Responses { get; set; } = new(); public List Samples { get; set; } = new(); public bool IsPublic { get; set; } /// /// Whether to allow Router to transfer Request to this Agent /// public bool AllowRouting { get; set; } public bool Disabled { get; set; } /// /// Combine different Agents together to form a Profile. /// public List Profiles { get; set; } = new(); public bool MergeUtility { get; set; } public List Utilities { get; set; } = new(); public List RoutingRules { get; set; } = new(); public AgentLlmConfig? LlmConfig { get; set; } public Agent ToAgent() { return new Agent { Name = Name, Description = Description, Instruction = Instruction, ChannelInstructions = ChannelInstructions, Templates = Templates, Functions = Functions, Responses = Responses, Samples = Samples, Utilities = Utilities, IsPublic = IsPublic, Type = Type, Disabled = Disabled, MergeUtility = MergeUtility, Profiles = Profiles, RoutingRules = RoutingRules?.Select(x => RoutingRuleUpdateModel.ToDomainElement(x))?.ToList() ?? new List(), LlmConfig = LlmConfig }; } }