-
-
Notifications
You must be signed in to change notification settings - Fork 628
Expand file tree
/
Copy pathAgentCreationModel.cs
More file actions
107 lines (90 loc) · 3.3 KB
/
AgentCreationModel.cs
File metadata and controls
107 lines (90 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using BotSharp.Abstraction.Agents.Models;
using BotSharp.Abstraction.Functions.Models;
using System.Text.Json.Serialization;
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;
/// <summary>
/// Agent routing mode
/// </summary>
public string? Mode { get; set; }
/// <summary>
/// Agent function visibility mode
/// </summary>
[JsonPropertyName("function_visibility_mode")]
public string? FuncVisMode { get; set; }
/// <summary>
/// LLM default system instructions
/// </summary>
public string Instruction { get; set; } = string.Empty;
/// <summary>
///
/// </summary>
public List<ChannelInstruction> ChannelInstructions { get; set; } = new();
/// <summary>
/// LLM extensible Instructions in addition to the default Instructions
/// </summary>
public List<AgentTemplate> Templates { get; set; } = new();
/// <summary>
/// LLM callable function definition
/// </summary>
public List<FunctionDef> Functions { get; set; } = new();
/// <summary>
/// Response template
/// </summary>
public List<AgentResponse> Responses { get; set; } = new();
public List<string> Samples { get; set; } = new();
public bool IsPublic { get; set; }
/// <summary>
/// Whether to allow Router to transfer Request to this Agent
/// </summary>
public bool AllowRouting { get; set; }
public bool Disabled { get; set; }
/// <summary>
/// Combine different Agents together to form a Profile.
/// </summary>
public List<string> Profiles { get; set; } = new();
public List<string> Labels { get; set; } = new();
public bool MergeUtility { get; set; }
public int? MaxMessageCount { get; set; }
public List<AgentUtility> Utilities { get; set; } = new();
public List<McpTool> McpTools { get; set; } = new();
public List<RoutingRuleUpdateModel> RoutingRules { get; set; } = new();
public List<AgentKnowledgeBase> KnowledgeBases { get; set; } = new();
public List<AgentRule> Rules { get; set; } = new();
public AgentLlmConfig? LlmConfig { get; set; }
public List<AgentSkill> Skills { get; set; }
public Agent ToAgent()
{
return new Agent
{
Name = Name,
Type = Type,
Mode = Mode,
FuncVisMode = FuncVisMode,
Disabled = Disabled,
IsPublic = IsPublic,
Description = Description,
Instruction = Instruction,
ChannelInstructions = ChannelInstructions,
Templates = Templates,
Functions = Functions,
Responses = Responses,
Samples = Samples,
Utilities = Utilities,
McpTools = McpTools,
MergeUtility = MergeUtility,
MaxMessageCount = MaxMessageCount,
Profiles = Profiles,
Labels = Labels,
LlmConfig = LlmConfig ?? new(),
KnowledgeBases = KnowledgeBases,
Rules = Rules,
RoutingRules = RoutingRules?.Select(x => RoutingRuleUpdateModel.ToDomainElement(x))?.ToList() ?? [],
Skills = Skills ?? new List<AgentSkill>(),
};
}
}