Skip to content

Commit f5f60b7

Browse files
author
Haiping Chen
committed
Log routing output
1 parent 2d8866a commit f5f60b7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Plugins/BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ public async Task AfterGenerated(RoleDialogModel message, TokenStatsModel tokenS
7979
var conversationId = _state.GetConversationId();
8080
var agent = await agentService.LoadAgent(message.CurrentAgentId);
8181

82+
// Log routing output
83+
try
84+
{
85+
var inst = message.Content.JsonContent<FunctionCallFromLlm>();
86+
await _chatHub.Clients.User(_user.Id).SendAsync("OnConversationContentLogGenerated", BuildContentLog(conversationId, agent?.Name, message.Content, message));
87+
}
88+
catch
89+
{
90+
// ignore
91+
}
92+
8293
string log;
8394
if (message.Role == AgentRole.Function)
8495
{

0 commit comments

Comments
 (0)