diff --git a/src/Infrastructure/BotSharp.Core/Instructs/InstructService.cs b/src/Infrastructure/BotSharp.Core/Instructs/InstructService.cs index d9f0fd6c..ec64f6af 100644 --- a/src/Infrastructure/BotSharp.Core/Instructs/InstructService.cs +++ b/src/Infrastructure/BotSharp.Core/Instructs/InstructService.cs @@ -34,7 +34,6 @@ public partial class InstructService : IInstructService } var completer = CompletionProvider.GetTextCompletion(_services); - var result = await completer.GetCompletion(agent.Instruction); var response = new InstructResult { diff --git a/src/Plugins/BotSharp.Plugin.AzureOpenAI/Providers/TextCompletionProvider.cs b/src/Plugins/BotSharp.Plugin.AzureOpenAI/Providers/TextCompletionProvider.cs index 4094b762..dc17ddc7 100644 --- a/src/Plugins/BotSharp.Plugin.AzureOpenAI/Providers/TextCompletionProvider.cs +++ b/src/Plugins/BotSharp.Plugin.AzureOpenAI/Providers/TextCompletionProvider.cs @@ -11,6 +11,7 @@ using BotSharp.Abstraction.Agents.Enums; using System.Linq; using System.Collections.Generic; using BotSharp.Abstraction.Agents.Models; +using BotSharp.Abstraction.Conversations.Settings; namespace BotSharp.Plugin.AzureOpenAI.Providers; @@ -55,6 +56,12 @@ public class TextCompletionProvider : ITextCompletion }; completionsOptions.StopSequences.Add($"{AgentRole.Assistant}:"); + var setting = _services.GetRequiredService(); + if (setting.ShowVerboseLog) + { + _logger.LogInformation(text); + } + var state = _services.GetRequiredService(); var temperature = float.Parse(state.GetState("temperature", "0.5")); var samplingFactor = float.Parse(state.GetState("sampling_factor", "0.5")); @@ -72,6 +79,11 @@ public class TextCompletionProvider : ITextCompletion completion += t.Text; }; + if (setting.ShowVerboseLog) + { + _logger.LogInformation(completion); + } + // After chat completion hook Task.WaitAll(hooks.Select(hook => hook.AfterGenerated(new RoleDialogModel(AgentRole.Assistant, completion), new TokenStatsModel