This commit is contained in:
Sakurasan
2025-04-21 21:50:29 +08:00
parent 51d4651c6c
commit a9ff7e1c94
3 changed files with 17 additions and 17 deletions

View File

@@ -13,7 +13,7 @@ type LLM interface {
type llm struct {
ApiKey *model.ApiKey
Usage *model.Usage
Usage *TokenUsage
tools any // TODO
Messages []any // TODO
llm LLM

View File

@@ -218,6 +218,7 @@ func (o *OpenAICompatible) StreamChat(ctx context.Context, chatReq llm.ChatReque
// case output <- &streamResp:
// }
}
fmt.Println("llm usage:", o.tokenUsage.Model, o.tokenUsage.PromptTokens, o.tokenUsage.CompletionTokens, o.tokenUsage.TotalTokens)
}()
return output, nil
}