refactor(terminology): rename user-facing tenant labels to workspace

Align product copy, API docs, Swagger descriptions, and i18n strings
with workspace terminology while keeping internal tenant identifiers
and headers unchanged for API compatibility.
This commit is contained in:
wizardchen
2026-07-14 16:13:49 +08:00
committed by lyingbug
parent e1572b71b9
commit 41975abcc5
161 changed files with 1865 additions and 1770 deletions
+5 -5
View File
@@ -9,7 +9,7 @@
1. **会话管理**:创建、获取、更新和删除会话
2. **知识库管理**:创建、获取、更新和删除知识库
3. **知识管理**:添加、获取和删除知识内容
4. **租户管理**:租户的CRUD操作
4. **空间管理**:空间的CRUD操作
5. **知识问答**:支持普通问答和流式问答
6. **Agent问答**:支持基于Agent的智能问答,包含思考过程、工具调用和反思
7. **分块管理**:查询、更新和删除知识分块
@@ -35,9 +35,9 @@ apiClient := client.NewClient(
)
```
### 租户配置
### 空间配置
客户端支持通过 `WithTenantID` 设置默认租户,请求时会自动携带 `X-Tenant-ID` 请求头:
客户端支持通过 `WithTenantID` 设置默认空间,请求时会自动携带 `X-Tenant-ID` 请求头:
```go
tenantID := uint64(10000)
@@ -48,11 +48,11 @@ apiClient := client.NewClient(
)
```
如果某个请求需要临时切换租户,可以在 `context` 中设置 `TenantID`,值可以是 `uint64`、`*uint64` 或字符串形式的数字,客户端会优先使用该值:
如果某个请求需要临时切换空间,可以在 `context` 中设置 `TenantID`,值可以是 `uint64`、`*uint64` 或字符串形式的数字,客户端会优先使用该值:
```go
ctx := context.WithValue(context.Background(), "TenantID", uint64(10000))
// 调用任意客户端方法时传入 ctx,即可切换到租户 10000
// 调用任意客户端方法时传入 ctx,即可切换到空间 10000
```
### 示例:创建知识库并上传文件