Skip to content

Commit feb884d

Browse files
author
Jicheng Lu
committed
assign fields
1 parent 0299fb4 commit feb884d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.UpdateAgent.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ public async Task UpdateAgent(Agent agent, AgentField updateField)
1313
var record = FindAgent(agent.Id);
1414
if (record == null) return;
1515

16+
record.Name = agent.Name ?? string.Empty;
17+
record.Description = agent.Description ?? string.Empty;
18+
record.Instruction = agent.Instruction ?? string.Empty;
19+
record.Functions = agent.Functions ?? new List<string>();
20+
record.Templates = agent.Templates ?? new List<AgentTemplate>();
21+
record.Responses = agent.Responses ?? new List<AgentResponse>();
22+
1623
_db.UpdateAgent(record, updateField);
1724
await Task.CompletedTask;
1825
}

0 commit comments

Comments
 (0)