初始提交:极码 GeekCode 全栈项目(FastAPI + Vue3)
This commit is contained in:
25
backend/models/ai_model.py
Normal file
25
backend/models/ai_model.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""AI模型配置模型"""
|
||||
from sqlalchemy import Column, Integer, String, Boolean, DateTime, Text
|
||||
from sqlalchemy.sql import func
|
||||
from database import Base
|
||||
|
||||
|
||||
class AIModelConfig(Base):
|
||||
"""AI模型配置表 - 存储各AI服务商的模型信息和API Key"""
|
||||
__tablename__ = "ai_model_configs"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
provider = Column(String(50), nullable=False) # openai/anthropic/google/deepseek
|
||||
provider_name = Column(String(100), default="") # 显示名称
|
||||
model_id = Column(String(100), nullable=False) # 模型标识符
|
||||
model_name = Column(String(100), default="") # 模型显示名称
|
||||
api_key = Column(String(500), default="") # API Key
|
||||
base_url = Column(String(500), default="") # 自定义API地址
|
||||
task_type = Column(String(50), default="") # 任务类型: multimodal/reasoning/lightweight/embedding
|
||||
is_enabled = Column(Boolean, default=True) # 是否启用
|
||||
is_default = Column(Boolean, default=False) # 是否为该任务类型的默认模型
|
||||
web_search_enabled = Column(Boolean, default=False) # 是否启用联网搜索(仅豆包/火山方舟支持)
|
||||
web_search_count = Column(Integer, default=5) # 联网搜索结果条数(1-50,默认5)
|
||||
description = Column(Text, default="") # 描述说明
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
|
||||
Reference in New Issue
Block a user