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; }
///
/// LLM default system instructions
///
public string Instruction { get; set; } = string.Empty;
///
/// LLM extensible Instructions in addition to the default Instructions
///
public List Templates { get; set; } = new List();
///
/// LLM callable function definition
///
public List Functions { get; set; } = new List();
///
/// Response template
///
public List Responses { get; set; } = new List();
public List Samples { get; set; } = new List();
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 List();
public List RoutingRules { get; set; } = new List();
public Agent ToAgent()
{
return new Agent
{
Name = Name,
Description = Description,
Instruction = Instruction,
Templates = Templates,
Functions = Functions,
Responses = Responses,
Samples = Samples,
IsPublic = IsPublic,
AllowRouting = AllowRouting,
Disabled = Disabled,
Profiles = Profiles,
RoutingRules = RoutingRules?
.Select(x => RoutingRuleUpdateModel.ToDomainElement(x))?
.ToList() ?? new List()
};
}
}