Merge branch 'main' of https://github.com/sipeed/picoclaw into chore-azure-openai-response

This commit is contained in:
Kunal Karmakar 2026-03-28 01:53:46 +00:00
commit 8b3493bb18

View file

@ -2110,16 +2110,21 @@ turnLoop:
}, },
) )
logger.DebugCF("agent", "LLM response", llmResponseFields := map[string]any{
map[string]any{ "agent_id": ts.agent.ID,
"agent_id": ts.agent.ID, "iteration": iteration,
"iteration": iteration, "content_chars": len(response.Content),
"content_chars": len(response.Content), "tool_calls": len(response.ToolCalls),
"tool_calls": len(response.ToolCalls), "reasoning": response.Reasoning,
"reasoning": response.Reasoning, "target_channel": al.targetReasoningChannelID(ts.channel),
"target_channel": al.targetReasoningChannelID(ts.channel), "channel": ts.channel,
"channel": ts.channel, }
}) if response.Usage != nil {
llmResponseFields["prompt_tokens"] = response.Usage.PromptTokens
llmResponseFields["completion_tokens"] = response.Usage.CompletionTokens
llmResponseFields["total_tokens"] = response.Usage.TotalTokens
}
logger.DebugCF("agent", "LLM response", llmResponseFields)
if len(response.ToolCalls) == 0 || gracefulTerminal { if len(response.ToolCalls) == 0 || gracefulTerminal {
responseContent := response.Content responseContent := response.Content