Merge pull request #313 from iceljc/features/refine-content-log
refine content log after call bot
This commit is contained in:
commit
9f31f84feb
|
|
@ -82,7 +82,18 @@ public class StreamingLogHook : ConversationHookBase, IContentGeneratingHook
|
|||
var conversationId = _state.GetConversationId();
|
||||
var agent = await agentService.LoadAgent(message.CurrentAgentId);
|
||||
|
||||
await _chatHub.Clients.User(_user.Id).SendAsync("OnConversationContentLogGenerated", BuildContentLog(conversationId, agent?.Name, tokenStats.Prompt, message));
|
||||
string log;
|
||||
if (message.Role == AgentRole.Function)
|
||||
{
|
||||
log = $"[{agent?.Name}]: {message.FunctionName}({message.FunctionArgs}) => {message.Content}";
|
||||
log += $"\r\n<== MessageId: {message.MessageId}";
|
||||
}
|
||||
else
|
||||
{
|
||||
log = tokenStats.Prompt;
|
||||
}
|
||||
|
||||
await _chatHub.Clients.User(_user.Id).SendAsync("OnConversationContentLogGenerated", BuildContentLog(conversationId, agent?.Name, log, message));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue