diff --git a/Directory.Build.props b/Directory.Build.props index 6374ce0a..d7ac58ae 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ 10.0 ..\..\..\packages - 0.16.1 + 0.16.2 true \ No newline at end of file diff --git a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetNextInstruction.cs b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetNextInstruction.cs index e44a8860..907ed5ad 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetNextInstruction.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetNextInstruction.cs @@ -134,9 +134,7 @@ public partial class RoutingService #endif private string GetNextStepPrompt() { - var db = _services.GetRequiredService(); - // _routerInstance.Router.Templates.First(x => x.Name == "next_step_prompt").Content; - var template = db.GetAgentTemplate(_routerInstance.AgentId, "next_step_prompt"); + var template = _routerInstance.Router.Templates.First(x => x.Name == "next_step_prompt").Content; // If enabled reasoning // JsonSerializer.Serialize(new FunctionCallFromLlm()); diff --git a/src/Infrastructure/BotSharp.OpenAPI/Controllers/InstructModeController.cs b/src/Infrastructure/BotSharp.OpenAPI/Controllers/InstructModeController.cs index d0f278bd..b53eaba8 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/Controllers/InstructModeController.cs +++ b/src/Infrastructure/BotSharp.OpenAPI/Controllers/InstructModeController.cs @@ -31,9 +31,7 @@ public class InstructModeController : ControllerBase, IApiAdapter // switch to different instruction template if (!string.IsNullOrEmpty(input.Template)) { - var agentSettings = _services.GetRequiredService(); - var filePath = Path.Combine(agentService.GetAgentDataDir(agentId), $"{input.Template}.{agentSettings.TemplateFormat}"); - agent.Instruction = System.IO.File.ReadAllText(filePath); + agent.Instruction = agent.Templates.First(x => x.Name == input.Template).Content; } var conv = _services.GetRequiredService();