From 862da9e83762f1639ed2e9d9be054eb76f894692 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Tue, 11 Jun 2024 22:41:37 -0500 Subject: [PATCH] fix default agent llm config --- .../BotSharp.Core/Agents/Services/AgentService.GetAgents.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs index 5d153687..91e62c93 100644 --- a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs +++ b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs @@ -44,7 +44,11 @@ public partial class AgentService if (profile.LlmConfig == null) { profile.LlmConfig = agentSetting.LlmConfig; - profile.LlmConfig.IsInherit = true; + } + else if (string.IsNullOrEmpty(profile.LlmConfig?.Provider) || string.IsNullOrEmpty(profile.LlmConfig?.Model)) + { + profile.LlmConfig.Provider = agentSetting.LlmConfig.Provider; + profile.LlmConfig.Model = agentSetting.LlmConfig.Model; } profile.Plugin = GetPlugin(profile.Id);