Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

feat(system): remove MinIO list buckets API and UI dependencies

wizardchen491c324197c7
diff --git a/client/system.go b/client/system.go
index b3377a8b9..2e26c5f36 100644
--- a/client/system.go
+++ b/client/system.go
@@ -57,13 +57,6 @@ type StorageCheckResponse struct {
BucketCreated bool `json:"bucket_created,omitempty"`
}
-// MinioBucketInfo represents MinIO bucket information
-type MinioBucketInfo struct {
- Name string `json:"name"`
- Policy string `json:"policy"`
- CreatedAt string `json:"created_at,omitempty"`
-}
-
// GetSystemInfo gets system version and configuration information
func (c *Client) GetSystemInfo(ctx context.Context) (*SystemInfo, error) {
resp, err := c.doRequest(ctx, http.MethodGet, "/api/v1/system/info", nil, nil)
@@ -154,21 +147,3 @@ func (c *Client) CheckStorageEngine(ctx context.Context, req *StorageCheckReques
}
return result.Data, nil
}
-
-// ListMinioBuckets lists all MinIO buckets with their access policies
-func (c *Client) ListMinioBuckets(ctx context.Context) ([]MinioBucketInfo, error) {
- resp, err := c.doRequest(ctx, http.MethodGet, "/api/v1/system/minio/buckets", nil, nil)
- if err != nil {
- return nil, err
- }
- var result struct {
- Code int `json:"code"`
- Data struct {
- Buckets []MinioBucketInfo `json:"buckets"`
- } `json:"data"`
- }
- if err := parseResponse(resp, &result); err != nil {
- return nil, err
- }
- return result.Data.Buckets, nil
-}
diff --git a/docs/docs.go b/docs/docs.go
index 601fe3906..8e7bae98c 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -51,7 +51,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -83,7 +83,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.CreateAgentRequest"
+ "$ref": "#/definitions/handler.CreateAgentRequest"
}
}
],
@@ -98,7 +98,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -177,13 +177,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -222,7 +222,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateAgentRequest"
+ "$ref": "#/definitions/handler.UpdateAgentRequest"
}
}
],
@@ -237,13 +237,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "无法修改内置智能体",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -288,19 +288,19 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "无法删除内置智能体",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -347,13 +347,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -418,13 +418,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -455,7 +455,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
}
},
@@ -489,7 +489,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
}
],
@@ -497,7 +497,7 @@ const docTemplate = `{
"201": {
"description": "Created",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
},
"400": {
@@ -535,7 +535,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ "$ref": "#/definitions/types.SyncLog"
}
},
"404": {
@@ -566,7 +566,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata"
+ "$ref": "#/definitions/datasource.ConnectorMetadata"
}
}
}
@@ -642,7 +642,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
},
"404": {
@@ -682,7 +682,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
}
],
@@ -690,7 +690,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
},
"400": {
@@ -772,7 +772,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ "$ref": "#/definitions/types.SyncLog"
}
}
},
@@ -851,7 +851,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Resource"
+ "$ref": "#/definitions/types.Resource"
}
}
},
@@ -925,7 +925,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ "$ref": "#/definitions/types.SyncLog"
}
},
"400": {
@@ -978,6 +978,35 @@ const docTemplate = `{
}
}
},
+ "/auth/auto-setup": {
+ "post": {
+ "description": "Lite 版专用:首次启动时自动创建默认用户和租户并返回令牌,后续启动直接签发令牌,免除手动注册/登录流程",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "自动初始化(Lite 桌面版)",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/types.LoginResponse"
+ }
+ },
+ "403": {
+ "description": "非 Lite 版本",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/auth/change-password": {
"post": {
"security": [
@@ -1026,7 +1055,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1052,7 +1081,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest"
+ "$ref": "#/definitions/types.LoginRequest"
}
}
],
@@ -1060,13 +1089,13 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
+ "$ref": "#/definitions/types.LoginResponse"
}
},
"401": {
"description": "认证失败",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1101,7 +1130,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1136,7 +1165,7 @@ const docTemplate = `{
"401": {
"description": "未授权",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1199,7 +1228,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse"
+ "$ref": "#/definitions/types.OIDCConfigResponse"
}
}
}
@@ -1231,19 +1260,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse"
+ "$ref": "#/definitions/types.OIDCAuthURLResponse"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "OIDC未启用",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1289,7 +1318,7 @@ const docTemplate = `{
"401": {
"description": "令牌无效",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1315,7 +1344,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest"
+ "$ref": "#/definitions/types.RegisterRequest"
}
}
],
@@ -1323,19 +1352,19 @@ const docTemplate = `{
"201": {
"description": "Created",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse"
+ "$ref": "#/definitions/types.RegisterResponse"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "注册功能已禁用",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1370,7 +1399,7 @@ const docTemplate = `{
"401": {
"description": "令牌无效",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1417,13 +1446,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "分块不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1484,13 +1513,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "分块不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1551,7 +1580,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1596,7 +1625,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1644,7 +1673,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateChunkRequest"
+ "$ref": "#/definitions/handler.UpdateChunkRequest"
}
}
],
@@ -1659,13 +1688,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "分块不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1717,13 +1746,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "分块不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1770,7 +1799,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1802,7 +1831,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.EvaluationRequest"
+ "$ref": "#/definitions/handler.EvaluationRequest"
}
}
],
@@ -1817,7 +1846,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1864,7 +1893,7 @@ const docTemplate = `{
"404": {
"description": "任务不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1898,7 +1927,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
+ "$ref": "#/definitions/handler.TextRelationExtractionRequest"
}
}
],
@@ -1913,7 +1942,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1971,7 +2000,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.FabriTextRequest"
+ "$ref": "#/definitions/handler.FabriTextRequest"
}
}
],
@@ -1986,7 +2015,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2042,7 +2071,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2089,7 +2118,7 @@ const docTemplate = `{
"404": {
"description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2128,7 +2157,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.KBModelConfigRequest"
+ "$ref": "#/definitions/handler.KBModelConfigRequest"
}
}
],
@@ -2143,13 +2172,62 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/models/asr/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查ASR模型",
+ "parameters": [
+ {
+ "description": "ASR检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2198,7 +2276,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2232,7 +2310,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ "$ref": "#/definitions/handler.RemoteModelCheckRequest"
}
}
],
@@ -2247,7 +2325,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2296,7 +2374,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2376,7 +2454,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2455,7 +2533,7 @@ const docTemplate = `{
"404": {
"description": "任务不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2493,7 +2571,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2550,7 +2628,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2604,7 +2682,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2674,7 +2752,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2706,7 +2784,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
+ "$ref": "#/definitions/types.KnowledgeBase"
}
}
],
@@ -2721,7 +2799,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2755,7 +2833,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseRequest"
+ "$ref": "#/definitions/handler.CopyKnowledgeBaseRequest"
}
}
],
@@ -2770,7 +2848,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2817,7 +2895,7 @@ const docTemplate = `{
"404": {
"description": "任务不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2870,13 +2948,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2915,7 +2993,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateKnowledgeBaseRequest"
+ "$ref": "#/definitions/handler.UpdateKnowledgeBaseRequest"
}
}
],
@@ -2930,7 +3008,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2975,7 +3053,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3058,7 +3136,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3097,7 +3175,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload"
+ "$ref": "#/definitions/types.FAQBatchUpsertPayload"
}
}
],
@@ -3112,7 +3190,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3174,7 +3252,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3220,7 +3298,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3261,7 +3339,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate"
+ "$ref": "#/definitions/types.FAQEntryFieldsBatchUpdate"
}
}
],
@@ -3276,7 +3354,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3332,7 +3410,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3386,13 +3464,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "条目不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3438,7 +3516,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ "$ref": "#/definitions/types.FAQEntryPayload"
}
}
],
@@ -3453,7 +3531,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3501,7 +3579,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.addSimilarQuestionsRequest"
+ "$ref": "#/definitions/handler.addSimilarQuestionsRequest"
}
}
],
@@ -3516,13 +3594,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "条目不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3563,7 +3641,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ "$ref": "#/definitions/types.FAQEntryPayload"
}
}
],
@@ -3578,7 +3656,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3619,7 +3697,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.updateLastFAQImportResultDisplayStatusRequest"
+ "$ref": "#/definitions/handler.updateLastFAQImportResultDisplayStatusRequest"
}
}
],
@@ -3634,13 +3712,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "知识库不存在或无导入记录",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3681,7 +3759,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest"
+ "$ref": "#/definitions/types.FAQSearchRequest"
}
}
],
@@ -3696,7 +3774,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3737,7 +3815,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams"
+ "$ref": "#/definitions/types.SearchParams"
}
}
],
@@ -3752,7 +3830,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3829,7 +3907,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3874,13 +3952,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "权限不足",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3952,7 +4030,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"409": {
@@ -4000,7 +4078,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ "$ref": "#/definitions/types.ManualKnowledgePayload"
}
}
],
@@ -4015,7 +4093,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4091,7 +4169,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"409": {
@@ -4145,7 +4223,7 @@ const docTemplate = `{
"404": {
"description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4179,7 +4257,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
+ "$ref": "#/definitions/types.ListSharesResponse"
}
}
}
@@ -4215,7 +4293,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest"
+ "$ref": "#/definitions/types.ShareKnowledgeBaseRequest"
}
}
],
@@ -4275,7 +4353,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest"
+ "$ref": "#/definitions/types.UpdateSharePermissionRequest"
}
}
],
@@ -4398,7 +4476,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4463,7 +4541,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4526,7 +4604,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4583,7 +4661,7 @@ const docTemplate = `{
"name": "body",
"in": "body",
"schema": {
- "$ref": "#/definitions/internal_handler.DeleteTagRequest"
+ "$ref": "#/definitions/handler.DeleteTagRequest"
}
}
],
@@ -4598,7 +4676,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4661,7 +4739,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4729,7 +4807,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4770,7 +4848,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ "$ref": "#/definitions/types.ManualKnowledgePayload"
}
}
],
@@ -4785,7 +4863,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4855,7 +4933,7 @@ const docTemplate = `{
"400": {
"description": "Invalid request",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4904,7 +4982,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4951,13 +5029,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "知识不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4996,7 +5074,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ "$ref": "#/definitions/types.Knowledge"
}
}
],
@@ -5011,7 +5089,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5056,7 +5134,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5102,7 +5180,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5151,7 +5229,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5198,13 +5276,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "权限不足",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5242,7 +5320,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5274,7 +5352,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService"
+ "$ref": "#/definitions/types.MCPService"
}
}
],
@@ -5289,7 +5367,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5336,7 +5414,7 @@ const docTemplate = `{
"404": {
"description": "服务不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5390,7 +5468,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5435,7 +5513,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5482,7 +5560,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5529,7 +5607,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5576,7 +5654,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5642,7 +5720,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.SearchMessagesRequest"
+ "$ref": "#/definitions/handler.SearchMessagesRequest"
}
}
],
@@ -5657,7 +5735,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5717,7 +5795,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5771,7 +5849,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5809,7 +5887,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5841,7 +5919,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.CreateModelRequest"
+ "$ref": "#/definitions/handler.CreateModelRequest"
}
}
],
@@ -5856,7 +5934,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5943,7 +6021,7 @@ const docTemplate = `{
"404": {
"description": "模型不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5982,7 +6060,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateModelRequest"
+ "$ref": "#/definitions/handler.UpdateModelRequest"
}
}
],
@@ -5997,7 +6075,7 @@ const docTemplate = `{
"404": {
"description": "模型不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -6042,7 +6120,7 @@ const docTemplate = `{
"404": {
"description": "模型不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -6067,7 +6145,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse"
+ "$ref": "#/definitions/types.ListOrganizationsResponse"
}
}
}
@@ -6096,7 +6174,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest"
+ "$ref": "#/definitions/types.CreateOrganizationRequest"
}
}
],
@@ -6142,7 +6220,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest"
+ "$ref": "#/definitions/types.JoinOrganizationRequest"
}
}
],
@@ -6188,7 +6266,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest"
+ "$ref": "#/definitions/types.JoinByOrganizationIDRequest"
}
}
],
@@ -6234,7 +6312,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest"
+ "$ref": "#/definitions/types.SubmitJoinRequestRequest"
}
}
],
@@ -6408,7 +6486,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest"
+ "$ref": "#/definitions/types.UpdateOrganizationRequest"
}
}
],
@@ -6497,7 +6575,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.InviteMemberRequest"
+ "$ref": "#/definitions/types.InviteMemberRequest"
}
}
],
@@ -6645,7 +6723,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest"
+ "$ref": "#/definitions/types.ReviewJoinRequestRequest"
}
}
],
@@ -6732,7 +6810,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListMembersResponse"
+ "$ref": "#/definitions/types.ListMembersResponse"
}
}
}
@@ -6777,7 +6855,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest"
+ "$ref": "#/definitions/types.UpdateMemberRoleRequest"
}
}
],
@@ -6873,7 +6951,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest"
+ "$ref": "#/definitions/types.RequestRoleUpgradeRequest"
}
}
],
@@ -7047,7 +7125,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
+ "$ref": "#/definitions/types.ListSharesResponse"
}
}
}
@@ -7099,7 +7177,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7131,7 +7209,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.CreateSessionRequest"
+ "$ref": "#/definitions/handler_session.CreateSessionRequest"
}
}
],
@@ -7146,7 +7224,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7180,7 +7258,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.batchDeleteRequest"
+ "$ref": "#/definitions/handler_session.batchDeleteRequest"
}
}
],
@@ -7195,7 +7273,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7229,7 +7307,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.SearchKnowledgeRequest"
+ "$ref": "#/definitions/handler_session.SearchKnowledgeRequest"
}
}
],
@@ -7244,7 +7322,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7291,7 +7369,7 @@ const docTemplate = `{
"404": {
"description": "会话不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7330,7 +7408,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Session"
+ "$ref": "#/definitions/types.Session"
}
}
],
@@ -7345,7 +7423,7 @@ const docTemplate = `{
"404": {
"description": "会话不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7390,7 +7468,7 @@ const docTemplate = `{
"404": {
"description": "会话不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7437,13 +7515,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "会话不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7484,7 +7562,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
+ "$ref": "#/definitions/handler_session.CreateKnowledgeQARequest"
}
}
],
@@ -7499,7 +7577,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7553,7 +7631,7 @@ const docTemplate = `{
"404": {
"description": "会话或消息不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7594,7 +7672,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
+ "$ref": "#/definitions/handler_session.CreateKnowledgeQARequest"
}
}
],
@@ -7609,7 +7687,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7650,7 +7728,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.StopSessionRequest"
+ "$ref": "#/definitions/handler_session.StopSessionRequest"
}
}
],
@@ -7665,7 +7743,7 @@ const docTemplate = `{
"404": {
"description": "会话或消息不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7706,7 +7784,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.GenerateTitleRequest"
+ "$ref": "#/definitions/handler_session.GenerateTitleRequest"
}
}
],
@@ -7721,7 +7799,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7785,7 +7863,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7838,44 +7916,7 @@ const docTemplate = `{
"200": {
"description": "系统信息",
"schema": {
- "$ref": "#/definitions/internal_handler.GetSystemInfoResponse"
- }
- }
- }
- }
- },
- "/system/minio/buckets": {
- "get": {
- "description": "获取所有 MinIO 存储桶及其访问权限",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "系统"
- ],
- "summary": "列出 MinIO 存储桶",
- "responses": {
- "200": {
- "description": "存储桶列表",
- "schema": {
- "$ref": "#/definitions/internal_handler.ListMinioBucketsResponse"
- }
- },
- "400": {
- "description": "MinIO 未启用",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "500": {
- "description": "服务器错误",
- "schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/handler.GetSystemInfoResponse"
}
}
}
@@ -7951,7 +7992,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.StorageCheckRequest"
+ "$ref": "#/definitions/handler.StorageCheckRequest"
}
}
],
@@ -7959,7 +8000,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/internal_handler.StorageCheckResponse"
+ "$ref": "#/definitions/handler.StorageCheckResponse"
}
}
}
@@ -7979,7 +8020,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/internal_handler.GetStorageEngineStatusResponse"
+ "$ref": "#/definitions/handler.GetStorageEngineStatusResponse"
}
}
}
@@ -8014,7 +8055,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8043,7 +8084,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "$ref": "#/definitions/types.Tenant"
}
}
],
@@ -8058,7 +8099,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8093,7 +8134,7 @@ const docTemplate = `{
"403": {
"description": "权限不足",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8131,7 +8172,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8169,7 +8210,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8207,7 +8248,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8245,7 +8286,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8292,7 +8333,7 @@ const docTemplate = `{
"400": {
"description": "不支持的键",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8346,7 +8387,7 @@ const docTemplate = `{
"400": {
"description": "不支持的键",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8412,7 +8453,7 @@ const docTemplate = `{
"403": {
"description": "权限不足",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8459,13 +8500,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "租户不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8501,7 +8542,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "$ref": "#/definitions/types.Tenant"
}
}
],
@@ -8516,7 +8557,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8558,13 +8599,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
}
},
- "/web-search/providers": {
+ "/vector-stores": {
"get": {
"security": [
{
@@ -8574,33 +8615,404 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Returns the list of available web search providers from configuration",
- "consumes": [
- "application/json"
- ],
+ "description": "List all vector stores for the current tenant, including environment-configured and user-created stores",
"produces": [
"application/json"
],
"tags": [
- "web-search"
+ "VectorStore"
],
- "summary": "Get available web search providers",
+ "summary": "List vector stores",
"responses": {
"200": {
- "description": "List of providers",
+ "description": "List of vector stores (env + DB)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
- }
- }
- },
- "definitions": {
- "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": {
- "type": "object",
- "properties": {
+ },
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Create a new vector store configuration for the current tenant",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Create vector store",
+ "parameters": [
+ {
+ "description": "Vector store configuration",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/handler.CreateStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Created vector store",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request or validation error",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "409": {
+ "description": "Duplicate endpoint and index",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Test connectivity using provided credentials without persisting. Returns detected server version.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Test vector store connection with raw credentials",
+ "parameters": [
+ {
+ "description": "Engine type and connection config",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/handler.TestStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Connection test result (success, version)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/types": {
+ "get": {
+ "description": "Return supported engine types with connection and index field schemas for UI form generation",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "List vector store types",
+ "responses": {
+ "200": {
+ "description": "List of engine types with config schemas",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Retrieve a single vector store by ID. Supports both DB stores and env stores (__env_* IDs)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Get vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Vector store details",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Update a vector store (name only). Engine type, connection config, and index config are immutable. Env stores cannot be modified.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Update vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "Updated fields",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/handler.UpdateStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Updated vector store",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Env store or validation error",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Soft-delete a vector store. Env stores cannot be deleted.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Delete vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Deletion success",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Env store cannot be deleted",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/{id}/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Test connectivity of an existing saved or env store. Returns detected server version. For DB stores, the version is automatically saved to connection_config.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Test vector store connection by ID",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Connection test result (success, version)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "datasource.ConnectorMetadata": {
+ "type": "object",
+ "properties": {
"auth_type": {
"description": "\"oauth2\", \"api_key\", \"token\", etc.",
"type": "string"
@@ -8630,11 +9042,11 @@ const docTemplate = `{
}
}
},
- "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "errors.AppError": {
"type": "object",
"properties": {
"code": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode"
+ "$ref": "#/definitions/errors.ErrorCode"
},
"details": {},
"message": {
@@ -8642,7 +9054,7 @@ const docTemplate = `{
}
}
},
- "github_com_Tencent_WeKnora_internal_errors.ErrorCode": {
+ "errors.ErrorCode": {
"type": "integer",
"enum": [
1000,
@@ -8689,2183 +9101,2346 @@ const docTemplate = `{
"ErrAgentInvalidTemperature"
]
},
- "github_com_Tencent_WeKnora_internal_types.AgentConfig": {
+ "github_com_Tencent_WeKnora_internal_errors.AppError": {
"type": "object",
"properties": {
- "allowed_skills": {
- "description": "Skill names whitelist (empty = allow all)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "allowed_tools": {
- "description": "List of allowed tool names",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "history_turns": {
- "description": "Number of history turns to keep in context",
- "type": "integer"
- },
- "knowledge_bases": {
- "description": "Accessible knowledge base IDs",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "description": "Accessible knowledge IDs (individual documents)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "llm_call_timeout": {
- "description": "LLM call timeout in seconds (default: 120). Controls the maximum time for a single LLM call.",
- "type": "integer"
- },
- "max_context_tokens": {
- "description": "Maximum context window tokens for the agent (default: 200000).\nThe agent compresses older messages to stay within this limit,\npreserving tool_call/tool_result pairs.",
- "type": "integer"
- },
- "max_iterations": {
- "description": "Maximum number of ReAct iterations",
- "type": "integer"
- },
- "max_tool_output_chars": {
- "description": "Maximum character length for tool output (default: 16000).\nOutputs exceeding this limit are truncated with head + tail preservation.",
- "type": "integer"
+ "code": {
+ "$ref": "#/definitions/errors.ErrorCode"
},
- "mcp_selection_mode": {
- "description": "MCP service selection",
+ "details": {},
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "gorm.DeletedAt": {
+ "type": "object",
+ "properties": {
+ "time": {
"type": "string"
},
- "mcp_services": {
- "description": "Selected MCP service IDs (when mode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "multi_turn_enabled": {
- "description": "Whether multi-turn conversation is enabled",
- "type": "boolean"
- },
- "parallel_tool_calls": {
- "description": "Whether to execute independent tool calls in parallel (default: false).\nWhen enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.",
+ "valid": {
+ "description": "Valid is true if Time is not NULL",
"type": "boolean"
+ }
+ }
+ },
+ "handler.CopyKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "source_id"
+ ],
+ "properties": {
+ "source_id": {
+ "type": "string"
},
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
- "type": "boolean"
+ "target_id": {
+ "type": "string"
},
- "skill_dirs": {
- "description": "Directories to search for skills",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "handler.CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
+ "type": "string"
},
- "skills_enabled": {
- "description": "Skills configuration (Progressive Disclosure pattern)",
- "type": "boolean"
+ "config": {
+ "$ref": "#/definitions/types.CustomAgentConfig"
},
- "system_prompt": {
- "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
+ "description": {
"type": "string"
},
- "system_prompt_web_disabled": {
- "description": "Deprecated: Custom prompt when web search is disabled",
+ "name": {
"type": "string"
- },
- "system_prompt_web_enabled": {
- "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
+ }
+ }
+ },
+ "handler.CreateModelRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "parameters",
+ "source",
+ "type"
+ ],
+ "properties": {
+ "description": {
"type": "string"
},
- "temperature": {
- "description": "LLM temperature for agent",
- "type": "number"
- },
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
- "type": "boolean"
+ "name": {
+ "type": "string"
},
- "use_custom_system_prompt": {
- "description": "Whether to use custom system prompt instead of default",
- "type": "boolean"
+ "parameters": {
+ "$ref": "#/definitions/types.ModelParameters"
},
- "web_search_enabled": {
- "description": "Whether web search tool is enabled",
- "type": "boolean"
+ "source": {
+ "$ref": "#/definitions/types.ModelSource"
},
- "web_search_max_results": {
- "description": "Maximum number of web search results (default: 5)",
- "type": "integer"
+ "type": {
+ "$ref": "#/definitions/types.ModelType"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AgentStep": {
+ "handler.CreateStoreRequest": {
"type": "object",
+ "required": [
+ "connection_config",
+ "engine_type",
+ "name"
+ ],
"properties": {
- "iteration": {
- "description": "Iteration number (0-indexed)",
- "type": "integer"
+ "connection_config": {
+ "$ref": "#/definitions/types.ConnectionConfig"
},
- "thought": {
- "description": "LLM's reasoning/thinking (Think phase)",
- "type": "string"
+ "engine_type": {
+ "$ref": "#/definitions/types.RetrieverEngineType"
},
- "timestamp": {
- "description": "When this step occurred",
- "type": "string"
+ "index_config": {
+ "$ref": "#/definitions/types.IndexConfig"
},
- "tool_calls": {
- "description": "Tools called in this step (Act phase)",
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "handler.DeleteTagRequest": {
+ "type": "object",
+ "properties": {
+ "exclude_ids": {
+ "description": "Chunk seq_ids to exclude from deletion",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall"
+ "type": "integer"
}
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": {
- "type": "string",
- "enum": [
- "all",
- "random"
- ],
- "x-enum-varnames": [
- "AnswerStrategyAll",
- "AnswerStrategyRandom"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": {
+ "handler.EvaluationRequest": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
- },
- "path_prefix": {
+ "chat_id": {
+ "description": "ID of chat model to use",
"type": "string"
},
- "region": {
+ "dataset_id": {
+ "description": "ID of dataset to evaluate",
"type": "string"
},
- "secret_id": {
+ "knowledge_base_id": {
+ "description": "ID of knowledge base to use",
"type": "string"
},
- "secret_key": {
+ "rerank_id": {
+ "description": "ID of rerank model to use",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": {
+ "handler.FabriTextRequest": {
"type": "object",
+ "required": [
+ "model_id"
+ ],
"properties": {
- "embedding_model_id": {
- "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
+ "model_id": {
"type": "string"
},
- "enabled": {
- "description": "Enabled controls whether chat history indexing is active",
- "type": "boolean"
- },
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
- "type": "string"
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": {
+ "handler.GetStorageEngineStatusResponse": {
"type": "object",
"properties": {
- "child_chunk_size": {
- "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
- "type": "integer"
- },
- "chunk_overlap": {
- "description": "Chunk overlap",
- "type": "integer"
- },
- "chunk_size": {
- "description": "Chunk size",
- "type": "integer"
- },
- "enable_multimodal": {
- "description": "EnableMultimodal (deprecated, kept for backward compatibility with old data)",
- "type": "boolean"
- },
- "enable_parent_child": {
- "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
- "type": "boolean"
- },
- "parent_chunk_size": {
- "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
- "type": "integer"
- },
- "parser_engine_rules": {
- "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, the builtin engine is used for all types.",
+ "engines": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ "$ref": "#/definitions/handler.StorageEngineStatusItem"
}
},
- "separators": {
- "description": "Separators",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "minio_env_available": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": {
- "type": "string",
- "enum": [
- "sliding_window",
- "smart"
- ],
- "x-enum-varnames": [
- "ContextCompressionSlidingWindow",
- "ContextCompressionSmart"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ContextConfig": {
+ "handler.GetSystemInfoResponse": {
"type": "object",
"properties": {
- "compression_strategy": {
- "description": "Compression strategy: \"sliding_window\" or \"smart\"",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
- }
- ]
+ "build_time": {
+ "type": "string"
},
- "max_tokens": {
- "description": "Maximum tokens allowed in LLM context",
- "type": "integer"
+ "commit_id": {
+ "type": "string"
},
- "recent_message_count": {
- "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
- "type": "integer"
+ "db_version": {
+ "type": "string"
},
- "summarize_threshold": {
- "description": "Summarize threshold: number of messages before summarization",
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ConversationConfig": {
- "type": "object",
- "properties": {
- "context_template": {
- "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "edition": {
"type": "string"
},
- "embedding_top_k": {
- "type": "integer"
+ "go_version": {
+ "type": "string"
},
- "enable_query_expansion": {
- "type": "boolean"
+ "graph_database_engine": {
+ "type": "string"
},
- "enable_rewrite": {
+ "keyword_index_engine": {
+ "type": "string"
+ },
+ "minio_enabled": {
"type": "boolean"
},
- "fallback_prompt": {
+ "vector_store_engine": {
"type": "string"
},
- "fallback_response": {
+ "version": {
"type": "string"
+ }
+ }
+ },
+ "handler.KBModelConfigRequest": {
+ "type": "object",
+ "required": [
+ "embeddingModelId",
+ "llmModelId"
+ ],
+ "properties": {
+ "asr_config": {
+ "$ref": "#/definitions/types.ASRConfig"
},
- "fallback_strategy": {
- "description": "Fallback strategy",
+ "documentSplitting": {
+ "description": "文档分块配置",
+ "type": "object",
+ "properties": {
+ "childChunkSize": {
+ "type": "integer"
+ },
+ "chunkOverlap": {
+ "type": "integer"
+ },
+ "chunkSize": {
+ "type": "integer"
+ },
+ "enableParentChild": {
+ "type": "boolean"
+ },
+ "parentChunkSize": {
+ "type": "integer"
+ },
+ "parserEngineRules": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "embeddingModelId": {
"type": "string"
},
- "keyword_threshold": {
- "type": "number"
+ "llmModelId": {
+ "type": "string"
},
- "max_completion_tokens": {
- "description": "MaxTokens is the maximum number of tokens to generate",
- "type": "integer"
+ "multimodal": {
+ "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "nodeExtract": {
+ "description": "知识图谱配置",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.GraphRelation"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
+ "type": "string"
+ }
+ }
},
- "max_rounds": {
- "description": "Retrieval \u0026 strategy parameters",
- "type": "integer"
+ "questionGeneration": {
+ "description": "问题生成配置",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "questionCount": {
+ "type": "integer"
+ }
+ }
},
- "prompt": {
- "description": "Prompt is the system prompt for normal mode",
+ "storageProvider": {
+ "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
"type": "string"
},
- "rerank_model_id": {
+ "vlm_config": {
+ "$ref": "#/definitions/types.VLMConfig"
+ }
+ }
+ },
+ "handler.RemoteModelCheckRequest": {
+ "type": "object",
+ "required": [
+ "baseUrl",
+ "modelName"
+ ],
+ "properties": {
+ "apiKey": {
"type": "string"
},
- "rerank_threshold": {
- "type": "number"
- },
- "rerank_top_k": {
- "type": "integer"
- },
- "rewrite_prompt_system": {
- "description": "Rewrite prompts",
+ "baseUrl": {
"type": "string"
},
- "rewrite_prompt_user": {
+ "modelName": {
"type": "string"
},
- "summary_model_id": {
- "description": "Model configuration",
+ "provider": {
"type": "string"
- },
- "temperature": {
- "description": "Temperature controls the randomness of the model output",
- "type": "number"
- },
- "vector_threshold": {
- "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
+ "handler.SearchMessagesRequest": {
"type": "object",
"required": [
- "name"
+ "query"
],
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
- },
- "description": {
- "type": "string",
- "maxLength": 1000
- },
- "invite_code_validity_days": {
- "description": "optional: 0=never, 1, 7, 30; default 7",
+ "limit": {
+ "description": "Maximum number of results to return (default: 20)",
"type": "integer"
},
- "member_limit": {
- "description": "optional: max members; 0=unlimited; default 50",
- "type": "integer"
+ "mode": {
+ "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")",
+ "type": "string"
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
- "type": "object",
- "properties": {
- "agent_mode": {
- "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
+ "query": {
+ "description": "Query text for search",
"type": "string"
},
- "allowed_tools": {
- "description": "Allowed tools (only for agent type)",
+ "session_ids": {
+ "description": "Filter by specific session IDs (optional)",
"type": "array",
"items": {
"type": "string"
}
+ }
+ }
+ },
+ "handler.StorageCheckRequest": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "$ref": "#/definitions/types.COSEngineConfig"
},
- "context_template": {
- "description": "Context template for normal mode (how to format retrieved chunks)",
- "type": "string"
- },
- "context_template_id": {
- "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content will be resolved at startup.",
- "type": "string"
- },
- "embedding_top_k": {
- "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
- "type": "integer"
- },
- "enable_query_expansion": {
- "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
- "type": "boolean"
- },
- "enable_rewrite": {
- "description": "Whether to enable query rewrite for multi-turn conversations",
- "type": "boolean"
- },
- "fallback_prompt": {
- "description": "Fallback prompt (when FallbackStrategy is \"model\")",
- "type": "string"
+ "minio": {
+ "$ref": "#/definitions/types.MinIOEngineConfig"
},
- "fallback_response": {
- "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
- "type": "string"
+ "oss": {
+ "$ref": "#/definitions/types.OSSEngineConfig"
},
- "fallback_strategy": {
- "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
+ "provider": {
+ "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
"type": "string"
},
- "faq_direct_answer_threshold": {
- "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
- "type": "number"
+ "s3": {
+ "$ref": "#/definitions/types.S3EngineConfig"
},
- "faq_priority_enabled": {
- "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "tos": {
+ "$ref": "#/definitions/types.TOSEngineConfig"
+ }
+ }
+ },
+ "handler.StorageCheckResponse": {
+ "type": "object",
+ "properties": {
+ "bucket_created": {
"type": "boolean"
},
- "faq_score_boost": {
- "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
- "type": "number"
- },
- "history_turns": {
- "description": "Number of history turns to keep in context",
- "type": "integer"
- },
- "image_storage_provider": {
- "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
+ "message": {
"type": "string"
},
- "image_upload_enabled": {
- "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "ok": {
+ "type": "boolean"
+ }
+ }
+ },
+ "handler.StorageEngineStatusItem": {
+ "type": "object",
+ "properties": {
+ "available": {
+ "description": "whether the engine can be used",
"type": "boolean"
},
- "kb_selection_mode": {
- "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
+ "description": {
+ "description": "short description for UI",
"type": "string"
},
- "keyword_threshold": {
- "description": "Keyword retrieval threshold",
- "type": "number"
- },
- "knowledge_bases": {
- "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "max_completion_tokens": {
- "description": "Maximum completion tokens (only for normal mode)",
- "type": "integer"
- },
- "max_iterations": {
- "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
- "type": "integer"
+ "name": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "type": "string"
+ }
+ }
+ },
+ "handler.TestStoreRequest": {
+ "type": "object",
+ "required": [
+ "connection_config",
+ "engine_type"
+ ],
+ "properties": {
+ "connection_config": {
+ "$ref": "#/definitions/types.ConnectionConfig"
},
- "mcp_selection_mode": {
- "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
+ "engine_type": {
+ "$ref": "#/definitions/types.RetrieverEngineType"
+ }
+ }
+ },
+ "handler.TextRelationExtractionRequest": {
+ "type": "object",
+ "required": [
+ "model_id",
+ "tags",
+ "text"
+ ],
+ "properties": {
+ "model_id": {
"type": "string"
},
- "mcp_services": {
- "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "tags": {
"type": "array",
"items": {
"type": "string"
}
},
- "model_id": {
- "description": "===== Model Settings =====\nModel ID to use for conversations",
+ "text": {
"type": "string"
- },
- "multi_turn_enabled": {
- "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
- "type": "boolean"
- },
- "rerank_model_id": {
- "description": "ReRank model ID for retrieval",
+ }
+ }
+ },
+ "handler.UpdateAgentRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
"type": "string"
},
- "rerank_threshold": {
- "description": "Rerank threshold",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "Rerank top K",
- "type": "integer"
- },
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
- "type": "boolean"
+ "config": {
+ "$ref": "#/definitions/types.CustomAgentConfig"
},
- "rewrite_prompt_system": {
- "description": "Rewrite prompt system message",
+ "description": {
"type": "string"
},
- "rewrite_prompt_user": {
- "description": "Rewrite prompt user message template",
+ "name": {
"type": "string"
+ }
+ }
+ },
+ "handler.UpdateChunkRequest": {
+ "type": "object",
+ "properties": {
+ "chunk_index": {
+ "type": "integer"
},
- "selected_skills": {
- "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "skills_selection_mode": {
- "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
+ "content": {
"type": "string"
},
- "suggested_prompts": {
- "description": "===== Suggested Prompts =====\n推荐问题列表,用于在前端对话面板展示快捷提问",
+ "embedding": {
"type": "array",
"items": {
- "type": "string"
+ "type": "number"
}
},
- "supported_file_types": {
- "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "end_at": {
+ "type": "integer"
},
- "system_prompt": {
- "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
+ "image_info": {
"type": "string"
},
- "system_prompt_id": {
- "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content will be resolved at startup.",
- "type": "string"
+ "is_enabled": {
+ "type": "boolean"
},
- "temperature": {
- "description": "Temperature for LLM (0-1)",
- "type": "number"
+ "start_at": {
+ "type": "integer"
+ }
+ }
+ },
+ "handler.UpdateKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/types.KnowledgeBaseConfig"
},
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
- "type": "boolean"
+ "description": {
+ "type": "string"
},
- "vector_threshold": {
- "description": "Vector retrieval threshold",
- "type": "number"
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "handler.UpdateModelRequest": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
},
- "vlm_model_id": {
- "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)",
+ "name": {
"type": "string"
},
- "web_search_enabled": {
- "description": "===== Web Search Settings =====\nWhether web search is enabled",
- "type": "boolean"
+ "parameters": {
+ "$ref": "#/definitions/types.ModelParameters"
},
- "web_search_max_results": {
- "description": "Maximum web search results",
- "type": "integer"
+ "source": {
+ "$ref": "#/definitions/types.ModelSource"
+ },
+ "type": {
+ "$ref": "#/definitions/types.ModelType"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.DataSource": {
+ "handler.UpdateStoreRequest": {
"type": "object",
+ "required": [
+ "name"
+ ],
"properties": {
- "config": {
- "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "handler.addSimilarQuestionsRequest": {
+ "type": "object",
+ "required": [
+ "similar_questions"
+ ],
+ "properties": {
+ "similar_questions": {
"type": "array",
+ "minItems": 1,
"items": {
- "type": "integer"
+ "type": "string"
}
- },
- "conflict_strategy": {
- "description": "Conflict resolution strategy: overwrite or skip",
+ }
+ }
+ },
+ "handler.updateLastFAQImportResultDisplayStatusRequest": {
+ "type": "object",
+ "required": [
+ "display_status"
+ ],
+ "properties": {
+ "display_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "close"
+ ]
+ }
+ }
+ },
+ "handler_session.AttachmentUpload": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "description": "Base64-encoded file content",
"type": "string"
},
- "created_at": {
- "description": "Creation timestamp",
+ "file_name": {
+ "description": "Original filename",
"type": "string"
},
- "deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
+ }
+ }
+ },
+ "handler_session.CreateKnowledgeQARequest": {
+ "type": "object",
+ "required": [
+ "query"
+ ],
+ "properties": {
+ "agent_enabled": {
+ "description": "Whether agent mode is enabled for this request",
+ "type": "boolean"
},
- "error_message": {
- "description": "Error message if status is \"error\"",
+ "agent_id": {
+ "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
"type": "string"
},
- "id": {
- "description": "Unique identifier",
- "type": "string"
+ "attachment_uploads": {
+ "description": "Attached files (documents, audio, etc.)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/handler_session.AttachmentUpload"
+ }
},
- "knowledge_base_id": {
- "description": "Target knowledge base ID",
+ "channel": {
+ "description": "Source channel: \"web\", \"api\", \"im\", etc.",
"type": "string"
},
- "last_sync_at": {
- "description": "Last successful sync timestamp",
- "type": "string"
+ "disable_title": {
+ "description": "Whether to disable auto title generation",
+ "type": "boolean"
},
- "last_sync_cursor": {
- "description": "Cursor or state for incremental sync (connector-specific)",
+ "enable_memory": {
+ "description": "Whether memory feature is enabled for this request",
+ "type": "boolean"
+ },
+ "images": {
+ "description": "Attached images for multimodal chat",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/handler_session.ImageAttachment"
}
},
- "last_sync_result": {
- "description": "Summary of last sync result",
+ "knowledge_base_ids": {
+ "description": "Selected knowledge base ID for this request",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
},
- "latest_sync_log": {
- "description": "Latest sync log (not stored in DB, populated on query)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
- }
- ]
- },
- "name": {
- "description": "User-friendly name",
- "type": "string"
- },
- "status": {
- "description": "Current status: active, paused, error",
- "type": "string"
- },
- "sync_deletions": {
- "description": "Whether to sync deletions from source",
- "type": "boolean"
+ "knowledge_ids": {
+ "description": "Selected knowledge ID for this request",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "sync_log_retention_days": {
- "description": "Number of days to keep sync logs (default: 30)",
- "type": "integer"
+ "mentioned_items": {
+ "description": "@mentioned knowledge bases and files",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/handler_session.MentionedItemRequest"
+ }
},
- "sync_mode": {
- "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
+ "query": {
+ "description": "Query text for knowledge base search",
"type": "string"
},
- "sync_schedule": {
- "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
+ "summary_model_id": {
+ "description": "Optional summary model ID for this request (overrides session default)",
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID for multi-tenancy",
- "type": "integer"
- },
- "total_items_synced": {
- "description": "Total items synced (not stored in DB, calculated on query)",
- "type": "integer"
- },
- "type": {
- "description": "Connector type (feishu, notion, confluence, etc.)",
+ "web_search_enabled": {
+ "description": "Whether web search is enabled for this request",
+ "type": "boolean"
+ }
+ }
+ },
+ "handler_session.CreateSessionRequest": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "description": "Description for the session (optional)",
"type": "string"
},
- "updated_at": {
- "description": "Last update timestamp",
+ "title": {
+ "description": "Title for the session (optional)",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": {
+ "handler_session.GenerateTitleRequest": {
"type": "object",
+ "required": [
+ "messages"
+ ],
"properties": {
- "dimension": {
- "type": "integer"
+ "messages": {
+ "description": "Messages to use as context for title generation",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.Message"
+ }
+ }
+ }
+ },
+ "handler_session.ImageAttachment": {
+ "type": "object",
+ "properties": {
+ "caption": {
+ "description": "VLM analysis result (context-aware, single call)",
+ "type": "string"
},
- "truncate_prompt_tokens": {
- "type": "integer"
+ "data": {
+ "description": "base64 data URI from frontend (data:image/png;base64,...)",
+ "type": "string"
+ },
+ "url": {
+ "description": "serving URL after saving to storage",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
+ "handler_session.MentionedItemRequest": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
- }
+ "id": {
+ "type": "string"
},
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
- }
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
+ "type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "name": {
+ "type": "string"
},
- "text": {
+ "type": {
+ "description": "\"kb\" for knowledge base, \"file\" for file",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": {
+ "handler_session.SearchKnowledgeRequest": {
"type": "object",
"required": [
- "entries"
+ "query"
],
"properties": {
- "dry_run": {
- "description": "仅验证,不实际导入",
- "type": "boolean"
+ "knowledge_base_id": {
+ "description": "Single knowledge base ID (for backward compatibility)",
+ "type": "string"
},
- "entries": {
+ "knowledge_base_ids": {
+ "description": "IDs of knowledge bases to search (multi-KB support)",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ "type": "string"
}
},
- "knowledge_id": {
- "type": "string"
- },
- "mode": {
- "type": "string",
- "enum": [
- "append",
- "replace"
- ]
+ "knowledge_ids": {
+ "description": "IDs of specific knowledge (files) to search",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "task_id": {
- "description": "可选,如果不传则自动生成UUID",
+ "query": {
+ "description": "Query text to search for",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQConfig": {
+ "handler_session.StopSessionRequest": {
"type": "object",
+ "required": [
+ "message_id"
+ ],
"properties": {
- "index_mode": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
- },
- "question_index_mode": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode"
+ "message_id": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": {
+ "handler_session.batchDeleteRequest": {
"type": "object",
"properties": {
- "by_id": {
- "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
- }
- },
- "by_tag": {
- "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
- }
+ "delete_all": {
+ "type": "boolean"
},
- "exclude_ids": {
- "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
+ "ids": {
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": {
+ "types.ASRConfig": {
"type": "object",
"properties": {
- "is_enabled": {
+ "enabled": {
"type": "boolean"
},
- "is_recommended": {
- "type": "boolean"
+ "language": {
+ "description": "optional: language hint for transcription",
+ "type": "string"
},
- "tag_id": {
- "type": "integer"
+ "model_id": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": {
+ "types.AgentConfig": {
"type": "object",
- "required": [
- "standard_question"
- ],
"properties": {
- "answer_strategy": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
+ "allowed_skills": {
+ "description": "Skill names whitelist (empty = allow all)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "answers": {
+ "allowed_tools": {
+ "description": "List of allowed tool names",
"type": "array",
"items": {
"type": "string"
}
},
- "id": {
- "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
"type": "integer"
},
- "is_enabled": {
- "type": "boolean"
- },
- "is_recommended": {
- "type": "boolean"
- },
- "negative_questions": {
+ "knowledge_bases": {
+ "description": "Accessible knowledge base IDs",
"type": "array",
"items": {
"type": "string"
}
},
- "similar_questions": {
+ "knowledge_ids": {
+ "description": "Accessible knowledge IDs (individual documents)",
"type": "array",
"items": {
"type": "string"
}
},
- "standard_question": {
- "type": "string"
- },
- "tag_id": {
+ "llm_call_timeout": {
+ "description": "LLM call timeout in seconds (default: 120). Controls the maximum time for a single LLM call.",
"type": "integer"
},
- "tag_name": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": {
- "type": "string",
- "enum": [
- "question_only",
- "question_answer"
- ],
- "x-enum-varnames": [
- "FAQIndexModeQuestionOnly",
- "FAQIndexModeQuestionAnswer"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": {
- "type": "string",
- "enum": [
- "combined",
- "separate"
- ],
- "x-enum-varnames": [
- "FAQQuestionIndexModeCombined",
- "FAQQuestionIndexModeSeparate"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": {
- "type": "object",
- "required": [
- "query_text"
- ],
- "properties": {
- "first_priority_tag_ids": {
- "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "max_context_tokens": {
+ "description": "Maximum context window tokens for the agent (default: 200000).\nThe agent compresses older messages to stay within this limit,\npreserving tool_call/tool_result pairs.",
+ "type": "integer"
},
- "match_count": {
+ "max_iterations": {
+ "description": "Maximum number of ReAct iterations",
"type": "integer"
},
- "only_recommended": {
- "description": "是否仅返回推荐的条目",
- "type": "boolean"
+ "max_tool_output_chars": {
+ "description": "Maximum character length for tool output (default: 16000).\nOutputs exceeding this limit are truncated with head + tail preservation.",
+ "type": "integer"
},
- "query_text": {
+ "mcp_selection_mode": {
+ "description": "MCP service selection",
"type": "string"
},
- "second_priority_tag_ids": {
- "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "vector_threshold": {
- "type": "number"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.GraphNode": {
- "type": "object",
- "properties": {
- "attributes": {
+ "mcp_services": {
+ "description": "Selected MCP service IDs (when mode is \"selected\")",
"type": "array",
"items": {
"type": "string"
}
},
- "chunks": {
+ "multi_turn_enabled": {
+ "description": "Whether multi-turn conversation is enabled",
+ "type": "boolean"
+ },
+ "parallel_tool_calls": {
+ "description": "Whether to execute independent tool calls in parallel (default: false).\nWhen enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.",
+ "type": "boolean"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
+ "type": "boolean"
+ },
+ "skill_dirs": {
+ "description": "Directories to search for skills",
"type": "array",
"items": {
"type": "string"
}
},
- "name": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.GraphRelation": {
- "type": "object",
- "properties": {
- "node1": {
+ "skills_enabled": {
+ "description": "Skills configuration (Progressive Disclosure pattern)",
+ "type": "boolean"
+ },
+ "system_prompt": {
+ "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
"type": "string"
},
- "node2": {
+ "system_prompt_web_disabled": {
+ "description": "Deprecated: Custom prompt when web search is disabled",
"type": "string"
},
- "type": {
+ "system_prompt_web_enabled": {
+ "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": {
- "type": "object",
- "properties": {
- "model_id": {
- "description": "Model ID",
+ },
+ "temperature": {
+ "description": "LLM temperature for agent",
+ "type": "number"
+ },
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
+ },
+ "use_custom_system_prompt": {
+ "description": "Whether to use custom system prompt instead of default",
+ "type": "boolean"
+ },
+ "web_search_enabled": {
+ "description": "Whether web search tool is enabled",
+ "type": "boolean"
+ },
+ "web_search_max_results": {
+ "description": "Maximum number of web search results (default: 5)",
+ "type": "integer"
+ },
+ "web_search_provider_id": {
+ "description": "WebSearchProviderEntity ID (resolved from agent config)",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
+ "types.AgentStep": {
"type": "object",
- "required": [
- "role",
- "user_id"
- ],
"properties": {
- "role": {
- "description": "Role to assign: admin/editor/viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "iteration": {
+ "description": "Iteration number (0-indexed)",
+ "type": "integer"
},
- "user_id": {
- "description": "User ID to invite",
+ "thought": {
+ "description": "LLM's reasoning/thinking (Think phase)",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
- "type": "object",
- "required": [
- "organization_id"
- ],
- "properties": {
- "message": {
- "description": "Optional message for join request",
- "type": "string",
- "maxLength": 500
},
- "organization_id": {
+ "timestamp": {
+ "description": "When this step occurred",
"type": "string"
},
- "role": {
- "description": "Optional: requested role (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "tool_calls": {
+ "description": "Tools called in this step (Act phase)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.ToolCall"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
- "type": "object",
- "required": [
- "invite_code"
+ "types.AnswerStrategy": {
+ "type": "string",
+ "enum": [
+ "all",
+ "random"
],
- "properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
- }
- }
+ "x-enum-varnames": [
+ "AnswerStrategyAll",
+ "AnswerStrategyRandom"
+ ]
},
- "github_com_Tencent_WeKnora_internal_types.Knowledge": {
+ "types.COSEngineConfig": {
"type": "object",
"properties": {
- "channel": {
- "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
+ "app_id": {
"type": "string"
},
- "created_at": {
- "description": "Creation time of the knowledge",
+ "bucket_name": {
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time of the knowledge",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "description": {
- "description": "Description of the knowledge",
+ "path_prefix": {
"type": "string"
},
- "embedding_model_id": {
- "description": "ID of the embedding model",
+ "region": {
"type": "string"
},
- "enable_status": {
- "description": "Enable status of the knowledge",
+ "secret_id": {
"type": "string"
},
- "error_message": {
- "description": "Error message of the knowledge",
+ "secret_key": {
"type": "string"
- },
- "file_hash": {
- "description": "File hash of the knowledge",
+ }
+ }
+ },
+ "types.ChatHistoryConfig": {
+ "type": "object",
+ "properties": {
+ "embedding_model_id": {
+ "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
"type": "string"
},
- "file_name": {
- "description": "File name of the knowledge",
- "type": "string"
+ "enabled": {
+ "description": "Enabled controls whether chat history indexing is active",
+ "type": "boolean"
},
- "file_path": {
- "description": "File path of the knowledge",
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
"type": "string"
+ }
+ }
+ },
+ "types.ChunkingConfig": {
+ "type": "object",
+ "properties": {
+ "child_chunk_size": {
+ "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
},
- "file_size": {
- "description": "File size of the knowledge",
+ "chunk_overlap": {
+ "description": "Chunk overlap",
"type": "integer"
},
- "file_type": {
- "description": "File type of the knowledge",
- "type": "string"
+ "chunk_size": {
+ "description": "Chunk size",
+ "type": "integer"
},
- "id": {
- "description": "Unique identifier of the knowledge",
- "type": "string"
+ "enable_multimodal": {
+ "description": "EnableMultimodal (deprecated, kept for backward compatibility with old data)",
+ "type": "boolean"
},
- "knowledge_base_id": {
- "description": "ID of the knowledge base",
- "type": "string"
+ "enable_parent_child": {
+ "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
+ "type": "boolean"
},
- "knowledge_base_name": {
- "description": "Knowledge base name (not stored in database, populated on query)",
- "type": "string"
+ "parent_chunk_size": {
+ "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
},
- "last_faq_import_result": {
- "description": "Last FAQ import result (for FAQ type knowledge only)",
+ "parser_engine_rules": {
+ "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, the builtin engine is used for all types.",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/types.ParserEngineRule"
}
},
- "metadata": {
- "description": "Metadata of the knowledge",
+ "separators": {
+ "description": "Separators",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
- },
- "parse_status": {
- "description": "Parse status of the knowledge",
+ }
+ }
+ },
+ "types.ConnectionConfig": {
+ "type": "object",
+ "properties": {
+ "addr": {
+ "description": "Common",
"type": "string"
},
- "processed_at": {
- "description": "Processed time of the knowledge",
+ "api_key": {
+ "description": "AES-GCM encrypted",
"type": "string"
},
- "source": {
- "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
+ "grpc_address": {
+ "description": "Weaviate",
"type": "string"
},
- "storage_size": {
- "description": "Storage size of the knowledge",
- "type": "integer"
- },
- "summary_status": {
- "description": "Summary status for async summary generation",
+ "host": {
+ "description": "Qdrant",
"type": "string"
},
- "tag_id": {
- "description": "Optional tag ID for categorization within a knowledge base",
+ "password": {
+ "description": "AES-GCM encrypted",
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
+ "port": {
"type": "integer"
},
- "title": {
- "description": "Title of the knowledge",
+ "scheme": {
"type": "string"
},
- "type": {
- "description": "Type of the knowledge",
+ "use_default_connection": {
+ "description": "Postgres",
+ "type": "boolean"
+ },
+ "use_tls": {
+ "type": "boolean"
+ },
+ "username": {
"type": "string"
},
- "updated_at": {
- "description": "Last updated time of the knowledge",
+ "version": {
+ "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": {
+ "types.ContextCompressionStrategy": {
+ "type": "string",
+ "enum": [
+ "sliding_window",
+ "smart"
+ ],
+ "x-enum-varnames": [
+ "ContextCompressionSlidingWindow",
+ "ContextCompressionSmart"
+ ]
+ },
+ "types.ContextConfig": {
"type": "object",
"properties": {
- "chunk_count": {
- "description": "Chunk count (not stored in database, calculated on query)",
- "type": "integer"
- },
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
- },
- "created_at": {
- "description": "Creation time of the knowledge base",
- "type": "string"
- },
- "deleted_at": {
- "description": "Deletion time of the knowledge base",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "description": {
- "description": "Description of the knowledge base",
- "type": "string"
- },
- "embedding_model_id": {
- "description": "ID of the embedding model",
- "type": "string"
- },
- "extract_config": {
- "description": "Extract config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
- }
- ]
- },
- "faq_config": {
- "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
- }
- ]
- },
- "id": {
- "description": "Unique identifier of the knowledge base",
- "type": "string"
- },
- "image_processing_config": {
- "description": "Image processing configuration",
+ "compression_strategy": {
+ "description": "Compression strategy: \"sliding_window\" or \"smart\"",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ "$ref": "#/definitions/types.ContextCompressionStrategy"
}
]
},
- "is_pinned": {
- "description": "Whether this knowledge base is pinned to the top of the list",
- "type": "boolean"
+ "max_tokens": {
+ "description": "Maximum tokens allowed in LLM context",
+ "type": "integer"
},
- "is_processing": {
- "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
- "type": "boolean"
+ "recent_message_count": {
+ "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "type": "integer"
},
- "is_temporary": {
- "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
- "type": "boolean"
+ "summarize_threshold": {
+ "description": "Summarize threshold: number of messages before summarization",
+ "type": "integer"
+ }
+ }
+ },
+ "types.ConversationConfig": {
+ "type": "object",
+ "properties": {
+ "context_template": {
+ "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "type": "string"
},
- "knowledge_count": {
- "description": "Knowledge count (not stored in database, calculated on query)",
+ "embedding_top_k": {
"type": "integer"
},
- "name": {
- "description": "Name of the knowledge base",
+ "enable_query_expansion": {
+ "type": "boolean"
+ },
+ "enable_rewrite": {
+ "type": "boolean"
+ },
+ "fallback_prompt": {
"type": "string"
},
- "pinned_at": {
- "description": "Time when the knowledge base was pinned (nil if not pinned)",
+ "fallback_response": {
"type": "string"
},
- "processing_count": {
- "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
- "type": "integer"
+ "fallback_strategy": {
+ "description": "Fallback strategy",
+ "type": "string"
},
- "question_generation_config": {
- "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
- }
- ]
+ "keyword_threshold": {
+ "type": "number"
},
- "share_count": {
- "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "max_completion_tokens": {
+ "description": "MaxTokens is the maximum number of tokens to generate",
"type": "integer"
},
- "storage_config": {
- "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
- }
- ]
+ "max_rounds": {
+ "description": "Retrieval \u0026 strategy parameters",
+ "type": "integer"
},
- "storage_provider_config": {
- "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
- }
- ]
+ "prompt": {
+ "description": "Prompt is the system prompt for normal mode",
+ "type": "string"
},
- "summary_model_id": {
- "description": "Summary model ID",
+ "rerank_model_id": {
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
+ "rerank_threshold": {
+ "type": "number"
+ },
+ "rerank_top_k": {
"type": "integer"
},
- "type": {
- "description": "Type of the knowledge base (document, faq, etc.)",
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompts",
"type": "string"
},
- "updated_at": {
- "description": "Last updated time of the knowledge base",
+ "rewrite_prompt_user": {
"type": "string"
},
- "vlm_config": {
- "description": "VLM config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
- }
- ]
+ "summary_model_id": {
+ "description": "Model configuration",
+ "type": "string"
+ },
+ "temperature": {
+ "description": "Temperature controls the randomness of the model output",
+ "type": "number"
+ },
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
+ "types.CreateOrganizationRequest": {
"type": "object",
+ "required": [
+ "name"
+ ],
"properties": {
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "faq_config": {
- "description": "FAQ configuration (only for FAQ type knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
- }
- ]
+ "description": {
+ "type": "string",
+ "maxLength": 1000
},
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
- }
- ]
+ "invite_code_validity_days": {
+ "description": "optional: 0=never, 1, 7, 30; default 7",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "optional: max members; 0=unlimited; default 50",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
+ "types.CredentialsConfig": {
"type": "object",
"properties": {
- "chunk_count": {
+ "weknoracloud": {
+ "$ref": "#/definitions/types.WeKnoraCloudCredentials"
+ }
+ }
+ },
+ "types.CustomAgentConfig": {
+ "type": "object",
+ "properties": {
+ "agent_mode": {
+ "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
+ "type": "string"
+ },
+ "allowed_tools": {
+ "description": "Allowed tools (only for agent type)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "asr_model_id": {
+ "description": "ASR model ID for audio transcription (optional)",
+ "type": "string"
+ },
+ "audio_upload_enabled": {
+ "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
+ "type": "boolean"
+ },
+ "context_template": {
+ "description": "Context template for normal mode (how to format retrieved chunks)",
+ "type": "string"
+ },
+ "context_template_id": {
+ "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content will be resolved at startup.",
+ "type": "string"
+ },
+ "embedding_top_k": {
+ "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
"type": "integer"
},
- "created_at": {
+ "enable_query_expansion": {
+ "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
+ "type": "boolean"
+ },
+ "enable_rewrite": {
+ "description": "Whether to enable query rewrite for multi-turn conversations",
+ "type": "boolean"
+ },
+ "fallback_prompt": {
+ "description": "Fallback prompt (when FallbackStrategy is \"model\")",
"type": "string"
},
- "id": {
+ "fallback_response": {
+ "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
"type": "string"
},
- "knowledge_base_id": {
+ "fallback_strategy": {
+ "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
"type": "string"
},
- "knowledge_base_name": {
+ "faq_direct_answer_threshold": {
+ "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
+ "type": "number"
+ },
+ "faq_priority_enabled": {
+ "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "type": "boolean"
+ },
+ "faq_score_boost": {
+ "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
+ "type": "number"
+ },
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
+ "image_storage_provider": {
+ "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
"type": "string"
},
- "knowledge_base_type": {
+ "image_upload_enabled": {
+ "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "type": "boolean"
+ },
+ "kb_selection_mode": {
+ "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
"type": "string"
},
- "knowledge_count": {
+ "keyword_threshold": {
+ "description": "Keyword retrieval threshold",
+ "type": "number"
+ },
+ "knowledge_bases": {
+ "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "llm_call_timeout": {
+ "description": "Timeout for a single LLM call in seconds (0 = use global default)",
"type": "integer"
},
- "my_permission": {
- "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
+ "max_completion_tokens": {
+ "description": "Maximum completion tokens (only for normal mode)",
+ "type": "integer"
+ },
+ "max_iterations": {
+ "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
+ "type": "integer"
+ },
+ "mcp_selection_mode": {
+ "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
"type": "string"
},
- "my_role_in_org": {
- "description": "Current user's role in this organization (admin/editor/viewer)",
+ "mcp_services": {
+ "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "model_id": {
+ "description": "===== Model Settings =====\nModel ID to use for conversations",
"type": "string"
},
- "organization_id": {
- "type": "string"
+ "multi_turn_enabled": {
+ "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
+ "type": "boolean"
},
- "organization_name": {
+ "rerank_model_id": {
+ "description": "ReRank model ID for retrieval",
"type": "string"
},
- "permission": {
- "description": "Share permission (what the space was granted: viewer/editor)",
- "type": "string"
+ "rerank_threshold": {
+ "description": "Rerank threshold",
+ "type": "number"
},
- "require_approval": {
+ "rerank_top_k": {
+ "description": "Rerank top K",
+ "type": "integer"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
"type": "boolean"
},
- "shared_by_user_id": {
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompt system message",
"type": "string"
},
- "shared_by_username": {
+ "rewrite_prompt_user": {
+ "description": "Rewrite prompt user message template",
"type": "string"
},
- "source_tenant_id": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
- "type": "object",
- "properties": {
- "members": {
+ "selected_skills": {
+ "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
+ "type": "string"
}
},
- "total": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
- "type": "object",
- "properties": {
- "organizations": {
+ "skills_selection_mode": {
+ "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
+ "type": "string"
+ },
+ "suggested_prompts": {
+ "description": "===== Suggested Prompts =====\n推荐问题列表,用于在前端对话面板展示快捷提问",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ "type": "string"
}
},
- "resource_counts": {
- "description": "各空间内知识库/智能体数量,供列表侧栏展示",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
- }
- ]
- },
- "total": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
- "type": "object",
- "properties": {
- "shares": {
+ "supported_file_types": {
+ "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
+ "type": "string"
}
},
- "total": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": {
- "type": "object",
- "properties": {
- "path_prefix": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LoginRequest": {
- "type": "object",
- "required": [
- "email",
- "password"
- ],
- "properties": {
- "email": {
+ "system_prompt": {
+ "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
"type": "string"
},
- "password": {
- "type": "string",
- "minLength": 6
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LoginResponse": {
- "type": "object",
- "properties": {
- "message": {
+ "system_prompt_id": {
+ "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content will be resolved at startup.",
"type": "string"
},
- "refresh_token": {
- "type": "string"
+ "temperature": {
+ "description": "Temperature for LLM (0-1)",
+ "type": "number"
},
- "success": {
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
"type": "boolean"
},
- "tenant": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "vector_threshold": {
+ "description": "Vector retrieval threshold",
+ "type": "number"
},
- "token": {
+ "vlm_model_id": {
+ "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)",
"type": "string"
},
- "user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig": {
- "type": "object",
- "properties": {
- "retry_count": {
- "description": "Number of retries, default: 3",
- "type": "integer"
+ "web_fetch_enabled": {
+ "description": "Whether to auto-fetch full page content for reranked web search results",
+ "type": "boolean"
},
- "retry_delay": {
- "description": "Delay between retries in seconds, default: 1",
+ "web_fetch_top_n": {
+ "description": "Max number of pages to fetch after rerank (default: 3)",
"type": "integer"
},
- "timeout": {
- "description": "Timeout in seconds, default: 30",
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": {
- "type": "object",
- "properties": {
- "api_key": {
- "type": "string"
+ "web_search_enabled": {
+ "description": "===== Web Search Settings =====\nWhether web search is enabled",
+ "type": "boolean"
},
- "custom_headers": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "web_search_max_results": {
+ "description": "Maximum web search results",
+ "type": "integer"
},
- "token": {
+ "web_search_provider_id": {
+ "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the tenant's default provider (is_default=true) is used.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPHeaders": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPService": {
+ "types.DataSource": {
"type": "object",
"properties": {
- "advanced_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
+ "config": {
+ "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
- "auth_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig"
+ "conflict_strategy": {
+ "description": "Conflict resolution strategy: overwrite or skip",
+ "type": "string"
},
"created_at": {
+ "description": "Creation timestamp",
"type": "string"
},
"deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "description": {
- "type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "env_vars": {
- "description": "Environment variables for stdio",
+ "description": "Soft delete timestamp",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
+ "$ref": "#/definitions/gorm.DeletedAt"
}
]
},
- "headers": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
+ "error_message": {
+ "description": "Error message if status is \"error\"",
+ "type": "string"
},
"id": {
+ "description": "Unique identifier",
"type": "string"
},
- "is_builtin": {
- "description": "Whether this is a builtin MCP service (visible to all tenants)",
- "type": "boolean"
+ "knowledge_base_id": {
+ "description": "Target knowledge base ID",
+ "type": "string"
},
- "name": {
+ "last_sync_at": {
+ "description": "Last successful sync timestamp",
"type": "string"
},
- "stdio_config": {
- "description": "Required for stdio transport",
+ "last_sync_cursor": {
+ "description": "Cursor or state for incremental sync (connector-specific)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "last_sync_result": {
+ "description": "Summary of last sync result",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "latest_sync_log": {
+ "description": "Latest sync log (not stored in DB, populated on query)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
+ "$ref": "#/definitions/types.SyncLog"
}
]
},
+ "name": {
+ "description": "User-friendly name",
+ "type": "string"
+ },
+ "status": {
+ "description": "Current status: active, paused, error",
+ "type": "string"
+ },
+ "sync_deletions": {
+ "description": "Whether to sync deletions from source",
+ "type": "boolean"
+ },
+ "sync_log_retention_days": {
+ "description": "Number of days to keep sync logs (default: 30)",
+ "type": "integer"
+ },
+ "sync_mode": {
+ "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
+ "type": "string"
+ },
+ "sync_schedule": {
+ "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
+ "type": "string"
+ },
"tenant_id": {
+ "description": "Tenant ID for multi-tenancy",
"type": "integer"
},
- "transport_type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
+ "total_items_synced": {
+ "description": "Total items synced (not stored in DB, calculated on query)",
+ "type": "integer"
+ },
+ "type": {
+ "description": "Connector type (feishu, notion, confluence, etc.)",
+ "type": "string"
},
"updated_at": {
+ "description": "Last update timestamp",
"type": "string"
+ }
+ }
+ },
+ "types.EmbeddingParameters": {
+ "type": "object",
+ "properties": {
+ "dimension": {
+ "type": "integer"
},
- "url": {
- "description": "Optional: required for SSE/HTTP Streamable",
- "type": "string"
+ "truncate_prompt_tokens": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": {
+ "types.ExtractConfig": {
"type": "object",
"properties": {
- "args": {
- "description": "Command arguments array",
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.GraphRelation"
+ }
+ },
+ "tags": {
"type": "array",
"items": {
"type": "string"
}
},
- "command": {
- "description": "Command: \"uvx\" or \"npx\"",
+ "text": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPTransportType": {
- "type": "string",
- "enum": [
- "sse",
- "http-streamable",
- "stdio"
- ],
- "x-enum-comments": {
- "MCPTransportHTTPStreamable": "HTTP Streamable",
- "MCPTransportSSE": "Server-Sent Events",
- "MCPTransportStdio": "Stdio (Standard Input/Output)"
- },
- "x-enum-descriptions": [
- "Server-Sent Events",
- "HTTP Streamable",
- "Stdio (Standard Input/Output)"
- ],
- "x-enum-varnames": [
- "MCPTransportSSE",
- "MCPTransportHTTPStreamable",
- "MCPTransportStdio"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": {
+ "types.FAQBatchUpsertPayload": {
"type": "object",
+ "required": [
+ "entries"
+ ],
"properties": {
- "channel": {
- "type": "string"
+ "dry_run": {
+ "description": "仅验证,不实际导入",
+ "type": "boolean"
},
- "content": {
- "type": "string"
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.FAQEntryPayload"
+ }
},
- "status": {
+ "knowledge_id": {
"type": "string"
},
- "tag_id": {
- "type": "string"
+ "mode": {
+ "type": "string",
+ "enum": [
+ "append",
+ "replace"
+ ]
},
- "title": {
+ "task_id": {
+ "description": "可选,如果不传则自动生成UUID",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MatchType": {
- "type": "integer",
- "enum": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "x-enum-comments": {
- "MatchTypeDataAnalysis": "数据分析匹配类型",
- "MatchTypeDirectLoad": "直接加载匹配类型",
- "MatchTypeParentChunk": "父Chunk匹配类型",
- "MatchTypeRelationChunk": "关系Chunk匹配类型",
- "MatchTypeWebSearch": "网络搜索匹配类型"
- },
- "x-enum-descriptions": [
- "",
- "",
- "",
- "",
- "父Chunk匹配类型",
- "关系Chunk匹配类型",
- "",
- "网络搜索匹配类型",
- "直接加载匹配类型",
- "数据分析匹配类型"
- ],
- "x-enum-varnames": [
- "MatchTypeEmbedding",
- "MatchTypeKeywords",
- "MatchTypeNearByChunk",
- "MatchTypeHistory",
- "MatchTypeParentChunk",
- "MatchTypeRelationChunk",
- "MatchTypeGraph",
- "MatchTypeWebSearch",
- "MatchTypeDirectLoad",
- "MatchTypeDataAnalysis"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.MentionedItem": {
+ "types.FAQConfig": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
+ "index_mode": {
+ "$ref": "#/definitions/types.FAQIndexMode"
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
- "type": "string"
+ "question_index_mode": {
+ "$ref": "#/definitions/types.FAQQuestionIndexMode"
+ }
+ }
+ },
+ "types.FAQEntryFieldsBatchUpdate": {
+ "type": "object",
+ "properties": {
+ "by_id": {
+ "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/types.FAQEntryFieldsUpdate"
+ }
},
- "name": {
- "type": "string"
+ "by_tag": {
+ "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/types.FAQEntryFieldsUpdate"
+ }
},
- "type": {
- "description": "\"kb\" for knowledge base, \"file\" for file",
- "type": "string"
+ "exclude_ids": {
+ "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Message": {
+ "types.FAQEntryFieldsUpdate": {
"type": "object",
"properties": {
- "agent_duration_ms": {
- "description": "Agent total execution duration in milliseconds (from query start to answer start)",
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "is_recommended": {
+ "type": "boolean"
+ },
+ "tag_id": {
"type": "integer"
+ }
+ }
+ },
+ "types.FAQEntryPayload": {
+ "type": "object",
+ "required": [
+ "standard_question"
+ ],
+ "properties": {
+ "answer_strategy": {
+ "$ref": "#/definitions/types.AnswerStrategy"
},
- "agent_steps": {
- "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
+ "answers": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep"
+ "type": "string"
}
},
- "channel": {
- "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
- "type": "string"
+ "id": {
+ "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "type": "integer"
},
- "content": {
- "description": "Message text content",
- "type": "string"
+ "is_enabled": {
+ "type": "boolean"
},
- "created_at": {
- "description": "Message creation timestamp",
- "type": "string"
+ "is_recommended": {
+ "type": "boolean"
},
- "deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "negative_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "id": {
- "description": "Unique identifier for the message",
+ "similar_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "standard_question": {
"type": "string"
},
- "images": {
- "description": "Attached images with OCR/Caption text (for user messages)",
+ "tag_id": {
+ "type": "integer"
+ },
+ "tag_name": {
+ "type": "string"
+ }
+ }
+ },
+ "types.FAQIndexMode": {
+ "type": "string",
+ "enum": [
+ "question_only",
+ "question_answer"
+ ],
+ "x-enum-varnames": [
+ "FAQIndexModeQuestionOnly",
+ "FAQIndexModeQuestionAnswer"
+ ]
+ },
+ "types.FAQQuestionIndexMode": {
+ "type": "string",
+ "enum": [
+ "combined",
+ "separate"
+ ],
+ "x-enum-varnames": [
+ "FAQQuestionIndexModeCombined",
+ "FAQQuestionIndexModeSeparate"
+ ]
+ },
+ "types.FAQSearchRequest": {
+ "type": "object",
+ "required": [
+ "query_text"
+ ],
+ "properties": {
+ "first_priority_tag_ids": {
+ "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage"
+ "type": "integer"
}
},
- "is_completed": {
- "description": "Whether message generation is complete",
- "type": "boolean"
+ "match_count": {
+ "type": "integer"
},
- "is_fallback": {
- "description": "Whether this response is a fallback (no knowledge base match found)",
+ "only_recommended": {
+ "description": "是否仅返回推荐的条目",
"type": "boolean"
},
- "knowledge_id": {
- "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
+ "query_text": {
"type": "string"
},
- "knowledge_references": {
- "description": "References to knowledge chunks used in the response",
+ "second_priority_tag_ids": {
+ "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
+ "type": "integer"
}
},
- "mentioned_items": {
- "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "vector_threshold": {
+ "type": "number"
+ }
+ }
+ },
+ "types.GraphNode": {
+ "type": "object",
+ "properties": {
+ "attributes": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
+ "type": "string"
}
},
- "request_id": {
- "description": "Request identifier for tracking API requests",
- "type": "string"
+ "chunks": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "role": {
- "description": "Message role: \"user\", \"assistant\", \"system\"",
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "types.GraphRelation": {
+ "type": "object",
+ "properties": {
+ "node1": {
"type": "string"
},
- "session_id": {
- "description": "ID of the session this message belongs to",
+ "node2": {
"type": "string"
},
- "updated_at": {
- "description": "Last update timestamp",
+ "type": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MessageImage": {
+ "types.ImageProcessingConfig": {
"type": "object",
"properties": {
- "caption": {
- "type": "string"
- },
- "url": {
+ "model_id": {
+ "description": "Model ID",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": {
+ "types.IndexConfig": {
"type": "object",
"properties": {
- "access_key_id": {
+ "collection_name": {
+ "description": "Milvus",
"type": "string"
},
- "bucket_name": {
+ "collection_prefix": {
+ "description": "Qdrant",
"type": "string"
},
- "endpoint": {
+ "index_name": {
+ "description": "ES, OpenSearch",
"type": "string"
},
- "mode": {
- "description": "\"docker\" or \"remote\"",
- "type": "string"
+ "number_of_replicas": {
+ "description": "ES, OpenSearch",
+ "type": "integer"
},
- "path_prefix": {
+ "number_of_shards": {
+ "description": "ES, OpenSearch",
+ "type": "integer"
+ }
+ }
+ },
+ "types.InviteMemberRequest": {
+ "type": "object",
+ "required": [
+ "role",
+ "user_id"
+ ],
+ "properties": {
+ "role": {
+ "description": "Role to assign: admin/editor/viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.OrgMemberRole"
+ }
+ ]
+ },
+ "user_id": {
+ "description": "User ID to invite",
"type": "string"
+ }
+ }
+ },
+ "types.JoinByOrganizationIDRequest": {
+ "type": "object",
+ "required": [
+ "organization_id"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message for join request",
+ "type": "string",
+ "maxLength": 500
},
- "secret_access_key": {
+ "organization_id": {
"type": "string"
},
- "use_ssl": {
- "type": "boolean"
+ "role": {
+ "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.OrgMemberRole"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ModelParameters": {
+ "types.JoinOrganizationRequest": {
"type": "object",
+ "required": [
+ "invite_code"
+ ],
"properties": {
- "api_key": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ }
+ }
+ },
+ "types.Knowledge": {
+ "type": "object",
+ "properties": {
+ "channel": {
+ "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
"type": "string"
},
- "base_url": {
+ "created_at": {
+ "description": "Creation time of the knowledge",
"type": "string"
},
- "embedding_parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
- },
- "extra_config": {
- "description": "Provider-specific configuration",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "deleted_at": {
+ "description": "Deletion time of the knowledge",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
- "interface_type": {
+ "description": {
+ "description": "Description of the knowledge",
"type": "string"
},
- "parameter_size": {
- "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
"type": "string"
},
- "provider": {
- "description": "Provider identifier: openai, aliyun, zhipu, generic",
+ "enable_status": {
+ "description": "Enable status of the knowledge",
"type": "string"
},
- "supports_vision": {
- "description": "Whether the model accepts image/multimodal input",
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ModelSource": {
- "type": "string",
- "enum": [
- "local",
- "remote",
- "aliyun",
- "zhipu",
- "volcengine",
- "deepseek",
- "hunyuan",
- "minimax",
- "openai",
- "gemini",
- "mimo",
- "siliconflow",
- "jina",
- "openrouter",
- "nvidia",
- "novita"
- ],
- "x-enum-comments": {
- "ModelSourceAliyun": "Aliyun DashScope model",
- "ModelSourceDeepseek": "Deepseek model",
- "ModelSourceGemini": "Gemini model",
- "ModelSourceHunyuan": "Hunyuan model",
- "ModelSourceJina": "Jina AI model",
- "ModelSourceLocal": "Local model",
- "ModelSourceMimo": "Mimo model",
- "ModelSourceMinimax": "Minimax mode",
- "ModelSourceNovita": "Novita AI model",
- "ModelSourceNvidia": "NVIDIA model",
- "ModelSourceOpenAI": "OpenAI model",
- "ModelSourceOpenRouter": "OpenRouter model",
- "ModelSourceRemote": "Remote model",
- "ModelSourceSiliconFlow": "SiliconFlow model",
- "ModelSourceVolcengine": "Volcengine model",
- "ModelSourceZhipu": "Zhipu model"
- },
- "x-enum-descriptions": [
- "Local model",
- "Remote model",
- "Aliyun DashScope model",
- "Zhipu model",
- "Volcengine model",
- "Deepseek model",
- "Hunyuan model",
- "Minimax mode",
- "OpenAI model",
- "Gemini model",
- "Mimo model",
- "SiliconFlow model",
- "Jina AI model",
- "OpenRouter model",
- "NVIDIA model",
- "Novita AI model"
- ],
- "x-enum-varnames": [
- "ModelSourceLocal",
- "ModelSourceRemote",
- "ModelSourceAliyun",
- "ModelSourceZhipu",
- "ModelSourceVolcengine",
- "ModelSourceDeepseek",
- "ModelSourceHunyuan",
- "ModelSourceMinimax",
- "ModelSourceOpenAI",
- "ModelSourceGemini",
- "ModelSourceMimo",
- "ModelSourceSiliconFlow",
- "ModelSourceJina",
- "ModelSourceOpenRouter",
- "ModelSourceNvidia",
- "ModelSourceNovita"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ModelType": {
- "type": "string",
- "enum": [
- "Embedding",
- "Rerank",
- "KnowledgeQA",
- "VLLM"
- ],
- "x-enum-comments": {
- "ModelTypeEmbedding": "Embedding model",
- "ModelTypeKnowledgeQA": "KnowledgeQA model",
- "ModelTypeRerank": "Rerank model",
- "ModelTypeVLLM": "VLLM model"
- },
- "x-enum-descriptions": [
- "Embedding model",
- "Rerank model",
- "KnowledgeQA model",
- "VLLM model"
- ],
- "x-enum-varnames": [
- "ModelTypeEmbedding",
- "ModelTypeRerank",
- "ModelTypeKnowledgeQA",
- "ModelTypeVLLM"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": {
- "type": "object",
- "properties": {
- "authorization_url": {
+ "error_message": {
+ "description": "Error message of the knowledge",
"type": "string"
},
- "provider_display_name": {
+ "file_hash": {
+ "description": "File hash of the knowledge",
"type": "string"
},
- "state": {
+ "file_name": {
+ "description": "File name of the knowledge",
"type": "string"
},
- "success": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": {
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
+ "file_path": {
+ "description": "File path of the knowledge",
+ "type": "string"
},
- "provider_display_name": {
+ "file_size": {
+ "description": "File size of the knowledge",
+ "type": "integer"
+ },
+ "file_type": {
+ "description": "File type of the knowledge",
"type": "string"
},
- "success": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
- "type": "string",
- "enum": [
- "admin",
- "editor",
- "viewer"
- ],
- "x-enum-varnames": [
- "OrgRoleAdmin",
- "OrgRoleEditor",
- "OrgRoleViewer"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
- "type": "object",
- "properties": {
- "avatar": {
+ "id": {
+ "description": "Unique identifier of the knowledge",
"type": "string"
},
- "email": {
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base",
"type": "string"
},
- "id": {
+ "knowledge_base_name": {
+ "description": "Knowledge base name (not stored in database, populated on query)",
"type": "string"
},
- "joined_at": {
+ "last_faq_import_result": {
+ "description": "Last FAQ import result (for FAQ type knowledge only)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "metadata": {
+ "description": "Metadata of the knowledge",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "parse_status": {
+ "description": "Parse status of the knowledge",
"type": "string"
},
- "role": {
+ "processed_at": {
+ "description": "Processed time of the knowledge",
+ "type": "string"
+ },
+ "source": {
+ "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
+ "type": "string"
+ },
+ "storage_size": {
+ "description": "Storage size of the knowledge",
+ "type": "integer"
+ },
+ "summary_status": {
+ "description": "Summary status for async summary generation",
+ "type": "string"
+ },
+ "tag_id": {
+ "description": "Optional tag ID for categorization within a knowledge base",
"type": "string"
},
"tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
- "user_id": {
+ "title": {
+ "description": "Title of the knowledge",
"type": "string"
},
- "username": {
+ "type": {
+ "description": "Type of the knowledge",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last updated time of the knowledge",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
+ "types.KnowledgeBase": {
"type": "object",
"properties": {
- "agent_share_count": {
- "description": "共享到该组织的智能体数量",
+ "asr_config": {
+ "description": "ASR config (Automatic Speech Recognition)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ASRConfig"
+ }
+ ]
+ },
+ "chunk_count": {
+ "description": "Chunk count (not stored in database, calculated on query)",
"type": "integer"
},
- "avatar": {
- "type": "string"
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ChunkingConfig"
+ }
+ ]
},
"created_at": {
+ "description": "Creation time of the knowledge base",
"type": "string"
},
+ "deleted_at": {
+ "description": "Deletion time of the knowledge base",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
"description": {
+ "description": "Description of the knowledge base",
"type": "string"
},
- "has_pending_upgrade": {
- "description": "当前用户是否有待处理的权限升级申请",
- "type": "boolean"
- },
- "id": {
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
"type": "string"
},
- "invite_code": {
- "type": "string"
+ "extract_config": {
+ "description": "Extract config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ExtractConfig"
+ }
+ ]
},
- "invite_code_expires_at": {
+ "faq_config": {
+ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.FAQConfig"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the knowledge base",
"type": "string"
},
- "invite_code_validity_days": {
- "type": "integer"
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ImageProcessingConfig"
+ }
+ ]
},
- "is_owner": {
+ "is_pinned": {
+ "description": "Whether this knowledge base is pinned to the top of the list",
"type": "boolean"
},
- "member_count": {
- "type": "integer"
+ "is_processing": {
+ "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
+ "type": "boolean"
},
- "member_limit": {
- "description": "0 = unlimited",
- "type": "integer"
+ "is_temporary": {
+ "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
+ "type": "boolean"
},
- "my_role": {
- "type": "string"
+ "knowledge_count": {
+ "description": "Knowledge count (not stored in database, calculated on query)",
+ "type": "integer"
},
"name": {
+ "description": "Name of the knowledge base",
"type": "string"
},
- "owner_id": {
+ "pinned_at": {
+ "description": "Time when the knowledge base was pinned (nil if not pinned)",
"type": "string"
},
- "pending_join_request_count": {
- "description": "待审批加入申请数(仅管理员可见)",
+ "processing_count": {
+ "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
"type": "integer"
},
- "require_approval": {
- "type": "boolean"
- },
- "searchable": {
- "type": "boolean"
+ "question_generation_config": {
+ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.QuestionGenerationConfig"
+ }
+ ]
},
"share_count": {
- "description": "共享到该组织的知识库数量",
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "type": "integer"
+ },
+ "storage_config": {
+ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.StorageConfig"
+ }
+ ]
+ },
+ "storage_provider_config": {
+ "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.StorageProviderConfig"
+ }
+ ]
+ },
+ "summary_model_id": {
+ "description": "Summary model ID",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
+ "type": {
+ "description": "Type of the knowledge base (document, faq, etc.)",
+ "type": "string"
+ },
"updated_at": {
+ "description": "Last updated time of the knowledge base",
"type": "string"
+ },
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.VLMConfig"
+ }
+ ]
+ }
+ }
+ },
+ "types.KnowledgeBaseConfig": {
+ "type": "object",
+ "properties": {
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ChunkingConfig"
+ }
+ ]
+ },
+ "faq_config": {
+ "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.FAQConfig"
+ }
+ ]
+ },
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ImageProcessingConfig"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": {
+ "types.KnowledgeBaseShareResponse": {
"type": "object",
"properties": {
- "docreader_addr": {
- "description": "文档解析服务地址",
+ "chunk_count": {
+ "type": "integer"
+ },
+ "created_at": {
"type": "string"
},
- "mineru_api_key": {
- "description": "MinerU 云 API Key",
+ "id": {
"type": "string"
},
- "mineru_cloud_enable_formula": {
- "type": "boolean"
+ "knowledge_base_id": {
+ "type": "string"
},
- "mineru_cloud_enable_ocr": {
- "type": "boolean"
+ "knowledge_base_name": {
+ "type": "string"
},
- "mineru_cloud_enable_table": {
- "type": "boolean"
+ "knowledge_base_type": {
+ "type": "string"
},
- "mineru_cloud_language": {
+ "knowledge_count": {
+ "type": "integer"
+ },
+ "my_permission": {
+ "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
"type": "string"
},
- "mineru_cloud_model": {
- "description": "MinerU 云 API 解析参数",
+ "my_role_in_org": {
+ "description": "Current user's role in this organization (admin/editor/viewer)",
"type": "string"
},
- "mineru_enable_formula": {
- "type": "boolean"
+ "organization_id": {
+ "type": "string"
},
- "mineru_enable_ocr": {
- "type": "boolean"
+ "organization_name": {
+ "type": "string"
},
- "mineru_enable_table": {
+ "permission": {
+ "description": "Share permission (what the space was granted: viewer/editor)",
+ "type": "string"
+ },
+ "require_approval": {
"type": "boolean"
},
- "mineru_endpoint": {
- "description": "MinerU 自建服务端点",
+ "shared_by_user_id": {
"type": "string"
},
- "mineru_language": {
+ "shared_by_username": {
"type": "string"
},
- "mineru_model": {
- "description": "MinerU 自建解析参数",
- "type": "string"
+ "source_tenant_id": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": {
+ "types.ListMembersResponse": {
"type": "object",
"properties": {
- "engine": {
- "type": "string"
+ "members": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.OrganizationMemberResponse"
+ }
},
- "file_types": {
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "types.ListOrganizationsResponse": {
+ "type": "object",
+ "properties": {
+ "organizations": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/types.OrganizationResponse"
}
+ },
+ "resource_counts": {
+ "description": "各空间内知识库/智能体数量,供列表侧栏展示",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ResourceCountsByOrgResponse"
+ }
+ ]
+ },
+ "total": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
+ "types.ListSharesResponse": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
+ "shares": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.KnowledgeBaseShareResponse"
+ }
},
- "question_count": {
- "description": "Number of questions to generate per chunk (default: 3, max: 10)",
+ "total": {
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
+ "types.LocalEngineConfig": {
+ "type": "object",
+ "properties": {
+ "path_prefix": {
+ "type": "string"
+ }
+ }
+ },
+ "types.LoginRequest": {
"type": "object",
"required": [
"email",
- "password",
- "username"
+ "password"
],
"properties": {
"email": {
@@ -10874,1751 +11449,1894 @@ const docTemplate = `{
"password": {
"type": "string",
"minLength": 6
- },
- "username": {
- "type": "string",
- "maxLength": 50,
- "minLength": 2
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RegisterResponse": {
+ "types.LoginResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
+ "refresh_token": {
+ "type": "string"
+ },
"success": {
"type": "boolean"
},
"tenant": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "$ref": "#/definitions/types.Tenant"
+ },
+ "token": {
+ "type": "string"
},
"user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
+ "$ref": "#/definitions/types.User"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
+ "types.MCPAdvancedConfig": {
"type": "object",
- "required": [
- "requested_role"
- ],
"properties": {
- "message": {
- "description": "Optional message explaining the reason",
- "type": "string",
- "maxLength": 500
+ "retry_count": {
+ "description": "Number of retries, default: 3",
+ "type": "integer"
},
- "requested_role": {
- "description": "The role user wants to upgrade to",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "retry_delay": {
+ "description": "Delay between retries in seconds, default: 1",
+ "type": "integer"
+ },
+ "timeout": {
+ "description": "Timeout in seconds, default: 30",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Resource": {
+ "types.MCPAuthConfig": {
"type": "object",
"properties": {
- "description": {
- "description": "Optional description",
- "type": "string"
- },
- "external_id": {
- "description": "Unique identifier in the external system",
+ "api_key": {
"type": "string"
},
- "metadata": {
- "description": "Additional metadata",
+ "custom_headers": {
"type": "object",
- "additionalProperties": true
- },
- "modified_at": {
- "description": "Last modified time in external system",
- "type": "string"
- },
- "name": {
- "description": "Display name",
- "type": "string"
- },
- "parent_id": {
- "description": "For hierarchical resources (parent ID if applicable)",
- "type": "string"
- },
- "type": {
- "description": "Resource type (document, folder, space, page, etc.)",
- "type": "string"
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "url": {
- "description": "URL to access in external system",
+ "token": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
+ "types.MCPEnvVars": {
"type": "object",
- "properties": {
- "agents": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
- },
- "knowledge_bases": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
- }
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "types.MCPHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": {
+ "types.MCPService": {
"type": "object",
"properties": {
- "embedding_top_k": {
- "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
- "type": "integer"
+ "advanced_config": {
+ "$ref": "#/definitions/types.MCPAdvancedConfig"
},
- "keyword_threshold": {
- "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
- "type": "number"
+ "auth_config": {
+ "$ref": "#/definitions/types.MCPAuthConfig"
},
- "rerank_model_id": {
- "description": "RerankModelID is the ID of the rerank model to use (required for search)",
+ "created_at": {
"type": "string"
},
- "rerank_threshold": {
- "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
- "type": "number"
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
},
- "rerank_top_k": {
- "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
- "type": "integer"
+ "description": {
+ "type": "string"
},
- "vector_threshold": {
- "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
- "type": "number"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
- "type": "object",
- "properties": {
- "retriever_engine_type": {
- "description": "Retriever engine type",
+ "enabled": {
+ "type": "boolean"
+ },
+ "env_vars": {
+ "description": "Environment variables for stdio",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ "$ref": "#/definitions/types.MCPEnvVars"
}
]
},
- "retriever_type": {
- "description": "Retriever type",
+ "headers": {
+ "$ref": "#/definitions/types.MCPHeaders"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_builtin": {
+ "description": "Whether this is a builtin MCP service (visible to all tenants)",
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "stdio_config": {
+ "description": "Required for stdio transport",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType"
+ "$ref": "#/definitions/types.MCPStdioConfig"
}
]
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "transport_type": {
+ "$ref": "#/definitions/types.MCPTransportType"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "url": {
+ "description": "Optional: required for SSE/HTTP Streamable",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": {
- "type": "string",
- "enum": [
- "postgres",
- "elasticsearch",
- "infinity",
- "elasticfaiss",
- "qdrant",
- "milvus",
- "weaviate",
- "sqlite"
- ],
- "x-enum-varnames": [
- "PostgresRetrieverEngineType",
- "ElasticsearchRetrieverEngineType",
- "InfinityRetrieverEngineType",
- "ElasticFaissRetrieverEngineType",
- "QdrantRetrieverEngineType",
- "MilvusRetrieverEngineType",
- "WeaviateRetrieverEngineType",
- "SQLiteRetrieverEngineType"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
+ "types.MCPStdioConfig": {
"type": "object",
"properties": {
- "engines": {
+ "args": {
+ "description": "Command arguments array",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams"
+ "type": "string"
}
+ },
+ "command": {
+ "description": "Command: \"uvx\" or \"npx\"",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrieverType": {
+ "types.MCPTransportType": {
"type": "string",
"enum": [
- "keywords",
- "vector",
- "websearch"
+ "sse",
+ "http-streamable",
+ "stdio"
],
"x-enum-comments": {
- "KeywordsRetrieverType": "Keywords retriever",
- "VectorRetrieverType": "Vector retriever",
- "WebSearchRetrieverType": "Web search retriever"
+ "MCPTransportHTTPStreamable": "HTTP Streamable",
+ "MCPTransportSSE": "Server-Sent Events",
+ "MCPTransportStdio": "Stdio (Standard Input/Output)"
},
"x-enum-descriptions": [
- "Keywords retriever",
- "Vector retriever",
- "Web search retriever"
+ "Server-Sent Events",
+ "HTTP Streamable",
+ "Stdio (Standard Input/Output)"
],
"x-enum-varnames": [
- "KeywordsRetrieverType",
- "VectorRetrieverType",
- "WebSearchRetrieverType"
+ "MCPTransportSSE",
+ "MCPTransportHTTPStreamable",
+ "MCPTransportStdio"
]
},
- "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
+ "types.ManualKnowledgePayload": {
"type": "object",
"properties": {
- "approved": {
- "type": "boolean"
+ "channel": {
+ "type": "string"
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "content": {
+ "type": "string"
},
- "role": {
- "description": "Optional: role to assign when approving; overrides applicant's requested role",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "status": {
+ "type": "string"
+ },
+ "tag_id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": {
+ "types.MatchType": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "x-enum-comments": {
+ "MatchTypeDataAnalysis": "数据分析匹配类型",
+ "MatchTypeDirectLoad": "直接加载匹配类型",
+ "MatchTypeParentChunk": "父Chunk匹配类型",
+ "MatchTypeRelationChunk": "关系Chunk匹配类型",
+ "MatchTypeWebSearch": "网络搜索匹配类型"
+ },
+ "x-enum-descriptions": [
+ "",
+ "",
+ "",
+ "",
+ "父Chunk匹配类型",
+ "关系Chunk匹配类型",
+ "",
+ "网络搜索匹配类型",
+ "直接加载匹配类型",
+ "数据分析匹配类型"
+ ],
+ "x-enum-varnames": [
+ "MatchTypeEmbedding",
+ "MatchTypeKeywords",
+ "MatchTypeNearByChunk",
+ "MatchTypeHistory",
+ "MatchTypeParentChunk",
+ "MatchTypeRelationChunk",
+ "MatchTypeGraph",
+ "MatchTypeWebSearch",
+ "MatchTypeDirectLoad",
+ "MatchTypeDataAnalysis"
+ ]
+ },
+ "types.MentionedItem": {
"type": "object",
"properties": {
- "access_key": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
- },
- "endpoint": {
+ "id": {
"type": "string"
},
- "path_prefix": {
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
"type": "string"
},
- "region": {
+ "name": {
"type": "string"
},
- "secret_key": {
+ "type": {
+ "description": "\"kb\" for knowledge base, \"file\" for file",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SearchParams": {
+ "types.Message": {
"type": "object",
"properties": {
- "disable_keywords_match": {
- "type": "boolean"
- },
- "disable_vector_match": {
- "type": "boolean"
- },
- "keyword_threshold": {
- "type": "number"
+ "agent_duration_ms": {
+ "description": "Agent total execution duration in milliseconds (from query start to answer start)",
+ "type": "integer"
},
- "knowledge_base_ids": {
- "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
+ "agent_steps": {
+ "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/types.AgentStep"
}
},
- "knowledge_ids": {
+ "attachments": {
+ "description": "Attached files (documents, audio, etc., for user messages)",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/types.MessageAttachment"
}
},
- "match_count": {
- "type": "integer"
+ "channel": {
+ "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
+ "type": "string"
},
- "only_recommended": {
- "type": "boolean"
+ "content": {
+ "description": "Message text content",
+ "type": "string"
},
- "query_embedding": {
+ "created_at": {
+ "description": "Message creation timestamp",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier for the message",
+ "type": "string"
+ },
+ "images": {
+ "description": "Attached images with OCR/Caption text (for user messages)",
"type": "array",
"items": {
- "type": "number"
+ "$ref": "#/definitions/types.MessageImage"
}
},
- "query_text": {
- "type": "string"
+ "is_completed": {
+ "description": "Whether message generation is complete",
+ "type": "boolean"
},
- "skip_context_enrichment": {
- "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
+ "is_fallback": {
+ "description": "Whether this response is a fallback (no knowledge base match found)",
"type": "boolean"
},
- "tag_ids": {
- "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "knowledge_id": {
+ "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
+ "type": "string"
+ },
+ "knowledge_references": {
+ "description": "References to knowledge chunks used in the response",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/types.SearchResult"
}
},
- "vector_threshold": {
- "type": "number"
+ "mentioned_items": {
+ "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.MentionedItem"
+ }
+ },
+ "request_id": {
+ "description": "Request identifier for tracking API requests",
+ "type": "string"
+ },
+ "role": {
+ "description": "Message role: \"user\", \"assistant\", \"system\"",
+ "type": "string"
+ },
+ "session_id": {
+ "description": "ID of the session this message belongs to",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SearchResult": {
+ "types.MessageAttachment": {
"type": "object",
"properties": {
- "chunk_index": {
- "description": "Chunk index",
- "type": "integer"
- },
- "chunk_metadata": {
- "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "content": {
+ "description": "Extracted text content (for small text files)",
+ "type": "string"
},
- "chunk_type": {
- "description": "Chunk 类型",
+ "file_name": {
+ "description": "Original filename",
"type": "string"
},
- "content": {
- "description": "Content",
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
+ },
+ "file_type": {
+ "description": "File extension (e.g., \".pdf\", \".docx\")",
"type": "string"
},
- "end_at": {
- "description": "End at",
+ "is_truncated": {
+ "description": "Whether content was truncated",
+ "type": "boolean"
+ },
+ "line_count": {
+ "description": "Total line count (for text files)",
"type": "integer"
},
- "id": {
- "description": "ID",
+ "url": {
+ "description": "Storage URL (provider://path)",
+ "type": "string"
+ }
+ }
+ },
+ "types.MessageImage": {
+ "type": "object",
+ "properties": {
+ "caption": {
"type": "string"
},
- "image_info": {
- "description": "图片信息 (JSON 格式)",
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "types.MinIOEngineConfig": {
+ "type": "object",
+ "properties": {
+ "access_key_id": {
"type": "string"
},
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
+ "bucket_name": {
"type": "string"
},
- "knowledge_channel": {
- "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
+ "endpoint": {
"type": "string"
},
- "knowledge_description": {
- "description": "KnowledgeDescription is the description of the knowledge document",
+ "mode": {
+ "description": "\"docker\" or \"remote\"",
"type": "string"
},
- "knowledge_filename": {
- "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
+ "path_prefix": {
"type": "string"
},
- "knowledge_id": {
- "description": "Knowledge ID",
+ "secret_access_key": {
"type": "string"
},
- "knowledge_source": {
- "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
+ "use_ssl": {
+ "type": "boolean"
+ }
+ }
+ },
+ "types.ModelParameters": {
+ "type": "object",
+ "properties": {
+ "api_key": {
"type": "string"
},
- "knowledge_title": {
- "description": "Knowledge title",
+ "app_id": {
+ "description": "WeKnoraCloud 厂商专用凭证",
"type": "string"
},
- "match_type": {
- "description": "Match type",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
- }
- ]
+ "app_secret": {
+ "description": "AES-256 加密存储,实际承载上游 API Key",
+ "type": "string"
},
- "matched_content": {
- "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "base_url": {
"type": "string"
},
- "metadata": {
- "description": "Metadata",
+ "embedding_parameters": {
+ "$ref": "#/definitions/types.EmbeddingParameters"
+ },
+ "extra_config": {
+ "description": "Provider-specific configuration",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
- "parent_chunk_id": {
- "description": "父 Chunk ID",
+ "interface_type": {
"type": "string"
},
- "score": {
- "description": "Score",
- "type": "number"
- },
- "seq": {
- "description": "Seq",
- "type": "integer"
+ "parameter_size": {
+ "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
+ "type": "string"
},
- "start_at": {
- "description": "Start at",
- "type": "integer"
+ "provider": {
+ "description": "Provider identifier: openai, aliyun, zhipu, generic",
+ "type": "string"
},
- "sub_chunk_id": {
- "description": "SubChunkIndex",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "supports_vision": {
+ "description": "Whether the model accepts image/multimodal input",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Session": {
+ "types.ModelSource": {
+ "type": "string",
+ "enum": [
+ "local",
+ "remote",
+ "aliyun",
+ "zhipu",
+ "volcengine",
+ "deepseek",
+ "hunyuan",
+ "minimax",
+ "openai",
+ "gemini",
+ "mimo",
+ "siliconflow",
+ "jina",
+ "openrouter",
+ "nvidia",
+ "novita",
+ "azure_openai"
+ ],
+ "x-enum-comments": {
+ "ModelSourceAliyun": "Aliyun DashScope model",
+ "ModelSourceAzureOpenAI": "Azure OpenAI model",
+ "ModelSourceDeepseek": "Deepseek model",
+ "ModelSourceGemini": "Gemini model",
+ "ModelSourceHunyuan": "Hunyuan model",
+ "ModelSourceJina": "Jina AI model",
+ "ModelSourceLocal": "Local model",
+ "ModelSourceMimo": "Mimo model",
+ "ModelSourceMinimax": "Minimax mode",
+ "ModelSourceNovita": "Novita AI model",
+ "ModelSourceNvidia": "NVIDIA model",
+ "ModelSourceOpenAI": "OpenAI model",
+ "ModelSourceOpenRouter": "OpenRouter model",
+ "ModelSourceRemote": "Remote model",
+ "ModelSourceSiliconFlow": "SiliconFlow model",
+ "ModelSourceVolcengine": "Volcengine model",
+ "ModelSourceZhipu": "Zhipu model"
+ },
+ "x-enum-descriptions": [
+ "Local model",
+ "Remote model",
+ "Aliyun DashScope model",
+ "Zhipu model",
+ "Volcengine model",
+ "Deepseek model",
+ "Hunyuan model",
+ "Minimax mode",
+ "OpenAI model",
+ "Gemini model",
+ "Mimo model",
+ "SiliconFlow model",
+ "Jina AI model",
+ "OpenRouter model",
+ "NVIDIA model",
+ "Novita AI model",
+ "Azure OpenAI model"
+ ],
+ "x-enum-varnames": [
+ "ModelSourceLocal",
+ "ModelSourceRemote",
+ "ModelSourceAliyun",
+ "ModelSourceZhipu",
+ "ModelSourceVolcengine",
+ "ModelSourceDeepseek",
+ "ModelSourceHunyuan",
+ "ModelSourceMinimax",
+ "ModelSourceOpenAI",
+ "ModelSourceGemini",
+ "ModelSourceMimo",
+ "ModelSourceSiliconFlow",
+ "ModelSourceJina",
+ "ModelSourceOpenRouter",
+ "ModelSourceNvidia",
+ "ModelSourceNovita",
+ "ModelSourceAzureOpenAI"
+ ]
+ },
+ "types.ModelType": {
+ "type": "string",
+ "enum": [
+ "Embedding",
+ "Rerank",
+ "KnowledgeQA",
+ "VLLM",
+ "ASR"
+ ],
+ "x-enum-comments": {
+ "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
+ "ModelTypeEmbedding": "Embedding model",
+ "ModelTypeKnowledgeQA": "KnowledgeQA model",
+ "ModelTypeRerank": "Rerank model",
+ "ModelTypeVLLM": "VLLM model"
+ },
+ "x-enum-descriptions": [
+ "Embedding model",
+ "Rerank model",
+ "KnowledgeQA model",
+ "VLLM model",
+ "ASR (Automatic Speech Recognition) model"
+ ],
+ "x-enum-varnames": [
+ "ModelTypeEmbedding",
+ "ModelTypeRerank",
+ "ModelTypeKnowledgeQA",
+ "ModelTypeVLLM",
+ "ModelTypeASR"
+ ]
+ },
+ "types.OIDCAuthURLResponse": {
"type": "object",
"properties": {
- "created_at": {
+ "authorization_url": {
"type": "string"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "description": {
- "description": "Description",
+ "provider_display_name": {
"type": "string"
},
- "id": {
- "description": "ID",
+ "state": {
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "types.OIDCConfigResponse": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
},
- "title": {
- "description": "Title",
+ "provider_display_name": {
"type": "string"
},
- "updated_at": {
- "type": "string"
+ "success": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
+ "types.OSSEngineConfig": {
"type": "object",
- "required": [
- "organization_id",
- "permission"
- ],
"properties": {
- "organization_id": {
+ "access_key": {
"type": "string"
},
- "permission": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
+ "type": "string"
+ },
+ "temp_bucket_name": {
+ "type": "string"
+ },
+ "temp_region": {
+ "type": "string"
+ },
+ "use_temp_bucket": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StorageConfig": {
+ "types.OrgMemberRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "OrgRoleAdmin",
+ "OrgRoleEditor",
+ "OrgRoleViewer"
+ ]
+ },
+ "types.OrganizationMemberResponse": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
- },
- "bucket_name": {
+ "avatar": {
"type": "string"
},
- "path_prefix": {
+ "email": {
"type": "string"
},
- "provider": {
+ "id": {
"type": "string"
},
- "region": {
+ "joined_at": {
"type": "string"
},
- "secret_id": {
+ "role": {
"type": "string"
},
- "secret_key": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": {
- "type": "object",
- "properties": {
- "cos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
+ "tenant_id": {
+ "type": "integer"
},
- "default_provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\"",
+ "user_id": {
"type": "string"
},
- "local": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
- },
- "minio": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
- },
- "s3": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
- },
- "tos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": {
- "type": "object",
- "properties": {
- "provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "username": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
+ "types.OrganizationResponse": {
"type": "object",
- "required": [
- "invite_code"
- ],
"properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
- },
- "message": {
- "type": "string",
- "maxLength": 500
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
+ "type": "integer"
},
- "role": {
- "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SyncLog": {
- "type": "object",
- "properties": {
- "created_at": {
- "description": "Creation timestamp (usually same as StartedAt)",
+ "avatar": {
"type": "string"
},
- "data_source_id": {
- "description": "Reference to the data source",
+ "created_at": {
"type": "string"
},
- "error_message": {
- "description": "Error details if status is \"failed\"",
+ "description": {
"type": "string"
},
- "finished_at": {
- "description": "Sync completion time",
- "type": "string"
+ "has_pending_upgrade": {
+ "description": "当前用户是否有待处理的权限升级申请",
+ "type": "boolean"
},
"id": {
- "description": "Unique identifier",
"type": "string"
},
- "items_created": {
- "description": "New items created in knowledge base",
- "type": "integer"
+ "invite_code": {
+ "type": "string"
},
- "items_deleted": {
- "description": "Items deleted from knowledge base",
- "type": "integer"
+ "invite_code_expires_at": {
+ "type": "string"
},
- "items_failed": {
- "description": "Items that failed to sync",
+ "invite_code_validity_days": {
"type": "integer"
},
- "items_skipped": {
- "description": "Items skipped (no changes detected)",
- "type": "integer"
+ "is_owner": {
+ "type": "boolean"
},
- "items_total": {
- "description": "Total items fetched from source",
+ "member_count": {
"type": "integer"
},
- "items_updated": {
- "description": "Existing items updated",
+ "member_limit": {
+ "description": "0 = unlimited",
"type": "integer"
},
- "result": {
- "description": "Detailed sync result (JSON-encoded)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "started_at": {
- "description": "Sync start time",
+ "my_role": {
"type": "string"
},
- "status": {
- "description": "Sync status: running, success, partial, failed, canceled",
+ "name": {
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
- },
- "updated_at": {
- "description": "Last update timestamp",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": {
- "type": "object",
- "properties": {
- "access_key": {
+ "owner_id": {
"type": "string"
},
- "bucket_name": {
- "type": "string"
+ "pending_join_request_count": {
+ "description": "待审批加入申请数(仅管理员可见)",
+ "type": "integer"
},
- "endpoint": {
- "type": "string"
+ "require_approval": {
+ "type": "boolean"
},
- "path_prefix": {
- "type": "string"
+ "searchable": {
+ "type": "boolean"
},
- "region": {
- "type": "string"
+ "share_count": {
+ "description": "共享到该组织的知识库数量",
+ "type": "integer"
},
- "secret_key": {
+ "updated_at": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Tenant": {
+ "types.ParserEngineConfig": {
"type": "object",
"properties": {
- "agent_config": {
- "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig"
- }
- ]
- },
- "api_key": {
- "description": "API key",
- "type": "string"
- },
- "business": {
- "description": "Business",
+ "mineru_api_key": {
+ "description": "MinerU 云 API Key",
"type": "string"
},
- "chat_history_config": {
- "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
- }
- ]
- },
- "context_config": {
- "description": "Global Context configuration for this tenant (default for all sessions)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
- }
- ]
- },
- "conversation_config": {
- "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig"
- }
- ]
+ "mineru_cloud_enable_formula": {
+ "type": "boolean"
},
- "created_at": {
- "description": "Creation time",
- "type": "string"
+ "mineru_cloud_enable_ocr": {
+ "type": "boolean"
},
- "deleted_at": {
- "description": "Deletion time",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "mineru_cloud_enable_table": {
+ "type": "boolean"
},
- "description": {
- "description": "Description",
+ "mineru_cloud_language": {
"type": "string"
},
- "id": {
- "description": "ID",
- "type": "integer"
- },
- "name": {
- "description": "Name",
+ "mineru_cloud_model": {
+ "description": "MinerU 云 API 解析参数",
"type": "string"
},
- "parser_engine_config": {
- "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
- }
- ]
+ "mineru_enable_formula": {
+ "type": "boolean"
},
- "retrieval_config": {
- "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
- }
- ]
+ "mineru_enable_ocr": {
+ "type": "boolean"
},
- "retriever_engines": {
- "description": "Retriever engines",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
- }
- ]
+ "mineru_enable_table": {
+ "type": "boolean"
},
- "status": {
- "description": "Status",
+ "mineru_endpoint": {
+ "description": "MinerU 自建服务端点",
"type": "string"
},
- "storage_engine_config": {
- "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
- }
- ]
- },
- "storage_quota": {
- "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
- "type": "integer"
- },
- "storage_used": {
- "description": "Storage used (Bytes)",
- "type": "integer"
+ "mineru_language": {
+ "type": "string"
},
- "updated_at": {
- "description": "Last updated time",
+ "mineru_model": {
+ "description": "MinerU 自建解析参数",
+ "type": "string"
+ }
+ }
+ },
+ "types.ParserEngineRule": {
+ "type": "object",
+ "properties": {
+ "engine": {
"type": "string"
},
- "web_search_config": {
- "description": "Global WebSearch configuration for this tenant",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
- }
- ]
+ "file_types": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ToolCall": {
+ "types.QuestionGenerationConfig": {
"type": "object",
"properties": {
- "args": {
- "description": "Tool arguments",
- "type": "object",
- "additionalProperties": true
+ "enabled": {
+ "type": "boolean"
},
- "duration": {
- "description": "Execution time in milliseconds",
+ "question_count": {
+ "description": "Number of questions to generate per chunk (default: 3, max: 10)",
"type": "integer"
- },
- "id": {
- "description": "Function call ID from LLM",
+ }
+ }
+ },
+ "types.RegisterRequest": {
+ "type": "object",
+ "required": [
+ "email",
+ "password",
+ "username"
+ ],
+ "properties": {
+ "email": {
"type": "string"
},
- "name": {
- "description": "Tool name",
- "type": "string"
+ "password": {
+ "type": "string",
+ "minLength": 6
},
- "reflection": {
- "description": "Agent's reflection on this tool call result (if enabled)",
+ "username": {
+ "type": "string",
+ "maxLength": 50,
+ "minLength": 2
+ }
+ }
+ },
+ "types.RegisterResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
"type": "string"
},
- "result": {
- "description": "Execution result (contains Output)",
+ "success": {
+ "type": "boolean"
+ },
+ "tenant": {
+ "$ref": "#/definitions/types.Tenant"
+ },
+ "user": {
+ "$ref": "#/definitions/types.User"
+ }
+ }
+ },
+ "types.RequestRoleUpgradeRequest": {
+ "type": "object",
+ "required": [
+ "requested_role"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message explaining the reason",
+ "type": "string",
+ "maxLength": 500
+ },
+ "requested_role": {
+ "description": "The role user wants to upgrade to",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult"
+ "$ref": "#/definitions/types.OrgMemberRole"
}
]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ToolResult": {
+ "types.Resource": {
"type": "object",
"properties": {
- "data": {
- "description": "Structured data for programmatic use",
+ "description": {
+ "description": "Optional description",
+ "type": "string"
+ },
+ "external_id": {
+ "description": "Unique identifier in the external system",
+ "type": "string"
+ },
+ "has_children": {
+ "description": "Whether this resource has children that can be expanded",
+ "type": "boolean"
+ },
+ "metadata": {
+ "description": "Additional metadata",
"type": "object",
"additionalProperties": true
},
- "error": {
- "description": "Error message if execution failed",
+ "modified_at": {
+ "description": "Last modified time in external system",
"type": "string"
},
- "images": {
- "description": "Base64 data URIs from tool (e.g. MCP image content)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "name": {
+ "description": "Display name",
+ "type": "string"
},
- "output": {
- "description": "Human-readable output",
+ "parent_id": {
+ "description": "For hierarchical resources (parent ID if applicable)",
"type": "string"
},
- "success": {
- "description": "Whether the tool executed successfully",
- "type": "boolean"
+ "type": {
+ "description": "Resource type (document, folder, space, page, etc.)",
+ "type": "string"
+ },
+ "url": {
+ "description": "URL to access in external system",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
+ "types.ResourceCountsByOrgResponse": {
"type": "object",
- "required": [
- "role"
- ],
"properties": {
- "role": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "agents": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "knowledge_bases": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
+ "types.RetrievalConfig": {
"type": "object",
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
+ "embedding_top_k": {
+ "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
+ "type": "integer"
},
- "description": {
- "type": "string",
- "maxLength": 1000
+ "keyword_threshold": {
+ "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
+ "type": "number"
},
- "invite_code_validity_days": {
- "description": "0=never, 1, 7, 30",
- "type": "integer"
+ "rerank_model_id": {
+ "description": "RerankModelID is the ID of the rerank model to use (required for search)",
+ "type": "string"
},
- "member_limit": {
- "description": "max members; 0=unlimited",
- "type": "integer"
+ "rerank_threshold": {
+ "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
+ "type": "number"
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
+ "rerank_top_k": {
+ "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
+ "type": "integer"
},
- "require_approval": {
- "type": "boolean"
+ "vector_threshold": {
+ "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
+ "type": "number"
+ }
+ }
+ },
+ "types.RetrieverEngineParams": {
+ "type": "object",
+ "properties": {
+ "retriever_engine_type": {
+ "description": "Retriever engine type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.RetrieverEngineType"
+ }
+ ]
},
- "searchable": {
- "description": "open for search so others can discover and join",
- "type": "boolean"
+ "retriever_type": {
+ "description": "Retriever type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.RetrieverType"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
+ "types.RetrieverEngineType": {
+ "type": "string",
+ "enum": [
+ "postgres",
+ "elasticsearch",
+ "infinity",
+ "elasticfaiss",
+ "qdrant",
+ "milvus",
+ "weaviate",
+ "sqlite"
+ ],
+ "x-enum-varnames": [
+ "PostgresRetrieverEngineType",
+ "ElasticsearchRetrieverEngineType",
+ "InfinityRetrieverEngineType",
+ "ElasticFaissRetrieverEngineType",
+ "QdrantRetrieverEngineType",
+ "MilvusRetrieverEngineType",
+ "WeaviateRetrieverEngineType",
+ "SQLiteRetrieverEngineType"
+ ]
+ },
+ "types.RetrieverEngines": {
"type": "object",
- "required": [
- "permission"
+ "properties": {
+ "engines": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.RetrieverEngineParams"
+ }
+ }
+ }
+ },
+ "types.RetrieverType": {
+ "type": "string",
+ "enum": [
+ "keywords",
+ "vector",
+ "websearch"
+ ],
+ "x-enum-comments": {
+ "KeywordsRetrieverType": "Keywords retriever",
+ "VectorRetrieverType": "Vector retriever",
+ "WebSearchRetrieverType": "Web search retriever"
+ },
+ "x-enum-descriptions": [
+ "Keywords retriever",
+ "Vector retriever",
+ "Web search retriever"
],
- "properties": {
- "permission": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- }
+ "x-enum-varnames": [
+ "KeywordsRetrieverType",
+ "VectorRetrieverType",
+ "WebSearchRetrieverType"
+ ]
},
- "github_com_Tencent_WeKnora_internal_types.User": {
+ "types.ReviewJoinRequestRequest": {
"type": "object",
"properties": {
- "avatar": {
- "description": "Avatar URL of the user",
- "type": "string"
- },
- "can_access_all_tenants": {
- "description": "Whether the user can access all tenants (cross-tenant access)",
+ "approved": {
"type": "boolean"
},
- "created_at": {
- "description": "Creation time of the user",
- "type": "string"
- },
- "deleted_at": {
- "description": "Deletion time of the user",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "email": {
- "description": "Email address of the user",
- "type": "string"
- },
- "id": {
- "description": "Unique identifier of the user",
- "type": "string"
- },
- "is_active": {
- "description": "Whether the user is active",
- "type": "boolean"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "tenant": {
- "description": "Association relationship, not stored in the database",
+ "role": {
+ "description": "Optional: role to assign when approving; overrides applicant's requested role",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "$ref": "#/definitions/types.OrgMemberRole"
}
]
- },
- "tenant_id": {
- "description": "Tenant ID that the user belongs to",
- "type": "integer"
- },
- "updated_at": {
- "description": "Last updated time of the user",
- "type": "string"
- },
- "username": {
- "description": "Username of the user",
- "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.VLMConfig": {
+ "types.S3EngineConfig": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API Key",
+ "access_key": {
"type": "string"
},
- "base_url": {
- "description": "Base URL",
+ "bucket_name": {
"type": "string"
},
- "enabled": {
- "type": "boolean"
+ "endpoint": {
+ "type": "string"
},
- "interface_type": {
- "description": "Interface Type: \"ollama\" or \"openai\"",
+ "path_prefix": {
"type": "string"
},
- "model_id": {
+ "region": {
"type": "string"
},
- "model_name": {
- "description": "兼容老版本\nModel Name",
+ "secret_key": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": {
+ "types.SearchParams": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API密钥(如果需要)",
- "type": "string"
+ "disable_keywords_match": {
+ "type": "boolean"
},
- "blacklist": {
- "description": "黑名单规则列表",
+ "disable_vector_match": {
+ "type": "boolean"
+ },
+ "keyword_threshold": {
+ "type": "number"
+ },
+ "knowledge_base_ids": {
+ "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
"type": "array",
"items": {
"type": "string"
}
},
- "compression_method": {
- "description": "压缩方法:none, summary, extract, rag",
- "type": "string"
+ "knowledge_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "document_fragments": {
- "description": "文档片段数量(用于RAG压缩)",
+ "match_count": {
"type": "integer"
},
- "embedding_dimension": {
- "description": "嵌入维度(用于RAG压缩)",
- "type": "integer"
+ "only_recommended": {
+ "type": "boolean"
},
- "embedding_model_id": {
- "description": "RAG压缩相关配置",
+ "query_embedding": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ },
+ "query_text": {
"type": "string"
},
- "include_date": {
- "description": "是否包含日期",
+ "skip_context_enrichment": {
+ "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
"type": "boolean"
},
- "max_results": {
- "description": "最大搜索结果数",
- "type": "integer"
- },
- "provider": {
- "description": "搜索引擎提供商ID",
- "type": "string"
+ "tag_ids": {
+ "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "rerank_model_id": {
- "description": "重排模型ID(用于RAG压缩)",
- "type": "string"
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "gorm.DeletedAt": {
+ "types.SearchResult": {
"type": "object",
"properties": {
- "time": {
+ "chunk_index": {
+ "description": "Chunk index",
+ "type": "integer"
+ },
+ "chunk_metadata": {
+ "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "chunk_type": {
+ "description": "Chunk 类型",
"type": "string"
},
- "valid": {
- "description": "Valid is true if Time is not NULL",
- "type": "boolean"
- }
- }
- },
- "internal_handler.CopyKnowledgeBaseRequest": {
- "type": "object",
- "required": [
- "source_id"
- ],
- "properties": {
- "source_id": {
+ "content": {
+ "description": "Content",
"type": "string"
},
- "target_id": {
+ "end_at": {
+ "description": "End at",
+ "type": "integer"
+ },
+ "id": {
+ "description": "ID",
"type": "string"
},
- "task_id": {
+ "image_info": {
+ "description": "图片信息 (JSON 格式)",
"type": "string"
- }
- }
- },
- "internal_handler.CreateAgentRequest": {
- "type": "object",
- "required": [
- "name"
- ],
- "properties": {
- "avatar": {
+ },
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
"type": "string"
},
- "config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ "knowledge_channel": {
+ "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
+ "type": "string"
},
- "description": {
+ "knowledge_description": {
+ "description": "KnowledgeDescription is the description of the knowledge document",
"type": "string"
},
- "name": {
+ "knowledge_filename": {
+ "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
"type": "string"
- }
- }
- },
- "internal_handler.CreateModelRequest": {
- "type": "object",
- "required": [
- "name",
- "parameters",
- "source",
- "type"
- ],
- "properties": {
- "description": {
+ },
+ "knowledge_id": {
+ "description": "Knowledge ID",
"type": "string"
},
- "name": {
+ "knowledge_source": {
+ "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
+ "knowledge_title": {
+ "description": "Knowledge title",
+ "type": "string"
},
- "source": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ "match_type": {
+ "description": "Match type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.MatchType"
+ }
+ ]
+ },
+ "matched_content": {
+ "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "type": "string"
+ },
+ "metadata": {
+ "description": "Metadata",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "parent_chunk_id": {
+ "description": "父 Chunk ID",
+ "type": "string"
+ },
+ "score": {
+ "description": "Score",
+ "type": "number"
+ },
+ "seq": {
+ "description": "Seq",
+ "type": "integer"
+ },
+ "start_at": {
+ "description": "Start at",
+ "type": "integer"
},
- "type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
- }
- }
- },
- "internal_handler.DeleteTagRequest": {
- "type": "object",
- "properties": {
- "exclude_ids": {
- "description": "Chunk seq_ids to exclude from deletion",
+ "sub_chunk_id": {
+ "description": "SubChunkIndex",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
}
}
},
- "internal_handler.EvaluationRequest": {
+ "types.Session": {
"type": "object",
"properties": {
- "chat_id": {
- "description": "ID of chat model to use",
+ "created_at": {
"type": "string"
},
- "dataset_id": {
- "description": "ID of dataset to evaluate",
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description",
"type": "string"
},
- "knowledge_base_id": {
- "description": "ID of knowledge base to use",
+ "id": {
+ "description": "ID",
"type": "string"
},
- "rerank_id": {
- "description": "ID of rerank model to use",
+ "tenant_id": {
+ "description": "Tenant ID",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Title",
+ "type": "string"
+ },
+ "updated_at": {
"type": "string"
}
}
},
- "internal_handler.FabriTextRequest": {
+ "types.ShareKnowledgeBaseRequest": {
"type": "object",
"required": [
- "model_id"
+ "organization_id",
+ "permission"
],
"properties": {
- "model_id": {
+ "organization_id": {
"type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "internal_handler.GetStorageEngineStatusResponse": {
- "type": "object",
- "properties": {
- "engines": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/internal_handler.StorageEngineStatusItem"
- }
- },
- "minio_env_available": {
- "type": "boolean"
+ "permission": {
+ "$ref": "#/definitions/types.OrgMemberRole"
}
}
},
- "internal_handler.GetSystemInfoResponse": {
+ "types.StorageConfig": {
"type": "object",
"properties": {
- "build_time": {
- "type": "string"
- },
- "commit_id": {
- "type": "string"
- },
- "db_version": {
+ "app_id": {
"type": "string"
},
- "edition": {
+ "bucket_name": {
"type": "string"
},
- "go_version": {
+ "path_prefix": {
"type": "string"
},
- "graph_database_engine": {
+ "provider": {
"type": "string"
},
- "keyword_index_engine": {
+ "region": {
"type": "string"
},
- "minio_enabled": {
- "type": "boolean"
- },
- "vector_store_engine": {
+ "secret_id": {
"type": "string"
},
- "version": {
+ "secret_key": {
"type": "string"
}
}
},
- "internal_handler.KBModelConfigRequest": {
+ "types.StorageEngineConfig": {
"type": "object",
- "required": [
- "embeddingModelId",
- "llmModelId"
- ],
"properties": {
- "documentSplitting": {
- "description": "文档分块配置",
- "type": "object",
- "properties": {
- "childChunkSize": {
- "type": "integer"
- },
- "chunkOverlap": {
- "type": "integer"
- },
- "chunkSize": {
- "type": "integer"
- },
- "enableParentChild": {
- "type": "boolean"
- },
- "parentChunkSize": {
- "type": "integer"
- },
- "parserEngineRules": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
- },
- "separators": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "embeddingModelId": {
- "type": "string"
+ "cos": {
+ "$ref": "#/definitions/types.COSEngineConfig"
},
- "llmModelId": {
+ "default_provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
"type": "string"
},
- "multimodal": {
- "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- }
- }
+ "local": {
+ "$ref": "#/definitions/types.LocalEngineConfig"
},
- "nodeExtract": {
- "description": "知识图谱配置",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
- }
- },
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
- }
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "text": {
- "type": "string"
- }
- }
+ "minio": {
+ "$ref": "#/definitions/types.MinIOEngineConfig"
},
- "questionGeneration": {
- "description": "问题生成配置",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "questionCount": {
- "type": "integer"
- }
- }
+ "oss": {
+ "$ref": "#/definitions/types.OSSEngineConfig"
},
- "storageProvider": {
- "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
- "type": "string"
+ "s3": {
+ "$ref": "#/definitions/types.S3EngineConfig"
},
- "vlm_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ "tos": {
+ "$ref": "#/definitions/types.TOSEngineConfig"
}
}
},
- "internal_handler.ListMinioBucketsResponse": {
+ "types.StorageProviderConfig": {
"type": "object",
"properties": {
- "buckets": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/internal_handler.MinioBucketInfo"
- }
+ "provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "type": "string"
}
}
},
- "internal_handler.MinioBucketInfo": {
+ "types.SubmitJoinRequestRequest": {
"type": "object",
+ "required": [
+ "invite_code"
+ ],
"properties": {
- "created_at": {
- "type": "string"
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
},
- "name": {
- "type": "string"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "policy": {
- "description": "\"public\", \"private\", \"custom\"",
- "type": "string"
+ "role": {
+ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.OrgMemberRole"
+ }
+ ]
}
}
},
- "internal_handler.RemoteModelCheckRequest": {
+ "types.SyncLog": {
"type": "object",
- "required": [
- "baseUrl",
- "modelName"
- ],
"properties": {
- "apiKey": {
+ "created_at": {
+ "description": "Creation timestamp (usually same as StartedAt)",
"type": "string"
},
- "baseUrl": {
+ "data_source_id": {
+ "description": "Reference to the data source",
"type": "string"
},
- "modelName": {
+ "error_message": {
+ "description": "Error details if status is \"failed\"",
"type": "string"
- }
- }
- },
- "internal_handler.SearchMessagesRequest": {
- "type": "object",
- "required": [
- "query"
- ],
- "properties": {
- "limit": {
- "description": "Maximum number of results to return (default: 20)",
+ },
+ "finished_at": {
+ "description": "Sync completion time",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier",
+ "type": "string"
+ },
+ "items_created": {
+ "description": "New items created in knowledge base",
+ "type": "integer"
+ },
+ "items_deleted": {
+ "description": "Items deleted from knowledge base",
+ "type": "integer"
+ },
+ "items_failed": {
+ "description": "Items that failed to sync",
+ "type": "integer"
+ },
+ "items_skipped": {
+ "description": "Items skipped (no changes detected)",
+ "type": "integer"
+ },
+ "items_total": {
+ "description": "Total items fetched from source",
"type": "integer"
},
- "mode": {
- "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")",
- "type": "string"
- },
- "query": {
- "description": "Query text for search",
- "type": "string"
+ "items_updated": {
+ "description": "Existing items updated",
+ "type": "integer"
},
- "session_ids": {
- "description": "Filter by specific session IDs (optional)",
+ "result": {
+ "description": "Detailed sync result (JSON-encoded)",
"type": "array",
"items": {
- "type": "string"
+ "type": "integer"
}
- }
- }
- },
- "internal_handler.StorageCheckRequest": {
- "type": "object",
- "properties": {
- "cos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
- },
- "minio": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
},
- "provider": {
- "description": "\"minio\", \"cos\", \"tos\", or \"s3\"",
+ "started_at": {
+ "description": "Sync start time",
"type": "string"
},
- "s3": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
+ "status": {
+ "description": "Sync status: running, success, partial, failed, canceled",
+ "type": "string"
},
- "tos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
- }
- }
- },
- "internal_handler.StorageCheckResponse": {
- "type": "object",
- "properties": {
- "bucket_created": {
- "type": "boolean"
+ "tenant_id": {
+ "description": "Tenant ID",
+ "type": "integer"
},
- "message": {
+ "updated_at": {
+ "description": "Last update timestamp",
"type": "string"
- },
- "ok": {
- "type": "boolean"
}
}
},
- "internal_handler.StorageEngineStatusItem": {
+ "types.TOSEngineConfig": {
"type": "object",
"properties": {
- "available": {
- "description": "whether the engine can be used",
- "type": "boolean"
+ "access_key": {
+ "type": "string"
},
- "description": {
- "description": "short description for UI",
+ "bucket_name": {
"type": "string"
},
- "name": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "endpoint": {
"type": "string"
- }
- }
- },
- "internal_handler.TextRelationExtractionRequest": {
- "type": "object",
- "required": [
- "model_id",
- "tags",
- "text"
- ],
- "properties": {
- "model_id": {
+ },
+ "path_prefix": {
"type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "region": {
+ "type": "string"
},
- "text": {
+ "secret_key": {
"type": "string"
}
}
},
- "internal_handler.UpdateAgentRequest": {
+ "types.Tenant": {
"type": "object",
"properties": {
- "avatar": {
- "type": "string"
- },
- "config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ "agent_config": {
+ "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.AgentConfig"
+ }
+ ]
},
- "description": {
+ "api_key": {
+ "description": "API key",
"type": "string"
},
- "name": {
+ "business": {
+ "description": "Business",
"type": "string"
- }
- }
- },
- "internal_handler.UpdateChunkRequest": {
- "type": "object",
- "properties": {
- "chunk_index": {
- "type": "integer"
},
- "content": {
- "type": "string"
+ "chat_history_config": {
+ "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ChatHistoryConfig"
+ }
+ ]
},
- "embedding": {
- "type": "array",
- "items": {
- "type": "number"
- }
+ "context_config": {
+ "description": "Global Context configuration for this tenant (default for all sessions)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ContextConfig"
+ }
+ ]
},
- "end_at": {
- "type": "integer"
+ "conversation_config": {
+ "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ConversationConfig"
+ }
+ ]
},
- "image_info": {
+ "created_at": {
+ "description": "Creation time",
"type": "string"
},
- "is_enabled": {
- "type": "boolean"
+ "credentials": {
+ "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.CredentialsConfig"
+ }
+ ]
},
- "start_at": {
- "type": "integer"
- }
- }
- },
- "internal_handler.UpdateKnowledgeBaseRequest": {
- "type": "object",
- "required": [
- "name"
- ],
- "properties": {
- "config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig"
+ "deleted_at": {
+ "description": "Deletion time",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
"description": {
+ "description": "Description",
"type": "string"
},
+ "id": {
+ "description": "ID",
+ "type": "integer"
+ },
"name": {
- "type": "string"
- }
- }
- },
- "internal_handler.UpdateModelRequest": {
- "type": "object",
- "properties": {
- "description": {
+ "description": "Name",
"type": "string"
},
- "name": {
+ "parser_engine_config": {
+ "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ParserEngineConfig"
+ }
+ ]
+ },
+ "retrieval_config": {
+ "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.RetrievalConfig"
+ }
+ ]
+ },
+ "retriever_engines": {
+ "description": "Retriever engines",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.RetrieverEngines"
+ }
+ ]
+ },
+ "status": {
+ "description": "Status",
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
+ "storage_engine_config": {
+ "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.StorageEngineConfig"
+ }
+ ]
},
- "source": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ "storage_quota": {
+ "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
+ "type": "integer"
},
- "type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
- }
- }
- },
- "internal_handler.addSimilarQuestionsRequest": {
- "type": "object",
- "required": [
- "similar_questions"
- ],
- "properties": {
- "similar_questions": {
- "type": "array",
- "minItems": 1,
- "items": {
- "type": "string"
- }
+ "storage_used": {
+ "description": "Storage used (Bytes)",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
+ },
+ "web_search_config": {
+ "description": "Global WebSearch configuration for this tenant",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.WebSearchConfig"
+ }
+ ]
}
}
},
- "internal_handler.updateLastFAQImportResultDisplayStatusRequest": {
+ "types.ToolCall": {
"type": "object",
- "required": [
- "display_status"
- ],
"properties": {
- "display_status": {
- "type": "string",
- "enum": [
- "open",
- "close"
+ "args": {
+ "description": "Tool arguments",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "duration": {
+ "description": "Execution time in milliseconds",
+ "type": "integer"
+ },
+ "id": {
+ "description": "Function call ID from LLM",
+ "type": "string"
+ },
+ "name": {
+ "description": "Tool name",
+ "type": "string"
+ },
+ "reflection": {
+ "description": "Agent's reflection on this tool call result (if enabled)",
+ "type": "string"
+ },
+ "result": {
+ "description": "Execution result (contains Output)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ToolResult"
+ }
]
}
}
},
- "internal_handler_session.CreateKnowledgeQARequest": {
+ "types.ToolResult": {
"type": "object",
- "required": [
- "query"
- ],
"properties": {
- "agent_enabled": {
- "description": "Whether agent mode is enabled for this request",
- "type": "boolean"
- },
- "agent_id": {
- "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
- "type": "string"
+ "data": {
+ "description": "Structured data for programmatic use",
+ "type": "object",
+ "additionalProperties": true
},
- "channel": {
- "description": "Source channel: \"web\", \"api\", \"im\", etc.",
+ "error": {
+ "description": "Error message if execution failed",
"type": "string"
},
- "disable_title": {
- "description": "Whether to disable auto title generation",
- "type": "boolean"
- },
- "enable_memory": {
- "description": "Whether memory feature is enabled for this request",
- "type": "boolean"
- },
"images": {
- "description": "Attached images for multimodal chat",
- "type": "array",
- "items": {
- "$ref": "#/definitions/internal_handler_session.ImageAttachment"
- }
- },
- "knowledge_base_ids": {
- "description": "Selected knowledge base ID for this request",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "description": "Selected knowledge ID for this request",
+ "description": "Base64 data URIs from tool (e.g. MCP image content)",
"type": "array",
"items": {
"type": "string"
}
},
- "mentioned_items": {
- "description": "@mentioned knowledge bases and files",
- "type": "array",
- "items": {
- "$ref": "#/definitions/internal_handler_session.MentionedItemRequest"
- }
- },
- "query": {
- "description": "Query text for knowledge base search",
- "type": "string"
- },
- "summary_model_id": {
- "description": "Optional summary model ID for this request (overrides session default)",
+ "output": {
+ "description": "Human-readable output",
"type": "string"
},
- "web_search_enabled": {
- "description": "Whether web search is enabled for this request",
+ "success": {
+ "description": "Whether the tool executed successfully",
"type": "boolean"
}
}
},
- "internal_handler_session.CreateSessionRequest": {
+ "types.UpdateMemberRoleRequest": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "$ref": "#/definitions/types.OrgMemberRole"
+ }
+ }
+ },
+ "types.UpdateOrganizationRequest": {
"type": "object",
"properties": {
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
+ },
"description": {
- "description": "Description for the session (optional)",
- "type": "string"
+ "type": "string",
+ "maxLength": 1000
},
- "title": {
- "description": "Title for the session (optional)",
- "type": "string"
+ "invite_code_validity_days": {
+ "description": "0=never, 1, 7, 30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "max members; 0=unlimited",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "description": "open for search so others can discover and join",
+ "type": "boolean"
}
}
},
- "internal_handler_session.GenerateTitleRequest": {
+ "types.UpdateSharePermissionRequest": {
"type": "object",
"required": [
- "messages"
+ "permission"
],
"properties": {
- "messages": {
- "description": "Messages to use as context for title generation",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Message"
- }
+ "permission": {
+ "$ref": "#/definitions/types.OrgMemberRole"
}
}
},
- "internal_handler_session.ImageAttachment": {
+ "types.User": {
"type": "object",
"properties": {
- "caption": {
- "description": "VLM analysis result (context-aware, single call)",
+ "avatar": {
+ "description": "Avatar URL of the user",
"type": "string"
},
- "data": {
- "description": "base64 data URI from frontend (data:image/png;base64,...)",
+ "can_access_all_tenants": {
+ "description": "Whether the user can access all tenants (cross-tenant access)",
+ "type": "boolean"
+ },
+ "created_at": {
+ "description": "Creation time of the user",
"type": "string"
},
- "url": {
- "description": "serving URL after saving to storage",
+ "deleted_at": {
+ "description": "Deletion time of the user",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "email": {
+ "description": "Email address of the user",
"type": "string"
- }
- }
- },
- "internal_handler_session.MentionedItemRequest": {
- "type": "object",
- "properties": {
+ },
"id": {
+ "description": "Unique identifier of the user",
"type": "string"
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
- "type": "string"
+ "is_active": {
+ "description": "Whether the user is active",
+ "type": "boolean"
},
- "name": {
+ "tenant": {
+ "description": "Association relationship, not stored in the database",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.Tenant"
+ }
+ ]
+ },
+ "tenant_id": {
+ "description": "Tenant ID that the user belongs to",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time of the user",
"type": "string"
},
- "type": {
- "description": "\"kb\" for knowledge base, \"file\" for file",
+ "username": {
+ "description": "Username of the user",
"type": "string"
}
}
},
- "internal_handler_session.SearchKnowledgeRequest": {
+ "types.VLMConfig": {
"type": "object",
- "required": [
- "query"
- ],
"properties": {
- "knowledge_base_id": {
- "description": "Single knowledge base ID (for backward compatibility)",
+ "api_key": {
+ "description": "API Key",
"type": "string"
},
- "knowledge_base_ids": {
- "description": "IDs of knowledge bases to search (multi-KB support)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "base_url": {
+ "description": "Base URL",
+ "type": "string"
},
- "knowledge_ids": {
- "description": "IDs of specific knowledge (files) to search",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "enabled": {
+ "type": "boolean"
},
- "query": {
- "description": "Query text to search for",
+ "interface_type": {
+ "description": "Interface Type: \"ollama\" or \"openai\"",
+ "type": "string"
+ },
+ "model_id": {
+ "type": "string"
+ },
+ "model_name": {
+ "description": "兼容老版本\nModel Name",
"type": "string"
}
}
},
- "internal_handler_session.StopSessionRequest": {
+ "types.WeKnoraCloudCredentials": {
"type": "object",
- "required": [
- "message_id"
- ],
"properties": {
- "message_id": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
"type": "string"
}
}
},
- "internal_handler_session.batchDeleteRequest": {
+ "types.WebSearchConfig": {
"type": "object",
"properties": {
- "delete_all": {
- "type": "boolean"
+ "api_key": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
},
- "ids": {
+ "blacklist": {
+ "description": "黑名单规则列表",
"type": "array",
"items": {
"type": "string"
}
+ },
+ "compression_method": {
+ "description": "压缩方法:none, summary, extract, rag",
+ "type": "string"
+ },
+ "document_fragments": {
+ "description": "文档片段数量(用于RAG压缩)",
+ "type": "integer"
+ },
+ "embedding_dimension": {
+ "description": "嵌入维度(用于RAG压缩)",
+ "type": "integer"
+ },
+ "embedding_model_id": {
+ "description": "RAG压缩相关配置",
+ "type": "string"
+ },
+ "include_date": {
+ "description": "是否包含日期",
+ "type": "boolean"
+ },
+ "max_results": {
+ "description": "最大搜索结果数",
+ "type": "integer"
+ },
+ "provider": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "rerank_model_id": {
+ "description": "重排模型ID(用于RAG压缩)",
+ "type": "string"
}
}
}
diff --git a/docs/swagger.json b/docs/swagger.json
index 9891d92d0..13adbdb14 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -44,7 +44,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -76,7 +76,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.CreateAgentRequest"
+ "$ref": "#/definitions/handler.CreateAgentRequest"
}
}
],
@@ -91,7 +91,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -170,13 +170,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -215,7 +215,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateAgentRequest"
+ "$ref": "#/definitions/handler.UpdateAgentRequest"
}
}
],
@@ -230,13 +230,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "无法修改内置智能体",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -281,19 +281,19 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "无法删除内置智能体",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -340,13 +340,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -411,13 +411,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -448,7 +448,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
}
},
@@ -482,7 +482,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
}
],
@@ -490,7 +490,7 @@
"201": {
"description": "Created",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
},
"400": {
@@ -528,7 +528,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ "$ref": "#/definitions/types.SyncLog"
}
},
"404": {
@@ -559,7 +559,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata"
+ "$ref": "#/definitions/datasource.ConnectorMetadata"
}
}
}
@@ -635,7 +635,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
},
"404": {
@@ -675,7 +675,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
}
],
@@ -683,7 +683,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
+ "$ref": "#/definitions/types.DataSource"
}
},
"400": {
@@ -765,7 +765,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ "$ref": "#/definitions/types.SyncLog"
}
}
},
@@ -844,7 +844,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Resource"
+ "$ref": "#/definitions/types.Resource"
}
}
},
@@ -918,7 +918,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ "$ref": "#/definitions/types.SyncLog"
}
},
"400": {
@@ -971,6 +971,35 @@
}
}
},
+ "/auth/auto-setup": {
+ "post": {
+ "description": "Lite 版专用:首次启动时自动创建默认用户和租户并返回令牌,后续启动直接签发令牌,免除手动注册/登录流程",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "自动初始化(Lite 桌面版)",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/types.LoginResponse"
+ }
+ },
+ "403": {
+ "description": "非 Lite 版本",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/auth/change-password": {
"post": {
"security": [
@@ -1019,7 +1048,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1045,7 +1074,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest"
+ "$ref": "#/definitions/types.LoginRequest"
}
}
],
@@ -1053,13 +1082,13 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
+ "$ref": "#/definitions/types.LoginResponse"
}
},
"401": {
"description": "认证失败",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1094,7 +1123,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1129,7 +1158,7 @@
"401": {
"description": "未授权",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1192,7 +1221,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse"
+ "$ref": "#/definitions/types.OIDCConfigResponse"
}
}
}
@@ -1224,19 +1253,19 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse"
+ "$ref": "#/definitions/types.OIDCAuthURLResponse"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "OIDC未启用",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1282,7 +1311,7 @@
"401": {
"description": "令牌无效",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1308,7 +1337,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest"
+ "$ref": "#/definitions/types.RegisterRequest"
}
}
],
@@ -1316,19 +1345,19 @@
"201": {
"description": "Created",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse"
+ "$ref": "#/definitions/types.RegisterResponse"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "注册功能已禁用",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1363,7 +1392,7 @@
"401": {
"description": "令牌无效",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1410,13 +1439,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "分块不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1477,13 +1506,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "分块不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1544,7 +1573,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1589,7 +1618,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1637,7 +1666,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateChunkRequest"
+ "$ref": "#/definitions/handler.UpdateChunkRequest"
}
}
],
@@ -1652,13 +1681,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "分块不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1710,13 +1739,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "分块不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1763,7 +1792,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1795,7 +1824,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.EvaluationRequest"
+ "$ref": "#/definitions/handler.EvaluationRequest"
}
}
],
@@ -1810,7 +1839,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1857,7 +1886,7 @@
"404": {
"description": "任务不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1891,7 +1920,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
+ "$ref": "#/definitions/handler.TextRelationExtractionRequest"
}
}
],
@@ -1906,7 +1935,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -1964,7 +1993,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.FabriTextRequest"
+ "$ref": "#/definitions/handler.FabriTextRequest"
}
}
],
@@ -1979,7 +2008,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2035,7 +2064,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2082,7 +2111,7 @@
"404": {
"description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2121,7 +2150,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.KBModelConfigRequest"
+ "$ref": "#/definitions/handler.KBModelConfigRequest"
}
}
],
@@ -2136,13 +2165,62 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/models/asr/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查ASR模型",
+ "parameters": [
+ {
+ "description": "ASR检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2191,7 +2269,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2225,7 +2303,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ "$ref": "#/definitions/handler.RemoteModelCheckRequest"
}
}
],
@@ -2240,7 +2318,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2289,7 +2367,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2369,7 +2447,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2448,7 +2526,7 @@
"404": {
"description": "任务不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2486,7 +2564,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2543,7 +2621,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2597,7 +2675,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2667,7 +2745,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2699,7 +2777,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
+ "$ref": "#/definitions/types.KnowledgeBase"
}
}
],
@@ -2714,7 +2792,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2748,7 +2826,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseRequest"
+ "$ref": "#/definitions/handler.CopyKnowledgeBaseRequest"
}
}
],
@@ -2763,7 +2841,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2810,7 +2888,7 @@
"404": {
"description": "任务不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2863,13 +2941,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2908,7 +2986,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateKnowledgeBaseRequest"
+ "$ref": "#/definitions/handler.UpdateKnowledgeBaseRequest"
}
}
],
@@ -2923,7 +3001,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -2968,7 +3046,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3051,7 +3129,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3090,7 +3168,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload"
+ "$ref": "#/definitions/types.FAQBatchUpsertPayload"
}
}
],
@@ -3105,7 +3183,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3167,7 +3245,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3213,7 +3291,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3254,7 +3332,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate"
+ "$ref": "#/definitions/types.FAQEntryFieldsBatchUpdate"
}
}
],
@@ -3269,7 +3347,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3325,7 +3403,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3379,13 +3457,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "条目不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3431,7 +3509,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ "$ref": "#/definitions/types.FAQEntryPayload"
}
}
],
@@ -3446,7 +3524,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3494,7 +3572,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.addSimilarQuestionsRequest"
+ "$ref": "#/definitions/handler.addSimilarQuestionsRequest"
}
}
],
@@ -3509,13 +3587,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "条目不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3556,7 +3634,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ "$ref": "#/definitions/types.FAQEntryPayload"
}
}
],
@@ -3571,7 +3649,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3612,7 +3690,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.updateLastFAQImportResultDisplayStatusRequest"
+ "$ref": "#/definitions/handler.updateLastFAQImportResultDisplayStatusRequest"
}
}
],
@@ -3627,13 +3705,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "知识库不存在或无导入记录",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3674,7 +3752,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest"
+ "$ref": "#/definitions/types.FAQSearchRequest"
}
}
],
@@ -3689,7 +3767,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3730,7 +3808,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams"
+ "$ref": "#/definitions/types.SearchParams"
}
}
],
@@ -3745,7 +3823,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3822,7 +3900,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3867,13 +3945,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "权限不足",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -3945,7 +4023,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"409": {
@@ -3993,7 +4071,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ "$ref": "#/definitions/types.ManualKnowledgePayload"
}
}
],
@@ -4008,7 +4086,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4084,7 +4162,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"409": {
@@ -4138,7 +4216,7 @@
"404": {
"description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4172,7 +4250,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
+ "$ref": "#/definitions/types.ListSharesResponse"
}
}
}
@@ -4208,7 +4286,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest"
+ "$ref": "#/definitions/types.ShareKnowledgeBaseRequest"
}
}
],
@@ -4268,7 +4346,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest"
+ "$ref": "#/definitions/types.UpdateSharePermissionRequest"
}
}
],
@@ -4391,7 +4469,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4456,7 +4534,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4519,7 +4597,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4576,7 +4654,7 @@
"name": "body",
"in": "body",
"schema": {
- "$ref": "#/definitions/internal_handler.DeleteTagRequest"
+ "$ref": "#/definitions/handler.DeleteTagRequest"
}
}
],
@@ -4591,7 +4669,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4654,7 +4732,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4722,7 +4800,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4763,7 +4841,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ "$ref": "#/definitions/types.ManualKnowledgePayload"
}
}
],
@@ -4778,7 +4856,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4848,7 +4926,7 @@
"400": {
"description": "Invalid request",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4897,7 +4975,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4944,13 +5022,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "知识不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -4989,7 +5067,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ "$ref": "#/definitions/types.Knowledge"
}
}
],
@@ -5004,7 +5082,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5049,7 +5127,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5095,7 +5173,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5144,7 +5222,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5191,13 +5269,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"403": {
"description": "权限不足",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5235,7 +5313,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5267,7 +5345,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService"
+ "$ref": "#/definitions/types.MCPService"
}
}
],
@@ -5282,7 +5360,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5329,7 +5407,7 @@
"404": {
"description": "服务不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5383,7 +5461,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5428,7 +5506,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5475,7 +5553,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5522,7 +5600,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5569,7 +5647,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5635,7 +5713,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.SearchMessagesRequest"
+ "$ref": "#/definitions/handler.SearchMessagesRequest"
}
}
],
@@ -5650,7 +5728,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5710,7 +5788,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5764,7 +5842,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5802,7 +5880,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5834,7 +5912,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.CreateModelRequest"
+ "$ref": "#/definitions/handler.CreateModelRequest"
}
}
],
@@ -5849,7 +5927,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5936,7 +6014,7 @@
"404": {
"description": "模型不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -5975,7 +6053,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateModelRequest"
+ "$ref": "#/definitions/handler.UpdateModelRequest"
}
}
],
@@ -5990,7 +6068,7 @@
"404": {
"description": "模型不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -6035,7 +6113,7 @@
"404": {
"description": "模型不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -6060,7 +6138,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse"
+ "$ref": "#/definitions/types.ListOrganizationsResponse"
}
}
}
@@ -6089,7 +6167,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest"
+ "$ref": "#/definitions/types.CreateOrganizationRequest"
}
}
],
@@ -6135,7 +6213,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest"
+ "$ref": "#/definitions/types.JoinOrganizationRequest"
}
}
],
@@ -6181,7 +6259,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest"
+ "$ref": "#/definitions/types.JoinByOrganizationIDRequest"
}
}
],
@@ -6227,7 +6305,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest"
+ "$ref": "#/definitions/types.SubmitJoinRequestRequest"
}
}
],
@@ -6401,7 +6479,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest"
+ "$ref": "#/definitions/types.UpdateOrganizationRequest"
}
}
],
@@ -6490,7 +6568,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.InviteMemberRequest"
+ "$ref": "#/definitions/types.InviteMemberRequest"
}
}
],
@@ -6638,7 +6716,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest"
+ "$ref": "#/definitions/types.ReviewJoinRequestRequest"
}
}
],
@@ -6725,7 +6803,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListMembersResponse"
+ "$ref": "#/definitions/types.ListMembersResponse"
}
}
}
@@ -6770,7 +6848,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest"
+ "$ref": "#/definitions/types.UpdateMemberRoleRequest"
}
}
],
@@ -6866,7 +6944,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest"
+ "$ref": "#/definitions/types.RequestRoleUpgradeRequest"
}
}
],
@@ -7040,7 +7118,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
+ "$ref": "#/definitions/types.ListSharesResponse"
}
}
}
@@ -7092,7 +7170,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7124,7 +7202,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.CreateSessionRequest"
+ "$ref": "#/definitions/handler_session.CreateSessionRequest"
}
}
],
@@ -7139,7 +7217,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7173,7 +7251,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.batchDeleteRequest"
+ "$ref": "#/definitions/handler_session.batchDeleteRequest"
}
}
],
@@ -7188,7 +7266,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7222,7 +7300,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.SearchKnowledgeRequest"
+ "$ref": "#/definitions/handler_session.SearchKnowledgeRequest"
}
}
],
@@ -7237,7 +7315,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7284,7 +7362,7 @@
"404": {
"description": "会话不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7323,7 +7401,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Session"
+ "$ref": "#/definitions/types.Session"
}
}
],
@@ -7338,7 +7416,7 @@
"404": {
"description": "会话不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7383,7 +7461,7 @@
"404": {
"description": "会话不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7430,13 +7508,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "会话不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7477,7 +7555,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
+ "$ref": "#/definitions/handler_session.CreateKnowledgeQARequest"
}
}
],
@@ -7492,7 +7570,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7546,7 +7624,7 @@
"404": {
"description": "会话或消息不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7587,7 +7665,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
+ "$ref": "#/definitions/handler_session.CreateKnowledgeQARequest"
}
}
],
@@ -7602,7 +7680,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7643,7 +7721,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.StopSessionRequest"
+ "$ref": "#/definitions/handler_session.StopSessionRequest"
}
}
],
@@ -7658,7 +7736,7 @@
"404": {
"description": "会话或消息不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7699,7 +7777,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.GenerateTitleRequest"
+ "$ref": "#/definitions/handler_session.GenerateTitleRequest"
}
}
],
@@ -7714,7 +7792,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7778,7 +7856,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -7831,44 +7909,7 @@
"200": {
"description": "系统信息",
"schema": {
- "$ref": "#/definitions/internal_handler.GetSystemInfoResponse"
- }
- }
- }
- }
- },
- "/system/minio/buckets": {
- "get": {
- "description": "获取所有 MinIO 存储桶及其访问权限",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "系统"
- ],
- "summary": "列出 MinIO 存储桶",
- "responses": {
- "200": {
- "description": "存储桶列表",
- "schema": {
- "$ref": "#/definitions/internal_handler.ListMinioBucketsResponse"
- }
- },
- "400": {
- "description": "MinIO 未启用",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "500": {
- "description": "服务器错误",
- "schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/handler.GetSystemInfoResponse"
}
}
}
@@ -7944,7 +7985,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.StorageCheckRequest"
+ "$ref": "#/definitions/handler.StorageCheckRequest"
}
}
],
@@ -7952,7 +7993,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/internal_handler.StorageCheckResponse"
+ "$ref": "#/definitions/handler.StorageCheckResponse"
}
}
}
@@ -7972,7 +8013,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/internal_handler.GetStorageEngineStatusResponse"
+ "$ref": "#/definitions/handler.GetStorageEngineStatusResponse"
}
}
}
@@ -8007,7 +8048,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8036,7 +8077,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "$ref": "#/definitions/types.Tenant"
}
}
],
@@ -8051,7 +8092,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8086,7 +8127,7 @@
"403": {
"description": "权限不足",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8124,7 +8165,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8162,7 +8203,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8200,7 +8241,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8238,7 +8279,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8285,7 +8326,7 @@
"400": {
"description": "不支持的键",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8339,7 +8380,7 @@
"400": {
"description": "不支持的键",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8405,7 +8446,7 @@
"403": {
"description": "权限不足",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8452,13 +8493,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
},
"404": {
"description": "租户不存在",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8494,7 +8535,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "$ref": "#/definitions/types.Tenant"
}
}
],
@@ -8509,7 +8550,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
@@ -8551,13 +8592,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/errors.AppError"
}
}
}
}
},
- "/web-search/providers": {
+ "/vector-stores": {
"get": {
"security": [
{
@@ -8567,33 +8608,404 @@
"ApiKeyAuth": []
}
],
- "description": "Returns the list of available web search providers from configuration",
- "consumes": [
- "application/json"
- ],
+ "description": "List all vector stores for the current tenant, including environment-configured and user-created stores",
"produces": [
"application/json"
],
"tags": [
- "web-search"
+ "VectorStore"
],
- "summary": "Get available web search providers",
+ "summary": "List vector stores",
"responses": {
"200": {
- "description": "List of providers",
+ "description": "List of vector stores (env + DB)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
- }
- }
- },
- "definitions": {
- "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": {
- "type": "object",
- "properties": {
+ },
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Create a new vector store configuration for the current tenant",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Create vector store",
+ "parameters": [
+ {
+ "description": "Vector store configuration",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/handler.CreateStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Created vector store",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request or validation error",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "409": {
+ "description": "Duplicate endpoint and index",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Test connectivity using provided credentials without persisting. Returns detected server version.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Test vector store connection with raw credentials",
+ "parameters": [
+ {
+ "description": "Engine type and connection config",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/handler.TestStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Connection test result (success, version)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request",
+ "schema": {
+ "$ref": "#/definitions/errors.AppError"
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/types": {
+ "get": {
+ "description": "Return supported engine types with connection and index field schemas for UI form generation",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "List vector store types",
+ "responses": {
+ "200": {
+ "description": "List of engine types with config schemas",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Retrieve a single vector store by ID. Supports both DB stores and env stores (__env_* IDs)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Get vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Vector store details",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Update a vector store (name only). Engine type, connection config, and index config are immutable. Env stores cannot be modified.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Update vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "Updated fields",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/handler.UpdateStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Updated vector store",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Env store or validation error",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Soft-delete a vector store. Env stores cannot be deleted.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Delete vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Deletion success",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Env store cannot be deleted",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/{id}/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Test connectivity of an existing saved or env store. Returns detected server version. For DB stores, the version is automatically saved to connection_config.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Test vector store connection by ID",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Connection test result (success, version)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "datasource.ConnectorMetadata": {
+ "type": "object",
+ "properties": {
"auth_type": {
"description": "\"oauth2\", \"api_key\", \"token\", etc.",
"type": "string"
@@ -8623,11 +9035,11 @@
}
}
},
- "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "errors.AppError": {
"type": "object",
"properties": {
"code": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode"
+ "$ref": "#/definitions/errors.ErrorCode"
},
"details": {},
"message": {
@@ -8635,7 +9047,7 @@
}
}
},
- "github_com_Tencent_WeKnora_internal_errors.ErrorCode": {
+ "errors.ErrorCode": {
"type": "integer",
"enum": [
1000,
@@ -8682,2183 +9094,2346 @@
"ErrAgentInvalidTemperature"
]
},
- "github_com_Tencent_WeKnora_internal_types.AgentConfig": {
+ "github_com_Tencent_WeKnora_internal_errors.AppError": {
"type": "object",
"properties": {
- "allowed_skills": {
- "description": "Skill names whitelist (empty = allow all)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "allowed_tools": {
- "description": "List of allowed tool names",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "history_turns": {
- "description": "Number of history turns to keep in context",
- "type": "integer"
- },
- "knowledge_bases": {
- "description": "Accessible knowledge base IDs",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "description": "Accessible knowledge IDs (individual documents)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "llm_call_timeout": {
- "description": "LLM call timeout in seconds (default: 120). Controls the maximum time for a single LLM call.",
- "type": "integer"
- },
- "max_context_tokens": {
- "description": "Maximum context window tokens for the agent (default: 200000).\nThe agent compresses older messages to stay within this limit,\npreserving tool_call/tool_result pairs.",
- "type": "integer"
- },
- "max_iterations": {
- "description": "Maximum number of ReAct iterations",
- "type": "integer"
- },
- "max_tool_output_chars": {
- "description": "Maximum character length for tool output (default: 16000).\nOutputs exceeding this limit are truncated with head + tail preservation.",
- "type": "integer"
+ "code": {
+ "$ref": "#/definitions/errors.ErrorCode"
},
- "mcp_selection_mode": {
- "description": "MCP service selection",
+ "details": {},
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "gorm.DeletedAt": {
+ "type": "object",
+ "properties": {
+ "time": {
"type": "string"
},
- "mcp_services": {
- "description": "Selected MCP service IDs (when mode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "multi_turn_enabled": {
- "description": "Whether multi-turn conversation is enabled",
- "type": "boolean"
- },
- "parallel_tool_calls": {
- "description": "Whether to execute independent tool calls in parallel (default: false).\nWhen enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.",
+ "valid": {
+ "description": "Valid is true if Time is not NULL",
"type": "boolean"
+ }
+ }
+ },
+ "handler.CopyKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "source_id"
+ ],
+ "properties": {
+ "source_id": {
+ "type": "string"
},
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
- "type": "boolean"
+ "target_id": {
+ "type": "string"
},
- "skill_dirs": {
- "description": "Directories to search for skills",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "handler.CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
+ "type": "string"
},
- "skills_enabled": {
- "description": "Skills configuration (Progressive Disclosure pattern)",
- "type": "boolean"
+ "config": {
+ "$ref": "#/definitions/types.CustomAgentConfig"
},
- "system_prompt": {
- "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
+ "description": {
"type": "string"
},
- "system_prompt_web_disabled": {
- "description": "Deprecated: Custom prompt when web search is disabled",
+ "name": {
"type": "string"
- },
- "system_prompt_web_enabled": {
- "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
+ }
+ }
+ },
+ "handler.CreateModelRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "parameters",
+ "source",
+ "type"
+ ],
+ "properties": {
+ "description": {
"type": "string"
},
- "temperature": {
- "description": "LLM temperature for agent",
- "type": "number"
- },
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
- "type": "boolean"
+ "name": {
+ "type": "string"
},
- "use_custom_system_prompt": {
- "description": "Whether to use custom system prompt instead of default",
- "type": "boolean"
+ "parameters": {
+ "$ref": "#/definitions/types.ModelParameters"
},
- "web_search_enabled": {
- "description": "Whether web search tool is enabled",
- "type": "boolean"
+ "source": {
+ "$ref": "#/definitions/types.ModelSource"
},
- "web_search_max_results": {
- "description": "Maximum number of web search results (default: 5)",
- "type": "integer"
+ "type": {
+ "$ref": "#/definitions/types.ModelType"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AgentStep": {
+ "handler.CreateStoreRequest": {
"type": "object",
+ "required": [
+ "connection_config",
+ "engine_type",
+ "name"
+ ],
"properties": {
- "iteration": {
- "description": "Iteration number (0-indexed)",
- "type": "integer"
+ "connection_config": {
+ "$ref": "#/definitions/types.ConnectionConfig"
},
- "thought": {
- "description": "LLM's reasoning/thinking (Think phase)",
- "type": "string"
+ "engine_type": {
+ "$ref": "#/definitions/types.RetrieverEngineType"
},
- "timestamp": {
- "description": "When this step occurred",
- "type": "string"
+ "index_config": {
+ "$ref": "#/definitions/types.IndexConfig"
},
- "tool_calls": {
- "description": "Tools called in this step (Act phase)",
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "handler.DeleteTagRequest": {
+ "type": "object",
+ "properties": {
+ "exclude_ids": {
+ "description": "Chunk seq_ids to exclude from deletion",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall"
+ "type": "integer"
}
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": {
- "type": "string",
- "enum": [
- "all",
- "random"
- ],
- "x-enum-varnames": [
- "AnswerStrategyAll",
- "AnswerStrategyRandom"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": {
+ "handler.EvaluationRequest": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
- },
- "path_prefix": {
+ "chat_id": {
+ "description": "ID of chat model to use",
"type": "string"
},
- "region": {
+ "dataset_id": {
+ "description": "ID of dataset to evaluate",
"type": "string"
},
- "secret_id": {
+ "knowledge_base_id": {
+ "description": "ID of knowledge base to use",
"type": "string"
},
- "secret_key": {
+ "rerank_id": {
+ "description": "ID of rerank model to use",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": {
+ "handler.FabriTextRequest": {
"type": "object",
+ "required": [
+ "model_id"
+ ],
"properties": {
- "embedding_model_id": {
- "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
+ "model_id": {
"type": "string"
},
- "enabled": {
- "description": "Enabled controls whether chat history indexing is active",
- "type": "boolean"
- },
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
- "type": "string"
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": {
+ "handler.GetStorageEngineStatusResponse": {
"type": "object",
"properties": {
- "child_chunk_size": {
- "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
- "type": "integer"
- },
- "chunk_overlap": {
- "description": "Chunk overlap",
- "type": "integer"
- },
- "chunk_size": {
- "description": "Chunk size",
- "type": "integer"
- },
- "enable_multimodal": {
- "description": "EnableMultimodal (deprecated, kept for backward compatibility with old data)",
- "type": "boolean"
- },
- "enable_parent_child": {
- "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
- "type": "boolean"
- },
- "parent_chunk_size": {
- "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
- "type": "integer"
- },
- "parser_engine_rules": {
- "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, the builtin engine is used for all types.",
+ "engines": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ "$ref": "#/definitions/handler.StorageEngineStatusItem"
}
},
- "separators": {
- "description": "Separators",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "minio_env_available": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": {
- "type": "string",
- "enum": [
- "sliding_window",
- "smart"
- ],
- "x-enum-varnames": [
- "ContextCompressionSlidingWindow",
- "ContextCompressionSmart"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ContextConfig": {
+ "handler.GetSystemInfoResponse": {
"type": "object",
"properties": {
- "compression_strategy": {
- "description": "Compression strategy: \"sliding_window\" or \"smart\"",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
- }
- ]
+ "build_time": {
+ "type": "string"
},
- "max_tokens": {
- "description": "Maximum tokens allowed in LLM context",
- "type": "integer"
+ "commit_id": {
+ "type": "string"
},
- "recent_message_count": {
- "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
- "type": "integer"
+ "db_version": {
+ "type": "string"
},
- "summarize_threshold": {
- "description": "Summarize threshold: number of messages before summarization",
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ConversationConfig": {
- "type": "object",
- "properties": {
- "context_template": {
- "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "edition": {
"type": "string"
},
- "embedding_top_k": {
- "type": "integer"
+ "go_version": {
+ "type": "string"
},
- "enable_query_expansion": {
- "type": "boolean"
+ "graph_database_engine": {
+ "type": "string"
},
- "enable_rewrite": {
+ "keyword_index_engine": {
+ "type": "string"
+ },
+ "minio_enabled": {
"type": "boolean"
},
- "fallback_prompt": {
+ "vector_store_engine": {
"type": "string"
},
- "fallback_response": {
+ "version": {
"type": "string"
+ }
+ }
+ },
+ "handler.KBModelConfigRequest": {
+ "type": "object",
+ "required": [
+ "embeddingModelId",
+ "llmModelId"
+ ],
+ "properties": {
+ "asr_config": {
+ "$ref": "#/definitions/types.ASRConfig"
},
- "fallback_strategy": {
- "description": "Fallback strategy",
+ "documentSplitting": {
+ "description": "文档分块配置",
+ "type": "object",
+ "properties": {
+ "childChunkSize": {
+ "type": "integer"
+ },
+ "chunkOverlap": {
+ "type": "integer"
+ },
+ "chunkSize": {
+ "type": "integer"
+ },
+ "enableParentChild": {
+ "type": "boolean"
+ },
+ "parentChunkSize": {
+ "type": "integer"
+ },
+ "parserEngineRules": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "embeddingModelId": {
"type": "string"
},
- "keyword_threshold": {
- "type": "number"
+ "llmModelId": {
+ "type": "string"
},
- "max_completion_tokens": {
- "description": "MaxTokens is the maximum number of tokens to generate",
- "type": "integer"
+ "multimodal": {
+ "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "nodeExtract": {
+ "description": "知识图谱配置",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.GraphRelation"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
+ "type": "string"
+ }
+ }
},
- "max_rounds": {
- "description": "Retrieval \u0026 strategy parameters",
- "type": "integer"
+ "questionGeneration": {
+ "description": "问题生成配置",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "questionCount": {
+ "type": "integer"
+ }
+ }
},
- "prompt": {
- "description": "Prompt is the system prompt for normal mode",
+ "storageProvider": {
+ "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
"type": "string"
},
- "rerank_model_id": {
+ "vlm_config": {
+ "$ref": "#/definitions/types.VLMConfig"
+ }
+ }
+ },
+ "handler.RemoteModelCheckRequest": {
+ "type": "object",
+ "required": [
+ "baseUrl",
+ "modelName"
+ ],
+ "properties": {
+ "apiKey": {
"type": "string"
},
- "rerank_threshold": {
- "type": "number"
- },
- "rerank_top_k": {
- "type": "integer"
- },
- "rewrite_prompt_system": {
- "description": "Rewrite prompts",
+ "baseUrl": {
"type": "string"
},
- "rewrite_prompt_user": {
+ "modelName": {
"type": "string"
},
- "summary_model_id": {
- "description": "Model configuration",
+ "provider": {
"type": "string"
- },
- "temperature": {
- "description": "Temperature controls the randomness of the model output",
- "type": "number"
- },
- "vector_threshold": {
- "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
+ "handler.SearchMessagesRequest": {
"type": "object",
"required": [
- "name"
+ "query"
],
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
- },
- "description": {
- "type": "string",
- "maxLength": 1000
- },
- "invite_code_validity_days": {
- "description": "optional: 0=never, 1, 7, 30; default 7",
+ "limit": {
+ "description": "Maximum number of results to return (default: 20)",
"type": "integer"
},
- "member_limit": {
- "description": "optional: max members; 0=unlimited; default 50",
- "type": "integer"
+ "mode": {
+ "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")",
+ "type": "string"
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
- "type": "object",
- "properties": {
- "agent_mode": {
- "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
+ "query": {
+ "description": "Query text for search",
"type": "string"
},
- "allowed_tools": {
- "description": "Allowed tools (only for agent type)",
+ "session_ids": {
+ "description": "Filter by specific session IDs (optional)",
"type": "array",
"items": {
"type": "string"
}
+ }
+ }
+ },
+ "handler.StorageCheckRequest": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "$ref": "#/definitions/types.COSEngineConfig"
},
- "context_template": {
- "description": "Context template for normal mode (how to format retrieved chunks)",
- "type": "string"
- },
- "context_template_id": {
- "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content will be resolved at startup.",
- "type": "string"
- },
- "embedding_top_k": {
- "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
- "type": "integer"
- },
- "enable_query_expansion": {
- "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
- "type": "boolean"
- },
- "enable_rewrite": {
- "description": "Whether to enable query rewrite for multi-turn conversations",
- "type": "boolean"
- },
- "fallback_prompt": {
- "description": "Fallback prompt (when FallbackStrategy is \"model\")",
- "type": "string"
+ "minio": {
+ "$ref": "#/definitions/types.MinIOEngineConfig"
},
- "fallback_response": {
- "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
- "type": "string"
+ "oss": {
+ "$ref": "#/definitions/types.OSSEngineConfig"
},
- "fallback_strategy": {
- "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
+ "provider": {
+ "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
"type": "string"
},
- "faq_direct_answer_threshold": {
- "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
- "type": "number"
+ "s3": {
+ "$ref": "#/definitions/types.S3EngineConfig"
},
- "faq_priority_enabled": {
- "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "tos": {
+ "$ref": "#/definitions/types.TOSEngineConfig"
+ }
+ }
+ },
+ "handler.StorageCheckResponse": {
+ "type": "object",
+ "properties": {
+ "bucket_created": {
"type": "boolean"
},
- "faq_score_boost": {
- "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
- "type": "number"
- },
- "history_turns": {
- "description": "Number of history turns to keep in context",
- "type": "integer"
- },
- "image_storage_provider": {
- "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
+ "message": {
"type": "string"
},
- "image_upload_enabled": {
- "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "ok": {
+ "type": "boolean"
+ }
+ }
+ },
+ "handler.StorageEngineStatusItem": {
+ "type": "object",
+ "properties": {
+ "available": {
+ "description": "whether the engine can be used",
"type": "boolean"
},
- "kb_selection_mode": {
- "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
+ "description": {
+ "description": "short description for UI",
"type": "string"
},
- "keyword_threshold": {
- "description": "Keyword retrieval threshold",
- "type": "number"
- },
- "knowledge_bases": {
- "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "max_completion_tokens": {
- "description": "Maximum completion tokens (only for normal mode)",
- "type": "integer"
- },
- "max_iterations": {
- "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
- "type": "integer"
+ "name": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "type": "string"
+ }
+ }
+ },
+ "handler.TestStoreRequest": {
+ "type": "object",
+ "required": [
+ "connection_config",
+ "engine_type"
+ ],
+ "properties": {
+ "connection_config": {
+ "$ref": "#/definitions/types.ConnectionConfig"
},
- "mcp_selection_mode": {
- "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
+ "engine_type": {
+ "$ref": "#/definitions/types.RetrieverEngineType"
+ }
+ }
+ },
+ "handler.TextRelationExtractionRequest": {
+ "type": "object",
+ "required": [
+ "model_id",
+ "tags",
+ "text"
+ ],
+ "properties": {
+ "model_id": {
"type": "string"
},
- "mcp_services": {
- "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "tags": {
"type": "array",
"items": {
"type": "string"
}
},
- "model_id": {
- "description": "===== Model Settings =====\nModel ID to use for conversations",
+ "text": {
"type": "string"
- },
- "multi_turn_enabled": {
- "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
- "type": "boolean"
- },
- "rerank_model_id": {
- "description": "ReRank model ID for retrieval",
+ }
+ }
+ },
+ "handler.UpdateAgentRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
"type": "string"
},
- "rerank_threshold": {
- "description": "Rerank threshold",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "Rerank top K",
- "type": "integer"
- },
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
- "type": "boolean"
+ "config": {
+ "$ref": "#/definitions/types.CustomAgentConfig"
},
- "rewrite_prompt_system": {
- "description": "Rewrite prompt system message",
+ "description": {
"type": "string"
},
- "rewrite_prompt_user": {
- "description": "Rewrite prompt user message template",
+ "name": {
"type": "string"
+ }
+ }
+ },
+ "handler.UpdateChunkRequest": {
+ "type": "object",
+ "properties": {
+ "chunk_index": {
+ "type": "integer"
},
- "selected_skills": {
- "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "skills_selection_mode": {
- "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
+ "content": {
"type": "string"
},
- "suggested_prompts": {
- "description": "===== Suggested Prompts =====\n推荐问题列表,用于在前端对话面板展示快捷提问",
+ "embedding": {
"type": "array",
"items": {
- "type": "string"
+ "type": "number"
}
},
- "supported_file_types": {
- "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "end_at": {
+ "type": "integer"
},
- "system_prompt": {
- "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
+ "image_info": {
"type": "string"
},
- "system_prompt_id": {
- "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content will be resolved at startup.",
- "type": "string"
+ "is_enabled": {
+ "type": "boolean"
},
- "temperature": {
- "description": "Temperature for LLM (0-1)",
- "type": "number"
+ "start_at": {
+ "type": "integer"
+ }
+ }
+ },
+ "handler.UpdateKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/types.KnowledgeBaseConfig"
},
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
- "type": "boolean"
+ "description": {
+ "type": "string"
},
- "vector_threshold": {
- "description": "Vector retrieval threshold",
- "type": "number"
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "handler.UpdateModelRequest": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
},
- "vlm_model_id": {
- "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)",
+ "name": {
"type": "string"
},
- "web_search_enabled": {
- "description": "===== Web Search Settings =====\nWhether web search is enabled",
- "type": "boolean"
+ "parameters": {
+ "$ref": "#/definitions/types.ModelParameters"
},
- "web_search_max_results": {
- "description": "Maximum web search results",
- "type": "integer"
+ "source": {
+ "$ref": "#/definitions/types.ModelSource"
+ },
+ "type": {
+ "$ref": "#/definitions/types.ModelType"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.DataSource": {
+ "handler.UpdateStoreRequest": {
"type": "object",
+ "required": [
+ "name"
+ ],
"properties": {
- "config": {
- "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "handler.addSimilarQuestionsRequest": {
+ "type": "object",
+ "required": [
+ "similar_questions"
+ ],
+ "properties": {
+ "similar_questions": {
"type": "array",
+ "minItems": 1,
"items": {
- "type": "integer"
+ "type": "string"
}
- },
- "conflict_strategy": {
- "description": "Conflict resolution strategy: overwrite or skip",
+ }
+ }
+ },
+ "handler.updateLastFAQImportResultDisplayStatusRequest": {
+ "type": "object",
+ "required": [
+ "display_status"
+ ],
+ "properties": {
+ "display_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "close"
+ ]
+ }
+ }
+ },
+ "handler_session.AttachmentUpload": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "description": "Base64-encoded file content",
"type": "string"
},
- "created_at": {
- "description": "Creation timestamp",
+ "file_name": {
+ "description": "Original filename",
"type": "string"
},
- "deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
+ }
+ }
+ },
+ "handler_session.CreateKnowledgeQARequest": {
+ "type": "object",
+ "required": [
+ "query"
+ ],
+ "properties": {
+ "agent_enabled": {
+ "description": "Whether agent mode is enabled for this request",
+ "type": "boolean"
},
- "error_message": {
- "description": "Error message if status is \"error\"",
+ "agent_id": {
+ "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
"type": "string"
},
- "id": {
- "description": "Unique identifier",
- "type": "string"
+ "attachment_uploads": {
+ "description": "Attached files (documents, audio, etc.)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/handler_session.AttachmentUpload"
+ }
},
- "knowledge_base_id": {
- "description": "Target knowledge base ID",
+ "channel": {
+ "description": "Source channel: \"web\", \"api\", \"im\", etc.",
"type": "string"
},
- "last_sync_at": {
- "description": "Last successful sync timestamp",
- "type": "string"
+ "disable_title": {
+ "description": "Whether to disable auto title generation",
+ "type": "boolean"
},
- "last_sync_cursor": {
- "description": "Cursor or state for incremental sync (connector-specific)",
+ "enable_memory": {
+ "description": "Whether memory feature is enabled for this request",
+ "type": "boolean"
+ },
+ "images": {
+ "description": "Attached images for multimodal chat",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/handler_session.ImageAttachment"
}
},
- "last_sync_result": {
- "description": "Summary of last sync result",
+ "knowledge_base_ids": {
+ "description": "Selected knowledge base ID for this request",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
},
- "latest_sync_log": {
- "description": "Latest sync log (not stored in DB, populated on query)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
- }
- ]
- },
- "name": {
- "description": "User-friendly name",
- "type": "string"
- },
- "status": {
- "description": "Current status: active, paused, error",
- "type": "string"
- },
- "sync_deletions": {
- "description": "Whether to sync deletions from source",
- "type": "boolean"
+ "knowledge_ids": {
+ "description": "Selected knowledge ID for this request",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "sync_log_retention_days": {
- "description": "Number of days to keep sync logs (default: 30)",
- "type": "integer"
+ "mentioned_items": {
+ "description": "@mentioned knowledge bases and files",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/handler_session.MentionedItemRequest"
+ }
},
- "sync_mode": {
- "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
+ "query": {
+ "description": "Query text for knowledge base search",
"type": "string"
},
- "sync_schedule": {
- "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
+ "summary_model_id": {
+ "description": "Optional summary model ID for this request (overrides session default)",
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID for multi-tenancy",
- "type": "integer"
- },
- "total_items_synced": {
- "description": "Total items synced (not stored in DB, calculated on query)",
- "type": "integer"
- },
- "type": {
- "description": "Connector type (feishu, notion, confluence, etc.)",
+ "web_search_enabled": {
+ "description": "Whether web search is enabled for this request",
+ "type": "boolean"
+ }
+ }
+ },
+ "handler_session.CreateSessionRequest": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "description": "Description for the session (optional)",
"type": "string"
},
- "updated_at": {
- "description": "Last update timestamp",
+ "title": {
+ "description": "Title for the session (optional)",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": {
+ "handler_session.GenerateTitleRequest": {
"type": "object",
+ "required": [
+ "messages"
+ ],
"properties": {
- "dimension": {
- "type": "integer"
+ "messages": {
+ "description": "Messages to use as context for title generation",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.Message"
+ }
+ }
+ }
+ },
+ "handler_session.ImageAttachment": {
+ "type": "object",
+ "properties": {
+ "caption": {
+ "description": "VLM analysis result (context-aware, single call)",
+ "type": "string"
},
- "truncate_prompt_tokens": {
- "type": "integer"
+ "data": {
+ "description": "base64 data URI from frontend (data:image/png;base64,...)",
+ "type": "string"
+ },
+ "url": {
+ "description": "serving URL after saving to storage",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
+ "handler_session.MentionedItemRequest": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
- }
+ "id": {
+ "type": "string"
},
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
- }
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
+ "type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "name": {
+ "type": "string"
},
- "text": {
+ "type": {
+ "description": "\"kb\" for knowledge base, \"file\" for file",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": {
+ "handler_session.SearchKnowledgeRequest": {
"type": "object",
"required": [
- "entries"
+ "query"
],
"properties": {
- "dry_run": {
- "description": "仅验证,不实际导入",
- "type": "boolean"
+ "knowledge_base_id": {
+ "description": "Single knowledge base ID (for backward compatibility)",
+ "type": "string"
},
- "entries": {
+ "knowledge_base_ids": {
+ "description": "IDs of knowledge bases to search (multi-KB support)",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ "type": "string"
}
},
- "knowledge_id": {
- "type": "string"
- },
- "mode": {
- "type": "string",
- "enum": [
- "append",
- "replace"
- ]
+ "knowledge_ids": {
+ "description": "IDs of specific knowledge (files) to search",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "task_id": {
- "description": "可选,如果不传则自动生成UUID",
+ "query": {
+ "description": "Query text to search for",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQConfig": {
+ "handler_session.StopSessionRequest": {
"type": "object",
+ "required": [
+ "message_id"
+ ],
"properties": {
- "index_mode": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
- },
- "question_index_mode": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode"
+ "message_id": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": {
+ "handler_session.batchDeleteRequest": {
"type": "object",
"properties": {
- "by_id": {
- "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
- }
- },
- "by_tag": {
- "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
- }
+ "delete_all": {
+ "type": "boolean"
},
- "exclude_ids": {
- "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
+ "ids": {
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": {
+ "types.ASRConfig": {
"type": "object",
"properties": {
- "is_enabled": {
+ "enabled": {
"type": "boolean"
},
- "is_recommended": {
- "type": "boolean"
+ "language": {
+ "description": "optional: language hint for transcription",
+ "type": "string"
},
- "tag_id": {
- "type": "integer"
+ "model_id": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": {
+ "types.AgentConfig": {
"type": "object",
- "required": [
- "standard_question"
- ],
"properties": {
- "answer_strategy": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
+ "allowed_skills": {
+ "description": "Skill names whitelist (empty = allow all)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "answers": {
+ "allowed_tools": {
+ "description": "List of allowed tool names",
"type": "array",
"items": {
"type": "string"
}
},
- "id": {
- "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
"type": "integer"
},
- "is_enabled": {
- "type": "boolean"
- },
- "is_recommended": {
- "type": "boolean"
- },
- "negative_questions": {
+ "knowledge_bases": {
+ "description": "Accessible knowledge base IDs",
"type": "array",
"items": {
"type": "string"
}
},
- "similar_questions": {
+ "knowledge_ids": {
+ "description": "Accessible knowledge IDs (individual documents)",
"type": "array",
"items": {
"type": "string"
}
},
- "standard_question": {
- "type": "string"
- },
- "tag_id": {
+ "llm_call_timeout": {
+ "description": "LLM call timeout in seconds (default: 120). Controls the maximum time for a single LLM call.",
"type": "integer"
},
- "tag_name": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": {
- "type": "string",
- "enum": [
- "question_only",
- "question_answer"
- ],
- "x-enum-varnames": [
- "FAQIndexModeQuestionOnly",
- "FAQIndexModeQuestionAnswer"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": {
- "type": "string",
- "enum": [
- "combined",
- "separate"
- ],
- "x-enum-varnames": [
- "FAQQuestionIndexModeCombined",
- "FAQQuestionIndexModeSeparate"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": {
- "type": "object",
- "required": [
- "query_text"
- ],
- "properties": {
- "first_priority_tag_ids": {
- "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "max_context_tokens": {
+ "description": "Maximum context window tokens for the agent (default: 200000).\nThe agent compresses older messages to stay within this limit,\npreserving tool_call/tool_result pairs.",
+ "type": "integer"
},
- "match_count": {
+ "max_iterations": {
+ "description": "Maximum number of ReAct iterations",
"type": "integer"
},
- "only_recommended": {
- "description": "是否仅返回推荐的条目",
- "type": "boolean"
+ "max_tool_output_chars": {
+ "description": "Maximum character length for tool output (default: 16000).\nOutputs exceeding this limit are truncated with head + tail preservation.",
+ "type": "integer"
},
- "query_text": {
+ "mcp_selection_mode": {
+ "description": "MCP service selection",
"type": "string"
},
- "second_priority_tag_ids": {
- "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "vector_threshold": {
- "type": "number"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.GraphNode": {
- "type": "object",
- "properties": {
- "attributes": {
+ "mcp_services": {
+ "description": "Selected MCP service IDs (when mode is \"selected\")",
"type": "array",
"items": {
"type": "string"
}
},
- "chunks": {
+ "multi_turn_enabled": {
+ "description": "Whether multi-turn conversation is enabled",
+ "type": "boolean"
+ },
+ "parallel_tool_calls": {
+ "description": "Whether to execute independent tool calls in parallel (default: false).\nWhen enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.",
+ "type": "boolean"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
+ "type": "boolean"
+ },
+ "skill_dirs": {
+ "description": "Directories to search for skills",
"type": "array",
"items": {
"type": "string"
}
},
- "name": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.GraphRelation": {
- "type": "object",
- "properties": {
- "node1": {
+ "skills_enabled": {
+ "description": "Skills configuration (Progressive Disclosure pattern)",
+ "type": "boolean"
+ },
+ "system_prompt": {
+ "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
"type": "string"
},
- "node2": {
+ "system_prompt_web_disabled": {
+ "description": "Deprecated: Custom prompt when web search is disabled",
"type": "string"
},
- "type": {
+ "system_prompt_web_enabled": {
+ "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": {
- "type": "object",
- "properties": {
- "model_id": {
- "description": "Model ID",
+ },
+ "temperature": {
+ "description": "LLM temperature for agent",
+ "type": "number"
+ },
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
+ },
+ "use_custom_system_prompt": {
+ "description": "Whether to use custom system prompt instead of default",
+ "type": "boolean"
+ },
+ "web_search_enabled": {
+ "description": "Whether web search tool is enabled",
+ "type": "boolean"
+ },
+ "web_search_max_results": {
+ "description": "Maximum number of web search results (default: 5)",
+ "type": "integer"
+ },
+ "web_search_provider_id": {
+ "description": "WebSearchProviderEntity ID (resolved from agent config)",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
+ "types.AgentStep": {
"type": "object",
- "required": [
- "role",
- "user_id"
- ],
"properties": {
- "role": {
- "description": "Role to assign: admin/editor/viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "iteration": {
+ "description": "Iteration number (0-indexed)",
+ "type": "integer"
},
- "user_id": {
- "description": "User ID to invite",
+ "thought": {
+ "description": "LLM's reasoning/thinking (Think phase)",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
- "type": "object",
- "required": [
- "organization_id"
- ],
- "properties": {
- "message": {
- "description": "Optional message for join request",
- "type": "string",
- "maxLength": 500
},
- "organization_id": {
+ "timestamp": {
+ "description": "When this step occurred",
"type": "string"
},
- "role": {
- "description": "Optional: requested role (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "tool_calls": {
+ "description": "Tools called in this step (Act phase)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.ToolCall"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
- "type": "object",
- "required": [
- "invite_code"
+ "types.AnswerStrategy": {
+ "type": "string",
+ "enum": [
+ "all",
+ "random"
],
- "properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
- }
- }
+ "x-enum-varnames": [
+ "AnswerStrategyAll",
+ "AnswerStrategyRandom"
+ ]
},
- "github_com_Tencent_WeKnora_internal_types.Knowledge": {
+ "types.COSEngineConfig": {
"type": "object",
"properties": {
- "channel": {
- "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
+ "app_id": {
"type": "string"
},
- "created_at": {
- "description": "Creation time of the knowledge",
+ "bucket_name": {
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time of the knowledge",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "description": {
- "description": "Description of the knowledge",
+ "path_prefix": {
"type": "string"
},
- "embedding_model_id": {
- "description": "ID of the embedding model",
+ "region": {
"type": "string"
},
- "enable_status": {
- "description": "Enable status of the knowledge",
+ "secret_id": {
"type": "string"
},
- "error_message": {
- "description": "Error message of the knowledge",
+ "secret_key": {
"type": "string"
- },
- "file_hash": {
- "description": "File hash of the knowledge",
+ }
+ }
+ },
+ "types.ChatHistoryConfig": {
+ "type": "object",
+ "properties": {
+ "embedding_model_id": {
+ "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
"type": "string"
},
- "file_name": {
- "description": "File name of the knowledge",
- "type": "string"
+ "enabled": {
+ "description": "Enabled controls whether chat history indexing is active",
+ "type": "boolean"
},
- "file_path": {
- "description": "File path of the knowledge",
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
"type": "string"
+ }
+ }
+ },
+ "types.ChunkingConfig": {
+ "type": "object",
+ "properties": {
+ "child_chunk_size": {
+ "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
},
- "file_size": {
- "description": "File size of the knowledge",
+ "chunk_overlap": {
+ "description": "Chunk overlap",
"type": "integer"
},
- "file_type": {
- "description": "File type of the knowledge",
- "type": "string"
+ "chunk_size": {
+ "description": "Chunk size",
+ "type": "integer"
},
- "id": {
- "description": "Unique identifier of the knowledge",
- "type": "string"
+ "enable_multimodal": {
+ "description": "EnableMultimodal (deprecated, kept for backward compatibility with old data)",
+ "type": "boolean"
},
- "knowledge_base_id": {
- "description": "ID of the knowledge base",
- "type": "string"
+ "enable_parent_child": {
+ "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
+ "type": "boolean"
},
- "knowledge_base_name": {
- "description": "Knowledge base name (not stored in database, populated on query)",
- "type": "string"
+ "parent_chunk_size": {
+ "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
},
- "last_faq_import_result": {
- "description": "Last FAQ import result (for FAQ type knowledge only)",
+ "parser_engine_rules": {
+ "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, the builtin engine is used for all types.",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/types.ParserEngineRule"
}
},
- "metadata": {
- "description": "Metadata of the knowledge",
+ "separators": {
+ "description": "Separators",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
- },
- "parse_status": {
- "description": "Parse status of the knowledge",
+ }
+ }
+ },
+ "types.ConnectionConfig": {
+ "type": "object",
+ "properties": {
+ "addr": {
+ "description": "Common",
"type": "string"
},
- "processed_at": {
- "description": "Processed time of the knowledge",
+ "api_key": {
+ "description": "AES-GCM encrypted",
"type": "string"
},
- "source": {
- "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
+ "grpc_address": {
+ "description": "Weaviate",
"type": "string"
},
- "storage_size": {
- "description": "Storage size of the knowledge",
- "type": "integer"
- },
- "summary_status": {
- "description": "Summary status for async summary generation",
+ "host": {
+ "description": "Qdrant",
"type": "string"
},
- "tag_id": {
- "description": "Optional tag ID for categorization within a knowledge base",
+ "password": {
+ "description": "AES-GCM encrypted",
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
+ "port": {
"type": "integer"
},
- "title": {
- "description": "Title of the knowledge",
+ "scheme": {
"type": "string"
},
- "type": {
- "description": "Type of the knowledge",
+ "use_default_connection": {
+ "description": "Postgres",
+ "type": "boolean"
+ },
+ "use_tls": {
+ "type": "boolean"
+ },
+ "username": {
"type": "string"
},
- "updated_at": {
- "description": "Last updated time of the knowledge",
+ "version": {
+ "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": {
+ "types.ContextCompressionStrategy": {
+ "type": "string",
+ "enum": [
+ "sliding_window",
+ "smart"
+ ],
+ "x-enum-varnames": [
+ "ContextCompressionSlidingWindow",
+ "ContextCompressionSmart"
+ ]
+ },
+ "types.ContextConfig": {
"type": "object",
"properties": {
- "chunk_count": {
- "description": "Chunk count (not stored in database, calculated on query)",
- "type": "integer"
- },
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
- },
- "created_at": {
- "description": "Creation time of the knowledge base",
- "type": "string"
- },
- "deleted_at": {
- "description": "Deletion time of the knowledge base",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "description": {
- "description": "Description of the knowledge base",
- "type": "string"
- },
- "embedding_model_id": {
- "description": "ID of the embedding model",
- "type": "string"
- },
- "extract_config": {
- "description": "Extract config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
- }
- ]
- },
- "faq_config": {
- "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
- }
- ]
- },
- "id": {
- "description": "Unique identifier of the knowledge base",
- "type": "string"
- },
- "image_processing_config": {
- "description": "Image processing configuration",
+ "compression_strategy": {
+ "description": "Compression strategy: \"sliding_window\" or \"smart\"",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ "$ref": "#/definitions/types.ContextCompressionStrategy"
}
]
},
- "is_pinned": {
- "description": "Whether this knowledge base is pinned to the top of the list",
- "type": "boolean"
+ "max_tokens": {
+ "description": "Maximum tokens allowed in LLM context",
+ "type": "integer"
},
- "is_processing": {
- "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
- "type": "boolean"
+ "recent_message_count": {
+ "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "type": "integer"
},
- "is_temporary": {
- "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
- "type": "boolean"
+ "summarize_threshold": {
+ "description": "Summarize threshold: number of messages before summarization",
+ "type": "integer"
+ }
+ }
+ },
+ "types.ConversationConfig": {
+ "type": "object",
+ "properties": {
+ "context_template": {
+ "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "type": "string"
},
- "knowledge_count": {
- "description": "Knowledge count (not stored in database, calculated on query)",
+ "embedding_top_k": {
"type": "integer"
},
- "name": {
- "description": "Name of the knowledge base",
+ "enable_query_expansion": {
+ "type": "boolean"
+ },
+ "enable_rewrite": {
+ "type": "boolean"
+ },
+ "fallback_prompt": {
"type": "string"
},
- "pinned_at": {
- "description": "Time when the knowledge base was pinned (nil if not pinned)",
+ "fallback_response": {
"type": "string"
},
- "processing_count": {
- "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
- "type": "integer"
+ "fallback_strategy": {
+ "description": "Fallback strategy",
+ "type": "string"
},
- "question_generation_config": {
- "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
- }
- ]
+ "keyword_threshold": {
+ "type": "number"
},
- "share_count": {
- "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "max_completion_tokens": {
+ "description": "MaxTokens is the maximum number of tokens to generate",
"type": "integer"
},
- "storage_config": {
- "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
- }
- ]
+ "max_rounds": {
+ "description": "Retrieval \u0026 strategy parameters",
+ "type": "integer"
},
- "storage_provider_config": {
- "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
- }
- ]
+ "prompt": {
+ "description": "Prompt is the system prompt for normal mode",
+ "type": "string"
},
- "summary_model_id": {
- "description": "Summary model ID",
+ "rerank_model_id": {
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
+ "rerank_threshold": {
+ "type": "number"
+ },
+ "rerank_top_k": {
"type": "integer"
},
- "type": {
- "description": "Type of the knowledge base (document, faq, etc.)",
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompts",
"type": "string"
},
- "updated_at": {
- "description": "Last updated time of the knowledge base",
+ "rewrite_prompt_user": {
"type": "string"
},
- "vlm_config": {
- "description": "VLM config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
- }
- ]
+ "summary_model_id": {
+ "description": "Model configuration",
+ "type": "string"
+ },
+ "temperature": {
+ "description": "Temperature controls the randomness of the model output",
+ "type": "number"
+ },
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
+ "types.CreateOrganizationRequest": {
"type": "object",
+ "required": [
+ "name"
+ ],
"properties": {
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "faq_config": {
- "description": "FAQ configuration (only for FAQ type knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
- }
- ]
+ "description": {
+ "type": "string",
+ "maxLength": 1000
},
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
- }
- ]
+ "invite_code_validity_days": {
+ "description": "optional: 0=never, 1, 7, 30; default 7",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "optional: max members; 0=unlimited; default 50",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
+ "types.CredentialsConfig": {
"type": "object",
"properties": {
- "chunk_count": {
+ "weknoracloud": {
+ "$ref": "#/definitions/types.WeKnoraCloudCredentials"
+ }
+ }
+ },
+ "types.CustomAgentConfig": {
+ "type": "object",
+ "properties": {
+ "agent_mode": {
+ "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
+ "type": "string"
+ },
+ "allowed_tools": {
+ "description": "Allowed tools (only for agent type)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "asr_model_id": {
+ "description": "ASR model ID for audio transcription (optional)",
+ "type": "string"
+ },
+ "audio_upload_enabled": {
+ "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
+ "type": "boolean"
+ },
+ "context_template": {
+ "description": "Context template for normal mode (how to format retrieved chunks)",
+ "type": "string"
+ },
+ "context_template_id": {
+ "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content will be resolved at startup.",
+ "type": "string"
+ },
+ "embedding_top_k": {
+ "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
"type": "integer"
},
- "created_at": {
+ "enable_query_expansion": {
+ "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
+ "type": "boolean"
+ },
+ "enable_rewrite": {
+ "description": "Whether to enable query rewrite for multi-turn conversations",
+ "type": "boolean"
+ },
+ "fallback_prompt": {
+ "description": "Fallback prompt (when FallbackStrategy is \"model\")",
"type": "string"
},
- "id": {
+ "fallback_response": {
+ "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
"type": "string"
},
- "knowledge_base_id": {
+ "fallback_strategy": {
+ "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
"type": "string"
},
- "knowledge_base_name": {
+ "faq_direct_answer_threshold": {
+ "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
+ "type": "number"
+ },
+ "faq_priority_enabled": {
+ "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "type": "boolean"
+ },
+ "faq_score_boost": {
+ "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
+ "type": "number"
+ },
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
+ "image_storage_provider": {
+ "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
"type": "string"
},
- "knowledge_base_type": {
+ "image_upload_enabled": {
+ "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "type": "boolean"
+ },
+ "kb_selection_mode": {
+ "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
"type": "string"
},
- "knowledge_count": {
+ "keyword_threshold": {
+ "description": "Keyword retrieval threshold",
+ "type": "number"
+ },
+ "knowledge_bases": {
+ "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "llm_call_timeout": {
+ "description": "Timeout for a single LLM call in seconds (0 = use global default)",
"type": "integer"
},
- "my_permission": {
- "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
+ "max_completion_tokens": {
+ "description": "Maximum completion tokens (only for normal mode)",
+ "type": "integer"
+ },
+ "max_iterations": {
+ "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
+ "type": "integer"
+ },
+ "mcp_selection_mode": {
+ "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
"type": "string"
},
- "my_role_in_org": {
- "description": "Current user's role in this organization (admin/editor/viewer)",
+ "mcp_services": {
+ "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "model_id": {
+ "description": "===== Model Settings =====\nModel ID to use for conversations",
"type": "string"
},
- "organization_id": {
- "type": "string"
+ "multi_turn_enabled": {
+ "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
+ "type": "boolean"
},
- "organization_name": {
+ "rerank_model_id": {
+ "description": "ReRank model ID for retrieval",
"type": "string"
},
- "permission": {
- "description": "Share permission (what the space was granted: viewer/editor)",
- "type": "string"
+ "rerank_threshold": {
+ "description": "Rerank threshold",
+ "type": "number"
},
- "require_approval": {
+ "rerank_top_k": {
+ "description": "Rerank top K",
+ "type": "integer"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
"type": "boolean"
},
- "shared_by_user_id": {
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompt system message",
"type": "string"
},
- "shared_by_username": {
+ "rewrite_prompt_user": {
+ "description": "Rewrite prompt user message template",
"type": "string"
},
- "source_tenant_id": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
- "type": "object",
- "properties": {
- "members": {
+ "selected_skills": {
+ "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
+ "type": "string"
}
},
- "total": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
- "type": "object",
- "properties": {
- "organizations": {
+ "skills_selection_mode": {
+ "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
+ "type": "string"
+ },
+ "suggested_prompts": {
+ "description": "===== Suggested Prompts =====\n推荐问题列表,用于在前端对话面板展示快捷提问",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ "type": "string"
}
},
- "resource_counts": {
- "description": "各空间内知识库/智能体数量,供列表侧栏展示",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
- }
- ]
- },
- "total": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
- "type": "object",
- "properties": {
- "shares": {
+ "supported_file_types": {
+ "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
+ "type": "string"
}
},
- "total": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": {
- "type": "object",
- "properties": {
- "path_prefix": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LoginRequest": {
- "type": "object",
- "required": [
- "email",
- "password"
- ],
- "properties": {
- "email": {
+ "system_prompt": {
+ "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
"type": "string"
},
- "password": {
- "type": "string",
- "minLength": 6
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LoginResponse": {
- "type": "object",
- "properties": {
- "message": {
+ "system_prompt_id": {
+ "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content will be resolved at startup.",
"type": "string"
},
- "refresh_token": {
- "type": "string"
+ "temperature": {
+ "description": "Temperature for LLM (0-1)",
+ "type": "number"
},
- "success": {
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
"type": "boolean"
},
- "tenant": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "vector_threshold": {
+ "description": "Vector retrieval threshold",
+ "type": "number"
},
- "token": {
+ "vlm_model_id": {
+ "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)",
"type": "string"
},
- "user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig": {
- "type": "object",
- "properties": {
- "retry_count": {
- "description": "Number of retries, default: 3",
- "type": "integer"
+ "web_fetch_enabled": {
+ "description": "Whether to auto-fetch full page content for reranked web search results",
+ "type": "boolean"
},
- "retry_delay": {
- "description": "Delay between retries in seconds, default: 1",
+ "web_fetch_top_n": {
+ "description": "Max number of pages to fetch after rerank (default: 3)",
"type": "integer"
},
- "timeout": {
- "description": "Timeout in seconds, default: 30",
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": {
- "type": "object",
- "properties": {
- "api_key": {
- "type": "string"
+ "web_search_enabled": {
+ "description": "===== Web Search Settings =====\nWhether web search is enabled",
+ "type": "boolean"
},
- "custom_headers": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "web_search_max_results": {
+ "description": "Maximum web search results",
+ "type": "integer"
},
- "token": {
+ "web_search_provider_id": {
+ "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the tenant's default provider (is_default=true) is used.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPHeaders": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPService": {
+ "types.DataSource": {
"type": "object",
"properties": {
- "advanced_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
+ "config": {
+ "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
- "auth_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig"
+ "conflict_strategy": {
+ "description": "Conflict resolution strategy: overwrite or skip",
+ "type": "string"
},
"created_at": {
+ "description": "Creation timestamp",
"type": "string"
},
"deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "description": {
- "type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "env_vars": {
- "description": "Environment variables for stdio",
+ "description": "Soft delete timestamp",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
+ "$ref": "#/definitions/gorm.DeletedAt"
}
]
},
- "headers": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
+ "error_message": {
+ "description": "Error message if status is \"error\"",
+ "type": "string"
},
"id": {
+ "description": "Unique identifier",
"type": "string"
},
- "is_builtin": {
- "description": "Whether this is a builtin MCP service (visible to all tenants)",
- "type": "boolean"
+ "knowledge_base_id": {
+ "description": "Target knowledge base ID",
+ "type": "string"
},
- "name": {
+ "last_sync_at": {
+ "description": "Last successful sync timestamp",
"type": "string"
},
- "stdio_config": {
- "description": "Required for stdio transport",
+ "last_sync_cursor": {
+ "description": "Cursor or state for incremental sync (connector-specific)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "last_sync_result": {
+ "description": "Summary of last sync result",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "latest_sync_log": {
+ "description": "Latest sync log (not stored in DB, populated on query)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
+ "$ref": "#/definitions/types.SyncLog"
}
]
},
+ "name": {
+ "description": "User-friendly name",
+ "type": "string"
+ },
+ "status": {
+ "description": "Current status: active, paused, error",
+ "type": "string"
+ },
+ "sync_deletions": {
+ "description": "Whether to sync deletions from source",
+ "type": "boolean"
+ },
+ "sync_log_retention_days": {
+ "description": "Number of days to keep sync logs (default: 30)",
+ "type": "integer"
+ },
+ "sync_mode": {
+ "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
+ "type": "string"
+ },
+ "sync_schedule": {
+ "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
+ "type": "string"
+ },
"tenant_id": {
+ "description": "Tenant ID for multi-tenancy",
"type": "integer"
},
- "transport_type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
+ "total_items_synced": {
+ "description": "Total items synced (not stored in DB, calculated on query)",
+ "type": "integer"
+ },
+ "type": {
+ "description": "Connector type (feishu, notion, confluence, etc.)",
+ "type": "string"
},
"updated_at": {
+ "description": "Last update timestamp",
"type": "string"
+ }
+ }
+ },
+ "types.EmbeddingParameters": {
+ "type": "object",
+ "properties": {
+ "dimension": {
+ "type": "integer"
},
- "url": {
- "description": "Optional: required for SSE/HTTP Streamable",
- "type": "string"
+ "truncate_prompt_tokens": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": {
+ "types.ExtractConfig": {
"type": "object",
"properties": {
- "args": {
- "description": "Command arguments array",
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.GraphRelation"
+ }
+ },
+ "tags": {
"type": "array",
"items": {
"type": "string"
}
},
- "command": {
- "description": "Command: \"uvx\" or \"npx\"",
+ "text": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPTransportType": {
- "type": "string",
- "enum": [
- "sse",
- "http-streamable",
- "stdio"
- ],
- "x-enum-comments": {
- "MCPTransportHTTPStreamable": "HTTP Streamable",
- "MCPTransportSSE": "Server-Sent Events",
- "MCPTransportStdio": "Stdio (Standard Input/Output)"
- },
- "x-enum-descriptions": [
- "Server-Sent Events",
- "HTTP Streamable",
- "Stdio (Standard Input/Output)"
- ],
- "x-enum-varnames": [
- "MCPTransportSSE",
- "MCPTransportHTTPStreamable",
- "MCPTransportStdio"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": {
+ "types.FAQBatchUpsertPayload": {
"type": "object",
+ "required": [
+ "entries"
+ ],
"properties": {
- "channel": {
- "type": "string"
+ "dry_run": {
+ "description": "仅验证,不实际导入",
+ "type": "boolean"
},
- "content": {
- "type": "string"
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.FAQEntryPayload"
+ }
},
- "status": {
+ "knowledge_id": {
"type": "string"
},
- "tag_id": {
- "type": "string"
+ "mode": {
+ "type": "string",
+ "enum": [
+ "append",
+ "replace"
+ ]
},
- "title": {
+ "task_id": {
+ "description": "可选,如果不传则自动生成UUID",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MatchType": {
- "type": "integer",
- "enum": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "x-enum-comments": {
- "MatchTypeDataAnalysis": "数据分析匹配类型",
- "MatchTypeDirectLoad": "直接加载匹配类型",
- "MatchTypeParentChunk": "父Chunk匹配类型",
- "MatchTypeRelationChunk": "关系Chunk匹配类型",
- "MatchTypeWebSearch": "网络搜索匹配类型"
- },
- "x-enum-descriptions": [
- "",
- "",
- "",
- "",
- "父Chunk匹配类型",
- "关系Chunk匹配类型",
- "",
- "网络搜索匹配类型",
- "直接加载匹配类型",
- "数据分析匹配类型"
- ],
- "x-enum-varnames": [
- "MatchTypeEmbedding",
- "MatchTypeKeywords",
- "MatchTypeNearByChunk",
- "MatchTypeHistory",
- "MatchTypeParentChunk",
- "MatchTypeRelationChunk",
- "MatchTypeGraph",
- "MatchTypeWebSearch",
- "MatchTypeDirectLoad",
- "MatchTypeDataAnalysis"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.MentionedItem": {
+ "types.FAQConfig": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
+ "index_mode": {
+ "$ref": "#/definitions/types.FAQIndexMode"
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
- "type": "string"
+ "question_index_mode": {
+ "$ref": "#/definitions/types.FAQQuestionIndexMode"
+ }
+ }
+ },
+ "types.FAQEntryFieldsBatchUpdate": {
+ "type": "object",
+ "properties": {
+ "by_id": {
+ "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/types.FAQEntryFieldsUpdate"
+ }
},
- "name": {
- "type": "string"
+ "by_tag": {
+ "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/types.FAQEntryFieldsUpdate"
+ }
},
- "type": {
- "description": "\"kb\" for knowledge base, \"file\" for file",
- "type": "string"
+ "exclude_ids": {
+ "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Message": {
+ "types.FAQEntryFieldsUpdate": {
"type": "object",
"properties": {
- "agent_duration_ms": {
- "description": "Agent total execution duration in milliseconds (from query start to answer start)",
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "is_recommended": {
+ "type": "boolean"
+ },
+ "tag_id": {
"type": "integer"
+ }
+ }
+ },
+ "types.FAQEntryPayload": {
+ "type": "object",
+ "required": [
+ "standard_question"
+ ],
+ "properties": {
+ "answer_strategy": {
+ "$ref": "#/definitions/types.AnswerStrategy"
},
- "agent_steps": {
- "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
+ "answers": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep"
+ "type": "string"
}
},
- "channel": {
- "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
- "type": "string"
+ "id": {
+ "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "type": "integer"
},
- "content": {
- "description": "Message text content",
- "type": "string"
+ "is_enabled": {
+ "type": "boolean"
},
- "created_at": {
- "description": "Message creation timestamp",
- "type": "string"
+ "is_recommended": {
+ "type": "boolean"
},
- "deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "negative_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "id": {
- "description": "Unique identifier for the message",
+ "similar_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "standard_question": {
"type": "string"
},
- "images": {
- "description": "Attached images with OCR/Caption text (for user messages)",
+ "tag_id": {
+ "type": "integer"
+ },
+ "tag_name": {
+ "type": "string"
+ }
+ }
+ },
+ "types.FAQIndexMode": {
+ "type": "string",
+ "enum": [
+ "question_only",
+ "question_answer"
+ ],
+ "x-enum-varnames": [
+ "FAQIndexModeQuestionOnly",
+ "FAQIndexModeQuestionAnswer"
+ ]
+ },
+ "types.FAQQuestionIndexMode": {
+ "type": "string",
+ "enum": [
+ "combined",
+ "separate"
+ ],
+ "x-enum-varnames": [
+ "FAQQuestionIndexModeCombined",
+ "FAQQuestionIndexModeSeparate"
+ ]
+ },
+ "types.FAQSearchRequest": {
+ "type": "object",
+ "required": [
+ "query_text"
+ ],
+ "properties": {
+ "first_priority_tag_ids": {
+ "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage"
+ "type": "integer"
}
},
- "is_completed": {
- "description": "Whether message generation is complete",
- "type": "boolean"
+ "match_count": {
+ "type": "integer"
},
- "is_fallback": {
- "description": "Whether this response is a fallback (no knowledge base match found)",
+ "only_recommended": {
+ "description": "是否仅返回推荐的条目",
"type": "boolean"
},
- "knowledge_id": {
- "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
+ "query_text": {
"type": "string"
},
- "knowledge_references": {
- "description": "References to knowledge chunks used in the response",
+ "second_priority_tag_ids": {
+ "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
+ "type": "integer"
}
},
- "mentioned_items": {
- "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "vector_threshold": {
+ "type": "number"
+ }
+ }
+ },
+ "types.GraphNode": {
+ "type": "object",
+ "properties": {
+ "attributes": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
+ "type": "string"
}
},
- "request_id": {
- "description": "Request identifier for tracking API requests",
- "type": "string"
+ "chunks": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "role": {
- "description": "Message role: \"user\", \"assistant\", \"system\"",
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "types.GraphRelation": {
+ "type": "object",
+ "properties": {
+ "node1": {
"type": "string"
},
- "session_id": {
- "description": "ID of the session this message belongs to",
+ "node2": {
"type": "string"
},
- "updated_at": {
- "description": "Last update timestamp",
+ "type": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MessageImage": {
+ "types.ImageProcessingConfig": {
"type": "object",
"properties": {
- "caption": {
- "type": "string"
- },
- "url": {
+ "model_id": {
+ "description": "Model ID",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": {
+ "types.IndexConfig": {
"type": "object",
"properties": {
- "access_key_id": {
+ "collection_name": {
+ "description": "Milvus",
"type": "string"
},
- "bucket_name": {
+ "collection_prefix": {
+ "description": "Qdrant",
"type": "string"
},
- "endpoint": {
+ "index_name": {
+ "description": "ES, OpenSearch",
"type": "string"
},
- "mode": {
- "description": "\"docker\" or \"remote\"",
- "type": "string"
+ "number_of_replicas": {
+ "description": "ES, OpenSearch",
+ "type": "integer"
},
- "path_prefix": {
+ "number_of_shards": {
+ "description": "ES, OpenSearch",
+ "type": "integer"
+ }
+ }
+ },
+ "types.InviteMemberRequest": {
+ "type": "object",
+ "required": [
+ "role",
+ "user_id"
+ ],
+ "properties": {
+ "role": {
+ "description": "Role to assign: admin/editor/viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.OrgMemberRole"
+ }
+ ]
+ },
+ "user_id": {
+ "description": "User ID to invite",
"type": "string"
+ }
+ }
+ },
+ "types.JoinByOrganizationIDRequest": {
+ "type": "object",
+ "required": [
+ "organization_id"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message for join request",
+ "type": "string",
+ "maxLength": 500
},
- "secret_access_key": {
+ "organization_id": {
"type": "string"
},
- "use_ssl": {
- "type": "boolean"
+ "role": {
+ "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.OrgMemberRole"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ModelParameters": {
+ "types.JoinOrganizationRequest": {
"type": "object",
+ "required": [
+ "invite_code"
+ ],
"properties": {
- "api_key": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ }
+ }
+ },
+ "types.Knowledge": {
+ "type": "object",
+ "properties": {
+ "channel": {
+ "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
"type": "string"
},
- "base_url": {
+ "created_at": {
+ "description": "Creation time of the knowledge",
"type": "string"
},
- "embedding_parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
- },
- "extra_config": {
- "description": "Provider-specific configuration",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "deleted_at": {
+ "description": "Deletion time of the knowledge",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
- "interface_type": {
+ "description": {
+ "description": "Description of the knowledge",
"type": "string"
},
- "parameter_size": {
- "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
"type": "string"
},
- "provider": {
- "description": "Provider identifier: openai, aliyun, zhipu, generic",
+ "enable_status": {
+ "description": "Enable status of the knowledge",
"type": "string"
},
- "supports_vision": {
- "description": "Whether the model accepts image/multimodal input",
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ModelSource": {
- "type": "string",
- "enum": [
- "local",
- "remote",
- "aliyun",
- "zhipu",
- "volcengine",
- "deepseek",
- "hunyuan",
- "minimax",
- "openai",
- "gemini",
- "mimo",
- "siliconflow",
- "jina",
- "openrouter",
- "nvidia",
- "novita"
- ],
- "x-enum-comments": {
- "ModelSourceAliyun": "Aliyun DashScope model",
- "ModelSourceDeepseek": "Deepseek model",
- "ModelSourceGemini": "Gemini model",
- "ModelSourceHunyuan": "Hunyuan model",
- "ModelSourceJina": "Jina AI model",
- "ModelSourceLocal": "Local model",
- "ModelSourceMimo": "Mimo model",
- "ModelSourceMinimax": "Minimax mode",
- "ModelSourceNovita": "Novita AI model",
- "ModelSourceNvidia": "NVIDIA model",
- "ModelSourceOpenAI": "OpenAI model",
- "ModelSourceOpenRouter": "OpenRouter model",
- "ModelSourceRemote": "Remote model",
- "ModelSourceSiliconFlow": "SiliconFlow model",
- "ModelSourceVolcengine": "Volcengine model",
- "ModelSourceZhipu": "Zhipu model"
- },
- "x-enum-descriptions": [
- "Local model",
- "Remote model",
- "Aliyun DashScope model",
- "Zhipu model",
- "Volcengine model",
- "Deepseek model",
- "Hunyuan model",
- "Minimax mode",
- "OpenAI model",
- "Gemini model",
- "Mimo model",
- "SiliconFlow model",
- "Jina AI model",
- "OpenRouter model",
- "NVIDIA model",
- "Novita AI model"
- ],
- "x-enum-varnames": [
- "ModelSourceLocal",
- "ModelSourceRemote",
- "ModelSourceAliyun",
- "ModelSourceZhipu",
- "ModelSourceVolcengine",
- "ModelSourceDeepseek",
- "ModelSourceHunyuan",
- "ModelSourceMinimax",
- "ModelSourceOpenAI",
- "ModelSourceGemini",
- "ModelSourceMimo",
- "ModelSourceSiliconFlow",
- "ModelSourceJina",
- "ModelSourceOpenRouter",
- "ModelSourceNvidia",
- "ModelSourceNovita"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ModelType": {
- "type": "string",
- "enum": [
- "Embedding",
- "Rerank",
- "KnowledgeQA",
- "VLLM"
- ],
- "x-enum-comments": {
- "ModelTypeEmbedding": "Embedding model",
- "ModelTypeKnowledgeQA": "KnowledgeQA model",
- "ModelTypeRerank": "Rerank model",
- "ModelTypeVLLM": "VLLM model"
- },
- "x-enum-descriptions": [
- "Embedding model",
- "Rerank model",
- "KnowledgeQA model",
- "VLLM model"
- ],
- "x-enum-varnames": [
- "ModelTypeEmbedding",
- "ModelTypeRerank",
- "ModelTypeKnowledgeQA",
- "ModelTypeVLLM"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": {
- "type": "object",
- "properties": {
- "authorization_url": {
+ "error_message": {
+ "description": "Error message of the knowledge",
"type": "string"
},
- "provider_display_name": {
+ "file_hash": {
+ "description": "File hash of the knowledge",
"type": "string"
},
- "state": {
+ "file_name": {
+ "description": "File name of the knowledge",
"type": "string"
},
- "success": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": {
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
+ "file_path": {
+ "description": "File path of the knowledge",
+ "type": "string"
},
- "provider_display_name": {
+ "file_size": {
+ "description": "File size of the knowledge",
+ "type": "integer"
+ },
+ "file_type": {
+ "description": "File type of the knowledge",
"type": "string"
},
- "success": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
- "type": "string",
- "enum": [
- "admin",
- "editor",
- "viewer"
- ],
- "x-enum-varnames": [
- "OrgRoleAdmin",
- "OrgRoleEditor",
- "OrgRoleViewer"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
- "type": "object",
- "properties": {
- "avatar": {
+ "id": {
+ "description": "Unique identifier of the knowledge",
"type": "string"
},
- "email": {
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base",
"type": "string"
},
- "id": {
+ "knowledge_base_name": {
+ "description": "Knowledge base name (not stored in database, populated on query)",
"type": "string"
},
- "joined_at": {
+ "last_faq_import_result": {
+ "description": "Last FAQ import result (for FAQ type knowledge only)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "metadata": {
+ "description": "Metadata of the knowledge",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "parse_status": {
+ "description": "Parse status of the knowledge",
"type": "string"
},
- "role": {
+ "processed_at": {
+ "description": "Processed time of the knowledge",
+ "type": "string"
+ },
+ "source": {
+ "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
+ "type": "string"
+ },
+ "storage_size": {
+ "description": "Storage size of the knowledge",
+ "type": "integer"
+ },
+ "summary_status": {
+ "description": "Summary status for async summary generation",
+ "type": "string"
+ },
+ "tag_id": {
+ "description": "Optional tag ID for categorization within a knowledge base",
"type": "string"
},
"tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
- "user_id": {
+ "title": {
+ "description": "Title of the knowledge",
"type": "string"
},
- "username": {
+ "type": {
+ "description": "Type of the knowledge",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last updated time of the knowledge",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
+ "types.KnowledgeBase": {
"type": "object",
"properties": {
- "agent_share_count": {
- "description": "共享到该组织的智能体数量",
+ "asr_config": {
+ "description": "ASR config (Automatic Speech Recognition)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ASRConfig"
+ }
+ ]
+ },
+ "chunk_count": {
+ "description": "Chunk count (not stored in database, calculated on query)",
"type": "integer"
},
- "avatar": {
- "type": "string"
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ChunkingConfig"
+ }
+ ]
},
"created_at": {
+ "description": "Creation time of the knowledge base",
"type": "string"
},
+ "deleted_at": {
+ "description": "Deletion time of the knowledge base",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
"description": {
+ "description": "Description of the knowledge base",
"type": "string"
},
- "has_pending_upgrade": {
- "description": "当前用户是否有待处理的权限升级申请",
- "type": "boolean"
- },
- "id": {
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
"type": "string"
},
- "invite_code": {
- "type": "string"
+ "extract_config": {
+ "description": "Extract config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ExtractConfig"
+ }
+ ]
},
- "invite_code_expires_at": {
+ "faq_config": {
+ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.FAQConfig"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the knowledge base",
"type": "string"
},
- "invite_code_validity_days": {
- "type": "integer"
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ImageProcessingConfig"
+ }
+ ]
},
- "is_owner": {
+ "is_pinned": {
+ "description": "Whether this knowledge base is pinned to the top of the list",
"type": "boolean"
},
- "member_count": {
- "type": "integer"
+ "is_processing": {
+ "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
+ "type": "boolean"
},
- "member_limit": {
- "description": "0 = unlimited",
- "type": "integer"
+ "is_temporary": {
+ "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
+ "type": "boolean"
},
- "my_role": {
- "type": "string"
+ "knowledge_count": {
+ "description": "Knowledge count (not stored in database, calculated on query)",
+ "type": "integer"
},
"name": {
+ "description": "Name of the knowledge base",
"type": "string"
},
- "owner_id": {
+ "pinned_at": {
+ "description": "Time when the knowledge base was pinned (nil if not pinned)",
"type": "string"
},
- "pending_join_request_count": {
- "description": "待审批加入申请数(仅管理员可见)",
+ "processing_count": {
+ "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
"type": "integer"
},
- "require_approval": {
- "type": "boolean"
- },
- "searchable": {
- "type": "boolean"
+ "question_generation_config": {
+ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.QuestionGenerationConfig"
+ }
+ ]
},
"share_count": {
- "description": "共享到该组织的知识库数量",
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "type": "integer"
+ },
+ "storage_config": {
+ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.StorageConfig"
+ }
+ ]
+ },
+ "storage_provider_config": {
+ "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.StorageProviderConfig"
+ }
+ ]
+ },
+ "summary_model_id": {
+ "description": "Summary model ID",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
+ "type": {
+ "description": "Type of the knowledge base (document, faq, etc.)",
+ "type": "string"
+ },
"updated_at": {
+ "description": "Last updated time of the knowledge base",
"type": "string"
+ },
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.VLMConfig"
+ }
+ ]
+ }
+ }
+ },
+ "types.KnowledgeBaseConfig": {
+ "type": "object",
+ "properties": {
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ChunkingConfig"
+ }
+ ]
+ },
+ "faq_config": {
+ "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.FAQConfig"
+ }
+ ]
+ },
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ImageProcessingConfig"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": {
+ "types.KnowledgeBaseShareResponse": {
"type": "object",
"properties": {
- "docreader_addr": {
- "description": "文档解析服务地址",
+ "chunk_count": {
+ "type": "integer"
+ },
+ "created_at": {
"type": "string"
},
- "mineru_api_key": {
- "description": "MinerU 云 API Key",
+ "id": {
"type": "string"
},
- "mineru_cloud_enable_formula": {
- "type": "boolean"
+ "knowledge_base_id": {
+ "type": "string"
},
- "mineru_cloud_enable_ocr": {
- "type": "boolean"
+ "knowledge_base_name": {
+ "type": "string"
},
- "mineru_cloud_enable_table": {
- "type": "boolean"
+ "knowledge_base_type": {
+ "type": "string"
},
- "mineru_cloud_language": {
+ "knowledge_count": {
+ "type": "integer"
+ },
+ "my_permission": {
+ "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
"type": "string"
},
- "mineru_cloud_model": {
- "description": "MinerU 云 API 解析参数",
+ "my_role_in_org": {
+ "description": "Current user's role in this organization (admin/editor/viewer)",
"type": "string"
},
- "mineru_enable_formula": {
- "type": "boolean"
+ "organization_id": {
+ "type": "string"
},
- "mineru_enable_ocr": {
- "type": "boolean"
+ "organization_name": {
+ "type": "string"
},
- "mineru_enable_table": {
+ "permission": {
+ "description": "Share permission (what the space was granted: viewer/editor)",
+ "type": "string"
+ },
+ "require_approval": {
"type": "boolean"
},
- "mineru_endpoint": {
- "description": "MinerU 自建服务端点",
+ "shared_by_user_id": {
"type": "string"
},
- "mineru_language": {
+ "shared_by_username": {
"type": "string"
},
- "mineru_model": {
- "description": "MinerU 自建解析参数",
- "type": "string"
+ "source_tenant_id": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": {
+ "types.ListMembersResponse": {
"type": "object",
"properties": {
- "engine": {
- "type": "string"
+ "members": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.OrganizationMemberResponse"
+ }
},
- "file_types": {
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "types.ListOrganizationsResponse": {
+ "type": "object",
+ "properties": {
+ "organizations": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/types.OrganizationResponse"
}
+ },
+ "resource_counts": {
+ "description": "各空间内知识库/智能体数量,供列表侧栏展示",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ResourceCountsByOrgResponse"
+ }
+ ]
+ },
+ "total": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
+ "types.ListSharesResponse": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
+ "shares": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.KnowledgeBaseShareResponse"
+ }
},
- "question_count": {
- "description": "Number of questions to generate per chunk (default: 3, max: 10)",
+ "total": {
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
+ "types.LocalEngineConfig": {
+ "type": "object",
+ "properties": {
+ "path_prefix": {
+ "type": "string"
+ }
+ }
+ },
+ "types.LoginRequest": {
"type": "object",
"required": [
"email",
- "password",
- "username"
+ "password"
],
"properties": {
"email": {
@@ -10867,1751 +11442,1894 @@
"password": {
"type": "string",
"minLength": 6
- },
- "username": {
- "type": "string",
- "maxLength": 50,
- "minLength": 2
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RegisterResponse": {
+ "types.LoginResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
+ "refresh_token": {
+ "type": "string"
+ },
"success": {
"type": "boolean"
},
"tenant": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "$ref": "#/definitions/types.Tenant"
+ },
+ "token": {
+ "type": "string"
},
"user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
+ "$ref": "#/definitions/types.User"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
+ "types.MCPAdvancedConfig": {
"type": "object",
- "required": [
- "requested_role"
- ],
"properties": {
- "message": {
- "description": "Optional message explaining the reason",
- "type": "string",
- "maxLength": 500
+ "retry_count": {
+ "description": "Number of retries, default: 3",
+ "type": "integer"
},
- "requested_role": {
- "description": "The role user wants to upgrade to",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "retry_delay": {
+ "description": "Delay between retries in seconds, default: 1",
+ "type": "integer"
+ },
+ "timeout": {
+ "description": "Timeout in seconds, default: 30",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Resource": {
+ "types.MCPAuthConfig": {
"type": "object",
"properties": {
- "description": {
- "description": "Optional description",
- "type": "string"
- },
- "external_id": {
- "description": "Unique identifier in the external system",
+ "api_key": {
"type": "string"
},
- "metadata": {
- "description": "Additional metadata",
+ "custom_headers": {
"type": "object",
- "additionalProperties": true
- },
- "modified_at": {
- "description": "Last modified time in external system",
- "type": "string"
- },
- "name": {
- "description": "Display name",
- "type": "string"
- },
- "parent_id": {
- "description": "For hierarchical resources (parent ID if applicable)",
- "type": "string"
- },
- "type": {
- "description": "Resource type (document, folder, space, page, etc.)",
- "type": "string"
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "url": {
- "description": "URL to access in external system",
+ "token": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
+ "types.MCPEnvVars": {
"type": "object",
- "properties": {
- "agents": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
- },
- "knowledge_bases": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
- }
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "types.MCPHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": {
+ "types.MCPService": {
"type": "object",
"properties": {
- "embedding_top_k": {
- "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
- "type": "integer"
+ "advanced_config": {
+ "$ref": "#/definitions/types.MCPAdvancedConfig"
},
- "keyword_threshold": {
- "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
- "type": "number"
+ "auth_config": {
+ "$ref": "#/definitions/types.MCPAuthConfig"
},
- "rerank_model_id": {
- "description": "RerankModelID is the ID of the rerank model to use (required for search)",
+ "created_at": {
"type": "string"
},
- "rerank_threshold": {
- "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
- "type": "number"
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
},
- "rerank_top_k": {
- "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
- "type": "integer"
+ "description": {
+ "type": "string"
},
- "vector_threshold": {
- "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
- "type": "number"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
- "type": "object",
- "properties": {
- "retriever_engine_type": {
- "description": "Retriever engine type",
+ "enabled": {
+ "type": "boolean"
+ },
+ "env_vars": {
+ "description": "Environment variables for stdio",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ "$ref": "#/definitions/types.MCPEnvVars"
}
]
},
- "retriever_type": {
- "description": "Retriever type",
+ "headers": {
+ "$ref": "#/definitions/types.MCPHeaders"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_builtin": {
+ "description": "Whether this is a builtin MCP service (visible to all tenants)",
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "stdio_config": {
+ "description": "Required for stdio transport",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType"
+ "$ref": "#/definitions/types.MCPStdioConfig"
}
]
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "transport_type": {
+ "$ref": "#/definitions/types.MCPTransportType"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "url": {
+ "description": "Optional: required for SSE/HTTP Streamable",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": {
- "type": "string",
- "enum": [
- "postgres",
- "elasticsearch",
- "infinity",
- "elasticfaiss",
- "qdrant",
- "milvus",
- "weaviate",
- "sqlite"
- ],
- "x-enum-varnames": [
- "PostgresRetrieverEngineType",
- "ElasticsearchRetrieverEngineType",
- "InfinityRetrieverEngineType",
- "ElasticFaissRetrieverEngineType",
- "QdrantRetrieverEngineType",
- "MilvusRetrieverEngineType",
- "WeaviateRetrieverEngineType",
- "SQLiteRetrieverEngineType"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
+ "types.MCPStdioConfig": {
"type": "object",
"properties": {
- "engines": {
+ "args": {
+ "description": "Command arguments array",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams"
+ "type": "string"
}
+ },
+ "command": {
+ "description": "Command: \"uvx\" or \"npx\"",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrieverType": {
+ "types.MCPTransportType": {
"type": "string",
"enum": [
- "keywords",
- "vector",
- "websearch"
+ "sse",
+ "http-streamable",
+ "stdio"
],
"x-enum-comments": {
- "KeywordsRetrieverType": "Keywords retriever",
- "VectorRetrieverType": "Vector retriever",
- "WebSearchRetrieverType": "Web search retriever"
+ "MCPTransportHTTPStreamable": "HTTP Streamable",
+ "MCPTransportSSE": "Server-Sent Events",
+ "MCPTransportStdio": "Stdio (Standard Input/Output)"
},
"x-enum-descriptions": [
- "Keywords retriever",
- "Vector retriever",
- "Web search retriever"
+ "Server-Sent Events",
+ "HTTP Streamable",
+ "Stdio (Standard Input/Output)"
],
"x-enum-varnames": [
- "KeywordsRetrieverType",
- "VectorRetrieverType",
- "WebSearchRetrieverType"
+ "MCPTransportSSE",
+ "MCPTransportHTTPStreamable",
+ "MCPTransportStdio"
]
},
- "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
+ "types.ManualKnowledgePayload": {
"type": "object",
"properties": {
- "approved": {
- "type": "boolean"
+ "channel": {
+ "type": "string"
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "content": {
+ "type": "string"
},
- "role": {
- "description": "Optional: role to assign when approving; overrides applicant's requested role",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "status": {
+ "type": "string"
+ },
+ "tag_id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": {
+ "types.MatchType": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "x-enum-comments": {
+ "MatchTypeDataAnalysis": "数据分析匹配类型",
+ "MatchTypeDirectLoad": "直接加载匹配类型",
+ "MatchTypeParentChunk": "父Chunk匹配类型",
+ "MatchTypeRelationChunk": "关系Chunk匹配类型",
+ "MatchTypeWebSearch": "网络搜索匹配类型"
+ },
+ "x-enum-descriptions": [
+ "",
+ "",
+ "",
+ "",
+ "父Chunk匹配类型",
+ "关系Chunk匹配类型",
+ "",
+ "网络搜索匹配类型",
+ "直接加载匹配类型",
+ "数据分析匹配类型"
+ ],
+ "x-enum-varnames": [
+ "MatchTypeEmbedding",
+ "MatchTypeKeywords",
+ "MatchTypeNearByChunk",
+ "MatchTypeHistory",
+ "MatchTypeParentChunk",
+ "MatchTypeRelationChunk",
+ "MatchTypeGraph",
+ "MatchTypeWebSearch",
+ "MatchTypeDirectLoad",
+ "MatchTypeDataAnalysis"
+ ]
+ },
+ "types.MentionedItem": {
"type": "object",
"properties": {
- "access_key": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
- },
- "endpoint": {
+ "id": {
"type": "string"
},
- "path_prefix": {
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
"type": "string"
},
- "region": {
+ "name": {
"type": "string"
},
- "secret_key": {
+ "type": {
+ "description": "\"kb\" for knowledge base, \"file\" for file",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SearchParams": {
+ "types.Message": {
"type": "object",
"properties": {
- "disable_keywords_match": {
- "type": "boolean"
- },
- "disable_vector_match": {
- "type": "boolean"
- },
- "keyword_threshold": {
- "type": "number"
+ "agent_duration_ms": {
+ "description": "Agent total execution duration in milliseconds (from query start to answer start)",
+ "type": "integer"
},
- "knowledge_base_ids": {
- "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
+ "agent_steps": {
+ "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/types.AgentStep"
}
},
- "knowledge_ids": {
+ "attachments": {
+ "description": "Attached files (documents, audio, etc., for user messages)",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/types.MessageAttachment"
}
},
- "match_count": {
- "type": "integer"
+ "channel": {
+ "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
+ "type": "string"
},
- "only_recommended": {
- "type": "boolean"
+ "content": {
+ "description": "Message text content",
+ "type": "string"
},
- "query_embedding": {
+ "created_at": {
+ "description": "Message creation timestamp",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier for the message",
+ "type": "string"
+ },
+ "images": {
+ "description": "Attached images with OCR/Caption text (for user messages)",
"type": "array",
"items": {
- "type": "number"
+ "$ref": "#/definitions/types.MessageImage"
}
},
- "query_text": {
- "type": "string"
+ "is_completed": {
+ "description": "Whether message generation is complete",
+ "type": "boolean"
},
- "skip_context_enrichment": {
- "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
+ "is_fallback": {
+ "description": "Whether this response is a fallback (no knowledge base match found)",
"type": "boolean"
},
- "tag_ids": {
- "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "knowledge_id": {
+ "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
+ "type": "string"
+ },
+ "knowledge_references": {
+ "description": "References to knowledge chunks used in the response",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/types.SearchResult"
}
},
- "vector_threshold": {
- "type": "number"
+ "mentioned_items": {
+ "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.MentionedItem"
+ }
+ },
+ "request_id": {
+ "description": "Request identifier for tracking API requests",
+ "type": "string"
+ },
+ "role": {
+ "description": "Message role: \"user\", \"assistant\", \"system\"",
+ "type": "string"
+ },
+ "session_id": {
+ "description": "ID of the session this message belongs to",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SearchResult": {
+ "types.MessageAttachment": {
"type": "object",
"properties": {
- "chunk_index": {
- "description": "Chunk index",
- "type": "integer"
- },
- "chunk_metadata": {
- "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "content": {
+ "description": "Extracted text content (for small text files)",
+ "type": "string"
},
- "chunk_type": {
- "description": "Chunk 类型",
+ "file_name": {
+ "description": "Original filename",
"type": "string"
},
- "content": {
- "description": "Content",
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
+ },
+ "file_type": {
+ "description": "File extension (e.g., \".pdf\", \".docx\")",
"type": "string"
},
- "end_at": {
- "description": "End at",
+ "is_truncated": {
+ "description": "Whether content was truncated",
+ "type": "boolean"
+ },
+ "line_count": {
+ "description": "Total line count (for text files)",
"type": "integer"
},
- "id": {
- "description": "ID",
+ "url": {
+ "description": "Storage URL (provider://path)",
+ "type": "string"
+ }
+ }
+ },
+ "types.MessageImage": {
+ "type": "object",
+ "properties": {
+ "caption": {
"type": "string"
},
- "image_info": {
- "description": "图片信息 (JSON 格式)",
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "types.MinIOEngineConfig": {
+ "type": "object",
+ "properties": {
+ "access_key_id": {
"type": "string"
},
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
+ "bucket_name": {
"type": "string"
},
- "knowledge_channel": {
- "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
+ "endpoint": {
"type": "string"
},
- "knowledge_description": {
- "description": "KnowledgeDescription is the description of the knowledge document",
+ "mode": {
+ "description": "\"docker\" or \"remote\"",
"type": "string"
},
- "knowledge_filename": {
- "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
+ "path_prefix": {
"type": "string"
},
- "knowledge_id": {
- "description": "Knowledge ID",
+ "secret_access_key": {
"type": "string"
},
- "knowledge_source": {
- "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
+ "use_ssl": {
+ "type": "boolean"
+ }
+ }
+ },
+ "types.ModelParameters": {
+ "type": "object",
+ "properties": {
+ "api_key": {
"type": "string"
},
- "knowledge_title": {
- "description": "Knowledge title",
+ "app_id": {
+ "description": "WeKnoraCloud 厂商专用凭证",
"type": "string"
},
- "match_type": {
- "description": "Match type",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
- }
- ]
+ "app_secret": {
+ "description": "AES-256 加密存储,实际承载上游 API Key",
+ "type": "string"
},
- "matched_content": {
- "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "base_url": {
"type": "string"
},
- "metadata": {
- "description": "Metadata",
+ "embedding_parameters": {
+ "$ref": "#/definitions/types.EmbeddingParameters"
+ },
+ "extra_config": {
+ "description": "Provider-specific configuration",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
- "parent_chunk_id": {
- "description": "父 Chunk ID",
+ "interface_type": {
"type": "string"
},
- "score": {
- "description": "Score",
- "type": "number"
- },
- "seq": {
- "description": "Seq",
- "type": "integer"
+ "parameter_size": {
+ "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
+ "type": "string"
},
- "start_at": {
- "description": "Start at",
- "type": "integer"
+ "provider": {
+ "description": "Provider identifier: openai, aliyun, zhipu, generic",
+ "type": "string"
},
- "sub_chunk_id": {
- "description": "SubChunkIndex",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "supports_vision": {
+ "description": "Whether the model accepts image/multimodal input",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Session": {
+ "types.ModelSource": {
+ "type": "string",
+ "enum": [
+ "local",
+ "remote",
+ "aliyun",
+ "zhipu",
+ "volcengine",
+ "deepseek",
+ "hunyuan",
+ "minimax",
+ "openai",
+ "gemini",
+ "mimo",
+ "siliconflow",
+ "jina",
+ "openrouter",
+ "nvidia",
+ "novita",
+ "azure_openai"
+ ],
+ "x-enum-comments": {
+ "ModelSourceAliyun": "Aliyun DashScope model",
+ "ModelSourceAzureOpenAI": "Azure OpenAI model",
+ "ModelSourceDeepseek": "Deepseek model",
+ "ModelSourceGemini": "Gemini model",
+ "ModelSourceHunyuan": "Hunyuan model",
+ "ModelSourceJina": "Jina AI model",
+ "ModelSourceLocal": "Local model",
+ "ModelSourceMimo": "Mimo model",
+ "ModelSourceMinimax": "Minimax mode",
+ "ModelSourceNovita": "Novita AI model",
+ "ModelSourceNvidia": "NVIDIA model",
+ "ModelSourceOpenAI": "OpenAI model",
+ "ModelSourceOpenRouter": "OpenRouter model",
+ "ModelSourceRemote": "Remote model",
+ "ModelSourceSiliconFlow": "SiliconFlow model",
+ "ModelSourceVolcengine": "Volcengine model",
+ "ModelSourceZhipu": "Zhipu model"
+ },
+ "x-enum-descriptions": [
+ "Local model",
+ "Remote model",
+ "Aliyun DashScope model",
+ "Zhipu model",
+ "Volcengine model",
+ "Deepseek model",
+ "Hunyuan model",
+ "Minimax mode",
+ "OpenAI model",
+ "Gemini model",
+ "Mimo model",
+ "SiliconFlow model",
+ "Jina AI model",
+ "OpenRouter model",
+ "NVIDIA model",
+ "Novita AI model",
+ "Azure OpenAI model"
+ ],
+ "x-enum-varnames": [
+ "ModelSourceLocal",
+ "ModelSourceRemote",
+ "ModelSourceAliyun",
+ "ModelSourceZhipu",
+ "ModelSourceVolcengine",
+ "ModelSourceDeepseek",
+ "ModelSourceHunyuan",
+ "ModelSourceMinimax",
+ "ModelSourceOpenAI",
+ "ModelSourceGemini",
+ "ModelSourceMimo",
+ "ModelSourceSiliconFlow",
+ "ModelSourceJina",
+ "ModelSourceOpenRouter",
+ "ModelSourceNvidia",
+ "ModelSourceNovita",
+ "ModelSourceAzureOpenAI"
+ ]
+ },
+ "types.ModelType": {
+ "type": "string",
+ "enum": [
+ "Embedding",
+ "Rerank",
+ "KnowledgeQA",
+ "VLLM",
+ "ASR"
+ ],
+ "x-enum-comments": {
+ "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
+ "ModelTypeEmbedding": "Embedding model",
+ "ModelTypeKnowledgeQA": "KnowledgeQA model",
+ "ModelTypeRerank": "Rerank model",
+ "ModelTypeVLLM": "VLLM model"
+ },
+ "x-enum-descriptions": [
+ "Embedding model",
+ "Rerank model",
+ "KnowledgeQA model",
+ "VLLM model",
+ "ASR (Automatic Speech Recognition) model"
+ ],
+ "x-enum-varnames": [
+ "ModelTypeEmbedding",
+ "ModelTypeRerank",
+ "ModelTypeKnowledgeQA",
+ "ModelTypeVLLM",
+ "ModelTypeASR"
+ ]
+ },
+ "types.OIDCAuthURLResponse": {
"type": "object",
"properties": {
- "created_at": {
+ "authorization_url": {
"type": "string"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "description": {
- "description": "Description",
+ "provider_display_name": {
"type": "string"
},
- "id": {
- "description": "ID",
+ "state": {
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "types.OIDCConfigResponse": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
},
- "title": {
- "description": "Title",
+ "provider_display_name": {
"type": "string"
},
- "updated_at": {
- "type": "string"
+ "success": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
+ "types.OSSEngineConfig": {
"type": "object",
- "required": [
- "organization_id",
- "permission"
- ],
"properties": {
- "organization_id": {
+ "access_key": {
"type": "string"
},
- "permission": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
+ "type": "string"
+ },
+ "temp_bucket_name": {
+ "type": "string"
+ },
+ "temp_region": {
+ "type": "string"
+ },
+ "use_temp_bucket": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StorageConfig": {
+ "types.OrgMemberRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "OrgRoleAdmin",
+ "OrgRoleEditor",
+ "OrgRoleViewer"
+ ]
+ },
+ "types.OrganizationMemberResponse": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
- },
- "bucket_name": {
+ "avatar": {
"type": "string"
},
- "path_prefix": {
+ "email": {
"type": "string"
},
- "provider": {
+ "id": {
"type": "string"
},
- "region": {
+ "joined_at": {
"type": "string"
},
- "secret_id": {
+ "role": {
"type": "string"
},
- "secret_key": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": {
- "type": "object",
- "properties": {
- "cos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
+ "tenant_id": {
+ "type": "integer"
},
- "default_provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\"",
+ "user_id": {
"type": "string"
},
- "local": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
- },
- "minio": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
- },
- "s3": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
- },
- "tos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": {
- "type": "object",
- "properties": {
- "provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "username": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
+ "types.OrganizationResponse": {
"type": "object",
- "required": [
- "invite_code"
- ],
"properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
- },
- "message": {
- "type": "string",
- "maxLength": 500
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
+ "type": "integer"
},
- "role": {
- "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SyncLog": {
- "type": "object",
- "properties": {
- "created_at": {
- "description": "Creation timestamp (usually same as StartedAt)",
+ "avatar": {
"type": "string"
},
- "data_source_id": {
- "description": "Reference to the data source",
+ "created_at": {
"type": "string"
},
- "error_message": {
- "description": "Error details if status is \"failed\"",
+ "description": {
"type": "string"
},
- "finished_at": {
- "description": "Sync completion time",
- "type": "string"
+ "has_pending_upgrade": {
+ "description": "当前用户是否有待处理的权限升级申请",
+ "type": "boolean"
},
"id": {
- "description": "Unique identifier",
"type": "string"
},
- "items_created": {
- "description": "New items created in knowledge base",
- "type": "integer"
+ "invite_code": {
+ "type": "string"
},
- "items_deleted": {
- "description": "Items deleted from knowledge base",
- "type": "integer"
+ "invite_code_expires_at": {
+ "type": "string"
},
- "items_failed": {
- "description": "Items that failed to sync",
+ "invite_code_validity_days": {
"type": "integer"
},
- "items_skipped": {
- "description": "Items skipped (no changes detected)",
- "type": "integer"
+ "is_owner": {
+ "type": "boolean"
},
- "items_total": {
- "description": "Total items fetched from source",
+ "member_count": {
"type": "integer"
},
- "items_updated": {
- "description": "Existing items updated",
+ "member_limit": {
+ "description": "0 = unlimited",
"type": "integer"
},
- "result": {
- "description": "Detailed sync result (JSON-encoded)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "started_at": {
- "description": "Sync start time",
+ "my_role": {
"type": "string"
},
- "status": {
- "description": "Sync status: running, success, partial, failed, canceled",
+ "name": {
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
- },
- "updated_at": {
- "description": "Last update timestamp",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": {
- "type": "object",
- "properties": {
- "access_key": {
+ "owner_id": {
"type": "string"
},
- "bucket_name": {
- "type": "string"
+ "pending_join_request_count": {
+ "description": "待审批加入申请数(仅管理员可见)",
+ "type": "integer"
},
- "endpoint": {
- "type": "string"
+ "require_approval": {
+ "type": "boolean"
},
- "path_prefix": {
- "type": "string"
+ "searchable": {
+ "type": "boolean"
},
- "region": {
- "type": "string"
+ "share_count": {
+ "description": "共享到该组织的知识库数量",
+ "type": "integer"
},
- "secret_key": {
+ "updated_at": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Tenant": {
+ "types.ParserEngineConfig": {
"type": "object",
"properties": {
- "agent_config": {
- "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig"
- }
- ]
- },
- "api_key": {
- "description": "API key",
- "type": "string"
- },
- "business": {
- "description": "Business",
+ "mineru_api_key": {
+ "description": "MinerU 云 API Key",
"type": "string"
},
- "chat_history_config": {
- "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
- }
- ]
- },
- "context_config": {
- "description": "Global Context configuration for this tenant (default for all sessions)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
- }
- ]
- },
- "conversation_config": {
- "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig"
- }
- ]
+ "mineru_cloud_enable_formula": {
+ "type": "boolean"
},
- "created_at": {
- "description": "Creation time",
- "type": "string"
+ "mineru_cloud_enable_ocr": {
+ "type": "boolean"
},
- "deleted_at": {
- "description": "Deletion time",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "mineru_cloud_enable_table": {
+ "type": "boolean"
},
- "description": {
- "description": "Description",
+ "mineru_cloud_language": {
"type": "string"
},
- "id": {
- "description": "ID",
- "type": "integer"
- },
- "name": {
- "description": "Name",
+ "mineru_cloud_model": {
+ "description": "MinerU 云 API 解析参数",
"type": "string"
},
- "parser_engine_config": {
- "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
- }
- ]
+ "mineru_enable_formula": {
+ "type": "boolean"
},
- "retrieval_config": {
- "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
- }
- ]
+ "mineru_enable_ocr": {
+ "type": "boolean"
},
- "retriever_engines": {
- "description": "Retriever engines",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
- }
- ]
+ "mineru_enable_table": {
+ "type": "boolean"
},
- "status": {
- "description": "Status",
+ "mineru_endpoint": {
+ "description": "MinerU 自建服务端点",
"type": "string"
},
- "storage_engine_config": {
- "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
- }
- ]
- },
- "storage_quota": {
- "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
- "type": "integer"
- },
- "storage_used": {
- "description": "Storage used (Bytes)",
- "type": "integer"
+ "mineru_language": {
+ "type": "string"
},
- "updated_at": {
- "description": "Last updated time",
+ "mineru_model": {
+ "description": "MinerU 自建解析参数",
+ "type": "string"
+ }
+ }
+ },
+ "types.ParserEngineRule": {
+ "type": "object",
+ "properties": {
+ "engine": {
"type": "string"
},
- "web_search_config": {
- "description": "Global WebSearch configuration for this tenant",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
- }
- ]
+ "file_types": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ToolCall": {
+ "types.QuestionGenerationConfig": {
"type": "object",
"properties": {
- "args": {
- "description": "Tool arguments",
- "type": "object",
- "additionalProperties": true
+ "enabled": {
+ "type": "boolean"
},
- "duration": {
- "description": "Execution time in milliseconds",
+ "question_count": {
+ "description": "Number of questions to generate per chunk (default: 3, max: 10)",
"type": "integer"
- },
- "id": {
- "description": "Function call ID from LLM",
+ }
+ }
+ },
+ "types.RegisterRequest": {
+ "type": "object",
+ "required": [
+ "email",
+ "password",
+ "username"
+ ],
+ "properties": {
+ "email": {
"type": "string"
},
- "name": {
- "description": "Tool name",
- "type": "string"
+ "password": {
+ "type": "string",
+ "minLength": 6
},
- "reflection": {
- "description": "Agent's reflection on this tool call result (if enabled)",
+ "username": {
+ "type": "string",
+ "maxLength": 50,
+ "minLength": 2
+ }
+ }
+ },
+ "types.RegisterResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
"type": "string"
},
- "result": {
- "description": "Execution result (contains Output)",
+ "success": {
+ "type": "boolean"
+ },
+ "tenant": {
+ "$ref": "#/definitions/types.Tenant"
+ },
+ "user": {
+ "$ref": "#/definitions/types.User"
+ }
+ }
+ },
+ "types.RequestRoleUpgradeRequest": {
+ "type": "object",
+ "required": [
+ "requested_role"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message explaining the reason",
+ "type": "string",
+ "maxLength": 500
+ },
+ "requested_role": {
+ "description": "The role user wants to upgrade to",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult"
+ "$ref": "#/definitions/types.OrgMemberRole"
}
]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ToolResult": {
+ "types.Resource": {
"type": "object",
"properties": {
- "data": {
- "description": "Structured data for programmatic use",
+ "description": {
+ "description": "Optional description",
+ "type": "string"
+ },
+ "external_id": {
+ "description": "Unique identifier in the external system",
+ "type": "string"
+ },
+ "has_children": {
+ "description": "Whether this resource has children that can be expanded",
+ "type": "boolean"
+ },
+ "metadata": {
+ "description": "Additional metadata",
"type": "object",
"additionalProperties": true
},
- "error": {
- "description": "Error message if execution failed",
+ "modified_at": {
+ "description": "Last modified time in external system",
"type": "string"
},
- "images": {
- "description": "Base64 data URIs from tool (e.g. MCP image content)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "name": {
+ "description": "Display name",
+ "type": "string"
},
- "output": {
- "description": "Human-readable output",
+ "parent_id": {
+ "description": "For hierarchical resources (parent ID if applicable)",
"type": "string"
},
- "success": {
- "description": "Whether the tool executed successfully",
- "type": "boolean"
+ "type": {
+ "description": "Resource type (document, folder, space, page, etc.)",
+ "type": "string"
+ },
+ "url": {
+ "description": "URL to access in external system",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
+ "types.ResourceCountsByOrgResponse": {
"type": "object",
- "required": [
- "role"
- ],
"properties": {
- "role": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "agents": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "knowledge_bases": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
+ "types.RetrievalConfig": {
"type": "object",
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
+ "embedding_top_k": {
+ "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
+ "type": "integer"
},
- "description": {
- "type": "string",
- "maxLength": 1000
+ "keyword_threshold": {
+ "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
+ "type": "number"
},
- "invite_code_validity_days": {
- "description": "0=never, 1, 7, 30",
- "type": "integer"
+ "rerank_model_id": {
+ "description": "RerankModelID is the ID of the rerank model to use (required for search)",
+ "type": "string"
},
- "member_limit": {
- "description": "max members; 0=unlimited",
- "type": "integer"
+ "rerank_threshold": {
+ "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
+ "type": "number"
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
+ "rerank_top_k": {
+ "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
+ "type": "integer"
},
- "require_approval": {
- "type": "boolean"
+ "vector_threshold": {
+ "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
+ "type": "number"
+ }
+ }
+ },
+ "types.RetrieverEngineParams": {
+ "type": "object",
+ "properties": {
+ "retriever_engine_type": {
+ "description": "Retriever engine type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.RetrieverEngineType"
+ }
+ ]
},
- "searchable": {
- "description": "open for search so others can discover and join",
- "type": "boolean"
+ "retriever_type": {
+ "description": "Retriever type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.RetrieverType"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
+ "types.RetrieverEngineType": {
+ "type": "string",
+ "enum": [
+ "postgres",
+ "elasticsearch",
+ "infinity",
+ "elasticfaiss",
+ "qdrant",
+ "milvus",
+ "weaviate",
+ "sqlite"
+ ],
+ "x-enum-varnames": [
+ "PostgresRetrieverEngineType",
+ "ElasticsearchRetrieverEngineType",
+ "InfinityRetrieverEngineType",
+ "ElasticFaissRetrieverEngineType",
+ "QdrantRetrieverEngineType",
+ "MilvusRetrieverEngineType",
+ "WeaviateRetrieverEngineType",
+ "SQLiteRetrieverEngineType"
+ ]
+ },
+ "types.RetrieverEngines": {
"type": "object",
- "required": [
- "permission"
+ "properties": {
+ "engines": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/types.RetrieverEngineParams"
+ }
+ }
+ }
+ },
+ "types.RetrieverType": {
+ "type": "string",
+ "enum": [
+ "keywords",
+ "vector",
+ "websearch"
+ ],
+ "x-enum-comments": {
+ "KeywordsRetrieverType": "Keywords retriever",
+ "VectorRetrieverType": "Vector retriever",
+ "WebSearchRetrieverType": "Web search retriever"
+ },
+ "x-enum-descriptions": [
+ "Keywords retriever",
+ "Vector retriever",
+ "Web search retriever"
],
- "properties": {
- "permission": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- }
+ "x-enum-varnames": [
+ "KeywordsRetrieverType",
+ "VectorRetrieverType",
+ "WebSearchRetrieverType"
+ ]
},
- "github_com_Tencent_WeKnora_internal_types.User": {
+ "types.ReviewJoinRequestRequest": {
"type": "object",
"properties": {
- "avatar": {
- "description": "Avatar URL of the user",
- "type": "string"
- },
- "can_access_all_tenants": {
- "description": "Whether the user can access all tenants (cross-tenant access)",
+ "approved": {
"type": "boolean"
},
- "created_at": {
- "description": "Creation time of the user",
- "type": "string"
- },
- "deleted_at": {
- "description": "Deletion time of the user",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "email": {
- "description": "Email address of the user",
- "type": "string"
- },
- "id": {
- "description": "Unique identifier of the user",
- "type": "string"
- },
- "is_active": {
- "description": "Whether the user is active",
- "type": "boolean"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "tenant": {
- "description": "Association relationship, not stored in the database",
+ "role": {
+ "description": "Optional: role to assign when approving; overrides applicant's requested role",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "$ref": "#/definitions/types.OrgMemberRole"
}
]
- },
- "tenant_id": {
- "description": "Tenant ID that the user belongs to",
- "type": "integer"
- },
- "updated_at": {
- "description": "Last updated time of the user",
- "type": "string"
- },
- "username": {
- "description": "Username of the user",
- "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.VLMConfig": {
+ "types.S3EngineConfig": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API Key",
+ "access_key": {
"type": "string"
},
- "base_url": {
- "description": "Base URL",
+ "bucket_name": {
"type": "string"
},
- "enabled": {
- "type": "boolean"
+ "endpoint": {
+ "type": "string"
},
- "interface_type": {
- "description": "Interface Type: \"ollama\" or \"openai\"",
+ "path_prefix": {
"type": "string"
},
- "model_id": {
+ "region": {
"type": "string"
},
- "model_name": {
- "description": "兼容老版本\nModel Name",
+ "secret_key": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": {
+ "types.SearchParams": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API密钥(如果需要)",
- "type": "string"
+ "disable_keywords_match": {
+ "type": "boolean"
},
- "blacklist": {
- "description": "黑名单规则列表",
+ "disable_vector_match": {
+ "type": "boolean"
+ },
+ "keyword_threshold": {
+ "type": "number"
+ },
+ "knowledge_base_ids": {
+ "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
"type": "array",
"items": {
"type": "string"
}
},
- "compression_method": {
- "description": "压缩方法:none, summary, extract, rag",
- "type": "string"
+ "knowledge_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "document_fragments": {
- "description": "文档片段数量(用于RAG压缩)",
+ "match_count": {
"type": "integer"
},
- "embedding_dimension": {
- "description": "嵌入维度(用于RAG压缩)",
- "type": "integer"
+ "only_recommended": {
+ "type": "boolean"
},
- "embedding_model_id": {
- "description": "RAG压缩相关配置",
+ "query_embedding": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ },
+ "query_text": {
"type": "string"
},
- "include_date": {
- "description": "是否包含日期",
+ "skip_context_enrichment": {
+ "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
"type": "boolean"
},
- "max_results": {
- "description": "最大搜索结果数",
- "type": "integer"
- },
- "provider": {
- "description": "搜索引擎提供商ID",
- "type": "string"
+ "tag_ids": {
+ "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "rerank_model_id": {
- "description": "重排模型ID(用于RAG压缩)",
- "type": "string"
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "gorm.DeletedAt": {
+ "types.SearchResult": {
"type": "object",
"properties": {
- "time": {
+ "chunk_index": {
+ "description": "Chunk index",
+ "type": "integer"
+ },
+ "chunk_metadata": {
+ "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "chunk_type": {
+ "description": "Chunk 类型",
"type": "string"
},
- "valid": {
- "description": "Valid is true if Time is not NULL",
- "type": "boolean"
- }
- }
- },
- "internal_handler.CopyKnowledgeBaseRequest": {
- "type": "object",
- "required": [
- "source_id"
- ],
- "properties": {
- "source_id": {
+ "content": {
+ "description": "Content",
"type": "string"
},
- "target_id": {
+ "end_at": {
+ "description": "End at",
+ "type": "integer"
+ },
+ "id": {
+ "description": "ID",
"type": "string"
},
- "task_id": {
+ "image_info": {
+ "description": "图片信息 (JSON 格式)",
"type": "string"
- }
- }
- },
- "internal_handler.CreateAgentRequest": {
- "type": "object",
- "required": [
- "name"
- ],
- "properties": {
- "avatar": {
+ },
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
"type": "string"
},
- "config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ "knowledge_channel": {
+ "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
+ "type": "string"
},
- "description": {
+ "knowledge_description": {
+ "description": "KnowledgeDescription is the description of the knowledge document",
"type": "string"
},
- "name": {
+ "knowledge_filename": {
+ "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
"type": "string"
- }
- }
- },
- "internal_handler.CreateModelRequest": {
- "type": "object",
- "required": [
- "name",
- "parameters",
- "source",
- "type"
- ],
- "properties": {
- "description": {
+ },
+ "knowledge_id": {
+ "description": "Knowledge ID",
"type": "string"
},
- "name": {
+ "knowledge_source": {
+ "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
+ "knowledge_title": {
+ "description": "Knowledge title",
+ "type": "string"
},
- "source": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ "match_type": {
+ "description": "Match type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.MatchType"
+ }
+ ]
+ },
+ "matched_content": {
+ "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "type": "string"
+ },
+ "metadata": {
+ "description": "Metadata",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "parent_chunk_id": {
+ "description": "父 Chunk ID",
+ "type": "string"
+ },
+ "score": {
+ "description": "Score",
+ "type": "number"
+ },
+ "seq": {
+ "description": "Seq",
+ "type": "integer"
+ },
+ "start_at": {
+ "description": "Start at",
+ "type": "integer"
},
- "type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
- }
- }
- },
- "internal_handler.DeleteTagRequest": {
- "type": "object",
- "properties": {
- "exclude_ids": {
- "description": "Chunk seq_ids to exclude from deletion",
+ "sub_chunk_id": {
+ "description": "SubChunkIndex",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
}
}
},
- "internal_handler.EvaluationRequest": {
+ "types.Session": {
"type": "object",
"properties": {
- "chat_id": {
- "description": "ID of chat model to use",
+ "created_at": {
"type": "string"
},
- "dataset_id": {
- "description": "ID of dataset to evaluate",
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description",
"type": "string"
},
- "knowledge_base_id": {
- "description": "ID of knowledge base to use",
+ "id": {
+ "description": "ID",
"type": "string"
},
- "rerank_id": {
- "description": "ID of rerank model to use",
+ "tenant_id": {
+ "description": "Tenant ID",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Title",
+ "type": "string"
+ },
+ "updated_at": {
"type": "string"
}
}
},
- "internal_handler.FabriTextRequest": {
+ "types.ShareKnowledgeBaseRequest": {
"type": "object",
"required": [
- "model_id"
+ "organization_id",
+ "permission"
],
"properties": {
- "model_id": {
+ "organization_id": {
"type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "internal_handler.GetStorageEngineStatusResponse": {
- "type": "object",
- "properties": {
- "engines": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/internal_handler.StorageEngineStatusItem"
- }
- },
- "minio_env_available": {
- "type": "boolean"
+ "permission": {
+ "$ref": "#/definitions/types.OrgMemberRole"
}
}
},
- "internal_handler.GetSystemInfoResponse": {
+ "types.StorageConfig": {
"type": "object",
"properties": {
- "build_time": {
- "type": "string"
- },
- "commit_id": {
- "type": "string"
- },
- "db_version": {
+ "app_id": {
"type": "string"
},
- "edition": {
+ "bucket_name": {
"type": "string"
},
- "go_version": {
+ "path_prefix": {
"type": "string"
},
- "graph_database_engine": {
+ "provider": {
"type": "string"
},
- "keyword_index_engine": {
+ "region": {
"type": "string"
},
- "minio_enabled": {
- "type": "boolean"
- },
- "vector_store_engine": {
+ "secret_id": {
"type": "string"
},
- "version": {
+ "secret_key": {
"type": "string"
}
}
},
- "internal_handler.KBModelConfigRequest": {
+ "types.StorageEngineConfig": {
"type": "object",
- "required": [
- "embeddingModelId",
- "llmModelId"
- ],
"properties": {
- "documentSplitting": {
- "description": "文档分块配置",
- "type": "object",
- "properties": {
- "childChunkSize": {
- "type": "integer"
- },
- "chunkOverlap": {
- "type": "integer"
- },
- "chunkSize": {
- "type": "integer"
- },
- "enableParentChild": {
- "type": "boolean"
- },
- "parentChunkSize": {
- "type": "integer"
- },
- "parserEngineRules": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
- },
- "separators": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "embeddingModelId": {
- "type": "string"
+ "cos": {
+ "$ref": "#/definitions/types.COSEngineConfig"
},
- "llmModelId": {
+ "default_provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
"type": "string"
},
- "multimodal": {
- "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- }
- }
+ "local": {
+ "$ref": "#/definitions/types.LocalEngineConfig"
},
- "nodeExtract": {
- "description": "知识图谱配置",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
- }
- },
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
- }
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "text": {
- "type": "string"
- }
- }
+ "minio": {
+ "$ref": "#/definitions/types.MinIOEngineConfig"
},
- "questionGeneration": {
- "description": "问题生成配置",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "questionCount": {
- "type": "integer"
- }
- }
+ "oss": {
+ "$ref": "#/definitions/types.OSSEngineConfig"
},
- "storageProvider": {
- "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
- "type": "string"
+ "s3": {
+ "$ref": "#/definitions/types.S3EngineConfig"
},
- "vlm_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ "tos": {
+ "$ref": "#/definitions/types.TOSEngineConfig"
}
}
},
- "internal_handler.ListMinioBucketsResponse": {
+ "types.StorageProviderConfig": {
"type": "object",
"properties": {
- "buckets": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/internal_handler.MinioBucketInfo"
- }
+ "provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "type": "string"
}
}
},
- "internal_handler.MinioBucketInfo": {
+ "types.SubmitJoinRequestRequest": {
"type": "object",
+ "required": [
+ "invite_code"
+ ],
"properties": {
- "created_at": {
- "type": "string"
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
},
- "name": {
- "type": "string"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "policy": {
- "description": "\"public\", \"private\", \"custom\"",
- "type": "string"
+ "role": {
+ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.OrgMemberRole"
+ }
+ ]
}
}
},
- "internal_handler.RemoteModelCheckRequest": {
+ "types.SyncLog": {
"type": "object",
- "required": [
- "baseUrl",
- "modelName"
- ],
"properties": {
- "apiKey": {
+ "created_at": {
+ "description": "Creation timestamp (usually same as StartedAt)",
"type": "string"
},
- "baseUrl": {
+ "data_source_id": {
+ "description": "Reference to the data source",
"type": "string"
},
- "modelName": {
+ "error_message": {
+ "description": "Error details if status is \"failed\"",
"type": "string"
- }
- }
- },
- "internal_handler.SearchMessagesRequest": {
- "type": "object",
- "required": [
- "query"
- ],
- "properties": {
- "limit": {
- "description": "Maximum number of results to return (default: 20)",
+ },
+ "finished_at": {
+ "description": "Sync completion time",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier",
+ "type": "string"
+ },
+ "items_created": {
+ "description": "New items created in knowledge base",
+ "type": "integer"
+ },
+ "items_deleted": {
+ "description": "Items deleted from knowledge base",
+ "type": "integer"
+ },
+ "items_failed": {
+ "description": "Items that failed to sync",
+ "type": "integer"
+ },
+ "items_skipped": {
+ "description": "Items skipped (no changes detected)",
+ "type": "integer"
+ },
+ "items_total": {
+ "description": "Total items fetched from source",
"type": "integer"
},
- "mode": {
- "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")",
- "type": "string"
- },
- "query": {
- "description": "Query text for search",
- "type": "string"
+ "items_updated": {
+ "description": "Existing items updated",
+ "type": "integer"
},
- "session_ids": {
- "description": "Filter by specific session IDs (optional)",
+ "result": {
+ "description": "Detailed sync result (JSON-encoded)",
"type": "array",
"items": {
- "type": "string"
+ "type": "integer"
}
- }
- }
- },
- "internal_handler.StorageCheckRequest": {
- "type": "object",
- "properties": {
- "cos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
- },
- "minio": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
},
- "provider": {
- "description": "\"minio\", \"cos\", \"tos\", or \"s3\"",
+ "started_at": {
+ "description": "Sync start time",
"type": "string"
},
- "s3": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
+ "status": {
+ "description": "Sync status: running, success, partial, failed, canceled",
+ "type": "string"
},
- "tos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
- }
- }
- },
- "internal_handler.StorageCheckResponse": {
- "type": "object",
- "properties": {
- "bucket_created": {
- "type": "boolean"
+ "tenant_id": {
+ "description": "Tenant ID",
+ "type": "integer"
},
- "message": {
+ "updated_at": {
+ "description": "Last update timestamp",
"type": "string"
- },
- "ok": {
- "type": "boolean"
}
}
},
- "internal_handler.StorageEngineStatusItem": {
+ "types.TOSEngineConfig": {
"type": "object",
"properties": {
- "available": {
- "description": "whether the engine can be used",
- "type": "boolean"
+ "access_key": {
+ "type": "string"
},
- "description": {
- "description": "short description for UI",
+ "bucket_name": {
"type": "string"
},
- "name": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "endpoint": {
"type": "string"
- }
- }
- },
- "internal_handler.TextRelationExtractionRequest": {
- "type": "object",
- "required": [
- "model_id",
- "tags",
- "text"
- ],
- "properties": {
- "model_id": {
+ },
+ "path_prefix": {
"type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "region": {
+ "type": "string"
},
- "text": {
+ "secret_key": {
"type": "string"
}
}
},
- "internal_handler.UpdateAgentRequest": {
+ "types.Tenant": {
"type": "object",
"properties": {
- "avatar": {
- "type": "string"
- },
- "config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ "agent_config": {
+ "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.AgentConfig"
+ }
+ ]
},
- "description": {
+ "api_key": {
+ "description": "API key",
"type": "string"
},
- "name": {
+ "business": {
+ "description": "Business",
"type": "string"
- }
- }
- },
- "internal_handler.UpdateChunkRequest": {
- "type": "object",
- "properties": {
- "chunk_index": {
- "type": "integer"
},
- "content": {
- "type": "string"
+ "chat_history_config": {
+ "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ChatHistoryConfig"
+ }
+ ]
},
- "embedding": {
- "type": "array",
- "items": {
- "type": "number"
- }
+ "context_config": {
+ "description": "Global Context configuration for this tenant (default for all sessions)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ContextConfig"
+ }
+ ]
},
- "end_at": {
- "type": "integer"
+ "conversation_config": {
+ "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ConversationConfig"
+ }
+ ]
},
- "image_info": {
+ "created_at": {
+ "description": "Creation time",
"type": "string"
},
- "is_enabled": {
- "type": "boolean"
+ "credentials": {
+ "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.CredentialsConfig"
+ }
+ ]
},
- "start_at": {
- "type": "integer"
- }
- }
- },
- "internal_handler.UpdateKnowledgeBaseRequest": {
- "type": "object",
- "required": [
- "name"
- ],
- "properties": {
- "config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig"
+ "deleted_at": {
+ "description": "Deletion time",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
"description": {
+ "description": "Description",
"type": "string"
},
+ "id": {
+ "description": "ID",
+ "type": "integer"
+ },
"name": {
- "type": "string"
- }
- }
- },
- "internal_handler.UpdateModelRequest": {
- "type": "object",
- "properties": {
- "description": {
+ "description": "Name",
"type": "string"
},
- "name": {
+ "parser_engine_config": {
+ "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ParserEngineConfig"
+ }
+ ]
+ },
+ "retrieval_config": {
+ "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.RetrievalConfig"
+ }
+ ]
+ },
+ "retriever_engines": {
+ "description": "Retriever engines",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.RetrieverEngines"
+ }
+ ]
+ },
+ "status": {
+ "description": "Status",
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
+ "storage_engine_config": {
+ "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.StorageEngineConfig"
+ }
+ ]
},
- "source": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ "storage_quota": {
+ "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
+ "type": "integer"
},
- "type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
- }
- }
- },
- "internal_handler.addSimilarQuestionsRequest": {
- "type": "object",
- "required": [
- "similar_questions"
- ],
- "properties": {
- "similar_questions": {
- "type": "array",
- "minItems": 1,
- "items": {
- "type": "string"
- }
+ "storage_used": {
+ "description": "Storage used (Bytes)",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
+ },
+ "web_search_config": {
+ "description": "Global WebSearch configuration for this tenant",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.WebSearchConfig"
+ }
+ ]
}
}
},
- "internal_handler.updateLastFAQImportResultDisplayStatusRequest": {
+ "types.ToolCall": {
"type": "object",
- "required": [
- "display_status"
- ],
"properties": {
- "display_status": {
- "type": "string",
- "enum": [
- "open",
- "close"
+ "args": {
+ "description": "Tool arguments",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "duration": {
+ "description": "Execution time in milliseconds",
+ "type": "integer"
+ },
+ "id": {
+ "description": "Function call ID from LLM",
+ "type": "string"
+ },
+ "name": {
+ "description": "Tool name",
+ "type": "string"
+ },
+ "reflection": {
+ "description": "Agent's reflection on this tool call result (if enabled)",
+ "type": "string"
+ },
+ "result": {
+ "description": "Execution result (contains Output)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.ToolResult"
+ }
]
}
}
},
- "internal_handler_session.CreateKnowledgeQARequest": {
+ "types.ToolResult": {
"type": "object",
- "required": [
- "query"
- ],
"properties": {
- "agent_enabled": {
- "description": "Whether agent mode is enabled for this request",
- "type": "boolean"
- },
- "agent_id": {
- "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
- "type": "string"
+ "data": {
+ "description": "Structured data for programmatic use",
+ "type": "object",
+ "additionalProperties": true
},
- "channel": {
- "description": "Source channel: \"web\", \"api\", \"im\", etc.",
+ "error": {
+ "description": "Error message if execution failed",
"type": "string"
},
- "disable_title": {
- "description": "Whether to disable auto title generation",
- "type": "boolean"
- },
- "enable_memory": {
- "description": "Whether memory feature is enabled for this request",
- "type": "boolean"
- },
"images": {
- "description": "Attached images for multimodal chat",
- "type": "array",
- "items": {
- "$ref": "#/definitions/internal_handler_session.ImageAttachment"
- }
- },
- "knowledge_base_ids": {
- "description": "Selected knowledge base ID for this request",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "description": "Selected knowledge ID for this request",
+ "description": "Base64 data URIs from tool (e.g. MCP image content)",
"type": "array",
"items": {
"type": "string"
}
},
- "mentioned_items": {
- "description": "@mentioned knowledge bases and files",
- "type": "array",
- "items": {
- "$ref": "#/definitions/internal_handler_session.MentionedItemRequest"
- }
- },
- "query": {
- "description": "Query text for knowledge base search",
- "type": "string"
- },
- "summary_model_id": {
- "description": "Optional summary model ID for this request (overrides session default)",
+ "output": {
+ "description": "Human-readable output",
"type": "string"
},
- "web_search_enabled": {
- "description": "Whether web search is enabled for this request",
+ "success": {
+ "description": "Whether the tool executed successfully",
"type": "boolean"
}
}
},
- "internal_handler_session.CreateSessionRequest": {
+ "types.UpdateMemberRoleRequest": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "$ref": "#/definitions/types.OrgMemberRole"
+ }
+ }
+ },
+ "types.UpdateOrganizationRequest": {
"type": "object",
"properties": {
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
+ },
"description": {
- "description": "Description for the session (optional)",
- "type": "string"
+ "type": "string",
+ "maxLength": 1000
},
- "title": {
- "description": "Title for the session (optional)",
- "type": "string"
+ "invite_code_validity_days": {
+ "description": "0=never, 1, 7, 30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "max members; 0=unlimited",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "description": "open for search so others can discover and join",
+ "type": "boolean"
}
}
},
- "internal_handler_session.GenerateTitleRequest": {
+ "types.UpdateSharePermissionRequest": {
"type": "object",
"required": [
- "messages"
+ "permission"
],
"properties": {
- "messages": {
- "description": "Messages to use as context for title generation",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Message"
- }
+ "permission": {
+ "$ref": "#/definitions/types.OrgMemberRole"
}
}
},
- "internal_handler_session.ImageAttachment": {
+ "types.User": {
"type": "object",
"properties": {
- "caption": {
- "description": "VLM analysis result (context-aware, single call)",
+ "avatar": {
+ "description": "Avatar URL of the user",
"type": "string"
},
- "data": {
- "description": "base64 data URI from frontend (data:image/png;base64,...)",
+ "can_access_all_tenants": {
+ "description": "Whether the user can access all tenants (cross-tenant access)",
+ "type": "boolean"
+ },
+ "created_at": {
+ "description": "Creation time of the user",
"type": "string"
},
- "url": {
- "description": "serving URL after saving to storage",
+ "deleted_at": {
+ "description": "Deletion time of the user",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "email": {
+ "description": "Email address of the user",
"type": "string"
- }
- }
- },
- "internal_handler_session.MentionedItemRequest": {
- "type": "object",
- "properties": {
+ },
"id": {
+ "description": "Unique identifier of the user",
"type": "string"
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
- "type": "string"
+ "is_active": {
+ "description": "Whether the user is active",
+ "type": "boolean"
},
- "name": {
+ "tenant": {
+ "description": "Association relationship, not stored in the database",
+ "allOf": [
+ {
+ "$ref": "#/definitions/types.Tenant"
+ }
+ ]
+ },
+ "tenant_id": {
+ "description": "Tenant ID that the user belongs to",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time of the user",
"type": "string"
},
- "type": {
- "description": "\"kb\" for knowledge base, \"file\" for file",
+ "username": {
+ "description": "Username of the user",
"type": "string"
}
}
},
- "internal_handler_session.SearchKnowledgeRequest": {
+ "types.VLMConfig": {
"type": "object",
- "required": [
- "query"
- ],
"properties": {
- "knowledge_base_id": {
- "description": "Single knowledge base ID (for backward compatibility)",
+ "api_key": {
+ "description": "API Key",
"type": "string"
},
- "knowledge_base_ids": {
- "description": "IDs of knowledge bases to search (multi-KB support)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "base_url": {
+ "description": "Base URL",
+ "type": "string"
},
- "knowledge_ids": {
- "description": "IDs of specific knowledge (files) to search",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "enabled": {
+ "type": "boolean"
},
- "query": {
- "description": "Query text to search for",
+ "interface_type": {
+ "description": "Interface Type: \"ollama\" or \"openai\"",
+ "type": "string"
+ },
+ "model_id": {
+ "type": "string"
+ },
+ "model_name": {
+ "description": "兼容老版本\nModel Name",
"type": "string"
}
}
},
- "internal_handler_session.StopSessionRequest": {
+ "types.WeKnoraCloudCredentials": {
"type": "object",
- "required": [
- "message_id"
- ],
"properties": {
- "message_id": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
"type": "string"
}
}
},
- "internal_handler_session.batchDeleteRequest": {
+ "types.WebSearchConfig": {
"type": "object",
"properties": {
- "delete_all": {
- "type": "boolean"
+ "api_key": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
},
- "ids": {
+ "blacklist": {
+ "description": "黑名单规则列表",
"type": "array",
"items": {
"type": "string"
}
+ },
+ "compression_method": {
+ "description": "压缩方法:none, summary, extract, rag",
+ "type": "string"
+ },
+ "document_fragments": {
+ "description": "文档片段数量(用于RAG压缩)",
+ "type": "integer"
+ },
+ "embedding_dimension": {
+ "description": "嵌入维度(用于RAG压缩)",
+ "type": "integer"
+ },
+ "embedding_model_id": {
+ "description": "RAG压缩相关配置",
+ "type": "string"
+ },
+ "include_date": {
+ "description": "是否包含日期",
+ "type": "boolean"
+ },
+ "max_results": {
+ "description": "最大搜索结果数",
+ "type": "integer"
+ },
+ "provider": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "rerank_model_id": {
+ "description": "重排模型ID(用于RAG压缩)",
+ "type": "string"
}
}
}
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index ae6ca15c4..ccb6fcdb8 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1,6 +1,6 @@
basePath: /api/v1
definitions:
- github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata:
+ datasource.ConnectorMetadata:
properties:
auth_type:
description: '"oauth2", "api_key", "token", etc.'
@@ -22,15 +22,15 @@ definitions:
type:
type: string
type: object
- github_com_Tencent_WeKnora_internal_errors.AppError:
+ errors.AppError:
properties:
code:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode'
+ $ref: '#/definitions/errors.ErrorCode'
details: {}
message:
type: string
type: object
- github_com_Tencent_WeKnora_internal_errors.ErrorCode:
+ errors.ErrorCode:
enum:
- 1000
- 1001
@@ -74,2104 +74,2170 @@ definitions:
- ErrAgentMissingAllowedTools
- ErrAgentInvalidMaxIterations
- ErrAgentInvalidTemperature
- github_com_Tencent_WeKnora_internal_types.AgentConfig:
+ github_com_Tencent_WeKnora_internal_errors.AppError:
properties:
- allowed_skills:
- description: Skill names whitelist (empty = allow all)
- items:
- type: string
- type: array
- allowed_tools:
- description: List of allowed tool names
- items:
- type: string
- type: array
- history_turns:
- description: Number of history turns to keep in context
- type: integer
- knowledge_bases:
- description: Accessible knowledge base IDs
- items:
- type: string
- type: array
- knowledge_ids:
- description: Accessible knowledge IDs (individual documents)
- items:
- type: string
- type: array
- llm_call_timeout:
- description: 'LLM call timeout in seconds (default: 120). Controls the maximum
- time for a single LLM call.'
- type: integer
- max_context_tokens:
- description: |-
- Maximum context window tokens for the agent (default: 200000).
- The agent compresses older messages to stay within this limit,
- preserving tool_call/tool_result pairs.
- type: integer
- max_iterations:
- description: Maximum number of ReAct iterations
- type: integer
- max_tool_output_chars:
- description: |-
- Maximum character length for tool output (default: 16000).
- Outputs exceeding this limit are truncated with head + tail preservation.
- type: integer
- mcp_selection_mode:
- description: MCP service selection
- type: string
- mcp_services:
- description: Selected MCP service IDs (when mode is "selected")
- items:
- type: string
- type: array
- multi_turn_enabled:
- description: Whether multi-turn conversation is enabled
- type: boolean
- parallel_tool_calls:
- description: |-
- Whether to execute independent tool calls in parallel (default: false).
- When enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.
- type: boolean
- retrieve_kb_only_when_mentioned:
- description: 'Whether to retrieve knowledge base only when explicitly mentioned
- with @ (default: false)'
- type: boolean
- skill_dirs:
- description: Directories to search for skills
- items:
- type: string
- type: array
- skills_enabled:
- description: Skills configuration (Progressive Disclosure pattern)
- type: boolean
- system_prompt:
- description: Unified system prompt (uses web_search_status placeholder for
- dynamic behavior)
- type: string
- system_prompt_web_disabled:
- description: 'Deprecated: Custom prompt when web search is disabled'
+ code:
+ $ref: '#/definitions/errors.ErrorCode'
+ details: {}
+ message:
type: string
- system_prompt_web_enabled:
- description: 'Deprecated: Use SystemPrompt instead. Kept for backward compatibility
- during migration.'
+ type: object
+ gorm.DeletedAt:
+ properties:
+ time:
type: string
- temperature:
- description: LLM temperature for agent
- type: number
- thinking:
- description: Whether to enable thinking mode (for models that support extended
- thinking)
- type: boolean
- use_custom_system_prompt:
- description: Whether to use custom system prompt instead of default
- type: boolean
- web_search_enabled:
- description: Whether web search tool is enabled
+ valid:
+ description: Valid is true if Time is not NULL
type: boolean
- web_search_max_results:
- description: 'Maximum number of web search results (default: 5)'
- type: integer
type: object
- github_com_Tencent_WeKnora_internal_types.AgentStep:
+ handler.CopyKnowledgeBaseRequest:
properties:
- iteration:
- description: Iteration number (0-indexed)
- type: integer
- thought:
- description: LLM's reasoning/thinking (Think phase)
+ source_id:
type: string
- timestamp:
- description: When this step occurred
+ target_id:
type: string
- tool_calls:
- description: Tools called in this step (Act phase)
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall'
- type: array
+ task_id:
+ type: string
+ required:
+ - source_id
type: object
- github_com_Tencent_WeKnora_internal_types.AnswerStrategy:
- enum:
- - all
- - random
- type: string
- x-enum-varnames:
- - AnswerStrategyAll
- - AnswerStrategyRandom
- github_com_Tencent_WeKnora_internal_types.COSEngineConfig:
+ handler.CreateAgentRequest:
properties:
- app_id:
+ avatar:
type: string
- bucket_name:
+ config:
+ $ref: '#/definitions/types.CustomAgentConfig'
+ description:
type: string
- path_prefix:
+ name:
type: string
- region:
+ required:
+ - name
+ type: object
+ handler.CreateModelRequest:
+ properties:
+ description:
type: string
- secret_id:
+ name:
type: string
- secret_key:
+ parameters:
+ $ref: '#/definitions/types.ModelParameters'
+ source:
+ $ref: '#/definitions/types.ModelSource'
+ type:
+ $ref: '#/definitions/types.ModelType'
+ required:
+ - name
+ - parameters
+ - source
+ - type
+ type: object
+ handler.CreateStoreRequest:
+ properties:
+ connection_config:
+ $ref: '#/definitions/types.ConnectionConfig'
+ engine_type:
+ $ref: '#/definitions/types.RetrieverEngineType'
+ index_config:
+ $ref: '#/definitions/types.IndexConfig'
+ name:
type: string
+ required:
+ - connection_config
+ - engine_type
+ - name
type: object
- github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig:
+ handler.DeleteTagRequest:
properties:
- embedding_model_id:
- description: |-
- EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.
- Once messages have been indexed, the model cannot be changed (requires re-indexing).
+ exclude_ids:
+ description: Chunk seq_ids to exclude from deletion
+ items:
+ type: integer
+ type: array
+ type: object
+ handler.EvaluationRequest:
+ properties:
+ chat_id:
+ description: ID of chat model to use
+ type: string
+ dataset_id:
+ description: ID of dataset to evaluate
type: string
- enabled:
- description: Enabled controls whether chat history indexing is active
- type: boolean
knowledge_base_id:
- description: |-
- KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.
- This is set internally when the feature is first enabled; users should not set this directly.
+ description: ID of knowledge base to use
+ type: string
+ rerank_id:
+ description: ID of rerank model to use
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.ChunkingConfig:
+ handler.FabriTextRequest:
properties:
- child_chunk_size:
- description: |-
- ChildChunkSize is the size of child chunks used for embedding (default: 384).
- Only used when EnableParentChild is true.
- type: integer
- chunk_overlap:
- description: Chunk overlap
- type: integer
- chunk_size:
- description: Chunk size
- type: integer
- enable_multimodal:
- description: EnableMultimodal (deprecated, kept for backward compatibility
- with old data)
- type: boolean
- enable_parent_child:
- description: |-
- EnableParentChild enables two-level parent-child chunking strategy.
- When enabled, large parent chunks provide context while small child chunks
- are used for vector matching. Retrieval matches on child but returns parent content.
- type: boolean
- parent_chunk_size:
- description: |-
- ParentChunkSize is the size of parent chunks (default: 4096).
- Only used when EnableParentChild is true.
- type: integer
- parser_engine_rules:
- description: |-
- ParserEngineRules configures which parser engine to use for each file type.
- When empty, the builtin engine is used for all types.
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule'
- type: array
- separators:
- description: Separators
+ model_id:
+ type: string
+ tags:
items:
type: string
type: array
+ required:
+ - model_id
type: object
- github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy:
- enum:
- - sliding_window
- - smart
- type: string
- x-enum-varnames:
- - ContextCompressionSlidingWindow
- - ContextCompressionSmart
- github_com_Tencent_WeKnora_internal_types.ContextConfig:
+ handler.GetStorageEngineStatusResponse:
properties:
- compression_strategy:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy'
- description: 'Compression strategy: "sliding_window" or "smart"'
- max_tokens:
- description: Maximum tokens allowed in LLM context
- type: integer
- recent_message_count:
- description: |-
- For sliding_window: number of messages to keep
- For smart: number of recent messages to keep uncompressed
- type: integer
- summarize_threshold:
- description: 'Summarize threshold: number of messages before summarization'
- type: integer
+ engines:
+ items:
+ $ref: '#/definitions/handler.StorageEngineStatusItem'
+ type: array
+ minio_env_available:
+ type: boolean
type: object
- github_com_Tencent_WeKnora_internal_types.ConversationConfig:
+ handler.GetSystemInfoResponse:
properties:
- context_template:
- description: ContextTemplate is the prompt template for summarizing retrieval
- results
+ build_time:
type: string
- embedding_top_k:
- type: integer
- enable_query_expansion:
- type: boolean
- enable_rewrite:
- type: boolean
- fallback_prompt:
+ commit_id:
type: string
- fallback_response:
+ db_version:
type: string
- fallback_strategy:
- description: Fallback strategy
+ edition:
type: string
- keyword_threshold:
- type: number
- max_completion_tokens:
- description: MaxTokens is the maximum number of tokens to generate
- type: integer
- max_rounds:
- description: Retrieval & strategy parameters
- type: integer
- prompt:
- description: Prompt is the system prompt for normal mode
+ go_version:
type: string
- rerank_model_id:
+ graph_database_engine:
type: string
- rerank_threshold:
- type: number
- rerank_top_k:
- type: integer
- rewrite_prompt_system:
- description: Rewrite prompts
+ keyword_index_engine:
type: string
- rewrite_prompt_user:
+ minio_enabled:
+ type: boolean
+ vector_store_engine:
type: string
- summary_model_id:
- description: Model configuration
+ version:
type: string
- temperature:
- description: Temperature controls the randomness of the model output
- type: number
- vector_threshold:
- type: number
type: object
- github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest:
+ handler.KBModelConfigRequest:
properties:
- avatar:
- description: optional avatar URL
- maxLength: 512
+ asr_config:
+ $ref: '#/definitions/types.ASRConfig'
+ documentSplitting:
+ description: 文档分块配置
+ properties:
+ childChunkSize:
+ type: integer
+ chunkOverlap:
+ type: integer
+ chunkSize:
+ type: integer
+ enableParentChild:
+ type: boolean
+ parentChunkSize:
+ type: integer
+ parserEngineRules:
+ items:
+ $ref: '#/definitions/types.ParserEngineRule'
+ type: array
+ separators:
+ items:
+ type: string
+ type: array
+ type: object
+ embeddingModelId:
type: string
- description:
- maxLength: 1000
+ llmModelId:
type: string
- invite_code_validity_days:
- description: 'optional: 0=never, 1, 7, 30; default 7'
- type: integer
- member_limit:
- description: 'optional: max members; 0=unlimited; default 50'
- type: integer
- name:
- maxLength: 255
- minLength: 1
+ multimodal:
+ description: 多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)
+ properties:
+ enabled:
+ type: boolean
+ type: object
+ nodeExtract:
+ description: 知识图谱配置
+ properties:
+ enabled:
+ type: boolean
+ nodes:
+ items:
+ $ref: '#/definitions/types.GraphNode'
+ type: array
+ relations:
+ items:
+ $ref: '#/definitions/types.GraphRelation'
+ type: array
+ tags:
+ items:
+ type: string
+ type: array
+ text:
+ type: string
+ type: object
+ questionGeneration:
+ description: 问题生成配置
+ properties:
+ enabled:
+ type: boolean
+ questionCount:
+ type: integer
+ type: object
+ storageProvider:
+ description: 存储引擎选择("local" | "minio" | "cos"),影响文档上传与文档内图片存储,参数从全局设置读取
type: string
+ vlm_config:
+ $ref: '#/definitions/types.VLMConfig'
required:
- - name
+ - embeddingModelId
+ - llmModelId
type: object
- github_com_Tencent_WeKnora_internal_types.CustomAgentConfig:
+ handler.RemoteModelCheckRequest:
properties:
- agent_mode:
- description: |-
- ===== Basic Settings =====
- Agent mode: "quick-answer" for RAG mode, "smart-reasoning" for ReAct agent mode
+ apiKey:
type: string
- allowed_tools:
- description: Allowed tools (only for agent type)
- items:
- type: string
- type: array
- context_template:
- description: Context template for normal mode (how to format retrieved chunks)
+ baseUrl:
type: string
- context_template_id:
- description: |-
- ContextTemplateID references a template ID in prompt_templates/ YAML files.
- If set and ContextTemplate is empty, the template content will be resolved at startup.
+ modelName:
type: string
- embedding_top_k:
- description: |-
- ===== Retrieval Strategy Settings (for both modes) =====
- Embedding/Vector retrieval top K
+ provider:
+ type: string
+ required:
+ - baseUrl
+ - modelName
+ type: object
+ handler.SearchMessagesRequest:
+ properties:
+ limit:
+ description: 'Maximum number of results to return (default: 20)'
type: integer
- enable_query_expansion:
- description: |-
- ===== Advanced Settings (mainly for normal mode) =====
- Whether to enable query expansion
- type: boolean
- enable_rewrite:
- description: Whether to enable query rewrite for multi-turn conversations
- type: boolean
- fallback_prompt:
- description: Fallback prompt (when FallbackStrategy is "model")
+ mode:
+ description: 'Search mode: "keyword", "vector", "hybrid" (default: "hybrid")'
type: string
- fallback_response:
- description: Fixed fallback response (when FallbackStrategy is "fixed")
+ query:
+ description: Query text for search
type: string
- fallback_strategy:
- description: 'Fallback strategy: "fixed" for fixed response, "model" for model
- generation'
+ session_ids:
+ description: Filter by specific session IDs (optional)
+ items:
+ type: string
+ type: array
+ required:
+ - query
+ type: object
+ handler.StorageCheckRequest:
+ properties:
+ cos:
+ $ref: '#/definitions/types.COSEngineConfig'
+ minio:
+ $ref: '#/definitions/types.MinIOEngineConfig'
+ oss:
+ $ref: '#/definitions/types.OSSEngineConfig'
+ provider:
+ description: '"minio", "cos", "tos", "s3", "oss"'
type: string
- faq_direct_answer_threshold:
- description: FAQ direct answer threshold - if similarity > this value, use
- FAQ answer directly
- type: number
- faq_priority_enabled:
- description: |-
- ===== FAQ Strategy Settings =====
- Whether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)
+ s3:
+ $ref: '#/definitions/types.S3EngineConfig'
+ tos:
+ $ref: '#/definitions/types.TOSEngineConfig'
+ type: object
+ handler.StorageCheckResponse:
+ properties:
+ bucket_created:
type: boolean
- faq_score_boost:
- description: FAQ score boost multiplier - FAQ results score multiplied by
- this factor
- type: number
- history_turns:
- description: Number of history turns to keep in context
- type: integer
- image_storage_provider:
- description: |-
- Storage provider for image uploads: "local", "minio", "cos", "tos", "s3", "oss"
- Empty means use the global/tenant default provider.
+ message:
type: string
- image_upload_enabled:
- description: |-
- ===== Image Upload / Multimodal Settings =====
- Whether image upload is enabled for this agent (default: false)
+ ok:
type: boolean
- kb_selection_mode:
- description: |-
- ===== Knowledge Base Settings =====
- Knowledge base selection mode: "all" = all KBs, "selected" = specific KBs, "none" = no KB
+ type: object
+ handler.StorageEngineStatusItem:
+ properties:
+ available:
+ description: whether the engine can be used
+ type: boolean
+ description:
+ description: short description for UI
type: string
- keyword_threshold:
- description: Keyword retrieval threshold
- type: number
- knowledge_bases:
- description: Associated knowledge base IDs (only used when KBSelectionMode
- is "selected")
- items:
- type: string
- type: array
- max_completion_tokens:
- description: Maximum completion tokens (only for normal mode)
- type: integer
- max_iterations:
- description: |-
- ===== Agent Mode Settings =====
- Maximum iterations for ReAct loop (only for agent type)
- type: integer
- mcp_selection_mode:
- description: 'MCP service selection mode: "all" = all enabled MCP services,
- "selected" = specific services, "none" = no MCP'
+ name:
+ description: '"local", "minio", "cos", "tos"'
type: string
- mcp_services:
- description: Selected MCP service IDs (only used when MCPSelectionMode is
- "selected")
+ type: object
+ handler.TestStoreRequest:
+ properties:
+ connection_config:
+ $ref: '#/definitions/types.ConnectionConfig'
+ engine_type:
+ $ref: '#/definitions/types.RetrieverEngineType'
+ required:
+ - connection_config
+ - engine_type
+ type: object
+ handler.TextRelationExtractionRequest:
+ properties:
+ model_id:
+ type: string
+ tags:
items:
type: string
type: array
- model_id:
- description: |-
- ===== Model Settings =====
- Model ID to use for conversations
+ text:
type: string
- multi_turn_enabled:
- description: |-
- ===== Multi-turn Conversation Settings =====
- Whether multi-turn conversation is enabled
- type: boolean
- rerank_model_id:
- description: ReRank model ID for retrieval
+ required:
+ - model_id
+ - tags
+ - text
+ type: object
+ handler.UpdateAgentRequest:
+ properties:
+ avatar:
type: string
- rerank_threshold:
- description: Rerank threshold
- type: number
- rerank_top_k:
- description: Rerank top K
- type: integer
- retrieve_kb_only_when_mentioned:
- description: |-
- Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)
- When true, knowledge base retrieval only happens if user explicitly mentions KB/files with @
- When false, knowledge base retrieval happens according to KBSelectionMode
- type: boolean
- rewrite_prompt_system:
- description: Rewrite prompt system message
+ config:
+ $ref: '#/definitions/types.CustomAgentConfig'
+ description:
type: string
- rewrite_prompt_user:
- description: Rewrite prompt user message template
+ name:
type: string
- selected_skills:
- description: Selected skill names (only used when SkillsSelectionMode is "selected")
- items:
- type: string
- type: array
- skills_selection_mode:
- description: |-
- ===== Skills Settings (only for smart-reasoning mode) =====
- Skills selection mode: "all" = all preloaded skills, "selected" = specific skills, "none" = no skills
+ type: object
+ handler.UpdateChunkRequest:
+ properties:
+ chunk_index:
+ type: integer
+ content:
type: string
- suggested_prompts:
- description: |-
- ===== Suggested Prompts =====
- 推荐问题列表,用于在前端对话面板展示快捷提问
- items:
- type: string
- type: array
- supported_file_types:
- description: |-
- ===== File Type Restriction Settings =====
- Supported file types for this agent (e.g., ["csv", "xlsx", "xls"])
- Empty means all file types are supported
- When set, only files with matching extensions can be used with this agent
+ embedding:
items:
- type: string
+ type: number
type: array
- system_prompt:
- description: System prompt for the agent (unified prompt, uses web_search_status
- placeholder for dynamic behavior)
- type: string
- system_prompt_id:
- description: |-
- SystemPromptID references a template ID in prompt_templates/ YAML files.
- If set and SystemPrompt is empty, the template content will be resolved at startup.
- type: string
- temperature:
- description: Temperature for LLM (0-1)
- type: number
- thinking:
- description: Whether to enable thinking mode (for models that support extended
- thinking)
- type: boolean
- vector_threshold:
- description: Vector retrieval threshold
- type: number
- vlm_model_id:
- description: VLM model ID for image analysis (optional, falls back to tenant-level
- VLM)
+ end_at:
+ type: integer
+ image_info:
type: string
- web_search_enabled:
- description: |-
- ===== Web Search Settings =====
- Whether web search is enabled
+ is_enabled:
type: boolean
- web_search_max_results:
- description: Maximum web search results
+ start_at:
type: integer
type: object
- github_com_Tencent_WeKnora_internal_types.DataSource:
+ handler.UpdateKnowledgeBaseRequest:
properties:
config:
- description: |-
- Encrypted configuration (API credentials, tokens, etc.)
- Stored as JSON with AES-256-GCM encryption
- items:
- type: integer
- type: array
- conflict_strategy:
- description: 'Conflict resolution strategy: overwrite or skip'
- type: string
- created_at:
- description: Creation timestamp
- type: string
- deleted_at:
- allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Soft delete timestamp
- error_message:
- description: Error message if status is "error"
- type: string
- id:
- description: Unique identifier
- type: string
- knowledge_base_id:
- description: Target knowledge base ID
- type: string
- last_sync_at:
- description: Last successful sync timestamp
+ $ref: '#/definitions/types.KnowledgeBaseConfig'
+ description:
type: string
- last_sync_cursor:
- description: Cursor or state for incremental sync (connector-specific)
- items:
- type: integer
- type: array
- last_sync_result:
- description: Summary of last sync result
- items:
- type: integer
- type: array
- latest_sync_log:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog'
- description: Latest sync log (not stored in DB, populated on query)
name:
- description: User-friendly name
- type: string
- status:
- description: 'Current status: active, paused, error'
type: string
- sync_deletions:
- description: Whether to sync deletions from source
- type: boolean
- sync_log_retention_days:
- description: 'Number of days to keep sync logs (default: 30)'
- type: integer
- sync_mode:
- description: 'Sync mode: "incremental" (recommended) or "full"'
+ required:
+ - name
+ type: object
+ handler.UpdateModelRequest:
+ properties:
+ description:
type: string
- sync_schedule:
- description: Cron expression for scheduled syncs (e.g., "0 */6 * * *" = every
- 6 hours)
+ name:
type: string
- tenant_id:
- description: Tenant ID for multi-tenancy
- type: integer
- total_items_synced:
- description: Total items synced (not stored in DB, calculated on query)
- type: integer
+ parameters:
+ $ref: '#/definitions/types.ModelParameters'
+ source:
+ $ref: '#/definitions/types.ModelSource'
type:
- description: Connector type (feishu, notion, confluence, etc.)
+ $ref: '#/definitions/types.ModelType'
+ type: object
+ handler.UpdateStoreRequest:
+ properties:
+ name:
type: string
- updated_at:
- description: Last update timestamp
+ required:
+ - name
+ type: object
+ handler.addSimilarQuestionsRequest:
+ properties:
+ similar_questions:
+ items:
+ type: string
+ minItems: 1
+ type: array
+ required:
+ - similar_questions
+ type: object
+ handler.updateLastFAQImportResultDisplayStatusRequest:
+ properties:
+ display_status:
+ enum:
+ - open
+ - close
type: string
+ required:
+ - display_status
type: object
- github_com_Tencent_WeKnora_internal_types.EmbeddingParameters:
+ handler_session.AttachmentUpload:
properties:
- dimension:
- type: integer
- truncate_prompt_tokens:
+ data:
+ description: Base64-encoded file content
+ type: string
+ file_name:
+ description: Original filename
+ type: string
+ file_size:
+ description: File size in bytes
type: integer
type: object
- github_com_Tencent_WeKnora_internal_types.ExtractConfig:
+ handler_session.CreateKnowledgeQARequest:
properties:
- enabled:
+ agent_enabled:
+ description: Whether agent mode is enabled for this request
type: boolean
- nodes:
+ agent_id:
+ description: Selected custom agent ID (backend resolves shared agent and its
+ tenant from share relation)
+ type: string
+ attachment_uploads:
+ description: Attached files (documents, audio, etc.)
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode'
+ $ref: '#/definitions/handler_session.AttachmentUpload'
type: array
- relations:
+ channel:
+ description: 'Source channel: "web", "api", "im", etc.'
+ type: string
+ disable_title:
+ description: Whether to disable auto title generation
+ type: boolean
+ enable_memory:
+ description: Whether memory feature is enabled for this request
+ type: boolean
+ images:
+ description: Attached images for multimodal chat
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation'
+ $ref: '#/definitions/handler_session.ImageAttachment'
type: array
- tags:
+ knowledge_base_ids:
+ description: Selected knowledge base ID for this request
items:
type: string
type: array
- text:
- type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload:
- properties:
- dry_run:
- description: 仅验证,不实际导入
- type: boolean
- entries:
+ knowledge_ids:
+ description: Selected knowledge ID for this request
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload'
+ type: string
type: array
- knowledge_id:
- type: string
- mode:
- enum:
- - append
- - replace
+ mentioned_items:
+ description: '@mentioned knowledge bases and files'
+ items:
+ $ref: '#/definitions/handler_session.MentionedItemRequest'
+ type: array
+ query:
+ description: Query text for knowledge base search
type: string
- task_id:
- description: 可选,如果不传则自动生成UUID
+ summary_model_id:
+ description: Optional summary model ID for this request (overrides session
+ default)
type: string
+ web_search_enabled:
+ description: Whether web search is enabled for this request
+ type: boolean
required:
- - entries
+ - query
type: object
- github_com_Tencent_WeKnora_internal_types.FAQConfig:
+ handler_session.CreateSessionRequest:
properties:
- index_mode:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode'
- question_index_mode:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode'
+ description:
+ description: Description for the session (optional)
+ type: string
+ title:
+ description: Title for the session (optional)
+ type: string
type: object
- github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate:
+ handler_session.GenerateTitleRequest:
properties:
- by_id:
- additionalProperties:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate'
- description: ByID 按条目ID更新,key为条目ID (seq_id)
- type: object
- by_tag:
- additionalProperties:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate'
- description: ByTag 按Tag批量更新,key为TagID (seq_id)
- type: object
- exclude_ids:
- description: ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)
+ messages:
+ description: Messages to use as context for title generation
items:
- type: integer
+ $ref: '#/definitions/types.Message'
type: array
+ required:
+ - messages
type: object
- github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate:
+ handler_session.ImageAttachment:
properties:
- is_enabled:
- type: boolean
- is_recommended:
- type: boolean
- tag_id:
- type: integer
+ caption:
+ description: VLM analysis result (context-aware, single call)
+ type: string
+ data:
+ description: base64 data URI from frontend (data:image/png;base64,...)
+ type: string
+ url:
+ description: serving URL after saving to storage
+ type: string
type: object
- github_com_Tencent_WeKnora_internal_types.FAQEntryPayload:
+ handler_session.MentionedItemRequest:
properties:
- answer_strategy:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy'
- answers:
- items:
- type: string
- type: array
id:
- description: ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)
- type: integer
- is_enabled:
- type: boolean
- is_recommended:
- type: boolean
- negative_questions:
+ type: string
+ kb_type:
+ description: '"document" or "faq" (only for kb type)'
+ type: string
+ name:
+ type: string
+ type:
+ description: '"kb" for knowledge base, "file" for file'
+ type: string
+ type: object
+ handler_session.SearchKnowledgeRequest:
+ properties:
+ knowledge_base_id:
+ description: Single knowledge base ID (for backward compatibility)
+ type: string
+ knowledge_base_ids:
+ description: IDs of knowledge bases to search (multi-KB support)
items:
type: string
type: array
- similar_questions:
+ knowledge_ids:
+ description: IDs of specific knowledge (files) to search
items:
type: string
type: array
- standard_question:
+ query:
+ description: Query text to search for
type: string
- tag_id:
- type: integer
- tag_name:
+ required:
+ - query
+ type: object
+ handler_session.StopSessionRequest:
+ properties:
+ message_id:
type: string
required:
- - standard_question
+ - message_id
type: object
- github_com_Tencent_WeKnora_internal_types.FAQIndexMode:
- enum:
- - question_only
- - question_answer
- type: string
- x-enum-varnames:
- - FAQIndexModeQuestionOnly
- - FAQIndexModeQuestionAnswer
- github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode:
- enum:
- - combined
- - separate
- type: string
- x-enum-varnames:
- - FAQQuestionIndexModeCombined
- - FAQQuestionIndexModeSeparate
- github_com_Tencent_WeKnora_internal_types.FAQSearchRequest:
+ handler_session.batchDeleteRequest:
properties:
- first_priority_tag_ids:
- description: 第一优先级标签ID列表,限定命中范围,优先级最高
+ delete_all:
+ type: boolean
+ ids:
items:
- type: integer
+ type: string
type: array
- match_count:
- type: integer
- only_recommended:
- description: 是否仅返回推荐的条目
+ type: object
+ types.ASRConfig:
+ properties:
+ enabled:
type: boolean
- query_text:
+ language:
+ description: 'optional: language hint for transcription'
+ type: string
+ model_id:
type: string
- second_priority_tag_ids:
- description: 第二优先级标签ID列表,限定命中范围,优先级低于第一优先级
- items:
- type: integer
- type: array
- vector_threshold:
- type: number
- required:
- - query_text
type: object
- github_com_Tencent_WeKnora_internal_types.GraphNode:
+ types.AgentConfig:
properties:
- attributes:
+ allowed_skills:
+ description: Skill names whitelist (empty = allow all)
items:
type: string
type: array
- chunks:
+ allowed_tools:
+ description: List of allowed tool names
items:
type: string
type: array
- name:
+ history_turns:
+ description: Number of history turns to keep in context
+ type: integer
+ knowledge_bases:
+ description: Accessible knowledge base IDs
+ items:
+ type: string
+ type: array
+ knowledge_ids:
+ description: Accessible knowledge IDs (individual documents)
+ items:
+ type: string
+ type: array
+ llm_call_timeout:
+ description: 'LLM call timeout in seconds (default: 120). Controls the maximum
+ time for a single LLM call.'
+ type: integer
+ max_context_tokens:
+ description: |-
+ Maximum context window tokens for the agent (default: 200000).
+ The agent compresses older messages to stay within this limit,
+ preserving tool_call/tool_result pairs.
+ type: integer
+ max_iterations:
+ description: Maximum number of ReAct iterations
+ type: integer
+ max_tool_output_chars:
+ description: |-
+ Maximum character length for tool output (default: 16000).
+ Outputs exceeding this limit are truncated with head + tail preservation.
+ type: integer
+ mcp_selection_mode:
+ description: MCP service selection
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.GraphRelation:
- properties:
- node1:
+ mcp_services:
+ description: Selected MCP service IDs (when mode is "selected")
+ items:
+ type: string
+ type: array
+ multi_turn_enabled:
+ description: Whether multi-turn conversation is enabled
+ type: boolean
+ parallel_tool_calls:
+ description: |-
+ Whether to execute independent tool calls in parallel (default: false).
+ When enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.
+ type: boolean
+ retrieve_kb_only_when_mentioned:
+ description: 'Whether to retrieve knowledge base only when explicitly mentioned
+ with @ (default: false)'
+ type: boolean
+ skill_dirs:
+ description: Directories to search for skills
+ items:
+ type: string
+ type: array
+ skills_enabled:
+ description: Skills configuration (Progressive Disclosure pattern)
+ type: boolean
+ system_prompt:
+ description: Unified system prompt (uses web_search_status placeholder for
+ dynamic behavior)
type: string
- node2:
+ system_prompt_web_disabled:
+ description: 'Deprecated: Custom prompt when web search is disabled'
type: string
- type:
+ system_prompt_web_enabled:
+ description: 'Deprecated: Use SystemPrompt instead. Kept for backward compatibility
+ during migration.'
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig:
- properties:
- model_id:
- description: Model ID
+ temperature:
+ description: LLM temperature for agent
+ type: number
+ thinking:
+ description: Whether to enable thinking mode (for models that support extended
+ thinking)
+ type: boolean
+ use_custom_system_prompt:
+ description: Whether to use custom system prompt instead of default
+ type: boolean
+ web_search_enabled:
+ description: Whether web search tool is enabled
+ type: boolean
+ web_search_max_results:
+ description: 'Maximum number of web search results (default: 5)'
+ type: integer
+ web_search_provider_id:
+ description: WebSearchProviderEntity ID (resolved from agent config)
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.InviteMemberRequest:
+ types.AgentStep:
properties:
- role:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
- description: 'Role to assign: admin/editor/viewer'
- user_id:
- description: User ID to invite
+ iteration:
+ description: Iteration number (0-indexed)
+ type: integer
+ thought:
+ description: LLM's reasoning/thinking (Think phase)
type: string
- required:
- - role
- - user_id
+ timestamp:
+ description: When this step occurred
+ type: string
+ tool_calls:
+ description: Tools called in this step (Act phase)
+ items:
+ $ref: '#/definitions/types.ToolCall'
+ type: array
type: object
- github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest:
+ types.AnswerStrategy:
+ enum:
+ - all
+ - random
+ type: string
+ x-enum-varnames:
+ - AnswerStrategyAll
+ - AnswerStrategyRandom
+ types.COSEngineConfig:
properties:
- message:
- description: Optional message for join request
- maxLength: 500
+ app_id:
type: string
- organization_id:
+ bucket_name:
type: string
- role:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
- description: 'Optional: requested role (admin/editor/viewer); default viewer'
- required:
- - organization_id
- type: object
- github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest:
- properties:
- invite_code:
- maxLength: 32
- minLength: 8
+ path_prefix:
type: string
- required:
- - invite_code
- type: object
- github_com_Tencent_WeKnora_internal_types.Knowledge:
- properties:
- channel:
- description: Channel indicates through which channel the knowledge was ingested
- (web, api, browser_extension, wechat, etc.)
+ region:
type: string
- created_at:
- description: Creation time of the knowledge
+ secret_id:
type: string
- deleted_at:
- allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Deletion time of the knowledge
- description:
- description: Description of the knowledge
+ secret_key:
type: string
+ type: object
+ types.ChatHistoryConfig:
+ properties:
embedding_model_id:
- description: ID of the embedding model
- type: string
- enable_status:
- description: Enable status of the knowledge
- type: string
- error_message:
- description: Error message of the knowledge
- type: string
- file_hash:
- description: File hash of the knowledge
- type: string
- file_name:
- description: File name of the knowledge
- type: string
- file_path:
- description: File path of the knowledge
- type: string
- file_size:
- description: File size of the knowledge
- type: integer
- file_type:
- description: File type of the knowledge
- type: string
- id:
- description: Unique identifier of the knowledge
+ description: |-
+ EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.
+ Once messages have been indexed, the model cannot be changed (requires re-indexing).
type: string
+ enabled:
+ description: Enabled controls whether chat history indexing is active
+ type: boolean
knowledge_base_id:
- description: ID of the knowledge base
- type: string
- knowledge_base_name:
- description: Knowledge base name (not stored in database, populated on query)
+ description: |-
+ KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.
+ This is set internally when the feature is first enabled; users should not set this directly.
type: string
- last_faq_import_result:
- description: Last FAQ import result (for FAQ type knowledge only)
+ type: object
+ types.ChunkingConfig:
+ properties:
+ child_chunk_size:
+ description: |-
+ ChildChunkSize is the size of child chunks used for embedding (default: 384).
+ Only used when EnableParentChild is true.
+ type: integer
+ chunk_overlap:
+ description: Chunk overlap
+ type: integer
+ chunk_size:
+ description: Chunk size
+ type: integer
+ enable_multimodal:
+ description: EnableMultimodal (deprecated, kept for backward compatibility
+ with old data)
+ type: boolean
+ enable_parent_child:
+ description: |-
+ EnableParentChild enables two-level parent-child chunking strategy.
+ When enabled, large parent chunks provide context while small child chunks
+ are used for vector matching. Retrieval matches on child but returns parent content.
+ type: boolean
+ parent_chunk_size:
+ description: |-
+ ParentChunkSize is the size of parent chunks (default: 4096).
+ Only used when EnableParentChild is true.
+ type: integer
+ parser_engine_rules:
+ description: |-
+ ParserEngineRules configures which parser engine to use for each file type.
+ When empty, the builtin engine is used for all types.
items:
- type: integer
+ $ref: '#/definitions/types.ParserEngineRule'
type: array
- metadata:
- description: Metadata of the knowledge
+ separators:
+ description: Separators
items:
- type: integer
+ type: string
type: array
- parse_status:
- description: Parse status of the knowledge
+ type: object
+ types.ConnectionConfig:
+ properties:
+ addr:
+ description: Common
type: string
- processed_at:
- description: Processed time of the knowledge
+ api_key:
+ description: AES-GCM encrypted
type: string
- source:
- description: Source of the knowledge (e.g. URL address for url type, "manual"
- for manual type)
+ grpc_address:
+ description: Weaviate
type: string
- storage_size:
- description: Storage size of the knowledge
- type: integer
- summary_status:
- description: Summary status for async summary generation
+ host:
+ description: Qdrant
type: string
- tag_id:
- description: Optional tag ID for categorization within a knowledge base
+ password:
+ description: AES-GCM encrypted
type: string
- tenant_id:
- description: Tenant ID
+ port:
type: integer
- title:
- description: Title of the knowledge
+ scheme:
type: string
- type:
- description: Type of the knowledge
+ use_default_connection:
+ description: Postgres
+ type: boolean
+ use_tls:
+ type: boolean
+ username:
type: string
- updated_at:
- description: Last updated time of the knowledge
+ version:
+ description: |-
+ Version is the detected server version (e.g., "7.10.1", "16.2", "1.12.6").
+ Auto-populated by TestConnection on successful connectivity check.
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.KnowledgeBase:
+ types.ContextCompressionStrategy:
+ enum:
+ - sliding_window
+ - smart
+ type: string
+ x-enum-varnames:
+ - ContextCompressionSlidingWindow
+ - ContextCompressionSmart
+ types.ContextConfig:
properties:
- chunk_count:
- description: Chunk count (not stored in database, calculated on query)
- type: integer
- chunking_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig'
- description: Chunking configuration
- created_at:
- description: Creation time of the knowledge base
- type: string
- deleted_at:
- allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Deletion time of the knowledge base
- description:
- description: Description of the knowledge base
- type: string
- embedding_model_id:
- description: ID of the embedding model
- type: string
- extract_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig'
- description: Extract config
- faq_config:
+ compression_strategy:
allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig'
- description: FAQConfig stores FAQ specific configuration such as indexing
- strategy
- id:
- description: Unique identifier of the knowledge base
+ - $ref: '#/definitions/types.ContextCompressionStrategy'
+ description: 'Compression strategy: "sliding_window" or "smart"'
+ max_tokens:
+ description: Maximum tokens allowed in LLM context
+ type: integer
+ recent_message_count:
+ description: |-
+ For sliding_window: number of messages to keep
+ For smart: number of recent messages to keep uncompressed
+ type: integer
+ summarize_threshold:
+ description: 'Summarize threshold: number of messages before summarization'
+ type: integer
+ type: object
+ types.ConversationConfig:
+ properties:
+ context_template:
+ description: ContextTemplate is the prompt template for summarizing retrieval
+ results
type: string
- image_processing_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig'
- description: Image processing configuration
- is_pinned:
- description: Whether this knowledge base is pinned to the top of the list
- type: boolean
- is_processing:
- description: IsProcessing indicates if there is a processing import task (for
- FAQ type knowledge bases)
+ embedding_top_k:
+ type: integer
+ enable_query_expansion:
type: boolean
- is_temporary:
- description: Whether this knowledge base is temporary (ephemeral) and should
- be hidden from UI
+ enable_rewrite:
type: boolean
- knowledge_count:
- description: Knowledge count (not stored in database, calculated on query)
- type: integer
- name:
- description: Name of the knowledge base
+ fallback_prompt:
type: string
- pinned_at:
- description: Time when the knowledge base was pinned (nil if not pinned)
+ fallback_response:
type: string
- processing_count:
- description: ProcessingCount indicates the number of knowledge items being
- processed (for document type knowledge bases)
+ fallback_strategy:
+ description: Fallback strategy
+ type: string
+ keyword_threshold:
+ type: number
+ max_completion_tokens:
+ description: MaxTokens is the maximum number of tokens to generate
type: integer
- question_generation_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig'
- description: QuestionGenerationConfig stores question generation configuration
- for document knowledge bases
- share_count:
- description: ShareCount indicates the number of organizations this knowledge
- base is shared with (not stored in database)
+ max_rounds:
+ description: Retrieval & strategy parameters
type: integer
- storage_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig'
- description: 'Deprecated: legacy COS config column. Kept for backward compatibility
- with old data.'
- storage_provider_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig'
- description: 'Storage provider config (new): only stores provider selection;
- credentials from tenant StorageEngineConfig'
- summary_model_id:
- description: Summary model ID
+ prompt:
+ description: Prompt is the system prompt for normal mode
type: string
- tenant_id:
- description: Tenant ID
+ rerank_model_id:
+ type: string
+ rerank_threshold:
+ type: number
+ rerank_top_k:
type: integer
- type:
- description: Type of the knowledge base (document, faq, etc.)
+ rewrite_prompt_system:
+ description: Rewrite prompts
type: string
- updated_at:
- description: Last updated time of the knowledge base
+ rewrite_prompt_user:
type: string
- vlm_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig'
- description: VLM config
- type: object
- github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig:
- properties:
- chunking_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig'
- description: Chunking configuration
- faq_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig'
- description: FAQ configuration (only for FAQ type knowledge bases)
- image_processing_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig'
- description: Image processing configuration
+ summary_model_id:
+ description: Model configuration
+ type: string
+ temperature:
+ description: Temperature controls the randomness of the model output
+ type: number
+ vector_threshold:
+ type: number
type: object
- github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse:
+ types.CreateOrganizationRequest:
properties:
- chunk_count:
- type: integer
- created_at:
- type: string
- id:
- type: string
- knowledge_base_id:
- type: string
- knowledge_base_name:
- type: string
- knowledge_base_type:
- type: string
- knowledge_count:
- type: integer
- my_permission:
- description: Effective permission for current user = min(Permission, MyRoleInOrg)
- type: string
- my_role_in_org:
- description: Current user's role in this organization (admin/editor/viewer)
- type: string
- organization_id:
- type: string
- organization_name:
- type: string
- permission:
- description: 'Share permission (what the space was granted: viewer/editor)'
- type: string
- require_approval:
- type: boolean
- shared_by_user_id:
+ avatar:
+ description: optional avatar URL
+ maxLength: 512
type: string
- shared_by_username:
+ description:
+ maxLength: 1000
type: string
- source_tenant_id:
- type: integer
- type: object
- github_com_Tencent_WeKnora_internal_types.ListMembersResponse:
- properties:
- members:
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse'
- type: array
- total:
- type: integer
- type: object
- github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse:
- properties:
- organizations:
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse'
- type: array
- resource_counts:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse'
- description: 各空间内知识库/智能体数量,供列表侧栏展示
- total:
+ invite_code_validity_days:
+ description: 'optional: 0=never, 1, 7, 30; default 7'
type: integer
- type: object
- github_com_Tencent_WeKnora_internal_types.ListSharesResponse:
- properties:
- shares:
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse'
- type: array
- total:
+ member_limit:
+ description: 'optional: max members; 0=unlimited; default 50'
type: integer
- type: object
- github_com_Tencent_WeKnora_internal_types.LocalEngineConfig:
- properties:
- path_prefix:
+ name:
+ maxLength: 255
+ minLength: 1
type: string
+ required:
+ - name
type: object
- github_com_Tencent_WeKnora_internal_types.LoginRequest:
+ types.CredentialsConfig:
properties:
- email:
- type: string
- password:
- minLength: 6
- type: string
- required:
- - email
- - password
+ weknoracloud:
+ $ref: '#/definitions/types.WeKnoraCloudCredentials'
type: object
- github_com_Tencent_WeKnora_internal_types.LoginResponse:
+ types.CustomAgentConfig:
properties:
- message:
+ agent_mode:
+ description: |-
+ ===== Basic Settings =====
+ Agent mode: "quick-answer" for RAG mode, "smart-reasoning" for ReAct agent mode
type: string
- refresh_token:
+ allowed_tools:
+ description: Allowed tools (only for agent type)
+ items:
+ type: string
+ type: array
+ asr_model_id:
+ description: ASR model ID for audio transcription (optional)
type: string
- success:
+ audio_upload_enabled:
+ description: 'Whether audio upload (ASR transcription) is enabled for this
+ agent (default: false)'
type: boolean
- tenant:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
- token:
+ context_template:
+ description: Context template for normal mode (how to format retrieved chunks)
type: string
- user:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User'
- type: object
- github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig:
- properties:
- retry_count:
- description: 'Number of retries, default: 3'
- type: integer
- retry_delay:
- description: 'Delay between retries in seconds, default: 1'
- type: integer
- timeout:
- description: 'Timeout in seconds, default: 30'
- type: integer
- type: object
- github_com_Tencent_WeKnora_internal_types.MCPAuthConfig:
- properties:
- api_key:
+ context_template_id:
+ description: |-
+ ContextTemplateID references a template ID in prompt_templates/ YAML files.
+ If set and ContextTemplate is empty, the template content will be resolved at startup.
type: string
- custom_headers:
- additionalProperties:
- type: string
- type: object
- token:
+ embedding_top_k:
+ description: |-
+ ===== Retrieval Strategy Settings (for both modes) =====
+ Embedding/Vector retrieval top K
+ type: integer
+ enable_query_expansion:
+ description: |-
+ ===== Advanced Settings (mainly for normal mode) =====
+ Whether to enable query expansion
+ type: boolean
+ enable_rewrite:
+ description: Whether to enable query rewrite for multi-turn conversations
+ type: boolean
+ fallback_prompt:
+ description: Fallback prompt (when FallbackStrategy is "model")
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.MCPEnvVars:
- additionalProperties:
- type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.MCPHeaders:
- additionalProperties:
- type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.MCPService:
- properties:
- advanced_config:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig'
- auth_config:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig'
- created_at:
+ fallback_response:
+ description: Fixed fallback response (when FallbackStrategy is "fixed")
type: string
- deleted_at:
- $ref: '#/definitions/gorm.DeletedAt'
- description:
+ fallback_strategy:
+ description: 'Fallback strategy: "fixed" for fixed response, "model" for model
+ generation'
type: string
- enabled:
+ faq_direct_answer_threshold:
+ description: FAQ direct answer threshold - if similarity > this value, use
+ FAQ answer directly
+ type: number
+ faq_priority_enabled:
+ description: |-
+ ===== FAQ Strategy Settings =====
+ Whether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)
type: boolean
- env_vars:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars'
- description: Environment variables for stdio
- headers:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders'
- id:
+ faq_score_boost:
+ description: FAQ score boost multiplier - FAQ results score multiplied by
+ this factor
+ type: number
+ history_turns:
+ description: Number of history turns to keep in context
+ type: integer
+ image_storage_provider:
+ description: |-
+ Storage provider for image uploads: "local", "minio", "cos", "tos"
+ Empty means use the global/tenant default provider.
type: string
- is_builtin:
- description: Whether this is a builtin MCP service (visible to all tenants)
+ image_upload_enabled:
+ description: |-
+ ===== Image Upload / Multimodal Settings =====
+ Whether image upload is enabled for this agent (default: false)
type: boolean
- name:
+ kb_selection_mode:
+ description: |-
+ ===== Knowledge Base Settings =====
+ Knowledge base selection mode: "all" = all KBs, "selected" = specific KBs, "none" = no KB
type: string
- stdio_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig'
- description: Required for stdio transport
- tenant_id:
+ keyword_threshold:
+ description: Keyword retrieval threshold
+ type: number
+ knowledge_bases:
+ description: Associated knowledge base IDs (only used when KBSelectionMode
+ is "selected")
+ items:
+ type: string
+ type: array
+ llm_call_timeout:
+ description: Timeout for a single LLM call in seconds (0 = use global default)
type: integer
- transport_type:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType'
- updated_at:
- type: string
- url:
- description: 'Optional: required for SSE/HTTP Streamable'
+ max_completion_tokens:
+ description: Maximum completion tokens (only for normal mode)
+ type: integer
+ max_iterations:
+ description: |-
+ ===== Agent Mode Settings =====
+ Maximum iterations for ReAct loop (only for agent type)
+ type: integer
+ mcp_selection_mode:
+ description: 'MCP service selection mode: "all" = all enabled MCP services,
+ "selected" = specific services, "none" = no MCP'
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.MCPStdioConfig:
- properties:
- args:
- description: Command arguments array
+ mcp_services:
+ description: Selected MCP service IDs (only used when MCPSelectionMode is
+ "selected")
items:
type: string
type: array
- command:
- description: 'Command: "uvx" or "npx"'
- type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.MCPTransportType:
- enum:
- - sse
- - http-streamable
- - stdio
- type: string
- x-enum-comments:
- MCPTransportHTTPStreamable: HTTP Streamable
- MCPTransportSSE: Server-Sent Events
- MCPTransportStdio: Stdio (Standard Input/Output)
- x-enum-descriptions:
- - Server-Sent Events
- - HTTP Streamable
- - Stdio (Standard Input/Output)
- x-enum-varnames:
- - MCPTransportSSE
- - MCPTransportHTTPStreamable
- - MCPTransportStdio
- github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload:
- properties:
- channel:
+ model_id:
+ description: |-
+ ===== Model Settings =====
+ Model ID to use for conversations
type: string
- content:
+ multi_turn_enabled:
+ description: |-
+ ===== Multi-turn Conversation Settings =====
+ Whether multi-turn conversation is enabled
+ type: boolean
+ rerank_model_id:
+ description: ReRank model ID for retrieval
type: string
- status:
+ rerank_threshold:
+ description: Rerank threshold
+ type: number
+ rerank_top_k:
+ description: Rerank top K
+ type: integer
+ retrieve_kb_only_when_mentioned:
+ description: |-
+ Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)
+ When true, knowledge base retrieval only happens if user explicitly mentions KB/files with @
+ When false, knowledge base retrieval happens according to KBSelectionMode
+ type: boolean
+ rewrite_prompt_system:
+ description: Rewrite prompt system message
type: string
- tag_id:
+ rewrite_prompt_user:
+ description: Rewrite prompt user message template
type: string
- title:
+ selected_skills:
+ description: Selected skill names (only used when SkillsSelectionMode is "selected")
+ items:
+ type: string
+ type: array
+ skills_selection_mode:
+ description: |-
+ ===== Skills Settings (only for smart-reasoning mode) =====
+ Skills selection mode: "all" = all preloaded skills, "selected" = specific skills, "none" = no skills
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.MatchType:
- enum:
- - 0
- - 1
- - 2
- - 3
- - 4
- - 5
- - 6
- - 7
- - 8
- - 9
- type: integer
- x-enum-comments:
- MatchTypeDataAnalysis: 数据分析匹配类型
- MatchTypeDirectLoad: 直接加载匹配类型
- MatchTypeParentChunk: 父Chunk匹配类型
- MatchTypeRelationChunk: 关系Chunk匹配类型
- MatchTypeWebSearch: 网络搜索匹配类型
- x-enum-descriptions:
- - ""
- - ""
- - ""
- - ""
- - 父Chunk匹配类型
- - 关系Chunk匹配类型
- - ""
- - 网络搜索匹配类型
- - 直接加载匹配类型
- - 数据分析匹配类型
- x-enum-varnames:
- - MatchTypeEmbedding
- - MatchTypeKeywords
- - MatchTypeNearByChunk
- - MatchTypeHistory
- - MatchTypeParentChunk
- - MatchTypeRelationChunk
- - MatchTypeGraph
- - MatchTypeWebSearch
- - MatchTypeDirectLoad
- - MatchTypeDataAnalysis
- github_com_Tencent_WeKnora_internal_types.MentionedItem:
- properties:
- id:
+ suggested_prompts:
+ description: |-
+ ===== Suggested Prompts =====
+ 推荐问题列表,用于在前端对话面板展示快捷提问
+ items:
+ type: string
+ type: array
+ supported_file_types:
+ description: |-
+ ===== File Type Restriction Settings =====
+ Supported file types for this agent (e.g., ["csv", "xlsx", "xls"])
+ Empty means all file types are supported
+ When set, only files with matching extensions can be used with this agent
+ items:
+ type: string
+ type: array
+ system_prompt:
+ description: System prompt for the agent (unified prompt, uses web_search_status
+ placeholder for dynamic behavior)
type: string
- kb_type:
- description: '"document" or "faq" (only for kb type)'
+ system_prompt_id:
+ description: |-
+ SystemPromptID references a template ID in prompt_templates/ YAML files.
+ If set and SystemPrompt is empty, the template content will be resolved at startup.
type: string
- name:
+ temperature:
+ description: Temperature for LLM (0-1)
+ type: number
+ thinking:
+ description: Whether to enable thinking mode (for models that support extended
+ thinking)
+ type: boolean
+ vector_threshold:
+ description: Vector retrieval threshold
+ type: number
+ vlm_model_id:
+ description: VLM model ID for image analysis (optional, falls back to tenant-level
+ VLM)
type: string
- type:
- description: '"kb" for knowledge base, "file" for file'
+ web_fetch_enabled:
+ description: Whether to auto-fetch full page content for reranked web search
+ results
+ type: boolean
+ web_fetch_top_n:
+ description: 'Max number of pages to fetch after rerank (default: 3)'
+ type: integer
+ web_search_enabled:
+ description: |-
+ ===== Web Search Settings =====
+ Whether web search is enabled
+ type: boolean
+ web_search_max_results:
+ description: Maximum web search results
+ type: integer
+ web_search_provider_id:
+ description: |-
+ WebSearchProviderID references a specific WebSearchProviderEntity.
+ If empty, the tenant's default provider (is_default=true) is used.
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.Message:
+ types.DataSource:
properties:
- agent_duration_ms:
- description: Agent total execution duration in milliseconds (from query start
- to answer start)
- type: integer
- agent_steps:
+ config:
description: |-
- Agent execution steps (only for assistant messages generated by agent)
- This contains the detailed reasoning process and tool calls made by the agent
- Stored for user history display, but NOT included in LLM context to avoid redundancy
+ Encrypted configuration (API credentials, tokens, etc.)
+ Stored as JSON with AES-256-GCM encryption
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep'
+ type: integer
type: array
- channel:
- description: Channel indicates the source channel of this message (e.g., "web",
- "api", "im")
- type: string
- content:
- description: Message text content
+ conflict_strategy:
+ description: 'Conflict resolution strategy: overwrite or skip'
type: string
created_at:
- description: Message creation timestamp
+ description: Creation timestamp
type: string
deleted_at:
allOf:
- $ref: '#/definitions/gorm.DeletedAt'
description: Soft delete timestamp
+ error_message:
+ description: Error message if status is "error"
+ type: string
id:
- description: Unique identifier for the message
+ description: Unique identifier
type: string
- images:
- description: Attached images with OCR/Caption text (for user messages)
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage'
- type: array
- is_completed:
- description: Whether message generation is complete
- type: boolean
- is_fallback:
- description: Whether this response is a fallback (no knowledge base match
- found)
- type: boolean
- knowledge_id:
- description: |-
- KnowledgeID links this message to a Knowledge entry in the chat history knowledge base
- Used for vector search indexing: when set, the message content has been indexed as a Knowledge passage
+ knowledge_base_id:
+ description: Target knowledge base ID
type: string
- knowledge_references:
- description: References to knowledge chunks used in the response
+ last_sync_at:
+ description: Last successful sync timestamp
+ type: string
+ last_sync_cursor:
+ description: Cursor or state for incremental sync (connector-specific)
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult'
+ type: integer
type: array
- mentioned_items:
- description: |-
- Mentioned knowledge bases and files (for user messages)
- Stores the @mentioned items when user sends a message
+ last_sync_result:
+ description: Summary of last sync result
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem'
+ type: integer
type: array
- request_id:
- description: Request identifier for tracking API requests
+ latest_sync_log:
+ allOf:
+ - $ref: '#/definitions/types.SyncLog'
+ description: Latest sync log (not stored in DB, populated on query)
+ name:
+ description: User-friendly name
type: string
- role:
- description: 'Message role: "user", "assistant", "system"'
+ status:
+ description: 'Current status: active, paused, error'
type: string
- session_id:
- description: ID of the session this message belongs to
+ sync_deletions:
+ description: Whether to sync deletions from source
+ type: boolean
+ sync_log_retention_days:
+ description: 'Number of days to keep sync logs (default: 30)'
+ type: integer
+ sync_mode:
+ description: 'Sync mode: "incremental" (recommended) or "full"'
+ type: string
+ sync_schedule:
+ description: Cron expression for scheduled syncs (e.g., "0 */6 * * *" = every
+ 6 hours)
+ type: string
+ tenant_id:
+ description: Tenant ID for multi-tenancy
+ type: integer
+ total_items_synced:
+ description: Total items synced (not stored in DB, calculated on query)
+ type: integer
+ type:
+ description: Connector type (feishu, notion, confluence, etc.)
type: string
updated_at:
description: Last update timestamp
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.MessageImage:
+ types.EmbeddingParameters:
properties:
- caption:
- type: string
- url:
- type: string
+ dimension:
+ type: integer
+ truncate_prompt_tokens:
+ type: integer
type: object
- github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig:
+ types.ExtractConfig:
properties:
- access_key_id:
- type: string
- bucket_name:
+ enabled:
+ type: boolean
+ nodes:
+ items:
+ $ref: '#/definitions/types.GraphNode'
+ type: array
+ relations:
+ items:
+ $ref: '#/definitions/types.GraphRelation'
+ type: array
+ tags:
+ items:
+ type: string
+ type: array
+ text:
type: string
- endpoint:
+ type: object
+ types.FAQBatchUpsertPayload:
+ properties:
+ dry_run:
+ description: 仅验证,不实际导入
+ type: boolean
+ entries:
+ items:
+ $ref: '#/definitions/types.FAQEntryPayload'
+ type: array
+ knowledge_id:
type: string
mode:
- description: '"docker" or "remote"'
- type: string
- path_prefix:
+ enum:
+ - append
+ - replace
type: string
- secret_access_key:
+ task_id:
+ description: 可选,如果不传则自动生成UUID
type: string
- use_ssl:
- type: boolean
+ required:
+ - entries
type: object
- github_com_Tencent_WeKnora_internal_types.ModelParameters:
+ types.FAQConfig:
properties:
- api_key:
- type: string
- base_url:
- type: string
- embedding_parameters:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters'
- extra_config:
+ index_mode:
+ $ref: '#/definitions/types.FAQIndexMode'
+ question_index_mode:
+ $ref: '#/definitions/types.FAQQuestionIndexMode'
+ type: object
+ types.FAQEntryFieldsBatchUpdate:
+ properties:
+ by_id:
additionalProperties:
- type: string
- description: Provider-specific configuration
+ $ref: '#/definitions/types.FAQEntryFieldsUpdate'
+ description: ByID 按条目ID更新,key为条目ID (seq_id)
type: object
- interface_type:
- type: string
- parameter_size:
- description: Ollama model parameter size (e.g., "7B", "13B", "70B")
+ by_tag:
+ additionalProperties:
+ $ref: '#/definitions/types.FAQEntryFieldsUpdate'
+ description: ByTag 按Tag批量更新,key为TagID (seq_id)
+ type: object
+ exclude_ids:
+ description: ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)
+ items:
+ type: integer
+ type: array
+ type: object
+ types.FAQEntryFieldsUpdate:
+ properties:
+ is_enabled:
+ type: boolean
+ is_recommended:
+ type: boolean
+ tag_id:
+ type: integer
+ type: object
+ types.FAQEntryPayload:
+ properties:
+ answer_strategy:
+ $ref: '#/definitions/types.AnswerStrategy'
+ answers:
+ items:
+ type: string
+ type: array
+ id:
+ description: ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)
+ type: integer
+ is_enabled:
+ type: boolean
+ is_recommended:
+ type: boolean
+ negative_questions:
+ items:
+ type: string
+ type: array
+ similar_questions:
+ items:
+ type: string
+ type: array
+ standard_question:
type: string
- provider:
- description: 'Provider identifier: openai, aliyun, zhipu, generic'
+ tag_id:
+ type: integer
+ tag_name:
type: string
- supports_vision:
- description: Whether the model accepts image/multimodal input
- type: boolean
+ required:
+ - standard_question
type: object
- github_com_Tencent_WeKnora_internal_types.ModelSource:
+ types.FAQIndexMode:
enum:
- - local
- - remote
- - aliyun
- - zhipu
- - volcengine
- - deepseek
- - hunyuan
- - minimax
- - openai
- - gemini
- - mimo
- - siliconflow
- - jina
- - openrouter
- - nvidia
- - novita
+ - question_only
+ - question_answer
type: string
- x-enum-comments:
- ModelSourceAliyun: Aliyun DashScope model
- ModelSourceDeepseek: Deepseek model
- ModelSourceGemini: Gemini model
- ModelSourceHunyuan: Hunyuan model
- ModelSourceJina: Jina AI model
- ModelSourceLocal: Local model
- ModelSourceMimo: Mimo model
- ModelSourceMinimax: Minimax mode
- ModelSourceNovita: Novita AI model
- ModelSourceNvidia: NVIDIA model
- ModelSourceOpenAI: OpenAI model
- ModelSourceOpenRouter: OpenRouter model
- ModelSourceRemote: Remote model
- ModelSourceSiliconFlow: SiliconFlow model
- ModelSourceVolcengine: Volcengine model
- ModelSourceZhipu: Zhipu model
- x-enum-descriptions:
- - Local model
- - Remote model
- - Aliyun DashScope model
- - Zhipu model
- - Volcengine model
- - Deepseek model
- - Hunyuan model
- - Minimax mode
- - OpenAI model
- - Gemini model
- - Mimo model
- - SiliconFlow model
- - Jina AI model
- - OpenRouter model
- - NVIDIA model
- - Novita AI model
x-enum-varnames:
- - ModelSourceLocal
- - ModelSourceRemote
- - ModelSourceAliyun
- - ModelSourceZhipu
- - ModelSourceVolcengine
- - ModelSourceDeepseek
- - ModelSourceHunyuan
- - ModelSourceMinimax
- - ModelSourceOpenAI
- - ModelSourceGemini
- - ModelSourceMimo
- - ModelSourceSiliconFlow
- - ModelSourceJina
- - ModelSourceOpenRouter
- - ModelSourceNvidia
- - ModelSourceNovita
- github_com_Tencent_WeKnora_internal_types.ModelType:
+ - FAQIndexModeQuestionOnly
+ - FAQIndexModeQuestionAnswer
+ types.FAQQuestionIndexMode:
enum:
- - Embedding
- - Rerank
- - KnowledgeQA
- - VLLM
+ - combined
+ - separate
type: string
- x-enum-comments:
- ModelTypeEmbedding: Embedding model
- ModelTypeKnowledgeQA: KnowledgeQA model
- ModelTypeRerank: Rerank model
- ModelTypeVLLM: VLLM model
- x-enum-descriptions:
- - Embedding model
- - Rerank model
- - KnowledgeQA model
- - VLLM model
x-enum-varnames:
- - ModelTypeEmbedding
- - ModelTypeRerank
- - ModelTypeKnowledgeQA
- - ModelTypeVLLM
- github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse:
+ - FAQQuestionIndexModeCombined
+ - FAQQuestionIndexModeSeparate
+ types.FAQSearchRequest:
properties:
- authorization_url:
+ first_priority_tag_ids:
+ description: 第一优先级标签ID列表,限定命中范围,优先级最高
+ items:
+ type: integer
+ type: array
+ match_count:
+ type: integer
+ only_recommended:
+ description: 是否仅返回推荐的条目
+ type: boolean
+ query_text:
type: string
- provider_display_name:
+ second_priority_tag_ids:
+ description: 第二优先级标签ID列表,限定命中范围,优先级低于第一优先级
+ items:
+ type: integer
+ type: array
+ vector_threshold:
+ type: number
+ required:
+ - query_text
+ type: object
+ types.GraphNode:
+ properties:
+ attributes:
+ items:
+ type: string
+ type: array
+ chunks:
+ items:
+ type: string
+ type: array
+ name:
type: string
- state:
+ type: object
+ types.GraphRelation:
+ properties:
+ node1:
+ type: string
+ node2:
+ type: string
+ type:
type: string
- success:
- type: boolean
type: object
- github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse:
+ types.ImageProcessingConfig:
properties:
- enabled:
- type: boolean
- provider_display_name:
+ model_id:
+ description: Model ID
type: string
- success:
- type: boolean
type: object
- github_com_Tencent_WeKnora_internal_types.OrgMemberRole:
- enum:
- - admin
- - editor
- - viewer
- type: string
- x-enum-varnames:
- - OrgRoleAdmin
- - OrgRoleEditor
- - OrgRoleViewer
- github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse:
+ types.IndexConfig:
properties:
- avatar:
+ collection_name:
+ description: Milvus
type: string
- email:
+ collection_prefix:
+ description: Qdrant
+ type: string
+ index_name:
+ description: ES, OpenSearch
+ type: string
+ number_of_replicas:
+ description: ES, OpenSearch
+ type: integer
+ number_of_shards:
+ description: ES, OpenSearch
+ type: integer
+ type: object
+ types.InviteMemberRequest:
+ properties:
+ role:
+ allOf:
+ - $ref: '#/definitions/types.OrgMemberRole'
+ description: 'Role to assign: admin/editor/viewer'
+ user_id:
+ description: User ID to invite
+ type: string
+ required:
+ - role
+ - user_id
+ type: object
+ types.JoinByOrganizationIDRequest:
+ properties:
+ message:
+ description: Optional message for join request
+ maxLength: 500
+ type: string
+ organization_id:
+ type: string
+ role:
+ allOf:
+ - $ref: '#/definitions/types.OrgMemberRole'
+ description: 'Optional: requested role (admin/editor/viewer); default viewer'
+ required:
+ - organization_id
+ type: object
+ types.JoinOrganizationRequest:
+ properties:
+ invite_code:
+ maxLength: 32
+ minLength: 8
+ type: string
+ required:
+ - invite_code
+ type: object
+ types.Knowledge:
+ properties:
+ channel:
+ description: Channel indicates through which channel the knowledge was ingested
+ (web, api, browser_extension, wechat, etc.)
+ type: string
+ created_at:
+ description: Creation time of the knowledge
+ type: string
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time of the knowledge
+ description:
+ description: Description of the knowledge
+ type: string
+ embedding_model_id:
+ description: ID of the embedding model
+ type: string
+ enable_status:
+ description: Enable status of the knowledge
+ type: string
+ error_message:
+ description: Error message of the knowledge
+ type: string
+ file_hash:
+ description: File hash of the knowledge
+ type: string
+ file_name:
+ description: File name of the knowledge
+ type: string
+ file_path:
+ description: File path of the knowledge
+ type: string
+ file_size:
+ description: File size of the knowledge
+ type: integer
+ file_type:
+ description: File type of the knowledge
type: string
id:
+ description: Unique identifier of the knowledge
+ type: string
+ knowledge_base_id:
+ description: ID of the knowledge base
+ type: string
+ knowledge_base_name:
+ description: Knowledge base name (not stored in database, populated on query)
+ type: string
+ last_faq_import_result:
+ description: Last FAQ import result (for FAQ type knowledge only)
+ items:
+ type: integer
+ type: array
+ metadata:
+ description: Metadata of the knowledge
+ items:
+ type: integer
+ type: array
+ parse_status:
+ description: Parse status of the knowledge
+ type: string
+ processed_at:
+ description: Processed time of the knowledge
+ type: string
+ source:
+ description: Source of the knowledge (e.g. URL address for url type, "manual"
+ for manual type)
+ type: string
+ storage_size:
+ description: Storage size of the knowledge
+ type: integer
+ summary_status:
+ description: Summary status for async summary generation
+ type: string
+ tag_id:
+ description: Optional tag ID for categorization within a knowledge base
+ type: string
+ tenant_id:
+ description: Tenant ID
+ type: integer
+ title:
+ description: Title of the knowledge
+ type: string
+ type:
+ description: Type of the knowledge
+ type: string
+ updated_at:
+ description: Last updated time of the knowledge
+ type: string
+ type: object
+ types.KnowledgeBase:
+ properties:
+ asr_config:
+ allOf:
+ - $ref: '#/definitions/types.ASRConfig'
+ description: ASR config (Automatic Speech Recognition)
+ chunk_count:
+ description: Chunk count (not stored in database, calculated on query)
+ type: integer
+ chunking_config:
+ allOf:
+ - $ref: '#/definitions/types.ChunkingConfig'
+ description: Chunking configuration
+ created_at:
+ description: Creation time of the knowledge base
+ type: string
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time of the knowledge base
+ description:
+ description: Description of the knowledge base
+ type: string
+ embedding_model_id:
+ description: ID of the embedding model
+ type: string
+ extract_config:
+ allOf:
+ - $ref: '#/definitions/types.ExtractConfig'
+ description: Extract config
+ faq_config:
+ allOf:
+ - $ref: '#/definitions/types.FAQConfig'
+ description: FAQConfig stores FAQ specific configuration such as indexing
+ strategy
+ id:
+ description: Unique identifier of the knowledge base
+ type: string
+ image_processing_config:
+ allOf:
+ - $ref: '#/definitions/types.ImageProcessingConfig'
+ description: Image processing configuration
+ is_pinned:
+ description: Whether this knowledge base is pinned to the top of the list
+ type: boolean
+ is_processing:
+ description: IsProcessing indicates if there is a processing import task (for
+ FAQ type knowledge bases)
+ type: boolean
+ is_temporary:
+ description: Whether this knowledge base is temporary (ephemeral) and should
+ be hidden from UI
+ type: boolean
+ knowledge_count:
+ description: Knowledge count (not stored in database, calculated on query)
+ type: integer
+ name:
+ description: Name of the knowledge base
type: string
- joined_at:
+ pinned_at:
+ description: Time when the knowledge base was pinned (nil if not pinned)
type: string
- role:
+ processing_count:
+ description: ProcessingCount indicates the number of knowledge items being
+ processed (for document type knowledge bases)
+ type: integer
+ question_generation_config:
+ allOf:
+ - $ref: '#/definitions/types.QuestionGenerationConfig'
+ description: QuestionGenerationConfig stores question generation configuration
+ for document knowledge bases
+ share_count:
+ description: ShareCount indicates the number of organizations this knowledge
+ base is shared with (not stored in database)
+ type: integer
+ storage_config:
+ allOf:
+ - $ref: '#/definitions/types.StorageConfig'
+ description: 'Deprecated: legacy COS config column. Kept for backward compatibility
+ with old data.'
+ storage_provider_config:
+ allOf:
+ - $ref: '#/definitions/types.StorageProviderConfig'
+ description: 'Storage provider config (new): only stores provider selection;
+ credentials from tenant StorageEngineConfig'
+ summary_model_id:
+ description: Summary model ID
type: string
tenant_id:
+ description: Tenant ID
type: integer
- user_id:
+ type:
+ description: Type of the knowledge base (document, faq, etc.)
type: string
- username:
+ updated_at:
+ description: Last updated time of the knowledge base
type: string
+ vlm_config:
+ allOf:
+ - $ref: '#/definitions/types.VLMConfig'
+ description: VLM config
type: object
- github_com_Tencent_WeKnora_internal_types.OrganizationResponse:
+ types.KnowledgeBaseConfig:
properties:
- agent_share_count:
- description: 共享到该组织的智能体数量
+ chunking_config:
+ allOf:
+ - $ref: '#/definitions/types.ChunkingConfig'
+ description: Chunking configuration
+ faq_config:
+ allOf:
+ - $ref: '#/definitions/types.FAQConfig'
+ description: FAQ configuration (only for FAQ type knowledge bases)
+ image_processing_config:
+ allOf:
+ - $ref: '#/definitions/types.ImageProcessingConfig'
+ description: Image processing configuration
+ type: object
+ types.KnowledgeBaseShareResponse:
+ properties:
+ chunk_count:
type: integer
- avatar:
- type: string
created_at:
type: string
- description:
- type: string
- has_pending_upgrade:
- description: 当前用户是否有待处理的权限升级申请
- type: boolean
id:
type: string
- invite_code:
- type: string
- invite_code_expires_at:
- type: string
- invite_code_validity_days:
- type: integer
- is_owner:
- type: boolean
- member_count:
- type: integer
- member_limit:
- description: 0 = unlimited
- type: integer
- my_role:
+ knowledge_base_id:
type: string
- name:
+ knowledge_base_name:
type: string
- owner_id:
+ knowledge_base_type:
type: string
- pending_join_request_count:
- description: 待审批加入申请数(仅管理员可见)
- type: integer
- require_approval:
- type: boolean
- searchable:
- type: boolean
- share_count:
- description: 共享到该组织的知识库数量
+ knowledge_count:
type: integer
- updated_at:
+ my_permission:
+ description: Effective permission for current user = min(Permission, MyRoleInOrg)
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.ParserEngineConfig:
- properties:
- docreader_addr:
- description: 文档解析服务地址
+ my_role_in_org:
+ description: Current user's role in this organization (admin/editor/viewer)
type: string
- mineru_api_key:
- description: MinerU 云 API Key
+ organization_id:
type: string
- mineru_cloud_enable_formula:
- type: boolean
- mineru_cloud_enable_ocr:
- type: boolean
- mineru_cloud_enable_table:
- type: boolean
- mineru_cloud_language:
+ organization_name:
type: string
- mineru_cloud_model:
- description: MinerU 云 API 解析参数
+ permission:
+ description: 'Share permission (what the space was granted: viewer/editor)'
type: string
- mineru_enable_formula:
- type: boolean
- mineru_enable_ocr:
- type: boolean
- mineru_enable_table:
+ require_approval:
type: boolean
- mineru_endpoint:
- description: MinerU 自建服务端点
- type: string
- mineru_language:
+ shared_by_user_id:
type: string
- mineru_model:
- description: MinerU 自建解析参数
+ shared_by_username:
type: string
+ source_tenant_id:
+ type: integer
type: object
- github_com_Tencent_WeKnora_internal_types.ParserEngineRule:
+ types.ListMembersResponse:
properties:
- engine:
- type: string
- file_types:
+ members:
items:
- type: string
+ $ref: '#/definitions/types.OrganizationMemberResponse'
type: array
+ total:
+ type: integer
type: object
- github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig:
+ types.ListOrganizationsResponse:
properties:
- enabled:
- type: boolean
- question_count:
- description: 'Number of questions to generate per chunk (default: 3, max:
- 10)'
+ organizations:
+ items:
+ $ref: '#/definitions/types.OrganizationResponse'
+ type: array
+ resource_counts:
+ allOf:
+ - $ref: '#/definitions/types.ResourceCountsByOrgResponse'
+ description: 各空间内知识库/智能体数量,供列表侧栏展示
+ total:
+ type: integer
+ type: object
+ types.ListSharesResponse:
+ properties:
+ shares:
+ items:
+ $ref: '#/definitions/types.KnowledgeBaseShareResponse'
+ type: array
+ total:
type: integer
type: object
- github_com_Tencent_WeKnora_internal_types.RegisterRequest:
+ types.LocalEngineConfig:
+ properties:
+ path_prefix:
+ type: string
+ type: object
+ types.LoginRequest:
properties:
email:
type: string
password:
minLength: 6
type: string
- username:
- maxLength: 50
- minLength: 2
- type: string
required:
- email
- password
- - username
type: object
- github_com_Tencent_WeKnora_internal_types.RegisterResponse:
+ types.LoginResponse:
properties:
message:
type: string
+ refresh_token:
+ type: string
success:
type: boolean
tenant:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
+ $ref: '#/definitions/types.Tenant'
+ token:
+ type: string
user:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User'
+ $ref: '#/definitions/types.User'
type: object
- github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest:
+ types.MCPAdvancedConfig:
properties:
- message:
- description: Optional message explaining the reason
- maxLength: 500
- type: string
- requested_role:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
- description: The role user wants to upgrade to
- required:
- - requested_role
+ retry_count:
+ description: 'Number of retries, default: 3'
+ type: integer
+ retry_delay:
+ description: 'Delay between retries in seconds, default: 1'
+ type: integer
+ timeout:
+ description: 'Timeout in seconds, default: 30'
+ type: integer
type: object
- github_com_Tencent_WeKnora_internal_types.Resource:
+ types.MCPAuthConfig:
properties:
- description:
- description: Optional description
- type: string
- external_id:
- description: Unique identifier in the external system
- type: string
- metadata:
- additionalProperties: true
- description: Additional metadata
- type: object
- modified_at:
- description: Last modified time in external system
- type: string
- name:
- description: Display name
- type: string
- parent_id:
- description: For hierarchical resources (parent ID if applicable)
- type: string
- type:
- description: Resource type (document, folder, space, page, etc.)
- type: string
- url:
- description: URL to access in external system
+ api_key:
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse:
- properties:
- agents:
- properties:
- by_organization:
- additionalProperties:
- type: integer
- type: object
- type: object
- knowledge_bases:
- properties:
- by_organization:
- additionalProperties:
- type: integer
- type: object
+ custom_headers:
+ additionalProperties:
+ type: string
type: object
+ token:
+ type: string
+ type: object
+ types.MCPEnvVars:
+ additionalProperties:
+ type: string
type: object
- github_com_Tencent_WeKnora_internal_types.RetrievalConfig:
- properties:
- embedding_top_k:
- description: 'EmbeddingTopK is the maximum number of chunks returned by vector
- search (default: 50)'
- type: integer
- keyword_threshold:
- description: 'KeywordThreshold is the minimum keyword match score (0-1, default:
- 0.3)'
- type: number
- rerank_model_id:
- description: RerankModelID is the ID of the rerank model to use (required
- for search)
- type: string
- rerank_threshold:
- description: 'RerankThreshold is the minimum rerank score (-10 to 10, default:
- 0.2)'
- type: number
- rerank_top_k:
- description: 'RerankTopK is the maximum number of results after reranking
- (default: 10)'
- type: integer
- vector_threshold:
- description: 'VectorThreshold is the minimum vector similarity score (0-1,
- default: 0.15)'
- type: number
- type: object
- github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams:
+ types.MCPHeaders:
+ additionalProperties:
+ type: string
+ type: object
+ types.MCPService:
properties:
- retriever_engine_type:
+ advanced_config:
+ $ref: '#/definitions/types.MCPAdvancedConfig'
+ auth_config:
+ $ref: '#/definitions/types.MCPAuthConfig'
+ created_at:
+ type: string
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ description:
+ type: string
+ enabled:
+ type: boolean
+ env_vars:
allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType'
- description: Retriever engine type
- retriever_type:
+ - $ref: '#/definitions/types.MCPEnvVars'
+ description: Environment variables for stdio
+ headers:
+ $ref: '#/definitions/types.MCPHeaders'
+ id:
+ type: string
+ is_builtin:
+ description: Whether this is a builtin MCP service (visible to all tenants)
+ type: boolean
+ name:
+ type: string
+ stdio_config:
allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType'
- description: Retriever type
+ - $ref: '#/definitions/types.MCPStdioConfig'
+ description: Required for stdio transport
+ tenant_id:
+ type: integer
+ transport_type:
+ $ref: '#/definitions/types.MCPTransportType'
+ updated_at:
+ type: string
+ url:
+ description: 'Optional: required for SSE/HTTP Streamable'
+ type: string
type: object
- github_com_Tencent_WeKnora_internal_types.RetrieverEngineType:
- enum:
- - postgres
- - elasticsearch
- - infinity
- - elasticfaiss
- - qdrant
- - milvus
- - weaviate
- - sqlite
- type: string
- x-enum-varnames:
- - PostgresRetrieverEngineType
- - ElasticsearchRetrieverEngineType
- - InfinityRetrieverEngineType
- - ElasticFaissRetrieverEngineType
- - QdrantRetrieverEngineType
- - MilvusRetrieverEngineType
- - WeaviateRetrieverEngineType
- - SQLiteRetrieverEngineType
- github_com_Tencent_WeKnora_internal_types.RetrieverEngines:
+ types.MCPStdioConfig:
properties:
- engines:
+ args:
+ description: Command arguments array
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams'
+ type: string
type: array
+ command:
+ description: 'Command: "uvx" or "npx"'
+ type: string
type: object
- github_com_Tencent_WeKnora_internal_types.RetrieverType:
+ types.MCPTransportType:
enum:
- - keywords
- - vector
- - websearch
+ - sse
+ - http-streamable
+ - stdio
type: string
x-enum-comments:
- KeywordsRetrieverType: Keywords retriever
- VectorRetrieverType: Vector retriever
- WebSearchRetrieverType: Web search retriever
+ MCPTransportHTTPStreamable: HTTP Streamable
+ MCPTransportSSE: Server-Sent Events
+ MCPTransportStdio: Stdio (Standard Input/Output)
x-enum-descriptions:
- - Keywords retriever
- - Vector retriever
- - Web search retriever
+ - Server-Sent Events
+ - HTTP Streamable
+ - Stdio (Standard Input/Output)
x-enum-varnames:
- - KeywordsRetrieverType
- - VectorRetrieverType
- - WebSearchRetrieverType
- github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest:
+ - MCPTransportSSE
+ - MCPTransportHTTPStreamable
+ - MCPTransportStdio
+ types.ManualKnowledgePayload:
properties:
- approved:
- type: boolean
- message:
- maxLength: 500
+ channel:
type: string
- role:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
- description: 'Optional: role to assign when approving; overrides applicant''s
- requested role'
- type: object
- github_com_Tencent_WeKnora_internal_types.S3EngineConfig:
- properties:
- access_key:
+ content:
type: string
- bucket_name:
+ status:
type: string
- endpoint:
+ tag_id:
type: string
- path_prefix:
+ title:
type: string
- region:
+ type: object
+ types.MatchType:
+ enum:
+ - 0
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
+ - 6
+ - 7
+ - 8
+ - 9
+ type: integer
+ x-enum-comments:
+ MatchTypeDataAnalysis: 数据分析匹配类型
+ MatchTypeDirectLoad: 直接加载匹配类型
+ MatchTypeParentChunk: 父Chunk匹配类型
+ MatchTypeRelationChunk: 关系Chunk匹配类型
+ MatchTypeWebSearch: 网络搜索匹配类型
+ x-enum-descriptions:
+ - ""
+ - ""
+ - ""
+ - ""
+ - 父Chunk匹配类型
+ - 关系Chunk匹配类型
+ - ""
+ - 网络搜索匹配类型
+ - 直接加载匹配类型
+ - 数据分析匹配类型
+ x-enum-varnames:
+ - MatchTypeEmbedding
+ - MatchTypeKeywords
+ - MatchTypeNearByChunk
+ - MatchTypeHistory
+ - MatchTypeParentChunk
+ - MatchTypeRelationChunk
+ - MatchTypeGraph
+ - MatchTypeWebSearch
+ - MatchTypeDirectLoad
+ - MatchTypeDataAnalysis
+ types.MentionedItem:
+ properties:
+ id:
type: string
- secret_key:
+ kb_type:
+ description: '"document" or "faq" (only for kb type)'
+ type: string
+ name:
+ type: string
+ type:
+ description: '"kb" for knowledge base, "file" for file'
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.SearchParams:
+ types.Message:
properties:
- disable_keywords_match:
- type: boolean
- disable_vector_match:
- type: boolean
- keyword_threshold:
- type: number
- knowledge_base_ids:
- description: |-
- KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,
- allowing a single retrieval call to span multiple KBs that share the
- same embedding model. When empty, HybridSearch uses its own id parameter.
- items:
- type: string
- type: array
- knowledge_ids:
- items:
- type: string
- type: array
- match_count:
+ agent_duration_ms:
+ description: Agent total execution duration in milliseconds (from query start
+ to answer start)
type: integer
- only_recommended:
- type: boolean
- query_embedding:
- items:
- type: number
- type: array
- query_text:
- type: string
- skip_context_enrichment:
+ agent_steps:
description: |-
- SkipContextEnrichment skips fetching parent, nearby, and relation chunks
- in processSearchResults. Used by the chat pipeline where context assembly
- is handled separately in the merge stage.
- type: boolean
- tag_ids:
- description: Tag IDs for filtering (used for FAQ priority filtering)
+ Agent execution steps (only for assistant messages generated by agent)
+ This contains the detailed reasoning process and tool calls made by the agent
+ Stored for user history display, but NOT included in LLM context to avoid redundancy
items:
- type: string
+ $ref: '#/definitions/types.AgentStep'
type: array
- vector_threshold:
- type: number
- type: object
- github_com_Tencent_WeKnora_internal_types.SearchResult:
- properties:
- chunk_index:
- description: Chunk index
- type: integer
- chunk_metadata:
- description: ChunkMetadata stores chunk-level metadata (e.g., generated questions)
+ attachments:
+ description: Attached files (documents, audio, etc., for user messages)
items:
- type: integer
+ $ref: '#/definitions/types.MessageAttachment'
type: array
- chunk_type:
- description: Chunk 类型
+ channel:
+ description: Channel indicates the source channel of this message (e.g., "web",
+ "api", "im")
type: string
content:
- description: Content
- type: string
- end_at:
- description: End at
- type: integer
- id:
- description: ID
- type: string
- image_info:
- description: 图片信息 (JSON 格式)
- type: string
- knowledge_base_id:
- description: KnowledgeBaseID is the ID of the knowledge base this result belongs
- to
- type: string
- knowledge_channel:
- description: KnowledgeChannel indicates through which channel the knowledge
- was ingested (web, api, wechat, etc.)
+ description: Message text content
type: string
- knowledge_description:
- description: KnowledgeDescription is the description of the knowledge document
+ created_at:
+ description: Message creation timestamp
type: string
- knowledge_filename:
- description: |-
- Knowledge file name
- Used for file type knowledge, contains the original file name
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Soft delete timestamp
+ id:
+ description: Unique identifier for the message
type: string
+ images:
+ description: Attached images with OCR/Caption text (for user messages)
+ items:
+ $ref: '#/definitions/types.MessageImage'
+ type: array
+ is_completed:
+ description: Whether message generation is complete
+ type: boolean
+ is_fallback:
+ description: Whether this response is a fallback (no knowledge base match
+ found)
+ type: boolean
knowledge_id:
- description: Knowledge ID
+ description: |-
+ KnowledgeID links this message to a Knowledge entry in the chat history knowledge base
+ Used for vector search indexing: when set, the message content has been indexed as a Knowledge passage
type: string
- knowledge_source:
+ knowledge_references:
+ description: References to knowledge chunks used in the response
+ items:
+ $ref: '#/definitions/types.SearchResult'
+ type: array
+ mentioned_items:
description: |-
- Knowledge source
- Used to indicate the source of the knowledge, such as "url"
+ Mentioned knowledge bases and files (for user messages)
+ Stores the @mentioned items when user sends a message
+ items:
+ $ref: '#/definitions/types.MentionedItem'
+ type: array
+ request_id:
+ description: Request identifier for tracking API requests
type: string
- knowledge_title:
- description: Knowledge title
+ role:
+ description: 'Message role: "user", "assistant", "system"'
type: string
- match_type:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType'
- description: Match type
- matched_content:
- description: |-
- MatchedContent is the actual content that was matched in vector search
- For FAQ: this is the matched question text (standard or similar question)
+ session_id:
+ description: ID of the session this message belongs to
type: string
- metadata:
- additionalProperties:
- type: string
- description: Metadata
- type: object
- parent_chunk_id:
- description: 父 Chunk ID
+ updated_at:
+ description: Last update timestamp
type: string
- score:
- description: Score
- type: number
- seq:
- description: Seq
- type: integer
- start_at:
- description: Start at
- type: integer
- sub_chunk_id:
- description: SubChunkIndex
- items:
- type: string
- type: array
type: object
- github_com_Tencent_WeKnora_internal_types.Session:
+ types.MessageAttachment:
properties:
- created_at:
- type: string
- deleted_at:
- $ref: '#/definitions/gorm.DeletedAt'
- description:
- description: Description
+ content:
+ description: Extracted text content (for small text files)
type: string
- id:
- description: ID
+ file_name:
+ description: Original filename
type: string
- tenant_id:
- description: Tenant ID
+ file_size:
+ description: File size in bytes
type: integer
- title:
- description: Title
+ file_type:
+ description: File extension (e.g., ".pdf", ".docx")
type: string
- updated_at:
+ is_truncated:
+ description: Whether content was truncated
+ type: boolean
+ line_count:
+ description: Total line count (for text files)
+ type: integer
+ url:
+ description: Storage URL (provider://path)
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest:
+ types.MessageImage:
properties:
- organization_id:
+ caption:
+ type: string
+ url:
type: string
- permission:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
- required:
- - organization_id
- - permission
type: object
- github_com_Tencent_WeKnora_internal_types.StorageConfig:
+ types.MinIOEngineConfig:
properties:
- app_id:
+ access_key_id:
type: string
bucket_name:
type: string
- path_prefix:
- type: string
- provider:
- type: string
- region:
- type: string
- secret_id:
+ endpoint:
type: string
- secret_key:
+ mode:
+ description: '"docker" or "remote"'
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.StorageEngineConfig:
- properties:
- cos:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig'
- default_provider:
- description: '"local", "minio", "cos", "tos", "s3", "oss"'
+ path_prefix:
type: string
- local:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig'
- minio:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig'
- oss:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig'
- s3:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig'
- tos:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig'
- type: object
- github_com_Tencent_WeKnora_internal_types.StorageProviderConfig:
- properties:
- provider:
- description: '"local", "minio", "cos", "tos", "s3", "oss"'
+ secret_access_key:
type: string
+ use_ssl:
+ type: boolean
type: object
- github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest:
+ types.ModelParameters:
properties:
- invite_code:
- maxLength: 32
- minLength: 8
+ api_key:
type: string
- message:
- maxLength: 500
+ app_id:
+ description: WeKnoraCloud 厂商专用凭证
type: string
- role:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
- description: 'Optional: role the applicant requests (admin/editor/viewer);
- default viewer'
- required:
- - invite_code
- type: object
- github_com_Tencent_WeKnora_internal_types.SyncLog:
- properties:
- created_at:
- description: Creation timestamp (usually same as StartedAt)
+ app_secret:
+ description: AES-256 加密存储,实际承载上游 API Key
type: string
- data_source_id:
- description: Reference to the data source
+ base_url:
type: string
- error_message:
- description: Error details if status is "failed"
+ embedding_parameters:
+ $ref: '#/definitions/types.EmbeddingParameters'
+ extra_config:
+ additionalProperties:
+ type: string
+ description: Provider-specific configuration
+ type: object
+ interface_type:
type: string
- finished_at:
- description: Sync completion time
+ parameter_size:
+ description: Ollama model parameter size (e.g., "7B", "13B", "70B")
type: string
- id:
- description: Unique identifier
+ provider:
+ description: 'Provider identifier: openai, aliyun, zhipu, generic'
type: string
- items_created:
- description: New items created in knowledge base
- type: integer
- items_deleted:
- description: Items deleted from knowledge base
- type: integer
- items_failed:
- description: Items that failed to sync
- type: integer
- items_skipped:
- description: Items skipped (no changes detected)
- type: integer
- items_total:
- description: Total items fetched from source
- type: integer
- items_updated:
- description: Existing items updated
- type: integer
- result:
- description: Detailed sync result (JSON-encoded)
- items:
- type: integer
- type: array
- started_at:
- description: Sync start time
+ supports_vision:
+ description: Whether the model accepts image/multimodal input
+ type: boolean
+ type: object
+ types.ModelSource:
+ enum:
+ - local
+ - remote
+ - aliyun
+ - zhipu
+ - volcengine
+ - deepseek
+ - hunyuan
+ - minimax
+ - openai
+ - gemini
+ - mimo
+ - siliconflow
+ - jina
+ - openrouter
+ - nvidia
+ - novita
+ - azure_openai
+ type: string
+ x-enum-comments:
+ ModelSourceAliyun: Aliyun DashScope model
+ ModelSourceAzureOpenAI: Azure OpenAI model
+ ModelSourceDeepseek: Deepseek model
+ ModelSourceGemini: Gemini model
+ ModelSourceHunyuan: Hunyuan model
+ ModelSourceJina: Jina AI model
+ ModelSourceLocal: Local model
+ ModelSourceMimo: Mimo model
+ ModelSourceMinimax: Minimax mode
+ ModelSourceNovita: Novita AI model
+ ModelSourceNvidia: NVIDIA model
+ ModelSourceOpenAI: OpenAI model
+ ModelSourceOpenRouter: OpenRouter model
+ ModelSourceRemote: Remote model
+ ModelSourceSiliconFlow: SiliconFlow model
+ ModelSourceVolcengine: Volcengine model
+ ModelSourceZhipu: Zhipu model
+ x-enum-descriptions:
+ - Local model
+ - Remote model
+ - Aliyun DashScope model
+ - Zhipu model
+ - Volcengine model
+ - Deepseek model
+ - Hunyuan model
+ - Minimax mode
+ - OpenAI model
+ - Gemini model
+ - Mimo model
+ - SiliconFlow model
+ - Jina AI model
+ - OpenRouter model
+ - NVIDIA model
+ - Novita AI model
+ - Azure OpenAI model
+ x-enum-varnames:
+ - ModelSourceLocal
+ - ModelSourceRemote
+ - ModelSourceAliyun
+ - ModelSourceZhipu
+ - ModelSourceVolcengine
+ - ModelSourceDeepseek
+ - ModelSourceHunyuan
+ - ModelSourceMinimax
+ - ModelSourceOpenAI
+ - ModelSourceGemini
+ - ModelSourceMimo
+ - ModelSourceSiliconFlow
+ - ModelSourceJina
+ - ModelSourceOpenRouter
+ - ModelSourceNvidia
+ - ModelSourceNovita
+ - ModelSourceAzureOpenAI
+ types.ModelType:
+ enum:
+ - Embedding
+ - Rerank
+ - KnowledgeQA
+ - VLLM
+ - ASR
+ type: string
+ x-enum-comments:
+ ModelTypeASR: ASR (Automatic Speech Recognition) model
+ ModelTypeEmbedding: Embedding model
+ ModelTypeKnowledgeQA: KnowledgeQA model
+ ModelTypeRerank: Rerank model
+ ModelTypeVLLM: VLLM model
+ x-enum-descriptions:
+ - Embedding model
+ - Rerank model
+ - KnowledgeQA model
+ - VLLM model
+ - ASR (Automatic Speech Recognition) model
+ x-enum-varnames:
+ - ModelTypeEmbedding
+ - ModelTypeRerank
+ - ModelTypeKnowledgeQA
+ - ModelTypeVLLM
+ - ModelTypeASR
+ types.OIDCAuthURLResponse:
+ properties:
+ authorization_url:
type: string
- status:
- description: 'Sync status: running, success, partial, failed, canceled'
+ provider_display_name:
type: string
- tenant_id:
- description: Tenant ID
- type: integer
- updated_at:
- description: Last update timestamp
+ state:
type: string
+ success:
+ type: boolean
type: object
- github_com_Tencent_WeKnora_internal_types.TOSEngineConfig:
+ types.OIDCConfigResponse:
properties:
- access_key:
- type: string
- bucket_name:
- type: string
- endpoint:
- type: string
- path_prefix:
- type: string
- region:
- type: string
- secret_key:
+ enabled:
+ type: boolean
+ provider_display_name:
type: string
+ success:
+ type: boolean
type: object
- github_com_Tencent_WeKnora_internal_types.OSSEngineConfig:
+ types.OSSEngineConfig:
properties:
access_key:
type: string
@@ -2192,758 +2258,887 @@ definitions:
use_temp_bucket:
type: boolean
type: object
- github_com_Tencent_WeKnora_internal_types.Tenant:
+ types.OrgMemberRole:
+ enum:
+ - admin
+ - editor
+ - viewer
+ type: string
+ x-enum-varnames:
+ - OrgRoleAdmin
+ - OrgRoleEditor
+ - OrgRoleViewer
+ types.OrganizationMemberResponse:
properties:
- agent_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig'
- description: |-
- Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.
- This field is kept for backward compatibility and will be removed in future versions.
- api_key:
- description: API key
- type: string
- business:
- description: Business
- type: string
- chat_history_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig'
- description: 'Chat history config: knowledge base configuration for indexing
- and searching chat messages via vector search'
- context_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig'
- description: Global Context configuration for this tenant (default for all
- sessions)
- conversation_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig'
- description: |-
- Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.
- This field is kept for backward compatibility and will be removed in future versions.
- created_at:
- description: Creation time
+ avatar:
type: string
- deleted_at:
- allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Deletion time
- description:
- description: Description
+ email:
type: string
id:
- description: ID
- type: integer
- name:
- description: Name
type: string
- parser_engine_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig'
- description: Parser engine config overrides (MinerU endpoint, API key, etc.).
- Used when parsing documents; overrides env.
- retrieval_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig'
- description: 'Retrieval config: global search/retrieval parameters shared
- by knowledge search and message search'
- retriever_engines:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines'
- description: Retriever engines
- status:
- description: Status
+ joined_at:
type: string
- storage_engine_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig'
- description: 'Storage engine config: parameters for Local, MinIO, COS. Used
- for document/file storage and docreader.'
- storage_quota:
- description: Storage quota (Bytes), default is 10GB, including vector, original
- file, text, index, etc.
- type: integer
- storage_used:
- description: Storage used (Bytes)
- type: integer
- updated_at:
- description: Last updated time
+ role:
type: string
- web_search_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig'
- description: Global WebSearch configuration for this tenant
- type: object
- github_com_Tencent_WeKnora_internal_types.ToolCall:
- properties:
- args:
- additionalProperties: true
- description: Tool arguments
- type: object
- duration:
- description: Execution time in milliseconds
+ tenant_id:
type: integer
- id:
- description: Function call ID from LLM
- type: string
- name:
- description: Tool name
+ user_id:
type: string
- reflection:
- description: Agent's reflection on this tool call result (if enabled)
+ username:
type: string
- result:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult'
- description: Execution result (contains Output)
type: object
- github_com_Tencent_WeKnora_internal_types.ToolResult:
+ types.OrganizationResponse:
properties:
- data:
- additionalProperties: true
- description: Structured data for programmatic use
- type: object
- error:
- description: Error message if execution failed
+ agent_share_count:
+ description: 共享到该组织的智能体数量
+ type: integer
+ avatar:
type: string
- images:
- description: Base64 data URIs from tool (e.g. MCP image content)
- items:
- type: string
- type: array
- output:
- description: Human-readable output
+ created_at:
type: string
- success:
- description: Whether the tool executed successfully
+ description:
+ type: string
+ has_pending_upgrade:
+ description: 当前用户是否有待处理的权限升级申请
type: boolean
- type: object
- github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest:
- properties:
- role:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
- required:
- - role
- type: object
- github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest:
- properties:
- avatar:
- description: optional avatar URL
- maxLength: 512
+ id:
type: string
- description:
- maxLength: 1000
+ invite_code:
+ type: string
+ invite_code_expires_at:
type: string
invite_code_validity_days:
- description: 0=never, 1, 7, 30
+ type: integer
+ is_owner:
+ type: boolean
+ member_count:
type: integer
member_limit:
- description: max members; 0=unlimited
+ description: 0 = unlimited
type: integer
+ my_role:
+ type: string
name:
- maxLength: 255
- minLength: 1
type: string
+ owner_id:
+ type: string
+ pending_join_request_count:
+ description: 待审批加入申请数(仅管理员可见)
+ type: integer
require_approval:
type: boolean
searchable:
- description: open for search so others can discover and join
- type: boolean
- type: object
- github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest:
- properties:
- permission:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
- required:
- - permission
- type: object
- github_com_Tencent_WeKnora_internal_types.User:
- properties:
- avatar:
- description: Avatar URL of the user
- type: string
- can_access_all_tenants:
- description: Whether the user can access all tenants (cross-tenant access)
- type: boolean
- created_at:
- description: Creation time of the user
- type: string
- deleted_at:
- allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Deletion time of the user
- email:
- description: Email address of the user
- type: string
- id:
- description: Unique identifier of the user
- type: string
- is_active:
- description: Whether the user is active
type: boolean
- tenant:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
- description: Association relationship, not stored in the database
- tenant_id:
- description: Tenant ID that the user belongs to
+ share_count:
+ description: 共享到该组织的知识库数量
type: integer
updated_at:
- description: Last updated time of the user
- type: string
- username:
- description: Username of the user
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.VLMConfig:
+ types.ParserEngineConfig:
properties:
- api_key:
- description: API Key
+ mineru_api_key:
+ description: MinerU 云 API Key
+ type: string
+ mineru_cloud_enable_formula:
+ type: boolean
+ mineru_cloud_enable_ocr:
+ type: boolean
+ mineru_cloud_enable_table:
+ type: boolean
+ mineru_cloud_language:
type: string
- base_url:
- description: Base URL
+ mineru_cloud_model:
+ description: MinerU 云 API 解析参数
type: string
- enabled:
+ mineru_enable_formula:
type: boolean
- interface_type:
- description: 'Interface Type: "ollama" or "openai"'
+ mineru_enable_ocr:
+ type: boolean
+ mineru_enable_table:
+ type: boolean
+ mineru_endpoint:
+ description: MinerU 自建服务端点
type: string
- model_id:
+ mineru_language:
type: string
- model_name:
- description: |-
- 兼容老版本
- Model Name
+ mineru_model:
+ description: MinerU 自建解析参数
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.WebSearchConfig:
+ types.ParserEngineRule:
properties:
- api_key:
- description: API密钥(如果需要)
+ engine:
type: string
- blacklist:
- description: 黑名单规则列表
+ file_types:
items:
type: string
type: array
- compression_method:
- description: 压缩方法:none, summary, extract, rag
- type: string
- document_fragments:
- description: 文档片段数量(用于RAG压缩)
- type: integer
- embedding_dimension:
- description: 嵌入维度(用于RAG压缩)
- type: integer
- embedding_model_id:
- description: RAG压缩相关配置
- type: string
- include_date:
- description: 是否包含日期
+ type: object
+ types.QuestionGenerationConfig:
+ properties:
+ enabled:
type: boolean
- max_results:
- description: 最大搜索结果数
+ question_count:
+ description: 'Number of questions to generate per chunk (default: 3, max:
+ 10)'
type: integer
- provider:
- description: 搜索引擎提供商ID
+ type: object
+ types.RegisterRequest:
+ properties:
+ email:
type: string
- rerank_model_id:
- description: 重排模型ID(用于RAG压缩)
+ password:
+ minLength: 6
+ type: string
+ username:
+ maxLength: 50
+ minLength: 2
type: string
+ required:
+ - email
+ - password
+ - username
type: object
- gorm.DeletedAt:
+ types.RegisterResponse:
properties:
- time:
+ message:
type: string
- valid:
- description: Valid is true if Time is not NULL
+ success:
type: boolean
+ tenant:
+ $ref: '#/definitions/types.Tenant'
+ user:
+ $ref: '#/definitions/types.User'
type: object
- internal_handler.CopyKnowledgeBaseRequest:
+ types.RequestRoleUpgradeRequest:
properties:
- source_id:
- type: string
- target_id:
- type: string
- task_id:
+ message:
+ description: Optional message explaining the reason
+ maxLength: 500
type: string
+ requested_role:
+ allOf:
+ - $ref: '#/definitions/types.OrgMemberRole'
+ description: The role user wants to upgrade to
required:
- - source_id
+ - requested_role
type: object
- internal_handler.CreateAgentRequest:
+ types.Resource:
properties:
- avatar:
- type: string
- config:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig'
description:
+ description: Optional description
+ type: string
+ external_id:
+ description: Unique identifier in the external system
+ type: string
+ has_children:
+ description: Whether this resource has children that can be expanded
+ type: boolean
+ metadata:
+ additionalProperties: true
+ description: Additional metadata
+ type: object
+ modified_at:
+ description: Last modified time in external system
type: string
name:
+ description: Display name
+ type: string
+ parent_id:
+ description: For hierarchical resources (parent ID if applicable)
+ type: string
+ type:
+ description: Resource type (document, folder, space, page, etc.)
+ type: string
+ url:
+ description: URL to access in external system
type: string
- required:
- - name
type: object
- internal_handler.CreateModelRequest:
+ types.ResourceCountsByOrgResponse:
properties:
- description:
+ agents:
+ properties:
+ by_organization:
+ additionalProperties:
+ type: integer
+ type: object
+ type: object
+ knowledge_bases:
+ properties:
+ by_organization:
+ additionalProperties:
+ type: integer
+ type: object
+ type: object
+ type: object
+ types.RetrievalConfig:
+ properties:
+ embedding_top_k:
+ description: 'EmbeddingTopK is the maximum number of chunks returned by vector
+ search (default: 50)'
+ type: integer
+ keyword_threshold:
+ description: 'KeywordThreshold is the minimum keyword match score (0-1, default:
+ 0.3)'
+ type: number
+ rerank_model_id:
+ description: RerankModelID is the ID of the rerank model to use (required
+ for search)
type: string
- name:
+ rerank_threshold:
+ description: 'RerankThreshold is the minimum rerank score (-10 to 10, default:
+ 0.2)'
+ type: number
+ rerank_top_k:
+ description: 'RerankTopK is the maximum number of results after reranking
+ (default: 10)'
+ type: integer
+ vector_threshold:
+ description: 'VectorThreshold is the minimum vector similarity score (0-1,
+ default: 0.15)'
+ type: number
+ type: object
+ types.RetrieverEngineParams:
+ properties:
+ retriever_engine_type:
+ allOf:
+ - $ref: '#/definitions/types.RetrieverEngineType'
+ description: Retriever engine type
+ retriever_type:
+ allOf:
+ - $ref: '#/definitions/types.RetrieverType'
+ description: Retriever type
+ type: object
+ types.RetrieverEngineType:
+ enum:
+ - postgres
+ - elasticsearch
+ - infinity
+ - elasticfaiss
+ - qdrant
+ - milvus
+ - weaviate
+ - sqlite
+ type: string
+ x-enum-varnames:
+ - PostgresRetrieverEngineType
+ - ElasticsearchRetrieverEngineType
+ - InfinityRetrieverEngineType
+ - ElasticFaissRetrieverEngineType
+ - QdrantRetrieverEngineType
+ - MilvusRetrieverEngineType
+ - WeaviateRetrieverEngineType
+ - SQLiteRetrieverEngineType
+ types.RetrieverEngines:
+ properties:
+ engines:
+ items:
+ $ref: '#/definitions/types.RetrieverEngineParams'
+ type: array
+ type: object
+ types.RetrieverType:
+ enum:
+ - keywords
+ - vector
+ - websearch
+ type: string
+ x-enum-comments:
+ KeywordsRetrieverType: Keywords retriever
+ VectorRetrieverType: Vector retriever
+ WebSearchRetrieverType: Web search retriever
+ x-enum-descriptions:
+ - Keywords retriever
+ - Vector retriever
+ - Web search retriever
+ x-enum-varnames:
+ - KeywordsRetrieverType
+ - VectorRetrieverType
+ - WebSearchRetrieverType
+ types.ReviewJoinRequestRequest:
+ properties:
+ approved:
+ type: boolean
+ message:
+ maxLength: 500
type: string
- parameters:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters'
- source:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource'
- type:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
- required:
- - name
- - parameters
- - source
- - type
+ role:
+ allOf:
+ - $ref: '#/definitions/types.OrgMemberRole'
+ description: 'Optional: role to assign when approving; overrides applicant''s
+ requested role'
type: object
- internal_handler.DeleteTagRequest:
+ types.S3EngineConfig:
properties:
- exclude_ids:
- description: Chunk seq_ids to exclude from deletion
+ access_key:
+ type: string
+ bucket_name:
+ type: string
+ endpoint:
+ type: string
+ path_prefix:
+ type: string
+ region:
+ type: string
+ secret_key:
+ type: string
+ type: object
+ types.SearchParams:
+ properties:
+ disable_keywords_match:
+ type: boolean
+ disable_vector_match:
+ type: boolean
+ keyword_threshold:
+ type: number
+ knowledge_base_ids:
+ description: |-
+ KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,
+ allowing a single retrieval call to span multiple KBs that share the
+ same embedding model. When empty, HybridSearch uses its own id parameter.
+ items:
+ type: string
+ type: array
+ knowledge_ids:
+ items:
+ type: string
+ type: array
+ match_count:
+ type: integer
+ only_recommended:
+ type: boolean
+ query_embedding:
items:
- type: integer
+ type: number
type: array
- type: object
- internal_handler.EvaluationRequest:
- properties:
- chat_id:
- description: ID of chat model to use
- type: string
- dataset_id:
- description: ID of dataset to evaluate
- type: string
- knowledge_base_id:
- description: ID of knowledge base to use
- type: string
- rerank_id:
- description: ID of rerank model to use
- type: string
- type: object
- internal_handler.FabriTextRequest:
- properties:
- model_id:
+ query_text:
type: string
- tags:
+ skip_context_enrichment:
+ description: |-
+ SkipContextEnrichment skips fetching parent, nearby, and relation chunks
+ in processSearchResults. Used by the chat pipeline where context assembly
+ is handled separately in the merge stage.
+ type: boolean
+ tag_ids:
+ description: Tag IDs for filtering (used for FAQ priority filtering)
items:
type: string
type: array
- required:
- - model_id
+ vector_threshold:
+ type: number
type: object
- internal_handler.GetStorageEngineStatusResponse:
+ types.SearchResult:
properties:
- engines:
+ chunk_index:
+ description: Chunk index
+ type: integer
+ chunk_metadata:
+ description: ChunkMetadata stores chunk-level metadata (e.g., generated questions)
items:
- $ref: '#/definitions/internal_handler.StorageEngineStatusItem'
+ type: integer
type: array
- minio_env_available:
- type: boolean
- type: object
- internal_handler.GetSystemInfoResponse:
- properties:
- build_time:
+ chunk_type:
+ description: Chunk 类型
type: string
- commit_id:
+ content:
+ description: Content
type: string
- db_version:
+ end_at:
+ description: End at
+ type: integer
+ id:
+ description: ID
type: string
- edition:
+ image_info:
+ description: 图片信息 (JSON 格式)
type: string
- go_version:
+ knowledge_base_id:
+ description: KnowledgeBaseID is the ID of the knowledge base this result belongs
+ to
type: string
- graph_database_engine:
+ knowledge_channel:
+ description: KnowledgeChannel indicates through which channel the knowledge
+ was ingested (web, api, wechat, etc.)
type: string
- keyword_index_engine:
+ knowledge_description:
+ description: KnowledgeDescription is the description of the knowledge document
type: string
- minio_enabled:
- type: boolean
- vector_store_engine:
+ knowledge_filename:
+ description: |-
+ Knowledge file name
+ Used for file type knowledge, contains the original file name
type: string
- version:
+ knowledge_id:
+ description: Knowledge ID
type: string
- type: object
- internal_handler.KBModelConfigRequest:
- properties:
- documentSplitting:
- description: 文档分块配置
- properties:
- childChunkSize:
- type: integer
- chunkOverlap:
- type: integer
- chunkSize:
- type: integer
- enableParentChild:
- type: boolean
- parentChunkSize:
- type: integer
- parserEngineRules:
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule'
- type: array
- separators:
- items:
- type: string
- type: array
- type: object
- embeddingModelId:
+ knowledge_source:
+ description: |-
+ Knowledge source
+ Used to indicate the source of the knowledge, such as "url"
type: string
- llmModelId:
+ knowledge_title:
+ description: Knowledge title
type: string
- multimodal:
- description: 多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)
- properties:
- enabled:
- type: boolean
- type: object
- nodeExtract:
- description: 知识图谱配置
- properties:
- enabled:
- type: boolean
- nodes:
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode'
- type: array
- relations:
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation'
- type: array
- tags:
- items:
- type: string
- type: array
- text:
- type: string
- type: object
- questionGeneration:
- description: 问题生成配置
- properties:
- enabled:
- type: boolean
- questionCount:
- type: integer
+ match_type:
+ allOf:
+ - $ref: '#/definitions/types.MatchType'
+ description: Match type
+ matched_content:
+ description: |-
+ MatchedContent is the actual content that was matched in vector search
+ For FAQ: this is the matched question text (standard or similar question)
+ type: string
+ metadata:
+ additionalProperties:
+ type: string
+ description: Metadata
type: object
- storageProvider:
- description: 存储引擎选择("local" | "minio" | "cos"),影响文档上传与文档内图片存储,参数从全局设置读取
+ parent_chunk_id:
+ description: 父 Chunk ID
type: string
- vlm_config:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig'
- required:
- - embeddingModelId
- - llmModelId
- type: object
- internal_handler.ListMinioBucketsResponse:
- properties:
- buckets:
+ score:
+ description: Score
+ type: number
+ seq:
+ description: Seq
+ type: integer
+ start_at:
+ description: Start at
+ type: integer
+ sub_chunk_id:
+ description: SubChunkIndex
items:
- $ref: '#/definitions/internal_handler.MinioBucketInfo'
+ type: string
type: array
type: object
- internal_handler.MinioBucketInfo:
+ types.Session:
properties:
created_at:
type: string
- name:
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ description:
+ description: Description
type: string
- policy:
- description: '"public", "private", "custom"'
+ id:
+ description: ID
type: string
- type: object
- internal_handler.RemoteModelCheckRequest:
- properties:
- apiKey:
+ tenant_id:
+ description: Tenant ID
+ type: integer
+ title:
+ description: Title
type: string
- baseUrl:
+ updated_at:
type: string
- modelName:
+ type: object
+ types.ShareKnowledgeBaseRequest:
+ properties:
+ organization_id:
type: string
+ permission:
+ $ref: '#/definitions/types.OrgMemberRole'
required:
- - baseUrl
- - modelName
+ - organization_id
+ - permission
type: object
- internal_handler.SearchMessagesRequest:
+ types.StorageConfig:
properties:
- limit:
- description: 'Maximum number of results to return (default: 20)'
- type: integer
- mode:
- description: 'Search mode: "keyword", "vector", "hybrid" (default: "hybrid")'
+ app_id:
type: string
- query:
- description: Query text for search
+ bucket_name:
+ type: string
+ path_prefix:
+ type: string
+ provider:
+ type: string
+ region:
+ type: string
+ secret_id:
+ type: string
+ secret_key:
type: string
- session_ids:
- description: Filter by specific session IDs (optional)
- items:
- type: string
- type: array
- required:
- - query
type: object
- internal_handler.StorageCheckRequest:
+ types.StorageEngineConfig:
properties:
cos:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig'
- minio:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig'
- provider:
- description: '"minio", "cos", "tos", "s3", or "oss"'
+ $ref: '#/definitions/types.COSEngineConfig'
+ default_provider:
+ description: '"local", "minio", "cos", "tos", "s3", "oss"'
type: string
+ local:
+ $ref: '#/definitions/types.LocalEngineConfig'
+ minio:
+ $ref: '#/definitions/types.MinIOEngineConfig'
oss:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig'
+ $ref: '#/definitions/types.OSSEngineConfig'
s3:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig'
+ $ref: '#/definitions/types.S3EngineConfig'
tos:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig'
- type: object
- internal_handler.StorageCheckResponse:
- properties:
- bucket_created:
- type: boolean
- message:
- type: string
- ok:
- type: boolean
- type: object
- internal_handler.StorageEngineStatusItem:
- properties:
- available:
- description: whether the engine can be used
- type: boolean
- description:
- description: short description for UI
- type: string
- name:
+ $ref: '#/definitions/types.TOSEngineConfig'
+ type: object
+ types.StorageProviderConfig:
+ properties:
+ provider:
description: '"local", "minio", "cos", "tos", "s3", "oss"'
type: string
type: object
- internal_handler.TextRelationExtractionRequest:
+ types.SubmitJoinRequestRequest:
properties:
- model_id:
+ invite_code:
+ maxLength: 32
+ minLength: 8
type: string
- tags:
- items:
- type: string
- type: array
- text:
+ message:
+ maxLength: 500
type: string
+ role:
+ allOf:
+ - $ref: '#/definitions/types.OrgMemberRole'
+ description: 'Optional: role the applicant requests (admin/editor/viewer);
+ default viewer'
required:
- - model_id
- - tags
- - text
+ - invite_code
type: object
- internal_handler.UpdateAgentRequest:
+ types.SyncLog:
properties:
- avatar:
+ created_at:
+ description: Creation timestamp (usually same as StartedAt)
type: string
- config:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig'
- description:
+ data_source_id:
+ description: Reference to the data source
type: string
- name:
+ error_message:
+ description: Error details if status is "failed"
type: string
- type: object
- internal_handler.UpdateChunkRequest:
- properties:
- chunk_index:
- type: integer
- content:
+ finished_at:
+ description: Sync completion time
type: string
- embedding:
+ id:
+ description: Unique identifier
+ type: string
+ items_created:
+ description: New items created in knowledge base
+ type: integer
+ items_deleted:
+ description: Items deleted from knowledge base
+ type: integer
+ items_failed:
+ description: Items that failed to sync
+ type: integer
+ items_skipped:
+ description: Items skipped (no changes detected)
+ type: integer
+ items_total:
+ description: Total items fetched from source
+ type: integer
+ items_updated:
+ description: Existing items updated
+ type: integer
+ result:
+ description: Detailed sync result (JSON-encoded)
items:
- type: number
+ type: integer
type: array
- end_at:
- type: integer
- image_info:
+ started_at:
+ description: Sync start time
type: string
- is_enabled:
- type: boolean
- start_at:
+ status:
+ description: 'Sync status: running, success, partial, failed, canceled'
+ type: string
+ tenant_id:
+ description: Tenant ID
type: integer
+ updated_at:
+ description: Last update timestamp
+ type: string
type: object
- internal_handler.UpdateKnowledgeBaseRequest:
+ types.TOSEngineConfig:
properties:
- config:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig'
- description:
+ access_key:
type: string
- name:
+ bucket_name:
+ type: string
+ endpoint:
+ type: string
+ path_prefix:
+ type: string
+ region:
+ type: string
+ secret_key:
type: string
- required:
- - name
type: object
- internal_handler.UpdateModelRequest:
+ types.Tenant:
properties:
+ agent_config:
+ allOf:
+ - $ref: '#/definitions/types.AgentConfig'
+ description: |-
+ Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.
+ This field is kept for backward compatibility and will be removed in future versions.
+ api_key:
+ description: API key
+ type: string
+ business:
+ description: Business
+ type: string
+ chat_history_config:
+ allOf:
+ - $ref: '#/definitions/types.ChatHistoryConfig'
+ description: 'Chat history config: knowledge base configuration for indexing
+ and searching chat messages via vector search'
+ context_config:
+ allOf:
+ - $ref: '#/definitions/types.ContextConfig'
+ description: Global Context configuration for this tenant (default for all
+ sessions)
+ conversation_config:
+ allOf:
+ - $ref: '#/definitions/types.ConversationConfig'
+ description: |-
+ Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.
+ This field is kept for backward compatibility and will be removed in future versions.
+ created_at:
+ description: Creation time
+ type: string
+ credentials:
+ allOf:
+ - $ref: '#/definitions/types.CredentialsConfig'
+ description: 'Credentials config: third-party provider credentials (e.g. WeKnoraCloud
+ AppID/AppSecret)'
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time
description:
+ description: Description
type: string
+ id:
+ description: ID
+ type: integer
name:
+ description: Name
type: string
- parameters:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters'
- source:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource'
- type:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
- type: object
- internal_handler.addSimilarQuestionsRequest:
- properties:
- similar_questions:
- items:
- type: string
- minItems: 1
- type: array
- required:
- - similar_questions
+ parser_engine_config:
+ allOf:
+ - $ref: '#/definitions/types.ParserEngineConfig'
+ description: Parser engine config overrides (MinerU endpoint, API key, etc.).
+ Used when parsing documents; overrides env.
+ retrieval_config:
+ allOf:
+ - $ref: '#/definitions/types.RetrievalConfig'
+ description: 'Retrieval config: global search/retrieval parameters shared
+ by knowledge search and message search'
+ retriever_engines:
+ allOf:
+ - $ref: '#/definitions/types.RetrieverEngines'
+ description: Retriever engines
+ status:
+ description: Status
+ type: string
+ storage_engine_config:
+ allOf:
+ - $ref: '#/definitions/types.StorageEngineConfig'
+ description: 'Storage engine config: parameters for Local, MinIO, COS. Used
+ for document/file storage and docreader.'
+ storage_quota:
+ description: Storage quota (Bytes), default is 10GB, including vector, original
+ file, text, index, etc.
+ type: integer
+ storage_used:
+ description: Storage used (Bytes)
+ type: integer
+ updated_at:
+ description: Last updated time
+ type: string
+ web_search_config:
+ allOf:
+ - $ref: '#/definitions/types.WebSearchConfig'
+ description: Global WebSearch configuration for this tenant
type: object
- internal_handler.updateLastFAQImportResultDisplayStatusRequest:
+ types.ToolCall:
properties:
- display_status:
- enum:
- - open
- - close
+ args:
+ additionalProperties: true
+ description: Tool arguments
+ type: object
+ duration:
+ description: Execution time in milliseconds
+ type: integer
+ id:
+ description: Function call ID from LLM
type: string
- required:
- - display_status
+ name:
+ description: Tool name
+ type: string
+ reflection:
+ description: Agent's reflection on this tool call result (if enabled)
+ type: string
+ result:
+ allOf:
+ - $ref: '#/definitions/types.ToolResult'
+ description: Execution result (contains Output)
type: object
- internal_handler_session.CreateKnowledgeQARequest:
+ types.ToolResult:
properties:
- agent_enabled:
- description: Whether agent mode is enabled for this request
- type: boolean
- agent_id:
- description: Selected custom agent ID (backend resolves shared agent and its
- tenant from share relation)
- type: string
- channel:
- description: 'Source channel: "web", "api", "im", etc.'
+ data:
+ additionalProperties: true
+ description: Structured data for programmatic use
+ type: object
+ error:
+ description: Error message if execution failed
type: string
- disable_title:
- description: Whether to disable auto title generation
- type: boolean
- enable_memory:
- description: Whether memory feature is enabled for this request
- type: boolean
images:
- description: Attached images for multimodal chat
- items:
- $ref: '#/definitions/internal_handler_session.ImageAttachment'
- type: array
- knowledge_base_ids:
- description: Selected knowledge base ID for this request
- items:
- type: string
- type: array
- knowledge_ids:
- description: Selected knowledge ID for this request
+ description: Base64 data URIs from tool (e.g. MCP image content)
items:
type: string
type: array
- mentioned_items:
- description: '@mentioned knowledge bases and files'
- items:
- $ref: '#/definitions/internal_handler_session.MentionedItemRequest'
- type: array
- query:
- description: Query text for knowledge base search
- type: string
- summary_model_id:
- description: Optional summary model ID for this request (overrides session
- default)
+ output:
+ description: Human-readable output
type: string
- web_search_enabled:
- description: Whether web search is enabled for this request
+ success:
+ description: Whether the tool executed successfully
type: boolean
+ type: object
+ types.UpdateMemberRoleRequest:
+ properties:
+ role:
+ $ref: '#/definitions/types.OrgMemberRole'
required:
- - query
+ - role
type: object
- internal_handler_session.CreateSessionRequest:
+ types.UpdateOrganizationRequest:
properties:
+ avatar:
+ description: optional avatar URL
+ maxLength: 512
+ type: string
description:
- description: Description for the session (optional)
+ maxLength: 1000
type: string
- title:
- description: Title for the session (optional)
+ invite_code_validity_days:
+ description: 0=never, 1, 7, 30
+ type: integer
+ member_limit:
+ description: max members; 0=unlimited
+ type: integer
+ name:
+ maxLength: 255
+ minLength: 1
type: string
+ require_approval:
+ type: boolean
+ searchable:
+ description: open for search so others can discover and join
+ type: boolean
type: object
- internal_handler_session.GenerateTitleRequest:
+ types.UpdateSharePermissionRequest:
properties:
- messages:
- description: Messages to use as context for title generation
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Message'
- type: array
+ permission:
+ $ref: '#/definitions/types.OrgMemberRole'
required:
- - messages
+ - permission
type: object
- internal_handler_session.ImageAttachment:
+ types.User:
properties:
- caption:
- description: VLM analysis result (context-aware, single call)
+ avatar:
+ description: Avatar URL of the user
type: string
- data:
- description: base64 data URI from frontend (data:image/png;base64,...)
+ can_access_all_tenants:
+ description: Whether the user can access all tenants (cross-tenant access)
+ type: boolean
+ created_at:
+ description: Creation time of the user
type: string
- url:
- description: serving URL after saving to storage
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time of the user
+ email:
+ description: Email address of the user
type: string
- type: object
- internal_handler_session.MentionedItemRequest:
- properties:
id:
+ description: Unique identifier of the user
type: string
- kb_type:
- description: '"document" or "faq" (only for kb type)'
- type: string
- name:
+ is_active:
+ description: Whether the user is active
+ type: boolean
+ tenant:
+ allOf:
+ - $ref: '#/definitions/types.Tenant'
+ description: Association relationship, not stored in the database
+ tenant_id:
+ description: Tenant ID that the user belongs to
+ type: integer
+ updated_at:
+ description: Last updated time of the user
type: string
- type:
- description: '"kb" for knowledge base, "file" for file'
+ username:
+ description: Username of the user
type: string
type: object
- internal_handler_session.SearchKnowledgeRequest:
+ types.VLMConfig:
properties:
- knowledge_base_id:
- description: Single knowledge base ID (for backward compatibility)
+ api_key:
+ description: API Key
type: string
- knowledge_base_ids:
- description: IDs of knowledge bases to search (multi-KB support)
- items:
- type: string
- type: array
- knowledge_ids:
- description: IDs of specific knowledge (files) to search
- items:
- type: string
- type: array
- query:
- description: Query text to search for
+ base_url:
+ description: Base URL
+ type: string
+ enabled:
+ type: boolean
+ interface_type:
+ description: 'Interface Type: "ollama" or "openai"'
+ type: string
+ model_id:
+ type: string
+ model_name:
+ description: |-
+ 兼容老版本
+ Model Name
type: string
- required:
- - query
type: object
- internal_handler_session.StopSessionRequest:
+ types.WeKnoraCloudCredentials:
properties:
- message_id:
+ app_id:
+ type: string
+ app_secret:
type: string
- required:
- - message_id
type: object
- internal_handler_session.batchDeleteRequest:
+ types.WebSearchConfig:
properties:
- delete_all:
- type: boolean
- ids:
+ api_key:
+ description: 'Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.'
+ type: string
+ blacklist:
+ description: 黑名单规则列表
items:
type: string
type: array
+ compression_method:
+ description: 压缩方法:none, summary, extract, rag
+ type: string
+ document_fragments:
+ description: 文档片段数量(用于RAG压缩)
+ type: integer
+ embedding_dimension:
+ description: 嵌入维度(用于RAG压缩)
+ type: integer
+ embedding_model_id:
+ description: RAG压缩相关配置
+ type: string
+ include_date:
+ description: 是否包含日期
+ type: boolean
+ max_results:
+ description: 最大搜索结果数
+ type: integer
+ provider:
+ description: 'Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.'
+ type: string
+ rerank_model_id:
+ description: 重排模型ID(用于RAG压缩)
+ type: string
type: object
info:
contact:
@@ -2970,7 +3165,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -2987,7 +3182,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.CreateAgentRequest'
+ $ref: '#/definitions/handler.CreateAgentRequest'
produces:
- application/json
responses:
@@ -2999,7 +3194,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3028,15 +3223,15 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"403":
description: 无法删除内置智能体
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 智能体不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3064,11 +3259,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 智能体不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3090,7 +3285,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.UpdateAgentRequest'
+ $ref: '#/definitions/handler.UpdateAgentRequest'
produces:
- application/json
responses:
@@ -3102,11 +3297,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"403":
description: 无法修改内置智能体
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3135,11 +3330,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 智能体不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3180,11 +3375,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 智能体不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3226,7 +3421,7 @@ paths:
description: OK
schema:
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ $ref: '#/definitions/types.DataSource'
type: array
"400":
description: Bad Request
@@ -3247,14 +3442,14 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ $ref: '#/definitions/types.DataSource'
produces:
- application/json
responses:
"201":
description: Created
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ $ref: '#/definitions/types.DataSource'
"400":
description: Bad Request
schema:
@@ -3299,7 +3494,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ $ref: '#/definitions/types.DataSource'
"404":
description: Not Found
schema:
@@ -3324,14 +3519,14 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ $ref: '#/definitions/types.DataSource'
produces:
- application/json
responses:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ $ref: '#/definitions/types.DataSource'
"400":
description: Bad Request
schema:
@@ -3365,7 +3560,7 @@ paths:
description: OK
schema:
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog'
+ $ref: '#/definitions/types.SyncLog'
type: array
"400":
description: Bad Request
@@ -3417,7 +3612,7 @@ paths:
description: OK
schema:
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Resource'
+ $ref: '#/definitions/types.Resource'
type: array
"400":
description: Bad Request
@@ -3466,7 +3661,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog'
+ $ref: '#/definitions/types.SyncLog'
"400":
description: Bad Request
schema:
@@ -3516,7 +3711,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog'
+ $ref: '#/definitions/types.SyncLog'
"404":
description: Not Found
schema:
@@ -3536,7 +3731,7 @@ paths:
description: OK
schema:
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata'
+ $ref: '#/definitions/datasource.ConnectorMetadata'
type: array
summary: Get available connectors
tags:
@@ -3571,6 +3766,25 @@ paths:
summary: Test connection with raw credentials (no persistence)
tags:
- DataSource
+ /auth/auto-setup:
+ post:
+ consumes:
+ - application/json
+ description: Lite 版专用:首次启动时自动创建默认用户和租户并返回令牌,后续启动直接签发令牌,免除手动注册/登录流程
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/types.LoginResponse'
+ "403":
+ description: 非 Lite 版本
+ schema:
+ $ref: '#/definitions/errors.AppError'
+ summary: 自动初始化(Lite 桌面版)
+ tags:
+ - 认证
/auth/change-password:
post:
consumes:
@@ -3599,7 +3813,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
summary: 修改密码
@@ -3616,18 +3830,18 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest'
+ $ref: '#/definitions/types.LoginRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse'
+ $ref: '#/definitions/types.LoginResponse'
"401":
description: 认证失败
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
summary: 用户登录
tags:
- 认证
@@ -3647,7 +3861,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
summary: 用户登出
@@ -3669,7 +3883,7 @@ paths:
"401":
description: 未授权
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
summary: 获取当前用户信息
@@ -3712,7 +3926,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse'
+ $ref: '#/definitions/types.OIDCConfigResponse'
summary: 获取OIDC登录配置
tags:
- 认证
@@ -3733,15 +3947,15 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse'
+ $ref: '#/definitions/types.OIDCAuthURLResponse'
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"403":
description: OIDC未启用
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
summary: 获取OIDC授权地址
tags:
- 认证
@@ -3771,7 +3985,7 @@ paths:
"401":
description: 令牌无效
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
summary: 刷新令牌
tags:
- 认证
@@ -3786,22 +4000,22 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest'
+ $ref: '#/definitions/types.RegisterRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse'
+ $ref: '#/definitions/types.RegisterResponse'
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"403":
description: 注册功能已禁用
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
summary: 用户注册
tags:
- 认证
@@ -3821,7 +4035,7 @@ paths:
"401":
description: 令牌无效
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
summary: 验证令牌
@@ -3849,7 +4063,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3887,7 +4101,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3921,11 +4135,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 分块不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3952,7 +4166,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.UpdateChunkRequest'
+ $ref: '#/definitions/handler.UpdateChunkRequest'
produces:
- application/json
responses:
@@ -3964,11 +4178,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 分块不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3997,11 +4211,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 分块不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4039,11 +4253,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 分块不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4072,7 +4286,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4089,7 +4303,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.EvaluationRequest'
+ $ref: '#/definitions/handler.EvaluationRequest'
produces:
- application/json
responses:
@@ -4101,7 +4315,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4130,7 +4344,7 @@ paths:
"404":
description: 任务不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4148,7 +4362,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.TextRelationExtractionRequest'
+ $ref: '#/definitions/handler.TextRelationExtractionRequest'
produces:
- application/json
responses:
@@ -4160,7 +4374,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4194,7 +4408,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.FabriTextRequest'
+ $ref: '#/definitions/handler.FabriTextRequest'
produces:
- application/json
responses:
@@ -4206,7 +4420,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4241,7 +4455,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4270,7 +4484,7 @@ paths:
"404":
description: 知识库不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4292,7 +4506,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.KBModelConfigRequest'
+ $ref: '#/definitions/handler.KBModelConfigRequest'
produces:
- application/json
responses:
@@ -4304,17 +4518,47 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 知识库不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
summary: 更新知识库配置
tags:
- 初始化
+ /initialization/models/asr/check:
+ post:
+ consumes:
+ - application/json
+ description: 检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点
+ parameters:
+ - description: ASR检查请求
+ in: body
+ name: request
+ required: true
+ schema:
+ type: object
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 检查结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 检查ASR模型
+ tags:
+ - 初始化
/initialization/models/embedding/test:
post:
consumes:
@@ -4338,7 +4582,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4356,7 +4600,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.RemoteModelCheckRequest'
+ $ref: '#/definitions/handler.RemoteModelCheckRequest'
produces:
- application/json
responses:
@@ -4368,7 +4612,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4398,7 +4642,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4450,7 +4694,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4479,7 +4723,7 @@ paths:
"404":
description: 任务不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4521,7 +4765,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4556,7 +4800,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4589,7 +4833,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4633,7 +4877,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4650,7 +4894,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase'
+ $ref: '#/definitions/types.KnowledgeBase'
produces:
- application/json
responses:
@@ -4662,7 +4906,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4691,7 +4935,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4723,11 +4967,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 知识库不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4749,7 +4993,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.UpdateKnowledgeBaseRequest'
+ $ref: '#/definitions/handler.UpdateKnowledgeBaseRequest'
produces:
- application/json
responses:
@@ -4761,7 +5005,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4801,7 +5045,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4854,7 +5098,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4879,7 +5123,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload'
+ $ref: '#/definitions/types.FAQBatchUpsertPayload'
produces:
- application/json
responses:
@@ -4891,7 +5135,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4925,11 +5169,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 条目不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4956,7 +5200,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload'
+ $ref: '#/definitions/types.FAQEntryPayload'
produces:
- application/json
responses:
@@ -4968,7 +5212,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4996,7 +5240,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.addSimilarQuestionsRequest'
+ $ref: '#/definitions/handler.addSimilarQuestionsRequest'
produces:
- application/json
responses:
@@ -5008,11 +5252,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 条目不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5040,7 +5284,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5063,7 +5307,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate'
+ $ref: '#/definitions/types.FAQEntryFieldsBatchUpdate'
produces:
- application/json
responses:
@@ -5075,7 +5319,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5110,7 +5354,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5133,7 +5377,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload'
+ $ref: '#/definitions/types.FAQEntryPayload'
produces:
- application/json
responses:
@@ -5145,7 +5389,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5168,7 +5412,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.updateLastFAQImportResultDisplayStatusRequest'
+ $ref: '#/definitions/handler.updateLastFAQImportResultDisplayStatusRequest'
produces:
- application/json
responses:
@@ -5180,11 +5424,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 知识库不存在或无导入记录
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5207,7 +5451,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest'
+ $ref: '#/definitions/types.FAQSearchRequest'
produces:
- application/json
responses:
@@ -5219,7 +5463,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5242,7 +5486,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams'
+ $ref: '#/definitions/types.SearchParams'
produces:
- application/json
responses:
@@ -5254,7 +5498,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5283,11 +5527,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"403":
description: 权限不足
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5335,7 +5579,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5381,7 +5625,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"409":
description: 文件重复
schema:
@@ -5409,7 +5653,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload'
+ $ref: '#/definitions/types.ManualKnowledgePayload'
produces:
- application/json
responses:
@@ -5421,7 +5665,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5469,7 +5713,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"409":
description: URL重复
schema:
@@ -5503,7 +5747,7 @@ paths:
"404":
description: 知识库不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5525,7 +5769,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse'
+ $ref: '#/definitions/types.ListSharesResponse'
security:
- Bearer: []
summary: 获取知识库的共享列表
@@ -5546,7 +5790,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest'
+ $ref: '#/definitions/types.ShareKnowledgeBaseRequest'
produces:
- application/json
responses:
@@ -5613,7 +5857,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest'
+ $ref: '#/definitions/types.UpdateSharePermissionRequest'
produces:
- application/json
responses:
@@ -5665,7 +5909,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5706,7 +5950,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5741,7 +5985,7 @@ paths:
in: body
name: body
schema:
- $ref: '#/definitions/internal_handler.DeleteTagRequest'
+ $ref: '#/definitions/handler.DeleteTagRequest'
produces:
- application/json
responses:
@@ -5753,7 +5997,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5792,7 +6036,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5810,7 +6054,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.CopyKnowledgeBaseRequest'
+ $ref: '#/definitions/handler.CopyKnowledgeBaseRequest'
produces:
- application/json
responses:
@@ -5822,7 +6066,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5851,7 +6095,7 @@ paths:
"404":
description: 任务不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5880,7 +6124,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5908,11 +6152,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 知识不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5934,7 +6178,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ $ref: '#/definitions/types.Knowledge'
produces:
- application/json
responses:
@@ -5946,7 +6190,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5974,7 +6218,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6005,7 +6249,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6034,11 +6278,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"403":
description: 权限不足
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6078,7 +6322,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6121,7 +6365,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6144,7 +6388,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload'
+ $ref: '#/definitions/types.ManualKnowledgePayload'
produces:
- application/json
responses:
@@ -6156,7 +6400,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6201,7 +6445,7 @@ paths:
"400":
description: Invalid request
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6231,7 +6475,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6254,7 +6498,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6271,7 +6515,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService'
+ $ref: '#/definitions/types.MCPService'
produces:
- application/json
responses:
@@ -6283,7 +6527,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6312,7 +6556,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6340,7 +6584,7 @@ paths:
"404":
description: 服务不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6374,7 +6618,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6403,7 +6647,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6432,7 +6676,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6461,7 +6705,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6495,7 +6739,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6533,7 +6777,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6570,7 +6814,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.SearchMessagesRequest'
+ $ref: '#/definitions/handler.SearchMessagesRequest'
produces:
- application/json
responses:
@@ -6582,7 +6826,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6605,7 +6849,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6622,7 +6866,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.CreateModelRequest'
+ $ref: '#/definitions/handler.CreateModelRequest'
produces:
- application/json
responses:
@@ -6634,7 +6878,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6663,7 +6907,7 @@ paths:
"404":
description: 模型不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6691,7 +6935,7 @@ paths:
"404":
description: 模型不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6713,7 +6957,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.UpdateModelRequest'
+ $ref: '#/definitions/handler.UpdateModelRequest'
produces:
- application/json
responses:
@@ -6725,7 +6969,7 @@ paths:
"404":
description: 模型不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6765,7 +7009,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse'
+ $ref: '#/definitions/types.ListOrganizationsResponse'
security:
- Bearer: []
summary: 获取我的组织列表
@@ -6781,7 +7025,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest'
+ $ref: '#/definitions/types.CreateOrganizationRequest'
produces:
- application/json
responses:
@@ -6863,7 +7107,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest'
+ $ref: '#/definitions/types.UpdateOrganizationRequest'
produces:
- application/json
responses:
@@ -6897,7 +7141,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.InviteMemberRequest'
+ $ref: '#/definitions/types.InviteMemberRequest'
produces:
- application/json
responses:
@@ -6992,7 +7236,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest'
+ $ref: '#/definitions/types.ReviewJoinRequestRequest'
produces:
- application/json
responses:
@@ -7049,7 +7293,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListMembersResponse'
+ $ref: '#/definitions/types.ListMembersResponse'
security:
- Bearer: []
summary: 获取组织成员列表
@@ -7104,7 +7348,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest'
+ $ref: '#/definitions/types.UpdateMemberRoleRequest'
produces:
- application/json
responses:
@@ -7138,7 +7382,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest'
+ $ref: '#/definitions/types.RequestRoleUpgradeRequest'
produces:
- application/json
responses:
@@ -7251,7 +7495,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse'
+ $ref: '#/definitions/types.ListSharesResponse'
security:
- Bearer: []
summary: 获取组织的共享知识库列表
@@ -7268,7 +7512,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest'
+ $ref: '#/definitions/types.JoinOrganizationRequest'
produces:
- application/json
responses:
@@ -7297,7 +7541,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest'
+ $ref: '#/definitions/types.JoinByOrganizationIDRequest'
produces:
- application/json
responses:
@@ -7326,7 +7570,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest'
+ $ref: '#/definitions/types.SubmitJoinRequestRequest'
produces:
- application/json
responses:
@@ -7421,7 +7665,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7438,7 +7682,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler_session.CreateSessionRequest'
+ $ref: '#/definitions/handler_session.CreateSessionRequest'
produces:
- application/json
responses:
@@ -7450,7 +7694,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7479,7 +7723,7 @@ paths:
"404":
description: 会话不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7507,7 +7751,7 @@ paths:
"404":
description: 会话不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7529,7 +7773,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Session'
+ $ref: '#/definitions/types.Session'
produces:
- application/json
responses:
@@ -7541,7 +7785,7 @@ paths:
"404":
description: 会话不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7570,11 +7814,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 会话不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7597,7 +7841,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler_session.CreateKnowledgeQARequest'
+ $ref: '#/definitions/handler_session.CreateKnowledgeQARequest'
produces:
- text/event-stream
responses:
@@ -7609,7 +7853,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7643,7 +7887,7 @@ paths:
"404":
description: 会话或消息不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7666,7 +7910,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler_session.CreateKnowledgeQARequest'
+ $ref: '#/definitions/handler_session.CreateKnowledgeQARequest'
produces:
- text/event-stream
responses:
@@ -7678,7 +7922,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7701,7 +7945,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler_session.StopSessionRequest'
+ $ref: '#/definitions/handler_session.StopSessionRequest'
produces:
- application/json
responses:
@@ -7713,7 +7957,7 @@ paths:
"404":
description: 会话或消息不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7736,7 +7980,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler_session.GenerateTitleRequest'
+ $ref: '#/definitions/handler_session.GenerateTitleRequest'
produces:
- application/json
responses:
@@ -7748,7 +7992,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7766,7 +8010,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler_session.batchDeleteRequest'
+ $ref: '#/definitions/handler_session.batchDeleteRequest'
produces:
- application/json
responses:
@@ -7778,7 +8022,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7796,7 +8040,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler_session.SearchKnowledgeRequest'
+ $ref: '#/definitions/handler_session.SearchKnowledgeRequest'
produces:
- application/json
responses:
@@ -7808,7 +8052,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7847,7 +8091,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7884,35 +8128,10 @@ paths:
"200":
description: 系统信息
schema:
- $ref: '#/definitions/internal_handler.GetSystemInfoResponse'
+ $ref: '#/definitions/handler.GetSystemInfoResponse'
summary: 获取系统信息
tags:
- 系统
- /system/minio/buckets:
- get:
- consumes:
- - application/json
- description: 获取所有 MinIO 存储桶及其访问权限
- produces:
- - application/json
- responses:
- "200":
- description: 存储桶列表
- schema:
- $ref: '#/definitions/internal_handler.ListMinioBucketsResponse'
- "400":
- description: MinIO 未启用
- schema:
- additionalProperties: true
- type: object
- "500":
- description: 服务器错误
- schema:
- additionalProperties: true
- type: object
- summary: 列出 MinIO 存储桶
- tags:
- - 系统
/system/parser-engines:
get:
produces:
@@ -7956,14 +8175,14 @@ paths:
name: body
required: true
schema:
- $ref: '#/definitions/internal_handler.StorageCheckRequest'
+ $ref: '#/definitions/handler.StorageCheckRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
- $ref: '#/definitions/internal_handler.StorageCheckResponse'
+ $ref: '#/definitions/handler.StorageCheckResponse'
summary: 测试存储引擎连通性
tags:
- 系统
@@ -7976,7 +8195,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/internal_handler.GetStorageEngineStatusResponse'
+ $ref: '#/definitions/handler.GetStorageEngineStatusResponse'
summary: 获取存储引擎状态
tags:
- 系统
@@ -7996,7 +8215,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
summary: 获取租户列表
@@ -8012,7 +8231,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
+ $ref: '#/definitions/types.Tenant'
produces:
- application/json
responses:
@@ -8024,7 +8243,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
summary: 创建租户
@@ -8052,7 +8271,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
summary: 删除租户
@@ -8079,11 +8298,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
"404":
description: 租户不存在
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8105,7 +8324,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
+ $ref: '#/definitions/types.Tenant'
produces:
- application/json
responses:
@@ -8117,7 +8336,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
summary: 更新租户
@@ -8139,7 +8358,7 @@ paths:
"403":
description: 权限不足
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
summary: 获取所有租户列表
@@ -8167,7 +8386,7 @@ paths:
"400":
description: 不支持的键
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8201,7 +8420,7 @@ paths:
"400":
description: 不支持的键
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8224,7 +8443,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8247,7 +8466,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8270,7 +8489,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8293,7 +8512,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8335,32 +8554,276 @@ paths:
"403":
description: 权限不足
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
summary: 搜索租户
tags:
- 租户管理
- /web-search/providers:
+ /vector-stores:
+ get:
+ description: List all vector stores for the current tenant, including environment-configured
+ and user-created stores
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: List of vector stores (env + DB)
+ schema:
+ additionalProperties: true
+ type: object
+ "401":
+ description: Unauthorized
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: List vector stores
+ tags:
+ - VectorStore
+ post:
+ consumes:
+ - application/json
+ description: Create a new vector store configuration for the current tenant
+ parameters:
+ - description: Vector store configuration
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/handler.CreateStoreRequest'
+ produces:
+ - application/json
+ responses:
+ "201":
+ description: Created vector store
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: Invalid request or validation error
+ schema:
+ $ref: '#/definitions/errors.AppError'
+ "401":
+ description: Unauthorized
+ schema:
+ additionalProperties: true
+ type: object
+ "409":
+ description: Duplicate endpoint and index
+ schema:
+ $ref: '#/definitions/errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: Create vector store
+ tags:
+ - VectorStore
+ /vector-stores/{id}:
+ delete:
+ description: Soft-delete a vector store. Env stores cannot be deleted.
+ parameters:
+ - description: Vector store ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: Deletion success
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: Env store cannot be deleted
+ schema:
+ additionalProperties: true
+ type: object
+ "401":
+ description: Unauthorized
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: Vector store not found
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: Delete vector store
+ tags:
+ - VectorStore
get:
+ description: Retrieve a single vector store by ID. Supports both DB stores and
+ env stores (__env_* IDs)
+ parameters:
+ - description: Vector store ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: Vector store details
+ schema:
+ additionalProperties: true
+ type: object
+ "401":
+ description: Unauthorized
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: Vector store not found
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: Get vector store
+ tags:
+ - VectorStore
+ put:
+ consumes:
+ - application/json
+ description: Update a vector store (name only). Engine type, connection config,
+ and index config are immutable. Env stores cannot be modified.
+ parameters:
+ - description: Vector store ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: Updated fields
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/handler.UpdateStoreRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: Updated vector store
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: Env store or validation error
+ schema:
+ additionalProperties: true
+ type: object
+ "401":
+ description: Unauthorized
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: Vector store not found
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: Update vector store
+ tags:
+ - VectorStore
+ /vector-stores/{id}/test:
+ post:
+ description: Test connectivity of an existing saved or env store. Returns detected
+ server version. For DB stores, the version is automatically saved to connection_config.
+ parameters:
+ - description: Vector store ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: Connection test result (success, version)
+ schema:
+ additionalProperties: true
+ type: object
+ "401":
+ description: Unauthorized
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: Vector store not found
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: Test vector store connection by ID
+ tags:
+ - VectorStore
+ /vector-stores/test:
+ post:
consumes:
- application/json
- description: Returns the list of available web search providers from configuration
+ description: Test connectivity using provided credentials without persisting.
+ Returns detected server version.
+ parameters:
+ - description: Engine type and connection config
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/handler.TestStoreRequest'
produces:
- application/json
responses:
"200":
- description: List of providers
+ description: Connection test result (success, version)
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: Invalid request
+ schema:
+ $ref: '#/definitions/errors.AppError'
+ "401":
+ description: Unauthorized
schema:
additionalProperties: true
type: object
security:
- Bearer: []
- ApiKeyAuth: []
- summary: Get available web search providers
+ summary: Test vector store connection with raw credentials
+ tags:
+ - VectorStore
+ /vector-stores/types:
+ get:
+ description: Return supported engine types with connection and index field schemas
+ for UI form generation
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: List of engine types with config schemas
+ schema:
+ additionalProperties: true
+ type: object
+ summary: List vector store types
tags:
- - web-search
+ - VectorStore
securityDefinitions:
ApiKeyAuth:
description: 租户身份认证:输入 sk- 开头的 API Key
diff --git a/frontend/src/api/system/index.ts b/frontend/src/api/system/index.ts
index 35ad2855b..431bcb604 100644
--- a/frontend/src/api/system/index.ts
+++ b/frontend/src/api/system/index.ts
@@ -109,20 +109,6 @@ export function getPromptTemplates(): Promise<{ data: PromptTemplatesConfig }> {
return get('/api/v1/tenants/kv/prompt-templates')
}
-export interface MinioBucketInfo {
- name: string
- policy: 'public' | 'private' | 'custom'
- created_at?: string
-}
-
-export interface ListMinioBucketsResponse {
- buckets: MinioBucketInfo[]
-}
-
-export function listMinioBuckets(): Promise<{ data: ListMinioBucketsResponse }> {
- return get('/api/v1/system/minio/buckets')
-}
-
export interface ParserEngineInfo {
Name: string
Description: string
diff --git a/frontend/src/views/settings/ParserEngineSettings.vue b/frontend/src/views/settings/ParserEngineSettings.vue
index 535161ee0..efa579bcf 100644
--- a/frontend/src/views/settings/ParserEngineSettings.vue
+++ b/frontend/src/views/settings/ParserEngineSettings.vue
@@ -25,195 +25,201 @@
<p class="empty-text">{{ $t('settings.parser.noEngineDetected') }}</p>
</div>
- <template v-else>
+ <div v-else class="engine-cards">
<!-- 当后端未返回 builtin 引擎项时,仍展示 DocReader 状态卡片 -->
- <div v-if="!hasBuiltinEngine" class="engine-item first" data-model-type="builtin">
- <div class="engine-item-header">
- <div class="engine-title-row">
- <h3>builtin</h3>
- <t-tag
- :theme="connected ? 'success' : 'danger'"
- variant="light"
- size="small"
- >{{ connected ? $t('settings.parser.connected') : $t('settings.parser.disconnected') }}</t-tag>
- </div>
- <p>{{ $t('settings.parser.builtinDesc') }}</p>
- </div>
- <div class="docreader-inline">
- <div class="status-line">
- <t-tag
- :theme="connected ? 'success' : 'danger'"
- variant="light"
- size="small"
- >{{ connected ? $t('settings.parser.connected') : $t('settings.parser.disconnected') }}</t-tag>
- <t-tag theme="default" variant="light" size="small">{{ docreaderTransport === 'http' ? 'HTTP' : 'gRPC' }}</t-tag>
- <span v-if="docreaderAddrEnv" class="env-hint">{{ $t('settings.parser.currentAddr') }}: {{ docreaderAddrEnv }}</span>
- </div>
- <p class="docreader-desc">
- {{ $t('settings.parser.envVarHint') }}
- </p>
+ <div
+ v-if="!hasBuiltinEngine"
+ :class="['engine-card', { active: drawerVisible && currentEngine?.Name === 'builtin' }]"
+ @click="openDrawer({ Name: 'builtin' } as any)"
+ >
+ <div class="engine-card-header">
+ <h3>builtin</h3>
+ <t-tag
+ :theme="connected ? 'success' : 'danger'"
+ variant="light"
+ size="small"
+ >{{ connected ? $t('settings.parser.connected') : $t('settings.parser.disconnected') }}</t-tag>
</div>
+ <p class="engine-card-desc">{{ $t('settings.parser.builtinDesc') }}</p>
</div>
<div
- v-for="(engine, idx) in sortedEngines"
+ v-for="engine in sortedEngines"
:key="engine.Name"
- :class="['engine-item', { first: idx === 0 && hasBuiltinEngine }]"
- :data-model-type="engine.Name"
+ :class="['engine-card', { active: drawerVisible && currentEngine?.Name === engine.Name }]"
+ @click="openDrawer(engine)"
>
- <div class="engine-item-header">
- <div class="engine-title-row">
- <h3>{{ getEngineDisplayName(engine.Name) }}</h3>
- <t-tag v-if="engine.Available" theme="success" variant="light" size="small">{{ $t('settings.parser.available') }}</t-tag>
- <t-tooltip v-else-if="engine.UnavailableReason" :content="engine.UnavailableReason" placement="top">
- <t-tag theme="danger" variant="light" size="small" class="tag-with-tooltip">{{ $t('settings.parser.unavailable') }}</t-tag>
- </t-tooltip>
- <t-tag v-else theme="danger" variant="light" size="small">{{ $t('settings.parser.unavailable') }}</t-tag>
- <a
- v-if="engineDocLink(engine.Name)"
- :href="engineDocLink(engine.Name)"
- target="_blank"
- rel="noopener noreferrer"
- class="engine-doc-link"
- >{{ engineDocLabel(engine.Name) }} ↗</a>
- </div>
- <p>{{ getEngineDisplayDesc(engine.Name, engine.Description) }}</p>
+ <div class="engine-card-header">
+ <h3>{{ getEngineDisplayName(engine.Name) }}</h3>
+ <t-tag v-if="engine.Available" theme="success" variant="light" size="small">{{ $t('settings.parser.available') }}</t-tag>
+ <t-tooltip v-else-if="engine.UnavailableReason" :content="engine.UnavailableReason" placement="top">
+ <t-tag theme="danger" variant="light" size="small" class="tag-with-tooltip">{{ $t('settings.parser.unavailable') }}</t-tag>
+ </t-tooltip>
+ <t-tag v-else theme="danger" variant="light" size="small">{{ $t('settings.parser.unavailable') }}</t-tag>
</div>
+ <p class="engine-card-desc">{{ getEngineDisplayDesc(engine.Name, engine.Description) }}</p>
+ </div>
+ </div>
+ </template>
- <!-- builtin: DocReader 连接信息 -->
- <div v-if="engine.Name === 'builtin'" class="docreader-inline">
- <div class="status-line">
- <t-tag v-if="connected" theme="success" variant="light" size="small">{{ $t('settings.parser.connected') }}</t-tag>
- <t-tag v-else theme="danger" variant="light" size="small">{{ $t('settings.parser.disconnected') }}</t-tag>
- <t-tag theme="default" variant="light" size="small">{{ docreaderTransport === 'http' ? 'HTTP' : 'gRPC' }}</t-tag>
- <span v-if="docreaderAddrEnv" class="env-hint">{{ $t('settings.parser.currentAddr') }}: {{ docreaderAddrEnv }}</span>
- </div>
- <p class="docreader-desc">
- {{ $t('settings.parser.envVarHint') }}
- </p>
+ <!-- 配置抽屉 -->
+ <t-drawer
+ v-model:visible="drawerVisible"
+ :header="drawerTitle"
+ size="500px"
+ >
+ <div v-if="currentEngine" class="drawer-content">
+ <div class="engine-info-block">
+ <p class="engine-desc">{{ getEngineDisplayDesc(currentEngine.Name, currentEngine.Description) }}
+ <a
+ v-if="engineDocLink(currentEngine.Name)"
+ :href="engineDocLink(currentEngine.Name)"
+ target="_blank"
+ rel="noopener noreferrer"
+ class="engine-doc-link"
+ >{{ engineDocLabel(currentEngine.Name) }} ↗</a>
+ </p>
+ </div>
+
+ <!-- builtin: DocReader 连接信息 -->
+ <div v-if="currentEngine.Name === 'builtin'" class="docreader-inline">
+ <div class="status-line">
+ <t-tag v-if="connected" theme="success" variant="light" size="small">{{ $t('settings.parser.connected') }}</t-tag>
+ <t-tag v-else theme="danger" variant="light" size="small">{{ $t('settings.parser.disconnected') }}</t-tag>
+ <t-tag theme="default" variant="light" size="small">{{ docreaderTransport === 'http' ? 'HTTP' : 'gRPC' }}</t-tag>
+ <span v-if="docreaderAddrEnv" class="env-hint">{{ $t('settings.parser.currentAddr') }}: {{ docreaderAddrEnv }}</span>
</div>
+ <p class="docreader-desc">
+ {{ $t('settings.parser.envVarHint') }}
+ </p>
+ </div>
- <!-- weknoracloud: 凭证状态 -->
- <template v-if="engine.Name === 'weknoracloud'">
- <div v-if="wkcState === 'configured'" class="wkc-status wkc-status--ok">
- <t-icon name="check-circle" style="font-size: 15px; color: var(--td-success-color); flex-shrink: 0;" />
- <span>{{ $t('settings.weknoraCloud.credentialConfigured') }}</span>
- </div>
- <div v-else-if="wkcState === 'loading'" class="wkc-status">
- <t-loading size="small" />
- <span>{{ $t('settings.weknoraCloud.checkingStatus') }}</span>
- </div>
- <div v-else class="wkc-status wkc-status--warn">
- <t-icon name="error-circle" style="font-size: 15px; color: #f97316; flex-shrink: 0;" />
- <div style="flex: 1;">
- <span v-if="wkcState === 'expired'">{{ $t('settings.weknoraCloud.credentialExpired') }}</span>
- <span v-else>{{ $t('settings.weknoraCloud.unconfigured') }}</span>
- <div style="margin-top: 6px;">
- <t-button
- variant="text"
- size="small"
- theme="primary"
- @click="goToWkcSettings"
- style="padding: 0; height: auto;"
- >{{ $t('settings.weknoraCloud.goToSettings') }}</t-button>
- </div>
+ <!-- weknoracloud: 凭证状态 -->
+ <template v-if="currentEngine.Name === 'weknoracloud'">
+ <div v-if="wkcState === 'configured'" class="wkc-status wkc-status--ok">
+ <t-icon name="check-circle" style="font-size: 15px; color: var(--td-success-color); flex-shrink: 0;" />
+ <span>{{ $t('settings.weknoraCloud.credentialConfigured') }}</span>
+ </div>
+ <div v-else-if="wkcState === 'loading'" class="wkc-status">
+ <t-loading size="small" />
+ <span>{{ $t('settings.weknoraCloud.checkingStatus') }}</span>
+ </div>
+ <div v-else class="wkc-status wkc-status--warn">
+ <t-icon name="error-circle" style="font-size: 15px; color: #f97316; flex-shrink: 0;" />
+ <div style="flex: 1;">
+ <span v-if="wkcState === 'expired'">{{ $t('settings.weknoraCloud.credentialExpired') }}</span>
+ <span v-else>{{ $t('settings.weknoraCloud.unconfigured') }}</span>
+ <div style="margin-top: 6px;">
+ <t-button
+ variant="text"
+ size="small"
+ theme="primary"
+ @click="goToWkcSettings"
+ style="padding: 0; height: auto;"
+ >{{ $t('settings.weknoraCloud.goToSettings') }}</t-button>
</div>
</div>
- </template>
-
- <div v-if="engine.FileTypes && engine.FileTypes.length" class="file-types">
- <t-tag
- v-for="ft in engine.FileTypes"
- :key="ft"
- size="small"
- variant="light"
- theme="default"
- >{{ ft }}</t-tag>
</div>
+ </template>
- <!-- mineru 自建配置 -->
- <div v-if="engine.Name === 'mineru'" class="engine-form">
- <div class="form-field">
- <label>{{ t('settings.parser.selfHostedEndpoint') }}</label>
- <t-input
- v-model="config.mineru_endpoint"
- :placeholder="$t('settings.parser.mineruEndpointPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Backend</label>
- <t-select v-model="config.mineru_model" :placeholder="$t('settings.parser.defaultPipeline')" clearable>
- <t-option value="pipeline" label="pipeline" />
- <t-option value="vlm-auto-engine" label="vlm-auto-engine" />
- <t-option value="vlm-http-client" label="vlm-http-client" />
- <t-option value="hybrid-auto-engine" label="hybrid-auto-engine" />
- <t-option value="hybrid-http-client" label="hybrid-http-client" />
- </t-select>
- </div>
- <div class="form-toggles">
- <t-checkbox v-model="config.mineru_enable_formula">{{ $t('settings.parser.formulaRecognition') }}</t-checkbox>
- <t-checkbox v-model="config.mineru_enable_table">{{ $t('settings.parser.tableRecognition') }}</t-checkbox>
- <t-checkbox v-model="config.mineru_enable_ocr">OCR</t-checkbox>
- </div>
- <div class="form-field">
- <label>{{ t('settings.parser.language') }}</label>
- <t-input
- v-model="config.mineru_language"
- :placeholder="$t('settings.parser.languagePlaceholder')"
- clearable
- />
- </div>
- </div>
+ <div v-if="currentEngine.FileTypes && currentEngine.FileTypes.length" class="file-types">
+ <t-tag
+ v-for="ft in currentEngine.FileTypes"
+ :key="ft"
+ size="small"
+ variant="light"
+ theme="default"
+ >{{ ft }}</t-tag>
+ </div>
- <!-- mineru_cloud 云 API 配置 -->
- <div v-if="engine.Name === 'mineru_cloud'" class="engine-form">
- <div class="form-field">
- <label>API Key</label>
- <t-input
- v-model="config.mineru_api_key"
- type="password"
- :placeholder="$t('settings.parser.mineruCloudApiKeyPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Model Version</label>
- <t-select v-model="config.mineru_cloud_model" :placeholder="$t('settings.parser.defaultPipeline')" clearable>
- <t-option value="pipeline" label="pipeline" />
- <t-option value="vlm" :label="$t('settings.parser.vlmLabel')" />
- <t-option value="MinerU-HTML" :label="$t('settings.parser.mineruHtmlLabel')" />
- </t-select>
- </div>
- <div class="form-toggles">
- <t-checkbox v-model="config.mineru_cloud_enable_formula">{{ $t('settings.parser.formulaRecognition') }}</t-checkbox>
- <t-checkbox v-model="config.mineru_cloud_enable_table">{{ $t('settings.parser.tableRecognition') }}</t-checkbox>
- <t-checkbox v-model="config.mineru_cloud_enable_ocr">OCR</t-checkbox>
- </div>
- <div class="form-field">
- <label>{{ t('settings.parser.language') }}</label>
- <t-input
- v-model="config.mineru_cloud_language"
- :placeholder="$t('settings.parser.languagePlaceholder')"
- clearable
- />
- </div>
+ <!-- mineru 自建配置 -->
+ <div v-if="currentEngine.Name === 'mineru'" class="engine-form">
+ <div class="form-item">
+ <label class="form-label">{{ t('settings.parser.selfHostedEndpoint') }}</label>
+ <t-input
+ v-model="config.mineru_endpoint"
+ :placeholder="$t('settings.parser.mineruEndpointPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Backend</label>
+ <t-select v-model="config.mineru_model" :placeholder="$t('settings.parser.defaultPipeline')" clearable>
+ <t-option value="pipeline" label="pipeline" />
+ <t-option value="vlm-auto-engine" label="vlm-auto-engine" />
+ <t-option value="vlm-http-client" label="vlm-http-client" />
+ <t-option value="hybrid-auto-engine" label="hybrid-auto-engine" />
+ <t-option value="hybrid-http-client" label="hybrid-http-client" />
+ </t-select>
+ </div>
+ <div class="form-toggles">
+ <t-checkbox v-model="config.mineru_enable_formula">{{ $t('settings.parser.formulaRecognition') }}</t-checkbox>
+ <t-checkbox v-model="config.mineru_enable_table">{{ $t('settings.parser.tableRecognition') }}</t-checkbox>
+ <t-checkbox v-model="config.mineru_enable_ocr">OCR</t-checkbox>
+ </div>
+ <div class="form-item" style="margin-top: 16px;">
+ <label class="form-label">{{ t('settings.parser.language') }}</label>
+ <t-input
+ v-model="config.mineru_language"
+ :placeholder="$t('settings.parser.languagePlaceholder')"
+ clearable
+ />
</div>
</div>
- </template>
- <!-- 检测与保存 -->
- <div class="save-bar">
- <t-button theme="default" variant="outline" :loading="checking" @click="onCheck">
- {{ $t('settings.parser.checkWithParams') }}
- </t-button>
- <t-button theme="primary" :loading="saving" @click="onSave">{{ $t('settings.parser.saveConfig') }}</t-button>
- <span v-if="checkMessage" class="save-msg hint">{{ checkMessage }}</span>
- <span v-else-if="saveMessage" :class="['save-msg', saveSuccess ? 'success' : 'error']">
- {{ saveMessage }}
- </span>
+ <!-- mineru_cloud 云 API 配置 -->
+ <div v-if="currentEngine.Name === 'mineru_cloud'" class="engine-form">
+ <div class="form-item">
+ <label class="form-label">API Key</label>
+ <t-input
+ v-model="config.mineru_api_key"
+ type="password"
+ :placeholder="$t('settings.parser.mineruCloudApiKeyPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Model Version</label>
+ <t-select v-model="config.mineru_cloud_model" :placeholder="$t('settings.parser.defaultPipeline')" clearable>
+ <t-option value="pipeline" label="pipeline" />
+ <t-option value="vlm" :label="$t('settings.parser.vlmLabel')" />
+ <t-option value="MinerU-HTML" :label="$t('settings.parser.mineruHtmlLabel')" />
+ </t-select>
+ </div>
+ <div class="form-toggles">
+ <t-checkbox v-model="config.mineru_cloud_enable_formula">{{ $t('settings.parser.formulaRecognition') }}</t-checkbox>
+ <t-checkbox v-model="config.mineru_cloud_enable_table">{{ $t('settings.parser.tableRecognition') }}</t-checkbox>
+ <t-checkbox v-model="config.mineru_cloud_enable_ocr">OCR</t-checkbox>
+ </div>
+ <div class="form-item" style="margin-top: 16px;">
+ <label class="form-label">{{ t('settings.parser.language') }}</label>
+ <t-input
+ v-model="config.mineru_cloud_language"
+ :placeholder="$t('settings.parser.languagePlaceholder')"
+ clearable
+ />
+ </div>
+ </div>
+ <div class="form-item" v-if="currentEngine && (hasConfigFields(currentEngine.Name) || currentEngine.Name === 'builtin')">
+ <label class="form-label">{{ $t('settings.parser.testConnection', '测试连接') }}</label>
+ <div class="api-test-section">
+ <t-button variant="outline" :loading="checking" @click="onCheck">
+ {{ $t('settings.parser.testConnection', '测试连接') }}
+ </t-button>
+ <span v-if="checkMessage || saveMessage" :class="['test-message', saveSuccess && !checkMessage ? 'success' : (checkMessage ? 'hint' : 'error')]">
+ {{ checkMessage || saveMessage }}
+ </span>
+ </div>
+ </div>
</div>
- </template>
+
+ <template #footer>
+ <div class="drawer-footer-actions">
+ <t-button theme="default" variant="outline" @click="drawerVisible = false">{{ $t('common.cancel') }}</t-button>
+ <t-button theme="primary" :loading="saving" @click="onSave">{{ $t('common.save') }}</t-button>
+ </div>
+ </template>
+ </t-drawer>
</div>
</template>
@@ -278,6 +284,12 @@ const checkMessage = ref('')
const hasBuiltinEngine = computed(() => engines.value.some(e => e.Name === 'builtin'))
+const drawerVisible = ref(false)
+const currentEngine = ref<ParserEngineInfo | null>(null)
+const drawerTitle = computed(() => {
+ return currentEngine.value ? getEngineDisplayName(currentEngine.value.Name) : ''
+})
+
/** 固定展示顺序,未列出的引擎排在末尾按名称排序 */
const ENGINE_ORDER: Record<string, number> = {
builtin: 0,
@@ -321,6 +333,13 @@ function getEngineDisplayDesc(engineName: string, fallback: string): string {
return translated !== key ? translated : fallback
}
+function openDrawer(engine: ParserEngineInfo) {
+ currentEngine.value = engine
+ drawerVisible.value = true
+ saveMessage.value = ''
+ checkMessage.value = ''
+}
+
async function loadEngines() {
try {
const res = await getParserEngines()
@@ -394,13 +413,47 @@ async function onCheck() {
}
checking.value = true
checkMessage.value = ''
+ saveMessage.value = ''
try {
const res = await checkParserEngines(buildConfigPayload())
engines.value = res?.data ?? []
- checkMessage.value = t('settings.parser.checkDoneStatusUpdated')
+ if (res?.connected !== undefined) {
+ connected.value = res.connected
+ }
+
+ if (currentEngine.value) {
+ if (currentEngine.value.Name === 'builtin') {
+ if (connected.value) {
+ checkMessage.value = t('settings.parser.checkSuccess', '测试连接成功')
+ saveSuccess.value = true
+ } else {
+ checkMessage.value = t('settings.parser.checkFailed', '测试连接失败')
+ saveSuccess.value = false
+ }
+ } else {
+ const updatedEngine = engines.value.find(e => e.Name === currentEngine.value!.Name)
+ if (updatedEngine) {
+ if (updatedEngine.Available) {
+ checkMessage.value = t('settings.parser.checkSuccess', '测试连接成功')
+ saveSuccess.value = true
+ } else {
+ checkMessage.value = updatedEngine.UnavailableReason || t('settings.parser.checkFailed', '测试连接失败')
+ saveSuccess.value = false
+ }
+ } else {
+ checkMessage.value = t('settings.parser.checkFailed', '引擎状态未知')
+ saveSuccess.value = false
+ }
+ }
+ } else {
+ checkMessage.value = t('settings.parser.checkDoneStatusUpdated', '检测已完成,状态已更新')
+ saveSuccess.value = true
+ }
+
setTimeout(() => { checkMessage.value = '' }, 3000)
} catch (e: any) {
- checkMessage.value = e?.message || t('settings.parser.checkFailed')
+ checkMessage.value = e?.message || t('settings.parser.checkFailed', '测试连接失败')
+ saveSuccess.value = false
} finally {
checking.value = false
}
@@ -413,6 +466,7 @@ async function onSave() {
await updateParserEngineConfig(buildConfigPayload())
saveSuccess.value = true
saveMessage.value = t('settings.parser.saveSuccess')
+ drawerVisible.value = false
loadEngines()
} catch (e: any) {
saveSuccess.value = false
@@ -500,34 +554,41 @@ onMounted(loadAll)
}
}
-// ---- 引擎条目 ----
-.engine-item {
- padding-top: 24px;
+// ---- 引擎卡片布局 ----
+.engine-cards {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
+ gap: 16px;
margin-top: 24px;
- border-top: 1px solid var(--td-component-stroke);
-
- &.first {
- margin-top: 0;
- padding-top: 0;
- border-top: none;
- }
}
-.engine-item-header {
- margin-bottom: 16px;
+.engine-card {
+ border: 1px solid var(--td-component-stroke);
+ border-radius: 8px;
+ padding: 16px;
+ cursor: pointer;
+ transition: all 0.2s ease;
+ background: var(--td-bg-color-container);
+ display: flex;
+ flex-direction: column;
- p {
- font-size: 13px;
- color: var(--td-text-color-placeholder);
- margin: 6px 0 0 0;
- line-height: 1.5;
+ &:hover {
+ border-color: var(--td-brand-color);
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+ }
+
+ &.active {
+ border-color: var(--td-brand-color);
+ background: rgba(var(--td-brand-color-5-rgba), 0.05);
}
}
-.engine-title-row {
+.engine-card-header {
display: flex;
align-items: center;
- gap: 10px;
+ justify-content: space-between;
+ gap: 8px;
+ margin-bottom: 8px;
h3 {
font-size: 15px;
@@ -535,30 +596,86 @@ onMounted(loadAll)
color: var(--td-text-color-primary);
margin: 0;
font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+}
+
+.engine-card-desc {
+ font-size: 13px;
+ color: var(--td-text-color-secondary);
+ margin: 0;
+ line-height: 1.5;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+
+// ---- 抽屉内容 ----
+.drawer-content {
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
+}
+
+.engine-info-block {
+ .engine-desc {
+ font-size: 13px;
+ color: var(--td-text-color-secondary);
+ margin: 0 0 8px 0;
+ line-height: 1.5;
+ }
+}
+
+// 输入框样式
+:deep(.t-input),
+:deep(.t-select) {
+ width: 100%;
+ font-size: 13px;
+
+ .t-input__inner,
+ .t-input__wrap,
+ input {
+ font-size: 13px;
+ border-radius: 6px;
+ border-color: var(--td-component-stroke);
+ transition: all 0.15s ease;
+ }
+
+ &:hover .t-input__inner,
+ &:hover .t-input__wrap,
+ &:hover input {
+ border-color: var(--td-component-stroke);
+ }
+
+ &.t-is-focused .t-input__inner,
+ &.t-is-focused .t-input__wrap,
+ &.t-is-focused input {
+ border-color: var(--td-brand-color);
+ box-shadow: 0 0 0 2px rgba(7, 192, 95, 0.1);
}
}
.engine-doc-link {
- margin-left: auto;
- font-size: 12px;
+ font-size: 13px;
color: var(--td-brand-color);
text-decoration: none;
- white-space: nowrap;
&:hover {
- opacity: 0.8;
+ text-decoration: underline;
}
}
// ---- DocReader 连接信息 ----
.docreader-inline {
- padding: 10px 14px;
+ padding: 12px 16px;
background: var(--td-bg-color-secondarycontainer);
border-radius: 8px;
- margin-bottom: 12px;
.status-line {
- margin-bottom: 6px;
+ margin-bottom: 8px;
}
}
@@ -567,13 +684,6 @@ onMounted(loadAll)
font-size: 12px;
color: var(--td-text-color-placeholder);
line-height: 1.6;
-
- code {
- padding: 1px 5px;
- font-size: 11px;
- background: var(--td-bg-color-secondarycontainer);
- border-radius: 3px;
- }
}
.status-line {
@@ -593,64 +703,43 @@ onMounted(loadAll)
display: flex;
flex-wrap: wrap;
gap: 6px;
- margin-bottom: 4px;
}
// ---- 配置表单 ----
.engine-form {
display: flex;
flex-direction: column;
- gap: 16px;
- margin-top: 16px;
- padding-top: 16px;
- border-top: 1px dashed var(--td-component-stroke);
+ gap: 0;
}
-.form-field {
- display: flex;
- flex-direction: column;
- gap: 6px;
+.form-item {
+ margin-bottom: 20px;
- label {
- font-size: 13px;
- font-weight: 500;
- color: var(--td-text-color-secondary);
+ &:last-child {
+ margin-bottom: 0;
}
}
-.form-toggles {
- display: flex;
- flex-wrap: wrap;
- gap: 16px;
-}
-
-// ---- 保存栏(sticky) ----
-.save-bar {
- display: flex;
- align-items: center;
- gap: 12px;
- position: sticky;
- bottom: 0;
- margin-top: 32px;
- padding: 16px 0 4px;
- background: linear-gradient(to bottom, transparent 0%, var(--td-bg-color-container) 12%);
- z-index: 10;
-}
-
-.save-msg {
- font-size: 13px;
-
- &.success {
- color: var(--td-success-color);
- }
+.form-label {
+ display: block;
+ margin-bottom: 8px;
+ font-size: 14px;
+ font-weight: 500;
+ color: var(--td-text-color-primary);
- &.error {
+ &.required::after {
+ content: '*';
color: var(--td-error-color);
+ margin-left: 4px;
+ font-weight: 600;
}
+}
- &.hint {
- color: var(--td-text-color-secondary);
- }
+.form-toggles {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 16px;
+ margin-bottom: 20px;
}
.tag-with-tooltip {
@@ -662,11 +751,10 @@ onMounted(loadAll)
display: flex;
align-items: flex-start;
gap: 8px;
- padding: 10px 14px;
+ padding: 12px 16px;
border-radius: 6px;
font-size: 13px;
color: var(--td-text-color-secondary);
- margin-bottom: 12px;
background: var(--td-bg-color-secondarycontainer);
&--ok {
@@ -681,4 +769,76 @@ onMounted(loadAll)
border-left: 3px solid #f97316;
}
}
+
+.api-test-section {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+
+ .test-message {
+ font-size: 13px;
+ line-height: 1.5;
+ flex: 1;
+
+ &.success {
+ color: var(--td-brand-color-active);
+ }
+
+ &.error {
+ color: var(--td-error-color);
+ }
+
+ &.hint {
+ color: var(--td-text-color-secondary);
+ }
+ }
+
+ :deep(.t-button) {
+ min-width: 88px;
+ height: 32px;
+ font-size: 13px;
+ border-radius: 6px;
+ flex-shrink: 0;
+ }
+
+ .status-icon {
+ font-size: 16px;
+ flex-shrink: 0;
+
+ &.available {
+ color: var(--td-brand-color);
+ }
+
+ &.unavailable {
+ color: var(--td-error-color);
+ }
+ }
+}
+
+.drawer-footer-actions {
+ display: flex;
+ justify-content: flex-end;
+ gap: 12px;
+ width: 100%;
+
+ :deep(.t-button) {
+ min-width: 80px;
+ height: 36px;
+ font-weight: 500;
+ font-size: 14px;
+ border-radius: 6px;
+ transition: all 0.15s ease;
+
+ &.t-button--variant-outline {
+ color: var(--td-text-color-secondary);
+ border-color: var(--td-component-stroke);
+
+ &:hover {
+ border-color: var(--td-brand-color);
+ color: var(--td-brand-color);
+ background: rgba(7, 192, 95, 0.04);
+ }
+ }
+ }
+}
</style>
diff --git a/frontend/src/views/settings/Settings.vue b/frontend/src/views/settings/Settings.vue
index 703c71200..958f7c0aa 100644
--- a/frontend/src/views/settings/Settings.vue
+++ b/frontend/src/views/settings/Settings.vue
@@ -186,45 +186,11 @@ const navItems = computed(() => [
{ key: 'general', icon: 'setting', label: t('general.title') },
{ key: 'ollama', icon: 'server', label: 'Ollama' },
{ key: 'weknoracloud', icon: '', label: 'WeKnora Cloud' },
- {
- key: 'models',
- icon: 'control-platform',
- label: t('settings.modelManagement'),
- children: [
- { key: 'chat', label: t('model.llmModel') },
- { key: 'embedding', label: t('model.embeddingModel') },
- { key: 'rerank', label: t('model.rerankModel') },
- { key: 'vllm', label: t('model.vlmModel') }
- ]
- },
+ { key: 'models', icon: 'control-platform', label: t('settings.modelManagement') },
{ key: 'websearch', icon: 'search', label: t('settings.webSearchConfig') },
{ key: 'chathistory', icon: 'chat', label: t('chatHistorySettings.title') },
- {
- key: 'parser',
- icon: 'file-search',
- label: t('settings.parserEngine'),
- children: [
- { key: 'builtin', label: 'Builtin (DocReader)' },
- { key: 'weknoracloud', label: 'WeKnora Cloud' },
- { key: 'simple', label: 'Simple' },
- { key: 'markitdown', label: 'Markitdown' },
- { key: 'mineru', label: 'MinerU' },
- { key: 'mineru_cloud', label: 'MinerU Cloud' },
- ]
- },
- {
- key: 'storage',
- icon: 'cloud',
- label: t('settings.storageEngine'),
- children: [
- { key: 'local', label: 'Local' },
- { key: 'minio', label: 'MinIO' },
- { key: 'cos', label: t('settings.storage.cos') },
- { key: 'tos', label: t('settings.storage.tos') },
- { key: 's3', label: 'AWS S3' },
- { key: 'oss', label: t('settings.storage.oss') },
- ]
- },
+ { key: 'parser', icon: 'file-search', label: t('settings.parserEngine') },
+ { key: 'storage', icon: 'cloud', label: t('settings.storageEngine') },
{ key: 'mcp', icon: 'tools', label: t('settings.mcpService') },
{ key: 'system', icon: 'info-circle', label: t('settings.systemSettings') },
{ key: 'tenant', icon: 'user-circle', label: t('settings.tenantInfo') },
diff --git a/frontend/src/views/settings/StorageEngineSettings.vue b/frontend/src/views/settings/StorageEngineSettings.vue
index 694a5f45f..ecb18259b 100644
--- a/frontend/src/views/settings/StorageEngineSettings.vue
+++ b/frontend/src/views/settings/StorageEngineSettings.vue
@@ -28,7 +28,12 @@
<p class="desc">{{ $t('settings.storage.defaultEngineDesc') }}</p>
</div>
<div class="setting-control">
- <t-select v-model="config.default_provider" style="width: 280px;" :placeholder="$t('settings.storage.defaultEngine')">
+ <t-select
+ v-model="config.default_provider"
+ style="width: 280px;"
+ :placeholder="$t('settings.storage.defaultEngine')"
+ @change="onSaveDefaultEngine"
+ >
<t-option value="local" :label="$t('settings.storage.engineLocal')" />
<t-option value="minio" label="MinIO" />
<t-option value="cos" :label="$t('settings.storage.engineCos')" />
@@ -36,475 +41,472 @@
<t-option value="s3" label="AWS S3" />
<t-option value="oss" :label="$t('settings.storage.engineOss')" />
</t-select>
+ <span v-if="saveMessage && !drawerVisible" :class="['save-msg', saveSuccess ? 'success' : 'error']" style="margin-left: 12px;">
+ {{ saveMessage }}
+ </span>
</div>
</div>
</div>
- <!-- Local -->
- <div class="engine-section" data-model-type="local">
- <div class="engine-header">
- <div class="engine-header-info">
- <div class="engine-title-row">
- <h3>{{ $t('settings.storage.localTitle') }}</h3>
- <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.available') }}</t-tag>
- </div>
- <p>{{ $t('settings.storage.localDesc') }}</p>
+ <div class="engine-cards">
+ <!-- Local -->
+ <div :class="['engine-card', { active: drawerVisible && currentEngine === 'local' }]" @click="openDrawer('local')">
+ <div class="engine-card-header">
+ <h3>{{ $t('settings.storage.localTitle') }}</h3>
+ <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.available') }}</t-tag>
</div>
+ <p class="engine-card-desc">{{ $t('settings.storage.localDesc') }}</p>
</div>
- <div class="engine-form">
- <div class="form-field">
- <label>{{ $t('settings.storage.pathPrefix') }}</label>
- <t-input
- v-model="config.local.path_prefix"
- :placeholder="$t('settings.storage.pathPrefixPlaceholder')"
- clearable
- />
+
+ <!-- MinIO -->
+ <div :class="['engine-card', { active: drawerVisible && currentEngine === 'minio' }]" @click="openDrawer('minio')">
+ <div class="engine-card-header">
+ <h3>MinIO</h3>
+ <t-tag v-if="minioAvailable" theme="success" variant="light" size="small">{{ $t('settings.storage.available') }}</t-tag>
+ <t-tag v-else theme="default" variant="light" size="small">{{ $t('settings.storage.needsConfig') }}</t-tag>
</div>
+ <p class="engine-card-desc">{{ $t('settings.storage.minioDesc') }}</p>
</div>
- </div>
- <!-- MinIO -->
- <div class="engine-section" data-model-type="minio">
- <div class="engine-header">
- <div class="engine-header-info">
- <div class="engine-title-row">
- <h3>MinIO</h3>
- <t-tag v-if="minioAvailable" theme="success" variant="light" size="small">{{ $t('settings.storage.available') }}</t-tag>
- <t-tag v-else theme="default" variant="light" size="small">{{ $t('settings.storage.needsConfig') }}</t-tag>
- </div>
- <p>{{ $t('settings.storage.minioDesc') }}</p>
+ <!-- COS -->
+ <div :class="['engine-card', { active: drawerVisible && currentEngine === 'cos' }]" @click="openDrawer('cos')">
+ <div class="engine-card-header">
+ <h3>{{ $t('settings.storage.cosTitle') }}</h3>
+ <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.configurable') }}</t-tag>
</div>
+ <p class="engine-card-desc">{{ $t('settings.storage.cosDesc') }}</p>
</div>
- <div class="mode-selector">
- <div
- :class="['mode-option', { active: config.minio.mode !== 'remote' }]"
- @click="config.minio.mode = 'docker'"
- >
- <span class="mode-label">{{ $t('settings.storage.minioDocker') }}</span>
- <t-tag v-if="minioEnvAvailable" theme="success" variant="light" size="small">{{ $t('settings.storage.detected') }}</t-tag>
- <t-tag v-else theme="default" variant="light" size="small">{{ $t('settings.storage.notDetected') }}</t-tag>
+ <!-- TOS -->
+ <div :class="['engine-card', { active: drawerVisible && currentEngine === 'tos' }]" @click="openDrawer('tos')">
+ <div class="engine-card-header">
+ <h3>{{ $t('settings.storage.tosTitle') }}</h3>
+ <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.configurable') }}</t-tag>
</div>
- <div
- :class="['mode-option', { active: config.minio.mode === 'remote' }]"
- @click="config.minio.mode = 'remote'"
- >
- <span class="mode-label">{{ $t('settings.storage.minioRemote') }}</span>
+ <p class="engine-card-desc">{{ $t('settings.storage.tosDesc') }}</p>
+ </div>
+
+ <!-- S3 -->
+ <div :class="['engine-card', { active: drawerVisible && currentEngine === 's3' }]" @click="openDrawer('s3')">
+ <div class="engine-card-header">
+ <h3>{{ $t('settings.storage.s3Title') }}</h3>
+ <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.configurable') }}</t-tag>
</div>
+ <p class="engine-card-desc">{{ $t('settings.storage.s3Desc') }}</p>
</div>
- <!-- Docker mode -->
- <div v-if="config.minio.mode !== 'remote'">
- <div v-if="minioEnvAvailable" class="engine-hint success">
- {{ $t('settings.storage.minioDockerDetected') }}
+ <!-- OSS -->
+ <div :class="['engine-card', { active: drawerVisible && currentEngine === 'oss' }]" @click="openDrawer('oss')">
+ <div class="engine-card-header">
+ <h3>{{ $t('settings.storage.ossTitle') }}</h3>
+ <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.configurable') }}</t-tag>
</div>
- <div v-else class="engine-hint warning">
- {{ $t('settings.storage.minioDockerNotDetected') }}
+ <p class="engine-card-desc">{{ $t('settings.storage.ossDesc') }}</p>
+ </div>
+ </div>
+ </template>
+
+ <!-- 配置抽屉 -->
+ <t-drawer
+ v-model:visible="drawerVisible"
+ :header="drawerTitle"
+ size="500px"
+ :footer="true"
+ @confirm="onSave"
+ >
+ <div class="drawer-content">
+ <!-- Local -->
+ <template v-if="currentEngine === 'local'">
+ <div class="engine-info-block">
+ <p class="engine-desc">{{ $t('settings.storage.localDesc') }}</p>
</div>
<div class="engine-form">
- <div class="form-field">
- <label>{{ $t('settings.storage.bucketName') }}</label>
- <t-select
- v-model="config.minio.bucket_name"
- filterable
- creatable
- :placeholder="$t('settings.storage.bucketSelectPlaceholder')"
- :loading="loadingBuckets"
- :disabled="!minioEnvAvailable"
- @focus="loadMinioBuckets"
- >
- <t-option
- v-for="b in minioBuckets"
- :key="b.name"
- :value="b.name"
- :label="b.name"
- />
- </t-select>
- </div>
- <div class="form-field form-field--inline">
- <label>Use SSL</label>
- <t-switch v-model="config.minio.use_ssl" size="small" />
- </div>
- <div class="form-field">
- <label>{{ $t('settings.storage.pathPrefix') }}</label>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.pathPrefix') }}</label>
<t-input
- v-model="config.minio.path_prefix"
- :placeholder="$t('settings.storage.prefixPlaceholder')"
+ v-model="config.local.path_prefix"
+ :placeholder="$t('settings.storage.pathPrefixPlaceholder')"
clearable
/>
</div>
</div>
- <div v-if="minioEnvAvailable" class="test-bar">
- <t-button size="small" variant="outline" :loading="checkingMinio" @click="onCheckMinio">{{ $t('settings.storage.testConnection') }}</t-button>
- <span v-if="minioCheckResult" :class="['test-msg', minioCheckResult.ok ? (minioCheckResult.bucket_created ? 'created' : 'success') : 'error']">
- {{ minioCheckResult.message }}
- </span>
+ </template>
+
+ <!-- MinIO -->
+ <template v-else-if="currentEngine === 'minio'">
+ <div class="engine-info-block">
+ <p class="engine-desc">{{ $t('settings.storage.minioDesc') }}</p>
</div>
- </div>
+ <div class="mode-selector">
+ <div
+ :class="['mode-option', { active: config.minio.mode !== 'remote' }]"
+ @click="config.minio.mode = 'docker'"
+ >
+ <span class="mode-label">{{ $t('settings.storage.minioDocker') }}</span>
+ <t-tag v-if="minioEnvAvailable" theme="success" variant="light" size="small">{{ $t('settings.storage.detected') }}</t-tag>
+ <t-tag v-else theme="default" variant="light" size="small">{{ $t('settings.storage.notDetected') }}</t-tag>
+ </div>
+ <div
+ :class="['mode-option', { active: config.minio.mode === 'remote' }]"
+ @click="config.minio.mode = 'remote'"
+ >
+ <span class="mode-label">{{ $t('settings.storage.minioRemote') }}</span>
+ </div>
+ </div>
+
+ <!-- Docker mode -->
+ <div v-if="config.minio.mode !== 'remote'">
+ <div v-if="minioEnvAvailable" class="engine-hint success">
+ {{ $t('settings.storage.minioDockerDetected') }}
+ </div>
+ <div v-else class="engine-hint warning">
+ {{ $t('settings.storage.minioDockerNotDetected') }}
+ </div>
+ <div class="engine-form">
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.bucketName') }}</label>
+ <t-input
+ v-model="config.minio.bucket_name"
+ :placeholder="$t('settings.storage.bucketPlaceholder')"
+ :disabled="!minioEnvAvailable"
+ clearable
+ />
+ </div>
+ <div class="form-item form-item--inline">
+ <label class="form-label">Use SSL</label>
+ <t-switch v-model="config.minio.use_ssl" size="small" />
+ </div>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.pathPrefix') }}</label>
+ <t-input
+ v-model="config.minio.path_prefix"
+ :placeholder="$t('settings.storage.prefixPlaceholder')"
+ clearable
+ />
+ </div>
+ </div>
+ </div>
+
+ <!-- Remote mode -->
+ <div v-else>
+ <div class="engine-hint">{{ $t('settings.storage.minioRemoteHint') }}</div>
+ <div class="engine-form">
+ <div class="form-item">
+ <label class="form-label">Endpoint</label>
+ <t-input
+ v-model="config.minio.endpoint"
+ placeholder="e.g. minio.example.com:9000"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Access Key ID</label>
+ <t-input
+ v-model="config.minio.access_key_id"
+ placeholder="MinIO Access Key"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Secret Access Key</label>
+ <t-input
+ v-model="config.minio.secret_access_key"
+ type="password"
+ placeholder="MinIO Secret Key"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.bucketName') }}</label>
+ <t-input
+ v-model="config.minio.bucket_name"
+ :placeholder="$t('settings.storage.bucketPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item form-item--inline">
+ <label class="form-label">Use SSL</label>
+ <t-switch v-model="config.minio.use_ssl" size="small" />
+ </div>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.pathPrefix') }}</label>
+ <t-input
+ v-model="config.minio.path_prefix"
+ :placeholder="$t('settings.storage.prefixPlaceholder')"
+ clearable
+ />
+ </div>
+ </div>
+ </div>
+ </template>
- <!-- Remote mode -->
- <div v-else>
- <div class="engine-hint">{{ $t('settings.storage.minioRemoteHint') }}</div>
+ <!-- COS -->
+ <template v-else-if="currentEngine === 'cos'">
+ <div class="engine-info-block">
+ <p class="engine-desc">
+ {{ $t('settings.storage.cosDesc') }}
+ <a class="engine-link" href="https://console.cloud.tencent.com/cos" target="_blank" rel="noopener">{{ $t('settings.storage.console') }} ↗</a>
+ <a class="engine-link" href="https://cloud.tencent.com/document/product/436" target="_blank" rel="noopener">{{ $t('settings.storage.docs') }} ↗</a>
+ </p>
+ </div>
<div class="engine-form">
- <div class="form-field">
- <label>Endpoint</label>
+ <div class="form-item">
+ <label class="form-label">Secret ID</label>
<t-input
- v-model="config.minio.endpoint"
- placeholder="e.g. minio.example.com:9000"
+ v-model="config.cos.secret_id"
+ :placeholder="$t('settings.storage.cosSecretIdPlaceholder')"
clearable
/>
</div>
- <div class="form-field">
- <label>Access Key ID</label>
+ <div class="form-item">
+ <label class="form-label">Secret Key</label>
<t-input
- v-model="config.minio.access_key_id"
- placeholder="MinIO Access Key"
+ v-model="config.cos.secret_key"
+ type="password"
+ :placeholder="$t('settings.storage.cosSecretKeyPlaceholder')"
clearable
/>
</div>
- <div class="form-field">
- <label>Secret Access Key</label>
+ <div class="form-item">
+ <label class="form-label">Region</label>
<t-input
- v-model="config.minio.secret_access_key"
- type="password"
- placeholder="MinIO Secret Key"
+ v-model="config.cos.region"
+ placeholder="e.g. ap-guangzhou"
clearable
/>
</div>
- <div class="form-field">
- <label>{{ $t('settings.storage.bucketName') }}</label>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.bucketName') }}</label>
<t-input
- v-model="config.minio.bucket_name"
+ v-model="config.cos.bucket_name"
:placeholder="$t('settings.storage.bucketPlaceholder')"
clearable
/>
</div>
- <div class="form-field form-field--inline">
- <label>Use SSL</label>
- <t-switch v-model="config.minio.use_ssl" size="small" />
+ <div class="form-item">
+ <label class="form-label">App ID</label>
+ <t-input
+ v-model="config.cos.app_id"
+ :placeholder="$t('settings.storage.cosAppIdPlaceholder')"
+ clearable
+ />
</div>
- <div class="form-field">
- <label>{{ $t('settings.storage.pathPrefix') }}</label>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.pathPrefix') }}</label>
<t-input
- v-model="config.minio.path_prefix"
+ v-model="config.cos.path_prefix"
:placeholder="$t('settings.storage.prefixPlaceholder')"
clearable
/>
</div>
</div>
- <div class="test-bar">
- <t-button size="small" variant="outline" :loading="checkingMinio" @click="onCheckMinio">{{ $t('settings.storage.testConnection') }}</t-button>
- <span v-if="minioCheckResult" :class="['test-msg', minioCheckResult.ok ? (minioCheckResult.bucket_created ? 'created' : 'success') : 'error']">
- {{ minioCheckResult.message }}
- </span>
- </div>
- </div>
- </div>
-
- <!-- COS -->
- <div class="engine-section" data-model-type="cos">
- <div class="engine-header">
- <div class="engine-header-info">
- <div class="engine-title-row">
- <h3>{{ $t('settings.storage.cosTitle') }}</h3>
- <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.configurable') }}</t-tag>
- </div>
- <p>
- {{ $t('settings.storage.cosDesc') }}
- <a class="engine-link" href="https://console.cloud.tencent.com/cos" target="_blank" rel="noopener">{{ $t('settings.storage.console') }} ↗</a>
- <a class="engine-link" href="https://cloud.tencent.com/document/product/436" target="_blank" rel="noopener">{{ $t('settings.storage.docs') }} ↗</a>
- </p>
- </div>
- </div>
- <div class="engine-form">
- <div class="form-field">
- <label>Secret ID</label>
- <t-input
- v-model="config.cos.secret_id"
- :placeholder="$t('settings.storage.cosSecretIdPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Secret Key</label>
- <t-input
- v-model="config.cos.secret_key"
- type="password"
- :placeholder="$t('settings.storage.cosSecretKeyPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Region</label>
- <t-input
- v-model="config.cos.region"
- placeholder="e.g. ap-guangzhou"
- clearable
- />
- </div>
- <div class="form-field">
- <label>{{ $t('settings.storage.bucketName') }}</label>
- <t-input
- v-model="config.cos.bucket_name"
- :placeholder="$t('settings.storage.bucketPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>App ID</label>
- <t-input
- v-model="config.cos.app_id"
- :placeholder="$t('settings.storage.cosAppIdPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>{{ $t('settings.storage.pathPrefix') }}</label>
- <t-input
- v-model="config.cos.path_prefix"
- :placeholder="$t('settings.storage.prefixPlaceholder')"
- clearable
- />
- </div>
- </div>
- <div class="test-bar">
- <t-button size="small" variant="outline" :loading="checkingCos" @click="onCheckCos">{{ $t('settings.storage.testConnection') }}</t-button>
- <span v-if="cosCheckResult" :class="['test-msg', cosCheckResult.ok ? 'success' : 'error']">
- {{ cosCheckResult.message }}
- </span>
- </div>
- </div>
+ </template>
- <!-- TOS -->
- <div class="engine-section" data-model-type="tos">
- <div class="engine-header">
- <div class="engine-header-info">
- <div class="engine-title-row">
- <h3>{{ $t('settings.storage.tosTitle') }}</h3>
- <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.configurable') }}</t-tag>
- </div>
- <p>
+ <!-- TOS -->
+ <template v-else-if="currentEngine === 'tos'">
+ <div class="engine-info-block">
+ <p class="engine-desc">
{{ $t('settings.storage.tosDesc') }}
<a class="engine-link" href="https://console.volcengine.com/tos" target="_blank" rel="noopener">{{ $t('settings.storage.console') }} ↗</a>
<a class="engine-link" href="https://www.volcengine.com/docs/6349" target="_blank" rel="noopener">{{ $t('settings.storage.docs') }} ↗</a>
</p>
</div>
- </div>
- <div class="engine-form">
- <div class="form-field">
- <label>Endpoint</label>
- <t-input
- v-model="config.tos.endpoint"
- placeholder="e.g. https://tos-cn-beijing.volces.com"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Region</label>
- <t-input
- v-model="config.tos.region"
- placeholder="e.g. cn-beijing"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Access Key</label>
- <t-input
- v-model="config.tos.access_key"
- :placeholder="$t('settings.storage.tosAccessKeyPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Secret Key</label>
- <t-input
- v-model="config.tos.secret_key"
- type="password"
- :placeholder="$t('settings.storage.tosSecretKeyPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>{{ $t('settings.storage.bucketName') }}</label>
- <t-input
- v-model="config.tos.bucket_name"
- :placeholder="$t('settings.storage.bucketPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>{{ $t('settings.storage.pathPrefix') }}</label>
- <t-input
- v-model="config.tos.path_prefix"
- :placeholder="$t('settings.storage.prefixPlaceholder')"
- clearable
- />
+ <div class="engine-form">
+ <div class="form-item">
+ <label class="form-label">Endpoint</label>
+ <t-input
+ v-model="config.tos.endpoint"
+ placeholder="e.g. https://tos-cn-beijing.volces.com"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Region</label>
+ <t-input
+ v-model="config.tos.region"
+ placeholder="e.g. cn-beijing"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Access Key</label>
+ <t-input
+ v-model="config.tos.access_key"
+ :placeholder="$t('settings.storage.tosAccessKeyPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Secret Key</label>
+ <t-input
+ v-model="config.tos.secret_key"
+ type="password"
+ :placeholder="$t('settings.storage.tosSecretKeyPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.bucketName') }}</label>
+ <t-input
+ v-model="config.tos.bucket_name"
+ :placeholder="$t('settings.storage.bucketPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.pathPrefix') }}</label>
+ <t-input
+ v-model="config.tos.path_prefix"
+ :placeholder="$t('settings.storage.prefixPlaceholder')"
+ clearable
+ />
+ </div>
</div>
- </div>
- <div class="test-bar">
- <t-button size="small" variant="outline" :loading="checkingTos" @click="onCheckTos">{{ $t('settings.storage.testConnection') }}</t-button>
- <span v-if="tosCheckResult" :class="['test-msg', tosCheckResult.ok ? 'success' : 'error']">
- {{ tosCheckResult.message }}
- </span>
- </div>
- </div>
+ </template>
- <!-- S3 -->
- <div class="engine-section" data-model-type="s3">
- <div class="engine-header">
- <div class="engine-header-info">
- <div class="engine-title-row">
- <h3>{{ $t('settings.storage.s3Title') }}</h3>
- <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.configurable') }}</t-tag>
- </div>
- <p>
+ <!-- S3 -->
+ <template v-else-if="currentEngine === 's3'">
+ <div class="engine-info-block">
+ <p class="engine-desc">
{{ $t('settings.storage.s3Desc') }}
<a class="engine-link" href="https://aws.amazon.com/s3/" target="_blank" rel="noopener">{{ $t('settings.storage.console') }} ↗</a>
<a class="engine-link" href="https://docs.aws.amazon.com/s3/" target="_blank" rel="noopener">{{ $t('settings.storage.docs') }} ↗</a>
</p>
</div>
- </div>
- <div class="engine-form">
- <div class="form-field">
- <label>Endpoint</label>
- <t-input
- v-model="config.s3.endpoint"
- placeholder="e.g. https://s3.amazonaws.com"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Region</label>
- <t-input
- v-model="config.s3.region"
- placeholder="e.g. us-east-1"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Access Key</label>
- <t-input
- v-model="config.s3.access_key"
- :placeholder="$t('settings.storage.s3AccessKeyPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Secret Key</label>
- <t-input
- v-model="config.s3.secret_key"
- type="password"
- :placeholder="$t('settings.storage.s3SecretKeyPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>{{ $t('settings.storage.bucketName') }}</label>
- <t-input
- v-model="config.s3.bucket_name"
- :placeholder="$t('settings.storage.bucketPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>{{ $t('settings.storage.pathPrefix') }}</label>
- <t-input
- v-model="config.s3.path_prefix"
- :placeholder="$t('settings.storage.prefixPlaceholder')"
- clearable
- />
+ <div class="engine-form">
+ <div class="form-item">
+ <label class="form-label">Endpoint</label>
+ <t-input
+ v-model="config.s3.endpoint"
+ placeholder="e.g. https://s3.amazonaws.com"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Region</label>
+ <t-input
+ v-model="config.s3.region"
+ placeholder="e.g. us-east-1"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Access Key</label>
+ <t-input
+ v-model="config.s3.access_key"
+ :placeholder="$t('settings.storage.s3AccessKeyPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Secret Key</label>
+ <t-input
+ v-model="config.s3.secret_key"
+ type="password"
+ :placeholder="$t('settings.storage.s3SecretKeyPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.bucketName') }}</label>
+ <t-input
+ v-model="config.s3.bucket_name"
+ :placeholder="$t('settings.storage.bucketPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.pathPrefix') }}</label>
+ <t-input
+ v-model="config.s3.path_prefix"
+ :placeholder="$t('settings.storage.prefixPlaceholder')"
+ clearable
+ />
+ </div>
</div>
- </div>
- <div class="test-bar">
- <t-button size="small" variant="outline" :loading="checkingS3" @click="onCheckS3">{{ $t('settings.storage.testConnection') }}</t-button>
- <span v-if="s3CheckResult" :class="['test-msg', s3CheckResult.ok ? 'success' : 'error']">
- {{ s3CheckResult.message }}
- </span>
- </div>
- </div>
+ </template>
- <!-- OSS -->
- <div class="engine-section" data-model-type="oss">
- <div class="engine-header">
- <div class="engine-header-info">
- <div class="engine-title-row">
- <h3>{{ $t('settings.storage.ossTitle') }}</h3>
- <t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.configurable') }}</t-tag>
- </div>
- <p>
+ <!-- OSS -->
+ <template v-else-if="currentEngine === 'oss'">
+ <div class="engine-info-block">
+ <p class="engine-desc">
{{ $t('settings.storage.ossDesc') }}
<a class="engine-link" href="https://oss.console.aliyun.com/" target="_blank" rel="noopener">{{ $t('settings.storage.console') }} ↗</a>
<a class="engine-link" href="https://help.aliyun.com/zh/oss/" target="_blank" rel="noopener">{{ $t('settings.storage.docs') }} ↗</a>
</p>
</div>
- </div>
- <div class="engine-form">
- <div class="form-field">
- <label>Endpoint</label>
- <t-input
- v-model="config.oss.endpoint"
- placeholder="e.g. https://oss-cn-hangzhou.aliyuncs.com"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Region</label>
- <t-input
- v-model="config.oss.region"
- placeholder="e.g. cn-hangzhou"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Access Key</label>
- <t-input
- v-model="config.oss.access_key"
- :placeholder="$t('settings.storage.ossAccessKeyPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>Secret Key</label>
- <t-input
- v-model="config.oss.secret_key"
- type="password"
- :placeholder="$t('settings.storage.ossSecretKeyPlaceholder')"
- clearable
- />
- </div>
- <div class="form-field">
- <label>{{ $t('settings.storage.bucketName') }}</label>
- <t-input
- v-model="config.oss.bucket_name"
- :placeholder="$t('settings.storage.bucketPlaceholder')"
- clearable
- />
+ <div class="engine-form">
+ <div class="form-item">
+ <label class="form-label">Endpoint</label>
+ <t-input
+ v-model="config.oss.endpoint"
+ placeholder="e.g. https://oss-cn-hangzhou.aliyuncs.com"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Region</label>
+ <t-input
+ v-model="config.oss.region"
+ placeholder="e.g. cn-hangzhou"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Access Key</label>
+ <t-input
+ v-model="config.oss.access_key"
+ :placeholder="$t('settings.storage.ossAccessKeyPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">Secret Key</label>
+ <t-input
+ v-model="config.oss.secret_key"
+ type="password"
+ :placeholder="$t('settings.storage.ossSecretKeyPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.bucketName') }}</label>
+ <t-input
+ v-model="config.oss.bucket_name"
+ :placeholder="$t('settings.storage.bucketPlaceholder')"
+ clearable
+ />
+ </div>
+ <div class="form-item">
+ <label class="form-label">{{ $t('settings.storage.pathPrefix') }}</label>
+ <t-input
+ v-model="config.oss.path_prefix"
+ :placeholder="$t('settings.storage.prefixPlaceholder')"
+ clearable
+ />
+ </div>
</div>
- <div class="form-field">
- <label>{{ $t('settings.storage.pathPrefix') }}</label>
- <t-input
- v-model="config.oss.path_prefix"
- :placeholder="$t('settings.storage.prefixPlaceholder')"
- clearable
- />
+ </template>
+ <div class="form-item" v-if="currentEngine && currentEngine !== 'local'">
+ <label class="form-label">{{ $t('settings.storage.testConnection') }}</label>
+ <div class="api-test-section">
+ <t-button variant="outline" :loading="currentCheckState.loading" @click="currentCheckState.onCheck">
+ {{ $t('settings.storage.testConnection') }}
+ </t-button>
+ <span v-if="currentCheckState.result" :class="['test-message', currentCheckState.result.ok ? (currentCheckState.result.bucket_created ? 'created' : 'success') : 'error']">
+ {{ currentCheckState.result.message }}
+ </span>
</div>
</div>
- <div class="test-bar">
- <t-button size="small" variant="outline" :loading="checkingOss" @click="onCheckOss">{{ $t('settings.storage.testConnection') }}</t-button>
- <span v-if="ossCheckResult" :class="['test-msg', ossCheckResult.ok ? 'success' : 'error']">
- {{ ossCheckResult.message }}
- </span>
- </div>
</div>
- <!-- Save -->
- <div class="save-bar">
- <t-button theme="primary" :loading="saving" @click="onSave">{{ $t('settings.storage.saveConfig') }}</t-button>
- <span v-if="saveMessage" :class="['save-msg', saveSuccess ? 'success' : 'error']">
- {{ saveMessage }}
- </span>
- </div>
- </template>
+ <template #footer>
+ <div class="drawer-footer-actions">
+ <t-button theme="default" variant="outline" @click="drawerVisible = false">{{ $t('common.cancel') }}</t-button>
+ <t-button theme="primary" :loading="saving" @click="onSave">{{ $t('common.save') }}</t-button>
+ </div>
+ </template>
+ </t-drawer>
</div>
</template>
@@ -515,10 +517,8 @@ import {
getStorageEngineConfig,
updateStorageEngineConfig,
getStorageEngineStatus,
- listMinioBuckets,
checkStorageEngine,
type StorageEngineConfig,
- type MinioBucketInfo,
} from '@/api/system'
const { t } = useI18n()
@@ -573,8 +573,6 @@ const engineStatus = ref<{ local: boolean; minio: boolean; cos: boolean }>({
cos: true,
})
const minioEnvAvailable = ref(false)
-const minioBuckets = ref<MinioBucketInfo[]>([])
-const loadingBuckets = ref(false)
const saving = ref(false)
const saveMessage = ref('')
const saveSuccess = ref(false)
@@ -590,6 +588,33 @@ const s3CheckResult = ref<{ ok: boolean; message: string } | null>(null)
const checkingOss = ref(false)
const ossCheckResult = ref<{ ok: boolean; message: string } | null>(null)
+const drawerVisible = ref(false)
+const currentEngine = ref<string | null>(null)
+
+const currentCheckState = computed(() => {
+ switch (currentEngine.value) {
+ case 'minio': return { loading: checkingMinio.value, result: minioCheckResult.value, onCheck: onCheckMinio }
+ case 'cos': return { loading: checkingCos.value, result: cosCheckResult.value, onCheck: onCheckCos }
+ case 'tos': return { loading: checkingTos.value, result: tosCheckResult.value, onCheck: onCheckTos }
+ case 's3': return { loading: checkingS3.value, result: s3CheckResult.value, onCheck: onCheckS3 }
+ case 'oss': return { loading: checkingOss.value, result: ossCheckResult.value, onCheck: onCheckOss }
+ default: return { loading: false, result: null, onCheck: () => {} }
+ }
+})
+
+const drawerTitle = computed(() => {
+ if (!currentEngine.value) return ''
+ const titles: Record<string, string> = {
+ local: t('settings.storage.localTitle'),
+ minio: 'MinIO',
+ cos: t('settings.storage.cosTitle'),
+ tos: t('settings.storage.tosTitle'),
+ s3: t('settings.storage.s3Title'),
+ oss: t('settings.storage.ossTitle'),
+ }
+ return titles[currentEngine.value] || currentEngine.value
+})
+
const minioAvailable = computed(() => {
if (config.value.minio?.mode === 'remote') {
return !!(config.value.minio.endpoint && config.value.minio.access_key_id && config.value.minio.secret_access_key)
@@ -597,6 +622,19 @@ const minioAvailable = computed(() => {
return minioEnvAvailable.value
})
+function openDrawer(engine: string) {
+ currentEngine.value = engine
+ drawerVisible.value = true
+ saveMessage.value = ''
+
+ // Reset check results
+ minioCheckResult.value = null
+ cosCheckResult.value = null
+ tosCheckResult.value = null
+ s3CheckResult.value = null
+ ossCheckResult.value = null
+}
+
async function loadConfig() {
try {
const res = await getStorageEngineConfig()
@@ -684,27 +722,11 @@ async function loadStatus() {
}
}
-async function loadMinioBuckets() {
- if (!minioEnvAvailable.value || loadingBuckets.value) return
- loadingBuckets.value = true
- try {
- const res = await listMinioBuckets()
- if (res?.data?.buckets) {
- minioBuckets.value = res.data.buckets
- }
- } catch {
- minioBuckets.value = []
- } finally {
- loadingBuckets.value = false
- }
-}
-
async function loadAll() {
loading.value = true
error.value = ''
try {
await Promise.all([loadConfig(), loadStatus()])
- if (minioEnvAvailable.value) loadMinioBuckets()
} catch (e: unknown) {
error.value = e instanceof Error ? e.message : t('settings.storage.loadFailed')
} finally {
@@ -773,6 +795,7 @@ async function onSave() {
await loadStatus()
saveSuccess.value = true
saveMessage.value = t('settings.storage.saveSuccess')
+ drawerVisible.value = false
} catch (e: unknown) {
saveSuccess.value = false
saveMessage.value = e instanceof Error ? e.message : t('settings.storage.saveFailed')
@@ -781,6 +804,10 @@ async function onSave() {
}
}
+async function onSaveDefaultEngine() {
+ await onSave()
+}
+
async function onCheckMinio() {
checkingMinio.value = true
minioCheckResult.value = null
@@ -788,10 +815,6 @@ async function onCheckMinio() {
const payload = buildPayload()
const res = await checkStorageEngine({ provider: 'minio', minio: payload.minio })
minioCheckResult.value = res?.data ?? { ok: false, message: t('settings.storage.unknownError') }
- // Refresh bucket list if a new bucket was auto-created
- if (res?.data?.bucket_created) {
- loadMinioBuckets()
- }
} catch (e: unknown) {
minioCheckResult.value = { ok: false, message: e instanceof Error ? e.message : t('settings.storage.requestFailed') }
} finally {
@@ -942,81 +965,166 @@ onMounted(loadAll)
align-items: center;
}
-.engine-section {
- margin-top: 32px;
- padding-top: 32px;
- border-top: 1px solid var(--td-component-stroke);
+// ---- 引擎卡片布局 ----
+.engine-cards {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
+ gap: 16px;
+ margin-top: 24px;
}
-.engine-header {
- margin-bottom: 16px;
+.engine-card {
+ border: 1px solid var(--td-component-stroke);
+ border-radius: 8px;
+ padding: 16px;
+ cursor: pointer;
+ transition: all 0.2s ease;
+ background: var(--td-bg-color-container);
+ display: flex;
+ flex-direction: column;
+
+ &:hover {
+ border-color: var(--td-brand-color);
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+ }
+
+ &.active {
+ border-color: var(--td-brand-color);
+ background: rgba(var(--td-brand-color-5-rgba), 0.05);
+ }
}
-.engine-header-info {
- .engine-title-row {
- display: flex;
- align-items: center;
- gap: 8px;
- margin-bottom: 6px;
-
- h3 {
- font-size: 17px;
- font-weight: 600;
- color: var(--td-text-color-primary);
- margin: 0;
- }
+.engine-card-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ margin-bottom: 8px;
+
+ h3 {
+ font-size: 15px;
+ font-weight: 600;
+ color: var(--td-text-color-primary);
+ margin: 0;
+ font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
+}
+
+.engine-card-desc {
+ font-size: 13px;
+ color: var(--td-text-color-secondary);
+ margin: 0;
+ line-height: 1.5;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
- p {
+// ---- 抽屉内容 ----
+.drawer-content {
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
+}
+
+.engine-info-block {
+ .engine-desc {
font-size: 13px;
- color: var(--td-text-color-placeholder);
- margin: 0;
+ color: var(--td-text-color-secondary);
+ margin: 0 0 8px 0;
line-height: 1.5;
}
}
+// 输入框样式
+:deep(.t-input),
+:deep(.t-select) {
+ width: 100%;
+ font-size: 13px;
+
+ .t-input__inner,
+ .t-input__wrap,
+ input {
+ font-size: 13px;
+ border-radius: 6px;
+ border-color: var(--td-component-stroke);
+ transition: all 0.15s ease;
+ }
+
+ &:hover .t-input__inner,
+ &:hover .t-input__wrap,
+ &:hover input {
+ border-color: var(--td-component-stroke);
+ }
+
+ &.t-is-focused .t-input__inner,
+ &.t-is-focused .t-input__wrap,
+ &.t-is-focused input {
+ border-color: var(--td-brand-color);
+ box-shadow: 0 0 0 2px rgba(7, 192, 95, 0.1);
+ }
+}
+
.engine-link {
- color: var(--td-text-color-placeholder);
+ color: var(--td-brand-color);
text-decoration: none;
margin-left: 4px;
+ font-size: 13px;
&:hover {
- color: var(--td-brand-color);
+ text-decoration: underline;
}
}
.engine-form {
display: flex;
flex-direction: column;
- gap: 16px;
+ gap: 0;
}
-.form-field {
- display: flex;
- flex-direction: column;
- gap: 6px;
+.form-item {
+ margin-bottom: 20px;
- label {
- font-size: 13px;
- font-weight: 500;
- color: var(--td-text-color-secondary);
+ &:last-child {
+ margin-bottom: 0;
}
+}
- &--inline {
- flex-direction: row;
- align-items: center;
- gap: 12px;
+.form-label {
+ display: block;
+ margin-bottom: 8px;
+ font-size: 14px;
+ font-weight: 500;
+ color: var(--td-text-color-primary);
- label {
- flex-shrink: 0;
- }
+ &.required::after {
+ content: '*';
+ color: var(--td-error-color);
+ margin-left: 4px;
+ font-weight: 600;
+ }
+}
+
+.form-item--inline {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ margin-bottom: 20px;
+
+ .form-label {
+ margin-bottom: 0;
+ flex-shrink: 0;
}
}
.mode-selector {
display: flex;
gap: 8px;
- margin-bottom: 16px;
+ margin-bottom: 20px;
}
.mode-option {
@@ -1069,41 +1177,71 @@ onMounted(loadAll)
}
}
-.test-bar {
+.drawer-actions {
display: flex;
align-items: center;
- gap: 12px;
margin-top: 16px;
padding-top: 16px;
- border-top: 1px solid var(--td-component-stroke);
+ border-top: 1px dashed var(--td-component-stroke);
}
-.test-msg {
- font-size: 13px;
+.api-test-section {
+ display: flex;
+ align-items: center;
+ gap: 12px;
- &.success {
- color: var(--td-success-color);
- }
+ .test-message {
+ font-size: 13px;
+ line-height: 1.5;
+ flex: 1;
- &.created {
- color: var(--td-warning-color);
+ &.success {
+ color: var(--td-brand-color-active);
+ }
+
+ &.error {
+ color: var(--td-error-color);
+ }
+
+ &.created {
+ color: var(--td-warning-color);
+ }
}
- &.error {
- color: var(--td-error-color);
+ :deep(.t-button) {
+ min-width: 88px;
+ height: 32px;
+ font-size: 13px;
+ border-radius: 6px;
+ flex-shrink: 0;
}
}
-.save-bar {
+.drawer-footer-actions {
display: flex;
- align-items: center;
+ justify-content: flex-end;
gap: 12px;
- position: sticky;
- bottom: 0;
- margin-top: 32px;
- padding: 16px 0 4px;
- background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, var(--td-bg-color-container) 12%);
- z-index: 10;
+ width: 100%;
+
+ :deep(.t-button) {
+ min-width: 80px;
+ height: 36px;
+ font-weight: 500;
+ font-size: 14px;
+ border-radius: 6px;
+ transition: all 0.15s ease;
+
+ &.t-button--variant-outline {
+ color: var(--td-text-color-secondary);
+ border-color: var(--td-component-stroke);
+
+ &:hover {
+ border-color: var(--td-brand-color);
+ color: var(--td-brand-color);
+ background: rgba(7, 192, 95, 0.04);
+ }
+ }
+ }
}
.save-msg {
diff --git a/internal/handler/system.go b/internal/handler/system.go
index 1af6391d2..55acee0aa 100644
--- a/internal/handler/system.go
+++ b/internal/handler/system.go
@@ -2,7 +2,6 @@ package handler
import (
"context"
- "encoding/json"
"fmt"
"net"
"os"
@@ -442,18 +441,6 @@ func (h *SystemHandler) isTOSEnvAvailable() bool {
os.Getenv("TOS_BUCKET_NAME") != ""
}
-// MinioBucketInfo represents bucket information with access policy
-type MinioBucketInfo struct {
- Name string `json:"name"`
- Policy string `json:"policy"` // "public", "private", "custom"
- CreatedAt string `json:"created_at,omitempty"`
-}
-
-// ListMinioBucketsResponse defines the response structure for listing buckets
-type ListMinioBucketsResponse struct {
- Buckets []MinioBucketInfo `json:"buckets"`
-}
-
// StorageEngineStatusItem describes one storage engine's availability and description.
type StorageEngineStatusItem struct {
Name string `json:"name"` // "local", "minio", "cos", "tos"
@@ -494,188 +481,7 @@ func (h *SystemHandler) GetStorageEngineStatus(c *gin.Context) {
})
}
-// ListMinioBuckets godoc
-// @Summary 列出 MinIO 存储桶
-// @Description 获取所有 MinIO 存储桶及其访问权限
-// @Tags 系统
-// @Accept json
-// @Produce json
-// @Success 200 {object} ListMinioBucketsResponse "存储桶列表"
-// @Failure 400 {object} map[string]interface{} "MinIO 未启用"
-// @Failure 500 {object} map[string]interface{} "服务器错误"
-// @Router /system/minio/buckets [get]
-func (h *SystemHandler) ListMinioBuckets(c *gin.Context) {
- ctx := logger.CloneContext(c.Request.Context())
-
- endpoint, accessKeyID, secretAccessKey := h.getMinioConfig(c)
- if endpoint == "" || accessKeyID == "" || secretAccessKey == "" {
- logger.Warn(ctx, "MinIO is not configured")
- c.JSON(400, gin.H{
- "code": 400,
- "msg": "MinIO is not configured",
- "success": false,
- })
- return
- }
-
- useSSL := os.Getenv("MINIO_USE_SSL") == "true"
- if v, exists := c.Get(types.TenantInfoContextKey.String()); exists {
- if tenant, ok := v.(*types.Tenant); ok && tenant != nil && tenant.StorageEngineConfig != nil && tenant.StorageEngineConfig.MinIO != nil {
- useSSL = tenant.StorageEngineConfig.MinIO.UseSSL
- }
- }
-
- // Create MinIO client
- minioClient, err := minio.New(endpoint, &minio.Options{
- Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
- Secure: useSSL,
- })
- if err != nil {
- logger.Error(ctx, "Failed to create MinIO client", "error", err)
- c.JSON(500, gin.H{
- "code": 500,
- "msg": "Failed to connect to MinIO",
- "success": false,
- })
- return
- }
-
- // List all buckets
- buckets, err := minioClient.ListBuckets(context.Background())
- if err != nil {
- logger.Error(ctx, "Failed to list MinIO buckets", "error", err)
- c.JSON(500, gin.H{
- "code": 500,
- "msg": "Failed to list buckets",
- "success": false,
- })
- return
- }
-
- // Get policy for each bucket
- bucketInfos := make([]MinioBucketInfo, 0, len(buckets))
- for _, bucket := range buckets {
- policy := "private" // default: no policy means private
-
- // Try to get bucket policy
- policyStr, err := minioClient.GetBucketPolicy(context.Background(), bucket.Name)
- if err == nil && policyStr != "" {
- policy = parseBucketPolicy(policyStr)
- }
- // If err != nil or policyStr is empty, bucket has no policy (private)
-
- bucketInfos = append(bucketInfos, MinioBucketInfo{
- Name: bucket.Name,
- Policy: policy,
- CreatedAt: bucket.CreationDate.Format("2006-01-02 15:04:05"),
- })
- }
-
- logger.Info(ctx, "Listed MinIO buckets successfully", "count", len(bucketInfos))
- c.JSON(200, gin.H{
- "code": 0,
- "msg": "success",
- "success": true,
- "data": ListMinioBucketsResponse{Buckets: bucketInfos},
- })
-}
-
-// BucketPolicy represents the S3 bucket policy structure
-type BucketPolicy struct {
- Version string `json:"Version"`
- Statement []PolicyStatement `json:"Statement"`
-}
-
-// PolicyStatement represents a single statement in the bucket policy
-type PolicyStatement struct {
- Effect string `json:"Effect"`
- Principal interface{} `json:"Principal"` // Can be "*" or {"AWS": [...]}
- Action interface{} `json:"Action"` // Can be string or []string
- Resource interface{} `json:"Resource"` // Can be string or []string
-}
-
-// parseBucketPolicy parses the policy JSON and determines the access type
-func parseBucketPolicy(policyStr string) string {
- var policy BucketPolicy
- if err := json.Unmarshal([]byte(policyStr), &policy); err != nil {
- // If we can't parse the policy, treat it as custom
- return "custom"
- }
-
- // Check if any statement grants public read access
- hasPublicRead := false
- for _, stmt := range policy.Statement {
- if stmt.Effect != "Allow" {
- continue
- }
-
- // Check if Principal is "*" (public)
- if !isPrincipalPublic(stmt.Principal) {
- continue
- }
-
- // Check if Action includes s3:GetObject
- if !hasGetObjectAction(stmt.Action) {
- continue
- }
-
- hasPublicRead = true
- break
- }
-
- if hasPublicRead {
- return "public"
- }
-
- // Has policy but not public read
- return "custom"
-}
-
-// isPrincipalPublic checks if the principal allows public access
-func isPrincipalPublic(principal interface{}) bool {
- switch p := principal.(type) {
- case string:
- return p == "*"
- case map[string]interface{}:
- // Check for {"AWS": "*"} or {"AWS": ["*"]}
- if aws, ok := p["AWS"]; ok {
- switch a := aws.(type) {
- case string:
- return a == "*"
- case []interface{}:
- for _, v := range a {
- if s, ok := v.(string); ok && s == "*" {
- return true
- }
- }
- }
- }
- }
- return false
-}
-
-// hasGetObjectAction checks if the action includes s3:GetObject
-func hasGetObjectAction(action interface{}) bool {
- checkAction := func(a string) bool {
- a = strings.ToLower(a)
- return a == "s3:getobject" || a == "s3:*" || a == "*"
- }
-
- switch act := action.(type) {
- case string:
- return checkAction(act)
- case []interface{}:
- for _, v := range act {
- if s, ok := v.(string); ok && checkAction(s) {
- return true
- }
- }
- }
- return false
-}
-
// --- Storage engine helpers ---
-
// cosFieldPattern validates COS region and bucket name format to prevent URL injection.
var cosFieldPattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9._-]{0,62}$`)
diff --git a/internal/router/router.go b/internal/router/router.go
index cfa377362..d0673a98b 100644
--- a/internal/router/router.go
+++ b/internal/router/router.go
@@ -448,7 +448,6 @@ func RegisterSystemRoutes(r *gin.RouterGroup, handler *handler.SystemHandler) {
systemRoutes.POST("/docreader/reconnect", handler.ReconnectDocReader)
systemRoutes.GET("/storage-engine-status", handler.GetStorageEngineStatus)
systemRoutes.POST("/storage-engine-check", handler.CheckStorageEngine)
- systemRoutes.GET("/minio/buckets", handler.ListMinioBuckets)
}
}