🎉 初始化项目
This commit is contained in:
26
server/model/app/ai_request_log.go
Normal file
26
server/model/app/ai_request_log.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/ai_proxy/server/global"
|
||||
)
|
||||
|
||||
// AiRequestLog AI请求日志
|
||||
type AiRequestLog struct {
|
||||
global.GVA_MODEL
|
||||
UserID *uint `json:"userId" gorm:"comment:用户ID;index"`
|
||||
PresetID *uint `json:"presetId" gorm:"comment:预设ID"`
|
||||
ProviderID *uint `json:"providerId" gorm:"comment:提供商ID"`
|
||||
OriginalMessage string `json:"originalMessage" gorm:"comment:原始消息;type:text"`
|
||||
InjectedPrompt map[string]interface{} `json:"injectedPrompt" gorm:"comment:注入后的提示词;type:jsonb;serializer:json"`
|
||||
ResponseText string `json:"responseText" gorm:"comment:响应文本;type:text"`
|
||||
ResponseTokens int `json:"responseTokens" gorm:"comment:响应Token数"`
|
||||
PromptTokens int `json:"promptTokens" gorm:"comment:提示Token数"`
|
||||
TotalTokens int `json:"totalTokens" gorm:"comment:总Token数"`
|
||||
LatencyMs int `json:"latencyMs" gorm:"comment:延迟(毫秒)"`
|
||||
Status string `json:"status" gorm:"comment:状态;size:20"` // success/error/timeout
|
||||
ErrorMessage string `json:"errorMessage" gorm:"comment:错误信息;type:text"`
|
||||
}
|
||||
|
||||
func (AiRequestLog) TableName() string {
|
||||
return "ai_request_logs"
|
||||
}
|
||||
Reference in New Issue
Block a user