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,34 @@
|
||||
// Package providers registers Cohere's hosted text rerank API.
|
||||
// https://docs.cohere.com/v2/reference/rerank
|
||||
package providers
|
||||
|
||||
import (
|
||||
"academy/internal/models/api"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// CohereID identifies Cohere in stored model configurations.
|
||||
const CohereID = "cohere"
|
||||
|
||||
// CohereRerankBaseURL serves Cohere's v2 rerank API.
|
||||
const CohereRerankBaseURL = "https://api.cohere.com/v2"
|
||||
|
||||
func newCohereProvider() *Definition {
|
||||
return &Definition{
|
||||
ID: CohereID, Name: "Cohere",
|
||||
Description: "Cohere text reranking (rerank-v4.0-pro, rerank-v4.0-fast, rerank-v3.5)",
|
||||
Website: "https://cohere.com", Icon: genericIcon,
|
||||
API: api.APIOpenAICompletions, RerankAPI: api.RerankCohere,
|
||||
Order: 57, RequiresAuth: true, Auth: AuthBearer,
|
||||
URLPatterns: []string{"api.cohere.com"},
|
||||
DefaultBaseURLs: map[types.ModelType]string{types.ModelTypeRerank: CohereRerankBaseURL},
|
||||
ModelTypes: []types.ModelType{types.ModelTypeRerank},
|
||||
Compat: VendorCompat{Rerank: api.RerankCompat{
|
||||
// The reference recommends no more than 1,000 documents per
|
||||
// request; use that as our batch size, not a claimed hard limit.
|
||||
// Omitting top_n returns all results. v2 does not need echoed
|
||||
// documents: the caller restores their text by result index.
|
||||
MaxDocuments: api.Ptr(1000),
|
||||
}},
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user