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

- 全量替换代码/配置/文档中的项目名(保留上游 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:
runny committed 2026-11-13 20:52:51 +08:00
1 parent 9097ee699d
commit 9058149576
3136 files changed
+18018 -18004

No files matched your search

@@ -1,15 +1,15 @@
// Package providers registers the WeKnora managed model service.
// Package providers registers the Academy managed model service.
//
// unverified: this is a first-party endpoint with no published API
// reference — https://weknora.weixin.qq.com/docs documents the WeKnora
// reference — https://weknora.weixin.qq.com/docs documents the Academy
// product, not the model gateway's wire protocol. Every fact below is taken
// from this repository's own clients rather than from vendor documentation,
// and is cited accordingly:
// - one host serves chat, embedding, rerank and VLM. Chat completions and
// VLM live at /api/v1/chat/completions rather than the OpenAI default
// path (internal/models/vlm/weknoracloud.go), embeddings at
// /api/v1/embeddings (internal/models/embedding/weknoracloud.go) and
// rerank at /api/v1/rerank (internal/models/rerank/weknoracloud.go).
// path (internal/models/vlm/academycloud.go), embeddings at
// /api/v1/embeddings (internal/models/embedding/academycloud.go) and
// rerank at /api/v1/rerank (internal/models/rerank/academycloud.go).
// Only the chat path goes through the Endpoint hook; the other three
// clients build their own URLs;
// - requests are signed with the tenant's AppID / AppSecret through
@@ -19,13 +19,13 @@
// parameter string including the MD5 of the body. There is no bearer
// key, hence the AuthSigned style and a fresh request id per call;
// - credentials are provisioned through the dedicated initialization
// endpoint (internal/handler/weknoracloud.go), so Validate performs no
// endpoint (internal/handler/academycloud.go), so Validate performs no
// key check here;
// - the model names the product provisions are chat, embedding, rerank and
// vlm (frontend/src/utils/weknoraCloudModels.ts). models.json is left
// vlm (frontend/src/utils/academyCloudModels.ts). models.json is left
// empty on purpose: no context window, output cap or price is published
// for them, and the embedding dimension is probed at runtime through
// GET /api/v1/models/weknoracloud/status.
// GET /api/v1/models/academycloud/status.
//
// unverified: SupportsMultiContent is kept false so chat messages are
// flattened to plain text, but nothing documents that restriction and the
@@ -42,41 +42,41 @@ import (
"net/http"
"strings"
"github.com/Tencent/WeKnora/internal/models/api"
modelutils "github.com/Tencent/WeKnora/internal/models/utils"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
modelutils "academy/internal/models/utils"
"academy/internal/types"
"github.com/google/uuid"
)
//go:embed assets/weknoracloud.svg
var weKnoraCloudIcon []byte
//go:embed assets/academycloud.svg
var academyCloudIcon []byte
// WeKnoraCloudID is the provider identifier stored on model rows.
const WeKnoraCloudID = "weknoracloud"
// AcademyCloudID is the provider identifier stored on model rows.
const AcademyCloudID = "academycloud"
// WeKnoraCloudBaseURL is the single service entry point; per-capability paths are
// AcademyCloudBaseURL is the single service entry point; per-capability paths are
// appended by the Endpoint hook and the embedding / rerank clients.
const WeKnoraCloudBaseURL = "https://weknora.weixin.qq.com"
const AcademyCloudBaseURL = "https://weknora.weixin.qq.com"
func newWeKnoraCloudProvider() *Definition {
func newAcademyCloudProvider() *Definition {
return &Definition{
ID: WeKnoraCloudID,
Name: "WeKnora Cloud",
Names: map[string]string{"zh-CN": "WeKnora 云服务"},
Description: "WeKnora managed models: chat, embedding, rerank, vlm",
Descriptions: map[string]string{"zh-CN": "WeKnora云服务,模型:chat, embedding, rerank, vlm"},
Website: WeKnoraCloudBaseURL,
Icon: weKnoraCloudIcon,
ID: AcademyCloudID,
Name: "Academy Cloud",
Names: map[string]string{"zh-CN": "Academy 云服务"},
Description: "Academy managed models: chat, embedding, rerank, vlm",
Descriptions: map[string]string{"zh-CN": "Academy云服务,模型:chat, embedding, rerank, vlm"},
Website: AcademyCloudBaseURL,
Icon: academyCloudIcon,
API: api.APIOpenAICompletions,
Order: 1,
RequiresAuth: true,
Auth: AuthSigned,
URLPatterns: []string{"weknora.weixin.qq.com"},
DefaultBaseURLs: map[types.ModelType]string{
types.ModelTypeKnowledgeQA: WeKnoraCloudBaseURL,
types.ModelTypeEmbedding: WeKnoraCloudBaseURL,
types.ModelTypeRerank: WeKnoraCloudBaseURL,
types.ModelTypeVLLM: WeKnoraCloudBaseURL,
types.ModelTypeKnowledgeQA: AcademyCloudBaseURL,
types.ModelTypeEmbedding: AcademyCloudBaseURL,
types.ModelTypeRerank: AcademyCloudBaseURL,
types.ModelTypeVLLM: AcademyCloudBaseURL,
},
ModelTypes: []types.ModelType{
types.ModelTypeKnowledgeQA,
+2 -2
View File
@@ -80,8 +80,8 @@ import (
_ "embed"
"strings"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/aliyun.svg
+2 -2
View File
@@ -46,8 +46,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/anthropic.svg
File renamed without changes.

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 265 B

+3 -3
View File
@@ -82,9 +82,9 @@ import (
"net/url"
"strings"
"github.com/Tencent/WeKnora/internal/models"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/azure_openai.svg
+2 -2
View File
@@ -1,6 +1,6 @@
package providers
import "github.com/Tencent/WeKnora/internal/models/internal/configcopy"
import "academy/internal/models/internal/configcopy"
// Builtins returns independent provider definitions without registering global state.
func Builtins() []*Definition {
@@ -33,7 +33,7 @@ func Builtins() []*Definition {
newRequestyProvider(),
newSiliconflowProvider(),
newVolcengineProvider(),
newWeKnoraCloudProvider(),
newAcademyCloudProvider(),
newZhipuProvider(),
})
}
+2 -2
View File
@@ -3,8 +3,8 @@
package providers
import (
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
// CohereID identifies Cohere in stored model configurations.
+4 -4
View File
@@ -3,10 +3,10 @@ package providers_test
import (
"testing"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/models/providers"
modelruntime "github.com/Tencent/WeKnora/internal/models/runtime"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/models/providers"
modelruntime "academy/internal/models/runtime"
"academy/internal/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
+1 -1
View File
@@ -1,6 +1,6 @@
package providers
import "github.com/Tencent/WeKnora/internal/models/api"
import "academy/internal/models/api"
// VendorCompat carries a vendor's defaults for every protocol it may speak.
type VendorCompat struct {
+2 -2
View File
@@ -53,8 +53,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/deepseek.svg
+4 -4
View File
@@ -5,9 +5,9 @@ import (
"fmt"
"strings"
"github.com/Tencent/WeKnora/internal/models"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models"
"academy/internal/models/api"
"academy/internal/types"
)
// AuthStyle names how a vendor expects credentials.
@@ -24,7 +24,7 @@ const (
AuthGoogleAPIKey AuthStyle = "x-goog-api-key"
// AuthNone sends nothing (local deployments).
AuthNone AuthStyle = "none"
// AuthSigned delegates to the vendor's Signer hook (WeKnora Cloud).
// AuthSigned delegates to the vendor's Signer hook (Academy Cloud).
AuthSigned AuthStyle = "signed"
)
+2 -2
View File
@@ -49,8 +49,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/gemini.svg
+3 -3
View File
@@ -36,9 +36,9 @@ import (
"fmt"
"strings"
"github.com/Tencent/WeKnora/internal/models"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/generic.svg
+3 -3
View File
@@ -34,9 +34,9 @@ import (
"fmt"
"strings"
"github.com/Tencent/WeKnora/internal/models"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/gpustack.svg
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"fmt"
"strings"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
// HuggingFaceTEIID is the provider ID for self-hosted TEI rerank models.
+2 -2
View File
@@ -57,8 +57,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/hunyuan.svg
+2 -2
View File
@@ -25,8 +25,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/jina.svg
+3 -3
View File
@@ -31,9 +31,9 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/litellm.svg
+2 -2
View File
@@ -44,8 +44,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/lkeap.svg
+2 -2
View File
@@ -47,8 +47,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/longcat.svg
+2 -2
View File
@@ -38,8 +38,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/mimo.svg
+2 -2
View File
@@ -48,8 +48,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/minimax.svg
+2 -2
View File
@@ -37,8 +37,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/modelscope.svg
+2 -2
View File
@@ -46,8 +46,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/moonshot.svg
+2 -2
View File
@@ -32,8 +32,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/novita.svg
+2 -2
View File
@@ -55,8 +55,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/nvidia.svg
+3 -3
View File
@@ -52,9 +52,9 @@ import (
"net/url"
"strings"
"github.com/Tencent/WeKnora/internal/models"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/openai.svg
+2 -2
View File
@@ -33,8 +33,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/openrouter.svg
+2 -2
View File
@@ -5,8 +5,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/pinecone.svg
+11 -11
View File
@@ -6,17 +6,17 @@ import (
"strings"
"testing"
"github.com/Tencent/WeKnora/internal/models"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/models/api/anthropicmessages"
"github.com/Tencent/WeKnora/internal/models/providers"
modelruntime "github.com/Tencent/WeKnora/internal/models/runtime"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models"
"academy/internal/models/api"
"academy/internal/models/api/anthropicmessages"
"academy/internal/models/providers"
modelruntime "academy/internal/models/runtime"
"academy/internal/types"
)
// expectedIDs is every built-in vendor this package links.
var expectedIDs = []string{
"generic", "weknoracloud", "huggingface_tei",
"generic", "academycloud", "huggingface_tei",
"aliyun", "zhipu", "volcengine", "hunyuan", "siliconflow", "deepseek",
"minimax", "moonshot", "mimo", "modelscope", "qianfan", "qiniu", "longcat", "lkeap",
"openai", "azure_openai", "anthropic", "gemini",
@@ -499,18 +499,18 @@ func TestHooks(t *testing.T) {
t.Errorf("azure legacy embedding api-version = %q", q["api-version"])
}
wk, _ := modelruntime.Get("weknoracloud")
wk, _ := modelruntime.Get("academycloud")
u, _ = wk.Endpoint(providers.EndpointRequest{
BaseURL: "https://weknora.weixin.qq.com/", ModelType: types.ModelTypeKnowledgeQA,
})
if u != "https://weknora.weixin.qq.com/api/v1/chat/completions" {
t.Errorf("weknoracloud endpoint = %q", u)
t.Errorf("academycloud endpoint = %q", u)
}
if wk.Auth != providers.AuthSigned || wk.Signer == nil {
t.Error("weknoracloud should use a signer")
t.Error("academycloud should use a signer")
}
if err := wk.ValidateConfig(&providers.Config{}); err != nil {
t.Errorf("weknoracloud validate should pass without key: %v", err)
t.Errorf("academycloud validate should pass without key: %v", err)
}
generic, _ := modelruntime.Get("generic")
+2 -2
View File
@@ -58,8 +58,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/qianfan.svg
+2 -2
View File
@@ -54,8 +54,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/qiniu.svg
+2 -2
View File
@@ -38,8 +38,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/requesty.svg
+2 -2
View File
@@ -32,8 +32,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/siliconflow.svg
+2 -2
View File
@@ -78,8 +78,8 @@ import (
_ "embed"
"strings"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/volcengine.svg
+2 -2
View File
@@ -56,8 +56,8 @@ package providers
import (
_ "embed"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/models/api"
"academy/internal/types"
)
//go:embed assets/zhipu.svg