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:
+5
-5
@@ -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
|
||||
```
|
||||
|
||||
### 示例:创建知识库并上传文件
|
||||
|
||||
+5
-5
@@ -9,7 +9,7 @@ The client includes the following main functional modules:
|
||||
1. **Session Management**: Create, retrieve, update, and delete sessions
|
||||
2. **Knowledge Base Management**: Create, retrieve, update, and delete knowledge bases
|
||||
3. **Knowledge Management**: Add, retrieve, and delete knowledge content
|
||||
4. **Tenant Management**: CRUD operations for tenants
|
||||
4. **Workspace Management**: CRUD operations for workspaces
|
||||
5. **Knowledge Q&A**: Supports regular Q&A and streaming Q&A
|
||||
6. **Chunk Management**: Query, update, and delete knowledge chunks
|
||||
7. **Message Management**: Retrieve and delete session messages
|
||||
@@ -35,9 +35,9 @@ apiClient := client.NewClient(
|
||||
)
|
||||
```
|
||||
|
||||
### Tenant Configuration
|
||||
### Workspace Configuration
|
||||
|
||||
You can set a default tenant with `WithTenantID`; the client will automatically send the `X-Tenant-ID` header:
|
||||
You can set a default workspace with `WithTenantID`; the client will automatically send the `X-Tenant-ID` header:
|
||||
|
||||
```go
|
||||
tenantID := uint64(10000)
|
||||
@@ -48,11 +48,11 @@ apiClient := client.NewClient(
|
||||
)
|
||||
```
|
||||
|
||||
If a single request needs a different tenant, set `TenantID` in the request context. The value can be a `uint64`, `*uint64`, or a numeric string, and it will take precedence over the client default:
|
||||
If a single request needs a different workspace, set `TenantID` in the request context. The value can be a `uint64`, `*uint64`, or a numeric string, and it will take precedence over the client default:
|
||||
|
||||
```go
|
||||
ctx := context.WithValue(context.Background(), "TenantID", uint64(10000))
|
||||
// Pass ctx into any client method to switch to tenant 10000 for that request
|
||||
// Pass ctx into any client method to switch to workspace 10000 for that request
|
||||
```
|
||||
|
||||
### Example: Create Knowledge Base and Upload File
|
||||
|
||||
Reference in New Issue
Block a user