refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名) - 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块) - docreader proto 描述符采用等长替换,保持序列化字节布局有效 - Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像 - 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
This commit is contained in:
1 parent
9097ee699d
commit
9058149576
3136 files changed
+18018
-18004
No files matched your search
@@ -8,18 +8,18 @@ import (
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
apperrors "github.com/Tencent/WeKnora/internal/errors"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/models/asr"
|
||||
"github.com/Tencent/WeKnora/internal/models/chat"
|
||||
"github.com/Tencent/WeKnora/internal/models/embedding"
|
||||
"github.com/Tencent/WeKnora/internal/models/providers"
|
||||
"github.com/Tencent/WeKnora/internal/models/rerank"
|
||||
"github.com/Tencent/WeKnora/internal/models/utils/ollama"
|
||||
"github.com/Tencent/WeKnora/internal/models/vlm"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
apperrors "academy/internal/errors"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/models/asr"
|
||||
"academy/internal/models/chat"
|
||||
"academy/internal/models/embedding"
|
||||
"academy/internal/models/providers"
|
||||
"academy/internal/models/rerank"
|
||||
"academy/internal/models/utils/ollama"
|
||||
"academy/internal/models/vlm"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
// ErrModelNotFound is returned when a model cannot be found in the repository
|
||||
@@ -66,13 +66,13 @@ func (s *modelService) decryptAppSecret(encrypted string) string {
|
||||
return encrypted
|
||||
}
|
||||
|
||||
// resolveWeKnoraCloudCredentials 为 WeKnoraCloud 厂商模型补全 AppID/AppSecret。
|
||||
// resolveAcademyCloudCredentials 为 AcademyCloud 厂商模型补全 AppID/AppSecret。
|
||||
// 当模型自身参数中未存储凭证时,自动从空间配置中获取(SaveCredentials 保存的凭证)。
|
||||
func (s *modelService) resolveWeKnoraCloudCredentials(ctx context.Context, params *types.ModelParameters) (appID, appSecret string) {
|
||||
func (s *modelService) resolveAcademyCloudCredentials(ctx context.Context, params *types.ModelParameters) (appID, appSecret string) {
|
||||
appID = params.AppID
|
||||
appSecret = s.decryptAppSecret(params.AppSecret)
|
||||
|
||||
if params.Provider != providers.WeKnoraCloudID {
|
||||
if params.Provider != providers.AcademyCloudID {
|
||||
return
|
||||
}
|
||||
if appID != "" && appSecret != "" {
|
||||
@@ -82,7 +82,7 @@ func (s *modelService) resolveWeKnoraCloudCredentials(ctx context.Context, param
|
||||
if s.tenantService == nil {
|
||||
return
|
||||
}
|
||||
creds := s.tenantService.GetWeKnoraCloudCredentials(ctx)
|
||||
creds := s.tenantService.GetAcademyCloudCredentials(ctx)
|
||||
if creds == nil {
|
||||
return
|
||||
}
|
||||
@@ -585,7 +585,7 @@ func (s *modelService) GetEmbeddingModel(ctx context.Context, modelId string) (e
|
||||
|
||||
logger.Infof(ctx, "Getting embedding model: %s, source: %s", model.Name, model.Source)
|
||||
|
||||
appID, appSecret := s.resolveWeKnoraCloudCredentials(ctx, &model.Parameters)
|
||||
appID, appSecret := s.resolveAcademyCloudCredentials(ctx, &model.Parameters)
|
||||
|
||||
embedder, err := embedding.NewEmbedder(embedding.ConfigFromModel(model, appID, appSecret), s.pooler, s.ollamaService)
|
||||
if err != nil {
|
||||
@@ -632,7 +632,7 @@ func (s *modelService) GetEmbeddingModelForTenant(ctx context.Context, modelId s
|
||||
|
||||
logger.Infof(ctx, "Getting cross-tenant embedding model: %s, source: %s, tenant: %d", model.Name, model.Source, tenantID)
|
||||
|
||||
appID, appSecret := s.resolveWeKnoraCloudCredentials(ctx, &model.Parameters)
|
||||
appID, appSecret := s.resolveAcademyCloudCredentials(ctx, &model.Parameters)
|
||||
|
||||
embedder, err := embedding.NewEmbedder(embedding.ConfigFromModel(model, appID, appSecret), s.pooler, s.ollamaService)
|
||||
if err != nil {
|
||||
@@ -662,7 +662,7 @@ func (s *modelService) GetRerankModel(ctx context.Context, modelId string) (rera
|
||||
|
||||
logger.Infof(ctx, "Getting rerank model: %s, source: %s", model.Name, model.Source)
|
||||
|
||||
appID, appSecret := s.resolveWeKnoraCloudCredentials(ctx, &model.Parameters)
|
||||
appID, appSecret := s.resolveAcademyCloudCredentials(ctx, &model.Parameters)
|
||||
|
||||
reranker, err := rerank.NewReranker(rerank.ConfigFromModel(model, appID, appSecret))
|
||||
if err != nil {
|
||||
@@ -705,7 +705,7 @@ func (s *modelService) GetChatModel(ctx context.Context, modelId string) (chat.C
|
||||
|
||||
logger.Infof(ctx, "Getting chat model: %s, source: %s", model.Name, model.Source)
|
||||
|
||||
appID, appSecret := s.resolveWeKnoraCloudCredentials(ctx, &model.Parameters)
|
||||
appID, appSecret := s.resolveAcademyCloudCredentials(ctx, &model.Parameters)
|
||||
|
||||
chatModel, err := chat.NewChat(chat.ConfigFromModel(model, appID, appSecret), s.ollamaService)
|
||||
if err != nil {
|
||||
@@ -742,7 +742,7 @@ func (s *modelService) GetVLMModel(ctx context.Context, modelId string) (vlm.VLM
|
||||
|
||||
logger.Infof(ctx, "Getting VLM model: %s, source: %s", model.Name, model.Source)
|
||||
|
||||
appID, appSecret := s.resolveWeKnoraCloudCredentials(ctx, &model.Parameters)
|
||||
appID, appSecret := s.resolveAcademyCloudCredentials(ctx, &model.Parameters)
|
||||
|
||||
vlmModel, err := vlm.NewVLM(vlm.ConfigFromModel(model, appID, appSecret), s.ollamaService)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user