mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-09-04 23:26:51 +08:00
:feat 新增模型配置页面和相关功能
- 新增模型配置页面组件和路由 - 实现模型配置表单和相关逻辑- 添加全局配置入口和功能- 优化首页布局和样式- 新增 404 页面组件 - 更新部分组件样式和结构
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
from openai import OpenAI
|
||||
|
||||
from app.gpt.base import GPT
|
||||
from app.gpt.provider.OpenAI_compatible_provider import OpenAICompatibleProvider
|
||||
from app.gpt.universal_gpt import UniversalGPT
|
||||
from app.models.model_config import ModelConfig
|
||||
|
||||
|
||||
class GPTFactory:
|
||||
@staticmethod
|
||||
def from_config(config: ModelConfig) -> GPT:
|
||||
client = OpenAICompatibleProvider(api_key=config.api_key, base_url=config.base_url).get_client()
|
||||
return UniversalGPT(client=client, model=config.model_name)
|
||||
Reference in New Issue
Block a user