M4b:ai_provider 删除手术①-⑥——神识全面接管模型出口
- ① 后端删除 app/ai_provider/(38 文件,含 anthropic/openai 格式、billing、audio、embedding)、services/ai_provider_admin.py、core/config/model_config.py、tests/ai_provider/(21 文件) - ② 连带退役 application/agent/(旧 Agent 循环/steer/follow-up/确认注册表)、application/skill_executor.py、app/skills/(python skills 孤儿)、endpoints/audio.py、application/imports.py(ProviderManager 消费方);settings 端点收敛为生成偏好 - ③ runs.py 修剪:AgentRunRegistry/steer/follow-up/confirmations 端点退役,保留 list/get/events/cancel/stream;safety 确认改为直接落库裁决(pending→approved/denied) - ④ 前端删除:models 页、ModelGatewayView、gateway.ts、GatewayPanel(玄关)、ModelGatewayPanel/ModelStrategyForm、audio.ts/useVoiceInput、网关类型与 mock;设置页收敛为外观/语言/通知 - ⑤ 配置收敛:config/models|providers|pricing.example.yaml 归档 shenshi/config/;.env.example 删 provider keys/MODEL_ENDPOINT_POOL/MODEL_CONFIG_PATH,收敛 SHENSHI_* - ⑥ 验收:rg 审计灵台 Provider SDK import 与 ai_provider 引用归零;后端 528 passed(2 个预存失败经 HEAD 复跑验证与本手术无关)、前端 type-check+201 passed、神识 go vet+test、BFF 4 passed
This commit is contained in:
1 parent
0d383725b5
commit
462d570751
129 files changed
+81
-15867
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"""主 Settings:多继承所有子配置,统一以绝对路径 ``_env_file`` 加载 ``.env``。
|
||||
|
||||
子配置见同目录下的 ``app_config`` / ``auth_config`` / ``database_config`` / ``log_config`` /
|
||||
``runtime_config`` / ``model_config`` / ``sandbox_config``。本文件聚合字段,并承载
|
||||
``runtime_config`` / ``sandbox_config``。本文件聚合字段,并承载
|
||||
跨子配置的路径解析与计算属性。
|
||||
|
||||
配置优先级(自高到低):命令行参数 > 系统环境变量 > ``.env`` > 类属性默认值。
|
||||
@@ -18,7 +18,6 @@ from app.core.config.app_config import AppConfig
|
||||
from app.core.config.auth_config import AuthConfig
|
||||
from app.core.config.database_config import DatabaseConfig
|
||||
from app.core.config.log_config import LogConfig
|
||||
from app.core.config.model_config import ModelGatewayConfig
|
||||
from app.core.config.runtime_config import RuntimeConfig
|
||||
from app.core.config.sandbox_config import SandboxSettings
|
||||
from app.core.config.time_config import TimeConfig
|
||||
@@ -35,7 +34,6 @@ class Settings(
|
||||
DatabaseConfig,
|
||||
LogConfig,
|
||||
RuntimeConfig,
|
||||
ModelGatewayConfig,
|
||||
SandboxSettings,
|
||||
TimeConfig,
|
||||
BaseSettings,
|
||||
@@ -117,21 +115,6 @@ class Settings(
|
||||
return example
|
||||
return configured
|
||||
|
||||
@cached_property
|
||||
def resolved_model_config_path(self) -> Path:
|
||||
"""解析模型配置文件路径。
|
||||
|
||||
如果配置文件不存在,尝试使用示例配置文件。
|
||||
"""
|
||||
configured = self.resolve_from_backend(self.model_config_path)
|
||||
if configured.exists():
|
||||
return configured
|
||||
# 如果配置文件不存在,尝试使用示例配置
|
||||
example = self.project_root / "config" / "models.example.yaml"
|
||||
if example.exists():
|
||||
return example
|
||||
return configured
|
||||
|
||||
@cached_property
|
||||
def resolved_avatar_dir(self) -> Path:
|
||||
"""解析角色头像存储目录为绝对路径。"""
|
||||
|
||||
Reference in new issue
Block a user