mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-28 17:50:56 +01:00
- Added BSON tags to fields in LLMResponseUsage struct to ensure proper serialization with MongoDB. - Updated the Usage field in ChatMessage model to exclude it from JSON serialization while retaining BSON compatibility. - Introduced GetUsage method in ChatMessage to aggregate token usage from contents, enhancing usage tracking capabilities.
8 lines
231 B
Go
8 lines
231 B
Go
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"`
|
|
}
|