mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 16:07:33 +00:00
解决与 #7618 的 51 个文件冲突,并把 ollama_cloud 接入平台清单与 provider profile: - domain/platforms.go 登记 ollama_cloud(OpenAI 网关,LiteLLMProvider 留空); provider_profile.go 登记 by_inbound profile(legacy/credits 两模式共用端点), 新增 ProviderProfile.DefaultAPIProtocol 表达未配置时默认 adaptive。 - 删除 #7114 手写的约 30 处平台清单/switch,改用清单派生(AllowedQuotaPlatforms、 binding 校验、调度快照、组合分组、路由 dispatcher、前端平台选项/配色/配额等)。 - 迁移 242_ollama_cloud_platform 改为 243_ollama_cloud_channel_monitor_provider: 只放宽渠道监控 provider CHECK,不再重建 #7618 删除的两个平台 CHECK(否则 command_code/cline 写入失败)。 - compositeOwnershipQueryPlatforms 改为平台清单派生,修复 command_code/cline 账号在组合分组归属扫描中被漏掉。 - 连接测试:ollama_cloud 专属路径先于按入站协议分流的通用分支。 - nativeAnthropicMessagesURL:版本感知拼接对 ollama_cloud 生效,国产厂商保持朴素拼接。 - GetOpenAIBaseURL 保留多协议账号不回落 api.openai.com 的护栏。 - 前端:ollama_cloud 保留专属表单(双额度模式 + 月度信用额度),从通用表单与 通用平台按钮中排除;端点常量改读平台清单;配额弹窗/设置页保留未知平台行护栏。 - 重新生成 platformCatalog.builtin.json;同步相关测试基准。
27 lines
395 B
Go
27 lines
395 B
Go
package model
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAllPlatformsIncludesEveryConcretePlatform(t *testing.T) {
|
|
require.ElementsMatch(t, []string{
|
|
"anthropic",
|
|
"openai",
|
|
"gemini",
|
|
"antigravity",
|
|
"grok",
|
|
"kimi",
|
|
"zhipu",
|
|
"deepseek",
|
|
"minimax",
|
|
"opencode_go",
|
|
"typesafe",
|
|
"command_code",
|
|
"cline",
|
|
"ollama_cloud",
|
|
}, AllPlatforms())
|
|
}
|