Documentation
¶
Overview ¶
Code generated by protoc-gen-api. DO NOT EDIT. source: malonaz/ai/v1/chat.proto
Code generated by protoc-gen-api. DO NOT EDIT. source: malonaz/ai/v1/errors.proto
Code generated by protoc-gen-api. DO NOT EDIT. source: malonaz/ai/v1/message.proto
Code generated by protoc-gen-api. DO NOT EDIT. source: malonaz/ai/v1/metrics.proto
Code generated by protoc-gen-api. DO NOT EDIT. source: malonaz/ai/v1/model.proto
Code generated by protoc-gen-api. DO NOT EDIT. source: malonaz/ai/v1/tool.proto
Code generated by protoc-gen-api. DO NOT EDIT. source: malonaz/ai/v1/voice.proto
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Chat ¶
type Chat struct {
OrganizationID string `db:"organization_id"`
UserID string `db:"user_id"`
ChatID string `db:"chat_id"`
CreateTime time.Time `db:"create_time"`
UpdateTime time.Time `db:"update_time"`
DeleteTime *time.Time `db:"delete_time"`
Etag string `db:"etag"`
Labels []byte `db:"labels"`
Metadata []byte `db:"metadata"`
}
type ChatStatsRow ¶
type ChatStatsRow struct {
Bucket *time.Time `db:"bucket"`
Count int32 `db:"count"`
Price float64 `db:"price"`
}
ChatStatsRow is one aggregated row of the chat stats query, grouped by bucket. Bucket is nil when no granularity is requested.
type MessageStatsRow ¶
type MessageStatsRow struct {
Bucket *time.Time `db:"bucket"`
Model string `db:"model"`
Count int32 `db:"count"`
Price float64 `db:"price"`
InputTokenQuantity int64 `db:"input_token_quantity"`
InputTokenPrice float64 `db:"input_token_price"`
OutputTokenQuantity int64 `db:"output_token_quantity"`
OutputTokenPrice float64 `db:"output_token_price"`
OutputReasoningTokenQuantity int64 `db:"output_reasoning_token_quantity"`
OutputReasoningTokenPrice float64 `db:"output_reasoning_token_price"`
InputTokenCacheReadQuantity int64 `db:"input_token_cache_read_quantity"`
InputTokenCacheReadPrice float64 `db:"input_token_cache_read_price"`
InputTokenCacheWriteQuantity int64 `db:"input_token_cache_write_quantity"`
InputTokenCacheWritePrice float64 `db:"input_token_cache_write_price"`
InputSecondQuantity int64 `db:"input_second_quantity"`
InputSecondPrice float64 `db:"input_second_price"`
OutputSecondQuantity int64 `db:"output_second_quantity"`
OutputSecondPrice float64 `db:"output_second_price"`
InputCharacterQuantity int64 `db:"input_character_quantity"`
InputCharacterPrice float64 `db:"input_character_price"`
InputImageTokenQuantity int64 `db:"input_image_token_quantity"`
InputImageTokenPrice float64 `db:"input_image_token_price"`
OutputImageTokenQuantity int64 `db:"output_image_token_quantity"`
OutputImageTokenPrice float64 `db:"output_image_token_price"`
InputImageTokenCacheReadQuantity int64 `db:"input_image_token_cache_read_quantity"`
InputImageTokenCacheReadPrice float64 `db:"input_image_token_cache_read_price"`
InputImageTokenCacheWriteQuantity int64 `db:"input_image_token_cache_write_quantity"`
InputImageTokenCacheWritePrice float64 `db:"input_image_token_cache_write_price"`
}
MessageStatsRow is one aggregated row of the message stats query, grouped by (bucket, model). Model is empty for messages that were not generated by a model (user, system and tool messages). Bucket is nil when no granularity is requested.
Every priced category of malonaz.ai.v1.ModelUsage is aggregated separately; the categories are disjoint, so callers can sum whichever ones they need.