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

+2 -2
View File
@@ -1,6 +1,6 @@
# WeKnora HTTP 客户端
# Academy HTTP 客户端
这个包提供了与WeKnora服务进行交互的客户端库,支持所有基于HTTP的接口调用,使其他模块更方便地集成WeKnora服务,无需直接编写HTTP请求代码。
这个包提供了与Academy服务进行交互的客户端库,支持所有基于HTTP的接口调用,使其他模块更方便地集成Academy服务,无需直接编写HTTP请求代码。
## 主要功能
+2 -2
View File
@@ -1,6 +1,6 @@
# WeKnora HTTP Client
# Academy HTTP Client
This package provides a client library for interacting with WeKnora services, supporting all HTTP-based interface calls, making it easier for other modules to integrate with WeKnora services without having to write HTTP request code directly.
This package provides a client library for interacting with Academy services, supporting all HTTP-based interface calls, making it easier for other modules to integrate with Academy services without having to write HTTP request code directly.
## Main Features
+1 -1
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// The Agent related interfaces are used to manage agent-based question-answering
package client
+1 -1
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// The Agent management interfaces are used to manage custom agents (CRUD operations)
package client
+3 -3
View File
@@ -122,7 +122,7 @@ type RefreshTokenResponse struct {
// Login authenticates with email + password and returns the JWT access token,
// refresh token, and principal info. Maps to POST /api/v1/auth/login.
//
// Used by `weknora auth login`.
// Used by `academy auth login`.
func (c *Client) Login(ctx context.Context, req LoginRequest) (*LoginResponse, error) {
resp, err := c.doRequest(ctx, http.MethodPost, "/api/v1/auth/login", req, nil)
if err != nil {
@@ -165,7 +165,7 @@ func (c *Client) SwitchTenant(ctx context.Context, req SwitchTenantRequest) (*Lo
// tenant projection. Maps to GET /api/v1/auth/me; the bearer token must
// already be set on the client (use WithBearerToken).
//
// Used by `weknora auth status` and `weknora whoami`.
// Used by `academy auth status` and `academy whoami`.
func (c *Client) GetCurrentUser(ctx context.Context) (*CurrentUserResponse, error) {
resp, err := c.doRequest(ctx, http.MethodGet, "/api/v1/auth/me", nil, nil)
if err != nil {
@@ -181,7 +181,7 @@ func (c *Client) GetCurrentUser(ctx context.Context) (*CurrentUserResponse, erro
// RefreshToken renews the JWT access token using a refresh token.
// Maps to POST /api/v1/auth/refresh.
//
// Callers (`weknora auth refresh`) read the refresh token from secrets,
// Callers (`academy auth refresh`) read the refresh token from secrets,
// invoke this method, and persist both new tokens. The SDK does not touch
// the secrets store directly — it stays a transport-only layer.
func (c *Client) RefreshToken(ctx context.Context, refreshToken string) (*RefreshTokenResponse, error) {
+1 -1
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// This package encapsulates CRUD operations for server resources and provides a friendly interface for callers
// The Chunk related interfaces are used to manage document chunks in the knowledge base
package client
+5 -5
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// This package encapsulates CRUD operations for server resources and provides a friendly interface for callers
package client
@@ -14,7 +14,7 @@ import (
"time"
)
// Client is the client for interacting with the WeKnora service.
// Client is the client for interacting with the Academy service.
//
// Authentication uses one of two credential kinds:
// - API key (long-lived, set via X-API-Key) — see WithAPIKey
@@ -214,18 +214,18 @@ func (c *Client) applyAuthHeaders(ctx context.Context, req *http.Request) {
}
}
// Raw performs a raw HTTP request against the WeKnora API with the client's
// Raw performs a raw HTTP request against the Academy API with the client's
// auth headers, X-Request-ID, and X-Tenant-ID injection applied.
//
// Experimental: this method is intended for one-off integrations and the
// `weknora api` CLI passthrough. The signature, return type, and behavior may
// `academy api` CLI passthrough. The signature, return type, and behavior may
// change in any minor version. Prefer typed methods (ListKnowledgeBases,
// GetKnowledgeBase, etc.) when they exist.
func (c *Client) Raw(ctx context.Context, method, path string, body interface{}) (*http.Response, error) {
return c.doRequest(ctx, method, path, body, nil)
}
// APIError is a typed non-2xx HTTP response from the WeKnora API. Recover it
// APIError is a typed non-2xx HTTP response from the Academy API. Recover it
// with errors.As to branch on the HTTP status or the server's structured error
// code without parsing the Error() string:
//
+1 -1
View File
@@ -124,7 +124,7 @@ func (c *Client) DeleteMySkillEnvVar(ctx context.Context, skillID, name string)
// SetMySandboxEnvVar stores the caller's own value for one config-wide
// variable. Unlike a skill variable the name is free-form, and the value is
// injected into every skill script and shell command this caller runs on that
// sandbox config. Names starting with WEKNORA_, and names the sandbox relies on
// sandbox config. Names starting with ACADEMY_, and names the sandbox relies on
// such as PATH, are refused.
func (c *Client) SetMySandboxEnvVar(ctx context.Context, configID, name, value string) error {
if configID == "" {
+1 -1
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// The Evaluation related interfaces are used for starting and retrieving model evaluation task results
// Evaluation tasks can be used to measure model performance and
// compare different embedding models, chat models, and reranking models
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"time"
)
// ExampleUsage demonstrates the complete usage flow of the WeKnora client, including:
// ExampleUsage demonstrates the complete usage flow of the Academy client, including:
// - Creating a client instance
// - Creating a knowledge base
// - Uploading knowledge files
+1 -1
View File
@@ -1,3 +1,3 @@
module github.com/Tencent/WeKnora/client
module academy/client
go 1.24.2
+2 -2
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// The Knowledge related interfaces are used to manage knowledge entries in the knowledge base
// Knowledge entries can be created from local files, web URLs, or directly from text content
// They can also be retrieved, deleted, and downloaded as files
@@ -535,7 +535,7 @@ func (c *Client) DownloadKnowledgeFile(ctx context.Context, knowledgeID string,
// empty when the server didn't send one) and a streaming reader for the
// body. Callers MUST Close the returned reader.
//
// Used by `weknora doc download` so the CLI can inspect the filename
// Used by `academy doc download` so the CLI can inspect the filename
// before opening the destination file — avoids streaming the full body
// to a temp file just to discover the request would have been rejected
// (overwrite without --force, missing --out for unnamed downloads, etc.).
+1 -1
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// The KnowledgeBase related interfaces are used to manage knowledge bases
// Knowledge bases are collections of knowledge entries that can be used for question-answering
// They can also be searched and queried using hybrid search
+1 -1
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// The Message related interfaces are used to manage messages in a session
// Messages can be created, retrieved, deleted, and queried
package client
+1 -1
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// The Model related interfaces are used to manage models for different tasks
// Models can be created, retrieved, updated, deleted, and queried
package client
+1 -1
View File
@@ -12,7 +12,7 @@ const (
// bytes through the authenticated /files proxy.
ResourceURLModeHandle ResourceURLMode = "handle"
// ResourceURLModePublic returns time-limited HTTP(S) URLs loadable without
// WeKnora credentials.
// Academy credentials.
ResourceURLModePublic ResourceURLMode = "public"
)
+1 -1
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// The Session related interfaces are used to manage sessions for question-answering
// Sessions can be created, retrieved, updated, deleted, and queried
// They can also be used to generate titles for sessions
+2 -2
View File
@@ -1,4 +1,4 @@
// Package client provides the implementation for interacting with the WeKnora API
// Package client provides the implementation for interacting with the Academy API
// The Tenant related interfaces are used to manage tenants in the system
// Tenants can be created, retrieved, updated, deleted, and queried
// They can also be used to manage retriever engines for different tasks
@@ -43,7 +43,7 @@ type Tenant struct {
// Storage used (Bytes)
StorageUsed int64 `yaml:"storage_used" json:"storage_used" gorm:"default:0"`
// APIKey is only populated by CreateTenant when the server has
// tenant.auto_create_api_key (env WEKNORA_TENANT_AUTO_CREATE_API_KEY)
// tenant.auto_create_api_key (env ACADEMY_TENANT_AUTO_CREATE_API_KEY)
// enabled: it carries the plaintext token of an auto-created full_access
// key. Empty otherwise. Save it on receipt — it is never returned again.
APIKey string `yaml:"api_key,omitempty" json:"api_key,omitempty"`