feat: 移除日志中的响应内容和模型信息,优化工具调用的日志记录

This commit is contained in:
oudecheng 2026-05-21 17:20:26 +08:00
parent 3128abe3c6
commit 159c1bbb7a

View File

@ -763,8 +763,6 @@ impl AgentLoop {
iteration,
response_len = response.content.len(),
tool_calls_len = response.tool_calls.len(),
content = %response.content,
model = %response.model,
"LLM response received"
);
@ -784,17 +782,9 @@ impl AgentLoop {
}
// Execute tool calls
let tool_calls_json = serde_json::to_string_pretty(&response.tool_calls)
.unwrap_or_else(|_| response.tool_calls.iter()
.map(|tc| format!("{}({})", tc.name, tc.arguments))
.collect::<Vec<_>>()
.join(", "));
tracing::info!(
iteration,
count = response.tool_calls.len(),
content = %response.content,
tool_calls = %tool_calls_json,
model = %response.model,
"Tool calls detected, executing tools"
);