Show text completion verbose log.
This commit is contained in:
parent
5d7dd09801
commit
2bc2367536
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<ConversationSetting>();
|
||||
if (setting.ShowVerboseLog)
|
||||
{
|
||||
_logger.LogInformation(text);
|
||||
}
|
||||
|
||||
var state = _services.GetRequiredService<IConversationStateService>();
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue