BotSharp/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Agents/AgentUpdateModel.cs

50 lines
1.2 KiB
C#
Raw Normal View History

2023-08-19 00:15:02 +00:00
using BotSharp.Abstraction.Agents.Models;
namespace BotSharp.OpenAPI.ViewModels.Agents;
public class AgentUpdateModel
{
2023-09-15 20:19:44 +00:00
public string? Name { get; set; } = string.Empty;
2023-08-19 00:15:02 +00:00
public string? Description { get; set; }
/// <summary>
/// Instruction
/// </summary>
public string? Instruction { get; set; }
2023-09-12 22:08:58 +00:00
/// <summary>
/// Templates
/// </summary>
public List<AgentTemplate>? Templates { get; set; }
2023-08-19 00:15:02 +00:00
/// <summary>
/// Samples
/// </summary>
public string? Samples { get; set; }
/// <summary>
/// Functions
/// </summary>
2023-09-12 22:08:58 +00:00
public List<string>? Functions { get; set; }
2023-08-19 00:15:02 +00:00
2023-08-28 05:28:14 +00:00
/// <summary>
/// Routes
/// </summary>
2023-09-12 22:08:58 +00:00
public List<AgentResponse>? Responses { get; set; }
2023-08-28 05:28:14 +00:00
2023-08-19 00:15:02 +00:00
public Agent ToAgent()
{
2023-09-15 20:19:44 +00:00
var agent = new Agent()
2023-08-19 00:15:02 +00:00
{
2023-09-15 20:19:44 +00:00
Name = Name ?? string.Empty,
Description = Description ?? string.Empty,
Instruction = Instruction ?? string.Empty,
Templates = Templates ?? new List<AgentTemplate>(),
Functions = Functions ?? new List<string>(),
Responses = Responses ?? new List<AgentResponse>()
2023-08-19 00:15:02 +00:00
};
return agent;
}
}