Skip to content

Commit bca130e

Browse files
authored
Merge pull request #1348 from yileicn/master
optimize AgentLlmConfig
2 parents d949e89 + b20d81c commit bca130e

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/Infrastructure/BotSharp.Abstraction/Agents/Models/AgentLlmConfig.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ namespace BotSharp.Abstraction.Agents.Models;
22

33
public class AgentLlmConfig
44
{
5+
public AgentLlmConfig() { }
6+
7+
public AgentLlmConfig(AgentTemplateLlmConfig templateLlmConfig)
8+
{
9+
Provider = templateLlmConfig.Provider;
10+
Model = templateLlmConfig.Model;
11+
MaxOutputTokens = templateLlmConfig.MaxOutputTokens;
12+
ReasoningEffortLevel = templateLlmConfig.ReasoningEffortLevel;
13+
}
14+
515
/// <summary>
616
/// Is inherited from default Agent Settings
717
/// </summary>

src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Instruct.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,7 @@ private async Task<Agent> BuildInnerAgent(InstructOptions? options)
7171
var templateLlmConfig = template?.LlmConfig;
7272
if (templateLlmConfig?.IsValid == true)
7373
{
74-
llmConfig = new AgentLlmConfig
75-
{
76-
Provider = templateLlmConfig.Provider,
77-
Model = templateLlmConfig.Model,
78-
MaxOutputTokens = templateLlmConfig.MaxOutputTokens,
79-
ReasoningEffortLevel = templateLlmConfig.ReasoningEffortLevel
80-
};
74+
llmConfig = new AgentLlmConfig(templateLlmConfig);
8175
}
8276
}
8377
}

0 commit comments

Comments
 (0)