File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,10 @@ async IAsyncEnumerable<ChatResponseUpdate> CompleteChatStreamingCore(IEnumerable
9494
9595 ( ( List < AIContent > ) update . Contents ) . AddRange ( output . Delta . ToolCalls . AsContents ( text , citations ) ) ;
9696
97- if ( update . Contents . Any ( ) )
98- yield return update ;
97+ if ( MapToUsage ( chunk . Usage ) is { } usage )
98+ update . Contents . Add ( new UsageContent ( usage ) { RawRepresentation = chunk . Usage } ) ;
99+
100+ yield return update ;
99101 }
100102 }
101103 }
@@ -277,6 +279,8 @@ codeResult.RawRepresentation is ToolCall codeToolCall &&
277279 {
278280 InputTokenCount = usage . PromptTokens ,
279281 OutputTokenCount = usage . CompletionTokens ,
282+ CachedInputTokenCount = usage . CachedPromptTextTokens ,
283+ ReasoningTokenCount = usage . ReasoningTokens ,
280284 TotalTokenCount = usage . TotalTokens
281285 } ;
282286
You can’t perform that action at this time.
0 commit comments