25 lines
1022 B
Go
25 lines
1022 B
Go
package app
|
|
|
|
import (
|
|
"git.echol.cn/loser/ai_proxy/server/global"
|
|
)
|
|
|
|
// AiModel AI模型配置
|
|
type AiModel struct {
|
|
global.GVA_MODEL
|
|
Name string `json:"name" gorm:"type:varchar(100);not null;comment:模型名称"`
|
|
DisplayName string `json:"display_name" gorm:"type:varchar(100);comment:显示名称"`
|
|
ProviderID uint `json:"provider_id" gorm:"not null;index;comment:提供商ID"`
|
|
Provider AiProvider `json:"provider" gorm:"foreignKey:ProviderID"`
|
|
PresetID *uint `json:"preset_id" gorm:"index;comment:绑定的预设ID"`
|
|
Preset *AiPreset `json:"preset,omitempty" gorm:"foreignKey:PresetID"`
|
|
Enabled bool `json:"enabled" gorm:"default:true;comment:是否启用"`
|
|
MaxTokens int `json:"max_tokens" gorm:"default:4096;comment:最大token数"`
|
|
Description string `json:"description" gorm:"type:text;comment:模型描述"`
|
|
UserID uint `json:"user_id" gorm:"index;comment:用户ID"`
|
|
}
|
|
|
|
func (AiModel) TableName() string {
|
|
return "ai_models"
|
|
}
|