using BotSharp.Abstraction.Agents.Models;
namespace BotSharp.OpenAPI.ViewModels.Agents;
public class AgentUpdateModel
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
///
/// Instruction
///
public string? Instruction { get; set; }
///
/// Templates
///
public List? Templates { get; set; }
///
/// Samples
///
public string? Samples { get; set; }
///
/// Functions
///
public List? Functions { get; set; }
///
/// Routes
///
public List? Responses { get; set; }
public Agent ToAgent()
{
var agent = new Agent
{
Name = Name
};
if (Description != null)
agent.Description = Description;
if (Instruction != null)
agent.Instruction = Instruction;
if (!Templates.IsNullOrEmpty())
agent.Templates = Templates;
if (Samples != null)
agent.Samples = Samples;
if (!Functions.IsNullOrEmpty())
agent.Functions = Functions;
if (!Responses.IsNullOrEmpty())
agent.Responses = Responses;
return agent;
}
}