mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 00:35:51 +00:00
feat: langfuse tracing 增加 thinking 参数记录
在 recordLLMObservation 中添加 thinking 配置(type/budgetTokens), 所有 provider(claude/gemini/openai)及 tokenEstimation、sideQuery 调用处同步传递 thinking 信息,便于 Langfuse 面板观察 thinking 使用情况。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,11 @@ export function recordLLMObservation(
|
||||
endTime?: Date
|
||||
completionStartTime?: Date
|
||||
tools?: unknown
|
||||
/** Thinking depth configuration used for this request */
|
||||
thinking?: {
|
||||
type: string
|
||||
budgetTokens?: number
|
||||
}
|
||||
},
|
||||
): void {
|
||||
if (!rootSpan || !isLangfuseEnabled()) return
|
||||
@@ -97,6 +102,10 @@ export function recordLLMObservation(
|
||||
metadata: {
|
||||
provider: params.provider,
|
||||
model: params.model,
|
||||
...(params.thinking && { thinkingType: params.thinking.type }),
|
||||
...(params.thinking?.budgetTokens !== undefined && {
|
||||
thinkingBudgetTokens: params.thinking.budgetTokens,
|
||||
}),
|
||||
},
|
||||
...(params.completionStartTime && { completionStartTime: params.completionStartTime }),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user