Files
crawlab/core/entity/llm.go
Marvin Zhang 67b51fdc83 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.
2025-04-14 16:29:32 +08:00

8 lines
253 B
Go

package entity
type LLMResponseUsage struct {
PromptTokens int `json:"prompt_tokens" bson:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens" bson:"completion_tokens"`
TotalTokens int `json:"total_tokens" bson:"total_tokens"`
}