mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-31 18:10:50 +01:00
refactor: update LLMResponseUsage struct and ChatMessage usage aggregation
- Renamed fields in LLMResponseUsage struct to better reflect their purpose, changing InputTokens and OutputTokens to PromptTokens and CompletionTokens. - Modified GetUsage method in ChatMessage to accept an optional contents parameter, improving flexibility in usage tracking. - Ensured consistent field naming and improved clarity in token usage aggregation logic.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package entity
|
||||
|
||||
type LLMResponseUsage struct {
|
||||
InputTokens int `json:"input_tokens" bson:"input_tokens"`
|
||||
OutputTokens int `json:"output_tokens" bson:"output_tokens"`
|
||||
TotalTokens int `json:"total_tokens" bson:"total_tokens"`
|
||||
PromptTokens int `json:"prompt_tokens" bson:"prompt_tokens"`
|
||||
CompletionTokens int `json:"completion_tokens" bson:"completion_tokens"`
|
||||
TotalTokens int `json:"total_tokens" bson:"total_tokens"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user