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; }
public DateTime CreatedDateTime { get; set; }
public DateTime UpdatedDateTime { get; set; }
///
/// Instruction
///
public string Instruction { get; set; }
///
/// Samples
///
public string Samples { get; set; }
///
/// Functions
///
public List Functions { get; set; }
///
/// Responses
///
public List Responses { get; set; }
///
/// Domain knowledges
///
public string Knowledges { get; set; }
public bool IsPublic { get; set; }
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,
CreatedDateTime = agent.CreatedDateTime,
UpdatedDateTime = agent.UpdatedDateTime,
};
}
public Agent SetInstruction(string instruction)
{
Instruction = instruction;
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;
}
}