package system

import "sundynix-go/global"

type SysAiConfig struct {
	global.BaseModel
	IsActive int `gorm:"column:is_active;type:tinyint;default:0;comment:是否激活(1是0否)" json:"isActive" form:"isActive"`
	// Qdrant 向量库配置
	QdrantUrl        string `gorm:"column:qdrant_url;type:varchar(255);comment:Qdrant接口地址" json:"qdrantUrl" form:"qdrantUrl"`
	QdrantApiKey     string `gorm:"column:qdrant_api_key;type:varchar(255);comment:Qdrant密钥" json:"qdrantApiKey" form:"qdrantApiKey"`
	QdrantCollection string `gorm:"column:qdrant_collection;type:varchar(100);comment:Qdrant集合名" json:"qdrantCollection" form:"qdrantCollection"`
	VectorDimension  int    `gorm:"column:vector_dimension;type:int;comment:向量维度(默认104)" json:"vectorDimension" form:"vectorDimension"`
	// 对话大模型配置（如 deepseek-chat、qwen-max、ollama 本地等）
	ChatProvider  string `gorm:"column:chat_provider;type:varchar(50);comment:对话模型供应商(deepseek/qwen/local等)" json:"chatProvider" form:"chatProvider"`
	ChatApiUrl    string `gorm:"column:chat_api_url;type:varchar(255);comment:对话模型接口地址" json:"chatApiUrl" form:"chatApiUrl"`
	ChatApiKey    string `gorm:"column:chat_api_key;type:varchar(255);comment:对话模型ApiKey" json:"chatApiKey" form:"chatApiKey"`
	ChatModelName string `gorm:"column:chat_model_name;type:varchar(100);comment:对话模型名称" json:"chatModelName" form:"chatModelName"`
	// Embedding 向量化模型配置（可与对话模型用不同供应商，如 bge-m3 本地 + deepseek 对话）
	EmbeddingProvider  string `gorm:"column:embedding_provider;type:varchar(50);comment:Embedding模型供应商" json:"embeddingProvider" form:"embeddingProvider"`
	EmbeddingApiUrl    string `gorm:"column:embedding_api_url;type:varchar(255);comment:Embedding模型接口地址" json:"embeddingApiUrl" form:"embeddingApiUrl"`
	EmbeddingApiKey    string `gorm:"column:embedding_api_key;type:varchar(255);comment:Embedding模型ApiKey" json:"embeddingApiKey" form:"embeddingApiKey"`
	EmbeddingModelName string `gorm:"column:embedding_model_name;type:varchar(100);comment:Embedding模型名称" json:"embeddingModelName" form:"embeddingModelName"`
	// 用量限制
	DailyQueryLimit int `gorm:"column:daily_query_limit;type:int;default:20;comment:每用户每日问答上限(0=不限)" json:"dailyQueryLimit" form:"dailyQueryLimit"`
}
