diff --git a/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.SelectFile.cs b/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.SelectFile.cs index 355df34d..50264576 100644 --- a/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.SelectFile.cs +++ b/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.SelectFile.cs @@ -80,6 +80,10 @@ public partial class FileInstructService { return res; } + else if (files.Count() == 1) + { + return files; + } var agentService = _services.GetRequiredService(); var llmProviderService = _services.GetRequiredService(); @@ -115,7 +119,7 @@ public partial class FileInstructService }).ToList(); var agentId = !string.IsNullOrWhiteSpace(options.AgentId) ? options.AgentId : BuiltInAgentId.FileAssistant; - var template = !string.IsNullOrWhiteSpace(options.Template) ? options.Template : "select_chat_file_instruction"; + var template = !string.IsNullOrWhiteSpace(options.Template) ? options.Template : "select-chat-file_instruction"; var prompt = db.GetAgentTemplate(agentId, template); var data = new Dictionary