feat(models): 桌面端 pineagents 提供商动态拉取算力中心 admin 模型
- list_provider_info 对 pineagents 调 fetch_models()(server-core /v1/models=admin 模型), 成功替换其模型列表, 失败回退静态 - 桌面端模型源迁至算力中心(admin 模型), 不再展示硬编码 DEEPSEEK 4 个
This commit is contained in:
@@ -1454,6 +1454,15 @@ class ProviderManager: # pylint: disable=too-many-public-methods
|
||||
self.builtin_providers[provider.id] = provider
|
||||
|
||||
async def list_provider_info(self) -> List[ProviderInfo]:
|
||||
# PineAgents(算力中心):动态拉取 admin 模型(server-core /v1/models),失败回退静态 DEEPSEEK_MODELS。
|
||||
pine = self.builtin_providers.get("pineagents")
|
||||
if pine is not None and hasattr(pine, "fetch_models"):
|
||||
try:
|
||||
fetched = await pine.fetch_models()
|
||||
if fetched:
|
||||
pine.models = fetched
|
||||
except Exception: # noqa: BLE001
|
||||
pass
|
||||
tasks = [
|
||||
provider.get_info() for provider in self.builtin_providers.values()
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user