Files
BiliNote/backend/app/models/model_config.py
Jefferyhcool bb974b0b89 :feat 新增模型配置页面和相关功能
- 新增模型配置页面组件和路由
- 实现模型配置表单和相关逻辑- 添加全局配置入口和功能- 优化首页布局和样式- 新增 404 页面组件
- 更新部分组件样式和结构
2025-04-22 17:01:02 +08:00

16 lines
757 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
@dataclass
class ModelConfig:
"""
存储每个模型提供商的调用参数信息,用于从数据库读取并动态构建 GPT 调用实例。
"""
name: str # 展示名,如 "GPT-4 Turbo"(用于前端展示)
provider: str # 模型提供商,如 "openai"、"qwen"、"deepseek"
api_key: str # 调用该模型使用的 API Key
base_url: str # 模型 API 接口地址OpenAI SDK兼容
model_name: str # 实际请求用的模型名称,如 "gpt-4-turbo"
created_at: Optional[datetime] = None # 可选:创建时间(从 SQLite 自动生成)