You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
947 B
21 lines
947 B
package model
|
|
|
|
import "time"
|
|
|
|
// AIChatMessage AI聊天消息
|
|
type AIChatMessage struct {
|
|
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
|
ConversationId int64 `gorm:"column:conversation_id;index;not null" json:"conversationId"`
|
|
Role string `gorm:"column:role;type:varchar(20);not null" json:"role"`
|
|
Content string `gorm:"column:content;type:longtext" json:"content"`
|
|
TokenCount int `gorm:"column:token_count;default:0" json:"tokenCount"`
|
|
Cost float64 `gorm:"column:cost;type:decimal(10,6);default:0" json:"cost"`
|
|
ModelId string `gorm:"column:model_id;type:varchar(100)" json:"modelId"`
|
|
LatencyMs int `gorm:"column:latency_ms;default:0" json:"latencyMs"`
|
|
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"createdAt"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (AIChatMessage) TableName() string {
|
|
return "ai_chat_message"
|
|
}
|
|
|