This commit is contained in:
Sakurasan
2025-04-21 21:59:13 +08:00
parent a9ff7e1c94
commit 2bc857cf88

View File

@@ -203,6 +203,7 @@ func (o *OpenAICompatible) StreamChat(ctx context.Context, chatReq llm.ChatReque
if err := json.Unmarshal(line, &streamResp); err != nil {
continue
}
fmt.Printf("%#v\n", streamResp.Usage)
if streamResp.Usage != nil {
o.tokenUsage.PromptTokens += streamResp.Usage.PromptTokens
o.tokenUsage.CompletionTokens += streamResp.Usage.CompletionTokens