chore: 初始化仓库,导入项目基线代码
Academy v0.8.3 完整代码基线:Go 后端(internal/cmd/cli/mcp-server/docreader)、 Vue 前端(frontend)、数据库迁移(migrations)、部署编排(docker/helm/deploy)与文档。 今日开发的培训推送管理改动随后单独提交。
This commit is contained in:
commit
7ec21f35b0
5767 files changed
+1436788
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package rerank
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"academy/internal/models/providers"
|
||||
modelruntime "academy/internal/models/runtime"
|
||||
)
|
||||
|
||||
// TestDetectByURLSeesVendorCatalog guards the blank import of
|
||||
// runtime composition.
|
||||
//
|
||||
// modelruntime.DetectByURL returns "generic" for every URL while the catalog is
|
||||
// empty. Without the vendor packages linked in, a stored rerank row that
|
||||
// carries no provider id resolves to the generic Cohere client: LKEAP and
|
||||
// Volcengine lose their signed SDK clients and Aliyun its native protocol.
|
||||
func TestDetectByURLSeesVendorCatalog(t *testing.T) {
|
||||
cases := map[string]string{
|
||||
"https://api.lkeap.cloud.tencent.com/v1": "lkeap",
|
||||
"https://api-knowledgebase.mlp.cn-beijing.volces.com": "volcengine",
|
||||
"https://api.jina.ai/v1": "jina",
|
||||
"https://open.bigmodel.cn/api/paas/v4": "zhipu",
|
||||
"https://dashscope.aliyuncs.com/compatible-mode/v1": "aliyun",
|
||||
"https://some-self-hosted-gateway.example.internal/v1": providers.GenericID,
|
||||
}
|
||||
for baseURL, want := range cases {
|
||||
if got := modelruntime.DetectByURL(baseURL); got != want {
|
||||
t.Errorf("DetectByURL(%q) = %q, want %q", baseURL, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user