From 491c324197c772d0588f2c5b13877b0bda5a9997 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Thu, 16 Apr 2026 17:32:35 +0800 Subject: [PATCH] feat(system): remove MinIO list buckets API and UI dependencies --- client/system.go | 25 - docs/docs.go | 3046 ++++++++++------- docs/swagger.json | 3046 ++++++++++------- docs/swagger.yaml | 2335 ++++++++----- frontend/src/api/system/index.ts | 14 - .../views/settings/ParserEngineSettings.vue | 678 ++-- frontend/src/views/settings/Settings.vue | 40 +- .../views/settings/StorageEngineSettings.vue | 1168 ++++--- internal/handler/system.go | 194 -- internal/router/router.go | 1 - 10 files changed, 6238 insertions(+), 4309 deletions(-) diff --git a/client/system.go b/client/system.go index b3377a8b..2e26c5f3 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 601fe390..8e7bae98 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,7 +8615,41 @@ const docTemplate = `{ "ApiKeyAuth": [] } ], - "description": "Returns the list of available web search providers from configuration", + "description": "List all vector stores for the current tenant, including environment-configured and user-created stores", + "produces": [ + "application/json" + ], + "tags": [ + "VectorStore" + ], + "summary": "List vector stores", + "responses": { + "200": { + "description": "List of vector stores (env + DB)", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "post": { + "security": [ + { + "Bearer": [] + }, + { + "ApiKeyAuth": [] + } + ], + "description": "Create a new vector store configuration for the current tenant", "consumes": [ "application/json" ], @@ -8582,12 +8657,349 @@ const docTemplate = `{ "application/json" ], "tags": [ - "web-search" + "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" + } + } ], - "summary": "Get available web search providers", "responses": { "200": { - "description": "List of providers", + "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 @@ -8598,7 +9010,7 @@ const docTemplate = `{ } }, "definitions": { - "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": { + "datasource.ConnectorMetadata": { "type": "object", "properties": { "auth_type": { @@ -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,7 +9101,814 @@ const docTemplate = `{ "ErrAgentInvalidTemperature" ] }, - "github_com_Tencent_WeKnora_internal_types.AgentConfig": { + "github_com_Tencent_WeKnora_internal_errors.AppError": { + "type": "object", + "properties": { + "code": { + "$ref": "#/definitions/errors.ErrorCode" + }, + "details": {}, + "message": { + "type": "string" + } + } + }, + "gorm.DeletedAt": { + "type": "object", + "properties": { + "time": { + "type": "string" + }, + "valid": { + "description": "Valid is true if Time is not NULL", + "type": "boolean" + } + } + }, + "handler.CopyKnowledgeBaseRequest": { + "type": "object", + "required": [ + "source_id" + ], + "properties": { + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + }, + "task_id": { + "type": "string" + } + } + }, + "handler.CreateAgentRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "avatar": { + "type": "string" + }, + "config": { + "$ref": "#/definitions/types.CustomAgentConfig" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "handler.CreateModelRequest": { + "type": "object", + "required": [ + "name", + "parameters", + "source", + "type" + ], + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parameters": { + "$ref": "#/definitions/types.ModelParameters" + }, + "source": { + "$ref": "#/definitions/types.ModelSource" + }, + "type": { + "$ref": "#/definitions/types.ModelType" + } + } + }, + "handler.CreateStoreRequest": { + "type": "object", + "required": [ + "connection_config", + "engine_type", + "name" + ], + "properties": { + "connection_config": { + "$ref": "#/definitions/types.ConnectionConfig" + }, + "engine_type": { + "$ref": "#/definitions/types.RetrieverEngineType" + }, + "index_config": { + "$ref": "#/definitions/types.IndexConfig" + }, + "name": { + "type": "string" + } + } + }, + "handler.DeleteTagRequest": { + "type": "object", + "properties": { + "exclude_ids": { + "description": "Chunk seq_ids to exclude from deletion", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "handler.EvaluationRequest": { + "type": "object", + "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" + } + } + }, + "handler.FabriTextRequest": { + "type": "object", + "required": [ + "model_id" + ], + "properties": { + "model_id": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "handler.GetStorageEngineStatusResponse": { + "type": "object", + "properties": { + "engines": { + "type": "array", + "items": { + "$ref": "#/definitions/handler.StorageEngineStatusItem" + } + }, + "minio_env_available": { + "type": "boolean" + } + } + }, + "handler.GetSystemInfoResponse": { + "type": "object", + "properties": { + "build_time": { + "type": "string" + }, + "commit_id": { + "type": "string" + }, + "db_version": { + "type": "string" + }, + "edition": { + "type": "string" + }, + "go_version": { + "type": "string" + }, + "graph_database_engine": { + "type": "string" + }, + "keyword_index_engine": { + "type": "string" + }, + "minio_enabled": { + "type": "boolean" + }, + "vector_store_engine": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "handler.KBModelConfigRequest": { + "type": "object", + "required": [ + "embeddingModelId", + "llmModelId" + ], + "properties": { + "asr_config": { + "$ref": "#/definitions/types.ASRConfig" + }, + "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" + }, + "llmModelId": { + "type": "string" + }, + "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" + } + } + }, + "questionGeneration": { + "description": "问题生成配置", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "questionCount": { + "type": "integer" + } + } + }, + "storageProvider": { + "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取", + "type": "string" + }, + "vlm_config": { + "$ref": "#/definitions/types.VLMConfig" + } + } + }, + "handler.RemoteModelCheckRequest": { + "type": "object", + "required": [ + "baseUrl", + "modelName" + ], + "properties": { + "apiKey": { + "type": "string" + }, + "baseUrl": { + "type": "string" + }, + "modelName": { + "type": "string" + }, + "provider": { + "type": "string" + } + } + }, + "handler.SearchMessagesRequest": { + "type": "object", + "required": [ + "query" + ], + "properties": { + "limit": { + "description": "Maximum number of results to return (default: 20)", + "type": "integer" + }, + "mode": { + "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")", + "type": "string" + }, + "query": { + "description": "Query text for search", + "type": "string" + }, + "session_ids": { + "description": "Filter by specific session IDs (optional)", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "handler.StorageCheckRequest": { + "type": "object", + "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" + }, + "s3": { + "$ref": "#/definitions/types.S3EngineConfig" + }, + "tos": { + "$ref": "#/definitions/types.TOSEngineConfig" + } + } + }, + "handler.StorageCheckResponse": { + "type": "object", + "properties": { + "bucket_created": { + "type": "boolean" + }, + "message": { + "type": "string" + }, + "ok": { + "type": "boolean" + } + } + }, + "handler.StorageEngineStatusItem": { + "type": "object", + "properties": { + "available": { + "description": "whether the engine can be used", + "type": "boolean" + }, + "description": { + "description": "short description for UI", + "type": "string" + }, + "name": { + "description": "\"local\", \"minio\", \"cos\", \"tos\"", + "type": "string" + } + } + }, + "handler.TestStoreRequest": { + "type": "object", + "required": [ + "connection_config", + "engine_type" + ], + "properties": { + "connection_config": { + "$ref": "#/definitions/types.ConnectionConfig" + }, + "engine_type": { + "$ref": "#/definitions/types.RetrieverEngineType" + } + } + }, + "handler.TextRelationExtractionRequest": { + "type": "object", + "required": [ + "model_id", + "tags", + "text" + ], + "properties": { + "model_id": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "text": { + "type": "string" + } + } + }, + "handler.UpdateAgentRequest": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "config": { + "$ref": "#/definitions/types.CustomAgentConfig" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "handler.UpdateChunkRequest": { + "type": "object", + "properties": { + "chunk_index": { + "type": "integer" + }, + "content": { + "type": "string" + }, + "embedding": { + "type": "array", + "items": { + "type": "number" + } + }, + "end_at": { + "type": "integer" + }, + "image_info": { + "type": "string" + }, + "is_enabled": { + "type": "boolean" + }, + "start_at": { + "type": "integer" + } + } + }, + "handler.UpdateKnowledgeBaseRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "config": { + "$ref": "#/definitions/types.KnowledgeBaseConfig" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "handler.UpdateModelRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parameters": { + "$ref": "#/definitions/types.ModelParameters" + }, + "source": { + "$ref": "#/definitions/types.ModelSource" + }, + "type": { + "$ref": "#/definitions/types.ModelType" + } + } + }, + "handler.UpdateStoreRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "handler.addSimilarQuestionsRequest": { + "type": "object", + "required": [ + "similar_questions" + ], + "properties": { + "similar_questions": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + } + } + }, + "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" + }, + "file_name": { + "description": "Original filename", + "type": "string" + }, + "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" + }, + "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.)", + "type": "array", + "items": { + "$ref": "#/definitions/handler_session.AttachmentUpload" + } + }, + "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", + "type": "array", + "items": { + "$ref": "#/definitions/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", + "type": "array", + "items": { + "type": "string" + } + }, + "mentioned_items": { + "description": "@mentioned knowledge bases and files", + "type": "array", + "items": { + "$ref": "#/definitions/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)", + "type": "string" + }, + "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" + }, + "title": { + "description": "Title for the session (optional)", + "type": "string" + } + } + }, + "handler_session.GenerateTitleRequest": { + "type": "object", + "required": [ + "messages" + ], + "properties": { + "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" + }, + "data": { + "description": "base64 data URI from frontend (data:image/png;base64,...)", + "type": "string" + }, + "url": { + "description": "serving URL after saving to storage", + "type": "string" + } + } + }, + "handler_session.MentionedItemRequest": { + "type": "object", + "properties": { + "id": { + "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" + } + } + }, + "handler_session.SearchKnowledgeRequest": { + "type": "object", + "required": [ + "query" + ], + "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)", + "type": "array", + "items": { + "type": "string" + } + }, + "knowledge_ids": { + "description": "IDs of specific knowledge (files) to search", + "type": "array", + "items": { + "type": "string" + } + }, + "query": { + "description": "Query text to search for", + "type": "string" + } + } + }, + "handler_session.StopSessionRequest": { + "type": "object", + "required": [ + "message_id" + ], + "properties": { + "message_id": { + "type": "string" + } + } + }, + "handler_session.batchDeleteRequest": { + "type": "object", + "properties": { + "delete_all": { + "type": "boolean" + }, + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "types.ASRConfig": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "language": { + "description": "optional: language hint for transcription", + "type": "string" + }, + "model_id": { + "type": "string" + } + } + }, + "types.AgentConfig": { "type": "object", "properties": { "allowed_skills": { @@ -8805,10 +10024,14 @@ const docTemplate = `{ "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.AgentStep": { + "types.AgentStep": { "type": "object", "properties": { "iteration": { @@ -8827,12 +10050,12 @@ const docTemplate = `{ "description": "Tools called in this step (Act phase)", "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall" + "$ref": "#/definitions/types.ToolCall" } } } }, - "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": { + "types.AnswerStrategy": { "type": "string", "enum": [ "all", @@ -8843,7 +10066,7 @@ const docTemplate = `{ "AnswerStrategyRandom" ] }, - "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": { + "types.COSEngineConfig": { "type": "object", "properties": { "app_id": { @@ -8866,7 +10089,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": { + "types.ChatHistoryConfig": { "type": "object", "properties": { "embedding_model_id": { @@ -8883,7 +10106,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": { + "types.ChunkingConfig": { "type": "object", "properties": { "child_chunk_size": { @@ -8914,7 +10137,7 @@ const docTemplate = `{ "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": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule" + "$ref": "#/definitions/types.ParserEngineRule" } }, "separators": { @@ -8926,7 +10149,52 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": { + "types.ConnectionConfig": { + "type": "object", + "properties": { + "addr": { + "description": "Common", + "type": "string" + }, + "api_key": { + "description": "AES-GCM encrypted", + "type": "string" + }, + "grpc_address": { + "description": "Weaviate", + "type": "string" + }, + "host": { + "description": "Qdrant", + "type": "string" + }, + "password": { + "description": "AES-GCM encrypted", + "type": "string" + }, + "port": { + "type": "integer" + }, + "scheme": { + "type": "string" + }, + "use_default_connection": { + "description": "Postgres", + "type": "boolean" + }, + "use_tls": { + "type": "boolean" + }, + "username": { + "type": "string" + }, + "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" + } + } + }, + "types.ContextCompressionStrategy": { "type": "string", "enum": [ "sliding_window", @@ -8937,14 +10205,14 @@ const docTemplate = `{ "ContextCompressionSmart" ] }, - "github_com_Tencent_WeKnora_internal_types.ContextConfig": { + "types.ContextConfig": { "type": "object", "properties": { "compression_strategy": { "description": "Compression strategy: \"sliding_window\" or \"smart\"", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy" + "$ref": "#/definitions/types.ContextCompressionStrategy" } ] }, @@ -8962,7 +10230,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ConversationConfig": { + "types.ConversationConfig": { "type": "object", "properties": { "context_template": { @@ -9032,7 +10300,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": { + "types.CreateOrganizationRequest": { "type": "object", "required": [ "name" @@ -9062,7 +10330,15 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": { + "types.CredentialsConfig": { + "type": "object", + "properties": { + "weknoracloud": { + "$ref": "#/definitions/types.WeKnoraCloudCredentials" + } + } + }, + "types.CustomAgentConfig": { "type": "object", "properties": { "agent_mode": { @@ -9076,6 +10352,14 @@ const docTemplate = `{ "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" @@ -9147,6 +10431,10 @@ const docTemplate = `{ "type": "string" } }, + "llm_call_timeout": { + "description": "Timeout for a single LLM call in seconds (0 = use global default)", + "type": "integer" + }, "max_completion_tokens": { "description": "Maximum completion tokens (only for normal mode)", "type": "integer" @@ -9247,6 +10535,14 @@ const docTemplate = `{ "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)", "type": "string" }, + "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 =====\nWhether web search is enabled", "type": "boolean" @@ -9254,10 +10550,14 @@ const docTemplate = `{ "web_search_max_results": { "description": "Maximum web search results", "type": "integer" + }, + "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.DataSource": { + "types.DataSource": { "type": "object", "properties": { "config": { @@ -9317,7 +10617,7 @@ const docTemplate = `{ "description": "Latest sync log (not stored in DB, populated on query)", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog" + "$ref": "#/definitions/types.SyncLog" } ] }, @@ -9363,7 +10663,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": { + "types.EmbeddingParameters": { "type": "object", "properties": { "dimension": { @@ -9374,7 +10674,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ExtractConfig": { + "types.ExtractConfig": { "type": "object", "properties": { "enabled": { @@ -9383,13 +10683,13 @@ const docTemplate = `{ "nodes": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode" + "$ref": "#/definitions/types.GraphNode" } }, "relations": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation" + "$ref": "#/definitions/types.GraphRelation" } }, "tags": { @@ -9403,7 +10703,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": { + "types.FAQBatchUpsertPayload": { "type": "object", "required": [ "entries" @@ -9416,7 +10716,7 @@ const docTemplate = `{ "entries": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload" + "$ref": "#/definitions/types.FAQEntryPayload" } }, "knowledge_id": { @@ -9435,32 +10735,32 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQConfig": { + "types.FAQConfig": { "type": "object", "properties": { "index_mode": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode" + "$ref": "#/definitions/types.FAQIndexMode" }, "question_index_mode": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode" + "$ref": "#/definitions/types.FAQQuestionIndexMode" } } }, - "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": { + "types.FAQEntryFieldsBatchUpdate": { "type": "object", "properties": { "by_id": { "description": "ByID 按条目ID更新,key为条目ID (seq_id)", "type": "object", "additionalProperties": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate" + "$ref": "#/definitions/types.FAQEntryFieldsUpdate" } }, "by_tag": { "description": "ByTag 按Tag批量更新,key为TagID (seq_id)", "type": "object", "additionalProperties": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate" + "$ref": "#/definitions/types.FAQEntryFieldsUpdate" } }, "exclude_ids": { @@ -9472,7 +10772,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": { + "types.FAQEntryFieldsUpdate": { "type": "object", "properties": { "is_enabled": { @@ -9486,14 +10786,14 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": { + "types.FAQEntryPayload": { "type": "object", "required": [ "standard_question" ], "properties": { "answer_strategy": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy" + "$ref": "#/definitions/types.AnswerStrategy" }, "answers": { "type": "array", @@ -9534,7 +10834,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": { + "types.FAQIndexMode": { "type": "string", "enum": [ "question_only", @@ -9545,7 +10845,7 @@ const docTemplate = `{ "FAQIndexModeQuestionAnswer" ] }, - "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": { + "types.FAQQuestionIndexMode": { "type": "string", "enum": [ "combined", @@ -9556,7 +10856,7 @@ const docTemplate = `{ "FAQQuestionIndexModeSeparate" ] }, - "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": { + "types.FAQSearchRequest": { "type": "object", "required": [ "query_text" @@ -9591,7 +10891,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.GraphNode": { + "types.GraphNode": { "type": "object", "properties": { "attributes": { @@ -9611,7 +10911,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.GraphRelation": { + "types.GraphRelation": { "type": "object", "properties": { "node1": { @@ -9625,7 +10925,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": { + "types.ImageProcessingConfig": { "type": "object", "properties": { "model_id": { @@ -9634,7 +10934,32 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": { + "types.IndexConfig": { + "type": "object", + "properties": { + "collection_name": { + "description": "Milvus", + "type": "string" + }, + "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" + } + } + }, + "types.InviteMemberRequest": { "type": "object", "required": [ "role", @@ -9645,7 +10970,7 @@ const docTemplate = `{ "description": "Role to assign: admin/editor/viewer", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] }, @@ -9655,7 +10980,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": { + "types.JoinByOrganizationIDRequest": { "type": "object", "required": [ "organization_id" @@ -9673,13 +10998,13 @@ const docTemplate = `{ "description": "Optional: requested role (admin/editor/viewer); default viewer", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": { + "types.JoinOrganizationRequest": { "type": "object", "required": [ "invite_code" @@ -9692,7 +11017,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.Knowledge": { + "types.Knowledge": { "type": "object", "properties": { "channel": { @@ -9815,9 +11140,17 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": { + "types.KnowledgeBase": { "type": "object", "properties": { + "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" @@ -9826,7 +11159,7 @@ const docTemplate = `{ "description": "Chunking configuration", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig" + "$ref": "#/definitions/types.ChunkingConfig" } ] }, @@ -9854,7 +11187,7 @@ const docTemplate = `{ "description": "Extract config", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig" + "$ref": "#/definitions/types.ExtractConfig" } ] }, @@ -9862,7 +11195,7 @@ const docTemplate = `{ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig" + "$ref": "#/definitions/types.FAQConfig" } ] }, @@ -9874,7 +11207,7 @@ const docTemplate = `{ "description": "Image processing configuration", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig" + "$ref": "#/definitions/types.ImageProcessingConfig" } ] }, @@ -9910,7 +11243,7 @@ const docTemplate = `{ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig" + "$ref": "#/definitions/types.QuestionGenerationConfig" } ] }, @@ -9922,7 +11255,7 @@ const docTemplate = `{ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig" + "$ref": "#/definitions/types.StorageConfig" } ] }, @@ -9930,7 +11263,7 @@ const docTemplate = `{ "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig" + "$ref": "#/definitions/types.StorageProviderConfig" } ] }, @@ -9954,20 +11287,20 @@ const docTemplate = `{ "description": "VLM config", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig" + "$ref": "#/definitions/types.VLMConfig" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": { + "types.KnowledgeBaseConfig": { "type": "object", "properties": { "chunking_config": { "description": "Chunking configuration", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig" + "$ref": "#/definitions/types.ChunkingConfig" } ] }, @@ -9975,7 +11308,7 @@ const docTemplate = `{ "description": "FAQ configuration (only for FAQ type knowledge bases)", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig" + "$ref": "#/definitions/types.FAQConfig" } ] }, @@ -9983,13 +11316,13 @@ const docTemplate = `{ "description": "Image processing configuration", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig" + "$ref": "#/definitions/types.ImageProcessingConfig" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": { + "types.KnowledgeBaseShareResponse": { "type": "object", "properties": { "chunk_count": { @@ -10045,13 +11378,13 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": { + "types.ListMembersResponse": { "type": "object", "properties": { "members": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse" + "$ref": "#/definitions/types.OrganizationMemberResponse" } }, "total": { @@ -10059,20 +11392,20 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": { + "types.ListOrganizationsResponse": { "type": "object", "properties": { "organizations": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse" + "$ref": "#/definitions/types.OrganizationResponse" } }, "resource_counts": { "description": "各空间内知识库/智能体数量,供列表侧栏展示", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse" + "$ref": "#/definitions/types.ResourceCountsByOrgResponse" } ] }, @@ -10081,13 +11414,13 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": { + "types.ListSharesResponse": { "type": "object", "properties": { "shares": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse" + "$ref": "#/definitions/types.KnowledgeBaseShareResponse" } }, "total": { @@ -10095,7 +11428,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": { + "types.LocalEngineConfig": { "type": "object", "properties": { "path_prefix": { @@ -10103,7 +11436,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.LoginRequest": { + "types.LoginRequest": { "type": "object", "required": [ "email", @@ -10119,7 +11452,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.LoginResponse": { + "types.LoginResponse": { "type": "object", "properties": { "message": { @@ -10132,17 +11465,17 @@ const docTemplate = `{ "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.MCPAdvancedConfig": { + "types.MCPAdvancedConfig": { "type": "object", "properties": { "retry_count": { @@ -10159,7 +11492,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": { + "types.MCPAuthConfig": { "type": "object", "properties": { "api_key": { @@ -10176,26 +11509,26 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": { + "types.MCPEnvVars": { "type": "object", "additionalProperties": { "type": "string" } }, - "github_com_Tencent_WeKnora_internal_types.MCPHeaders": { + "types.MCPHeaders": { "type": "object", "additionalProperties": { "type": "string" } }, - "github_com_Tencent_WeKnora_internal_types.MCPService": { + "types.MCPService": { "type": "object", "properties": { "advanced_config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig" + "$ref": "#/definitions/types.MCPAdvancedConfig" }, "auth_config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig" + "$ref": "#/definitions/types.MCPAuthConfig" }, "created_at": { "type": "string" @@ -10213,12 +11546,12 @@ const docTemplate = `{ "description": "Environment variables for stdio", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars" + "$ref": "#/definitions/types.MCPEnvVars" } ] }, "headers": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders" + "$ref": "#/definitions/types.MCPHeaders" }, "id": { "type": "string" @@ -10234,7 +11567,7 @@ const docTemplate = `{ "description": "Required for stdio transport", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig" + "$ref": "#/definitions/types.MCPStdioConfig" } ] }, @@ -10242,7 +11575,7 @@ const docTemplate = `{ "type": "integer" }, "transport_type": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType" + "$ref": "#/definitions/types.MCPTransportType" }, "updated_at": { "type": "string" @@ -10253,7 +11586,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": { + "types.MCPStdioConfig": { "type": "object", "properties": { "args": { @@ -10269,7 +11602,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.MCPTransportType": { + "types.MCPTransportType": { "type": "string", "enum": [ "sse", @@ -10292,7 +11625,7 @@ const docTemplate = `{ "MCPTransportStdio" ] }, - "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": { + "types.ManualKnowledgePayload": { "type": "object", "properties": { "channel": { @@ -10312,7 +11645,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.MatchType": { + "types.MatchType": { "type": "integer", "enum": [ 0, @@ -10358,7 +11691,7 @@ const docTemplate = `{ "MatchTypeDataAnalysis" ] }, - "github_com_Tencent_WeKnora_internal_types.MentionedItem": { + "types.MentionedItem": { "type": "object", "properties": { "id": { @@ -10377,7 +11710,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.Message": { + "types.Message": { "type": "object", "properties": { "agent_duration_ms": { @@ -10388,7 +11721,14 @@ const docTemplate = `{ "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": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep" + "$ref": "#/definitions/types.AgentStep" + } + }, + "attachments": { + "description": "Attached files (documents, audio, etc., for user messages)", + "type": "array", + "items": { + "$ref": "#/definitions/types.MessageAttachment" } }, "channel": { @@ -10419,7 +11759,7 @@ const docTemplate = `{ "description": "Attached images with OCR/Caption text (for user messages)", "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage" + "$ref": "#/definitions/types.MessageImage" } }, "is_completed": { @@ -10438,14 +11778,14 @@ const docTemplate = `{ "description": "References to knowledge chunks used in the response", "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult" + "$ref": "#/definitions/types.SearchResult" } }, "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/github_com_Tencent_WeKnora_internal_types.MentionedItem" + "$ref": "#/definitions/types.MentionedItem" } }, "request_id": { @@ -10466,7 +11806,40 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.MessageImage": { + "types.MessageAttachment": { + "type": "object", + "properties": { + "content": { + "description": "Extracted text content (for small text files)", + "type": "string" + }, + "file_name": { + "description": "Original filename", + "type": "string" + }, + "file_size": { + "description": "File size in bytes", + "type": "integer" + }, + "file_type": { + "description": "File extension (e.g., \".pdf\", \".docx\")", + "type": "string" + }, + "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" + } + } + }, + "types.MessageImage": { "type": "object", "properties": { "caption": { @@ -10477,7 +11850,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": { + "types.MinIOEngineConfig": { "type": "object", "properties": { "access_key_id": { @@ -10504,17 +11877,25 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ModelParameters": { + "types.ModelParameters": { "type": "object", "properties": { "api_key": { "type": "string" }, + "app_id": { + "description": "WeKnoraCloud 厂商专用凭证", + "type": "string" + }, + "app_secret": { + "description": "AES-256 加密存储,实际承载上游 API Key", + "type": "string" + }, "base_url": { "type": "string" }, "embedding_parameters": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters" + "$ref": "#/definitions/types.EmbeddingParameters" }, "extra_config": { "description": "Provider-specific configuration", @@ -10540,7 +11921,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ModelSource": { + "types.ModelSource": { "type": "string", "enum": [ "local", @@ -10558,10 +11939,12 @@ const docTemplate = `{ "jina", "openrouter", "nvidia", - "novita" + "novita", + "azure_openai" ], "x-enum-comments": { "ModelSourceAliyun": "Aliyun DashScope model", + "ModelSourceAzureOpenAI": "Azure OpenAI model", "ModelSourceDeepseek": "Deepseek model", "ModelSourceGemini": "Gemini model", "ModelSourceHunyuan": "Hunyuan model", @@ -10594,7 +11977,8 @@ const docTemplate = `{ "Jina AI model", "OpenRouter model", "NVIDIA model", - "Novita AI model" + "Novita AI model", + "Azure OpenAI model" ], "x-enum-varnames": [ "ModelSourceLocal", @@ -10612,18 +11996,21 @@ const docTemplate = `{ "ModelSourceJina", "ModelSourceOpenRouter", "ModelSourceNvidia", - "ModelSourceNovita" + "ModelSourceNovita", + "ModelSourceAzureOpenAI" ] }, - "github_com_Tencent_WeKnora_internal_types.ModelType": { + "types.ModelType": { "type": "string", "enum": [ "Embedding", "Rerank", "KnowledgeQA", - "VLLM" + "VLLM", + "ASR" ], "x-enum-comments": { + "ModelTypeASR": "ASR (Automatic Speech Recognition) model", "ModelTypeEmbedding": "Embedding model", "ModelTypeKnowledgeQA": "KnowledgeQA model", "ModelTypeRerank": "Rerank model", @@ -10633,16 +12020,18 @@ const docTemplate = `{ "Embedding model", "Rerank model", "KnowledgeQA model", - "VLLM model" + "VLLM model", + "ASR (Automatic Speech Recognition) model" ], "x-enum-varnames": [ "ModelTypeEmbedding", "ModelTypeRerank", "ModelTypeKnowledgeQA", - "ModelTypeVLLM" + "ModelTypeVLLM", + "ModelTypeASR" ] }, - "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": { + "types.OIDCAuthURLResponse": { "type": "object", "properties": { "authorization_url": { @@ -10659,7 +12048,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": { + "types.OIDCConfigResponse": { "type": "object", "properties": { "enabled": { @@ -10673,7 +12062,39 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": { + "types.OSSEngineConfig": { + "type": "object", + "properties": { + "access_key": { + "type": "string" + }, + "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" + } + } + }, + "types.OrgMemberRole": { "type": "string", "enum": [ "admin", @@ -10686,7 +12107,7 @@ const docTemplate = `{ "OrgRoleViewer" ] }, - "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": { + "types.OrganizationMemberResponse": { "type": "object", "properties": { "avatar": { @@ -10715,7 +12136,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": { + "types.OrganizationResponse": { "type": "object", "properties": { "agent_share_count": { @@ -10785,13 +12206,9 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": { + "types.ParserEngineConfig": { "type": "object", "properties": { - "docreader_addr": { - "description": "文档解析服务地址", - "type": "string" - }, "mineru_api_key": { "description": "MinerU 云 API Key", "type": "string" @@ -10834,7 +12251,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": { + "types.ParserEngineRule": { "type": "object", "properties": { "engine": { @@ -10848,7 +12265,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": { + "types.QuestionGenerationConfig": { "type": "object", "properties": { "enabled": { @@ -10860,7 +12277,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.RegisterRequest": { + "types.RegisterRequest": { "type": "object", "required": [ "email", @@ -10882,7 +12299,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.RegisterResponse": { + "types.RegisterResponse": { "type": "object", "properties": { "message": { @@ -10892,14 +12309,14 @@ const docTemplate = `{ "type": "boolean" }, "tenant": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant" + "$ref": "#/definitions/types.Tenant" }, "user": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User" + "$ref": "#/definitions/types.User" } } }, - "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": { + "types.RequestRoleUpgradeRequest": { "type": "object", "required": [ "requested_role" @@ -10914,13 +12331,13 @@ const docTemplate = `{ "description": "The role user wants to upgrade to", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.Resource": { + "types.Resource": { "type": "object", "properties": { "description": { @@ -10931,6 +12348,10 @@ const docTemplate = `{ "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", @@ -10958,7 +12379,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": { + "types.ResourceCountsByOrgResponse": { "type": "object", "properties": { "agents": { @@ -10985,7 +12406,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": { + "types.RetrievalConfig": { "type": "object", "properties": { "embedding_top_k": { @@ -11014,14 +12435,14 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": { + "types.RetrieverEngineParams": { "type": "object", "properties": { "retriever_engine_type": { "description": "Retriever engine type", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType" + "$ref": "#/definitions/types.RetrieverEngineType" } ] }, @@ -11029,13 +12450,13 @@ const docTemplate = `{ "description": "Retriever type", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType" + "$ref": "#/definitions/types.RetrieverType" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": { + "types.RetrieverEngineType": { "type": "string", "enum": [ "postgres", @@ -11058,18 +12479,18 @@ const docTemplate = `{ "SQLiteRetrieverEngineType" ] }, - "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": { + "types.RetrieverEngines": { "type": "object", "properties": { "engines": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams" + "$ref": "#/definitions/types.RetrieverEngineParams" } } } }, - "github_com_Tencent_WeKnora_internal_types.RetrieverType": { + "types.RetrieverType": { "type": "string", "enum": [ "keywords", @@ -11092,7 +12513,7 @@ const docTemplate = `{ "WebSearchRetrieverType" ] }, - "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": { + "types.ReviewJoinRequestRequest": { "type": "object", "properties": { "approved": { @@ -11106,13 +12527,13 @@ const docTemplate = `{ "description": "Optional: role to assign when approving; overrides applicant's requested role", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": { + "types.S3EngineConfig": { "type": "object", "properties": { "access_key": { @@ -11135,7 +12556,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.SearchParams": { + "types.SearchParams": { "type": "object", "properties": { "disable_keywords_match": { @@ -11191,7 +12612,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.SearchResult": { + "types.SearchResult": { "type": "object", "properties": { "chunk_index": { @@ -11257,7 +12678,7 @@ const docTemplate = `{ "description": "Match type", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType" + "$ref": "#/definitions/types.MatchType" } ] }, @@ -11297,7 +12718,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.Session": { + "types.Session": { "type": "object", "properties": { "created_at": { @@ -11327,7 +12748,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": { + "types.ShareKnowledgeBaseRequest": { "type": "object", "required": [ "organization_id", @@ -11338,11 +12759,11 @@ const docTemplate = `{ "type": "string" }, "permission": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } } }, - "github_com_Tencent_WeKnora_internal_types.StorageConfig": { + "types.StorageConfig": { "type": "object", "properties": { "app_id": { @@ -11368,40 +12789,43 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": { + "types.StorageEngineConfig": { "type": "object", "properties": { "cos": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig" + "$ref": "#/definitions/types.COSEngineConfig" }, "default_provider": { - "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\"", + "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"", "type": "string" }, "local": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig" + "$ref": "#/definitions/types.LocalEngineConfig" }, "minio": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig" + "$ref": "#/definitions/types.MinIOEngineConfig" + }, + "oss": { + "$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" + "$ref": "#/definitions/types.TOSEngineConfig" } } }, - "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": { + "types.StorageProviderConfig": { "type": "object", "properties": { "provider": { - "description": "\"local\", \"minio\", \"cos\", \"tos\"", + "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"", "type": "string" } } }, - "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": { + "types.SubmitJoinRequestRequest": { "type": "object", "required": [ "invite_code" @@ -11420,13 +12844,13 @@ const docTemplate = `{ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.SyncLog": { + "types.SyncLog": { "type": "object", "properties": { "created_at": { @@ -11498,7 +12922,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": { + "types.TOSEngineConfig": { "type": "object", "properties": { "access_key": { @@ -11521,14 +12945,14 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.Tenant": { + "types.Tenant": { "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" + "$ref": "#/definitions/types.AgentConfig" } ] }, @@ -11544,7 +12968,7 @@ const docTemplate = `{ "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" + "$ref": "#/definitions/types.ChatHistoryConfig" } ] }, @@ -11552,7 +12976,7 @@ const docTemplate = `{ "description": "Global Context configuration for this tenant (default for all sessions)", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig" + "$ref": "#/definitions/types.ContextConfig" } ] }, @@ -11560,7 +12984,7 @@ const docTemplate = `{ "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" + "$ref": "#/definitions/types.ConversationConfig" } ] }, @@ -11568,6 +12992,14 @@ const docTemplate = `{ "description": "Creation time", "type": "string" }, + "credentials": { + "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)", + "allOf": [ + { + "$ref": "#/definitions/types.CredentialsConfig" + } + ] + }, "deleted_at": { "description": "Deletion time", "allOf": [ @@ -11592,7 +13024,7 @@ const docTemplate = `{ "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" + "$ref": "#/definitions/types.ParserEngineConfig" } ] }, @@ -11600,7 +13032,7 @@ const docTemplate = `{ "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig" + "$ref": "#/definitions/types.RetrievalConfig" } ] }, @@ -11608,7 +13040,7 @@ const docTemplate = `{ "description": "Retriever engines", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines" + "$ref": "#/definitions/types.RetrieverEngines" } ] }, @@ -11620,7 +13052,7 @@ const docTemplate = `{ "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" + "$ref": "#/definitions/types.StorageEngineConfig" } ] }, @@ -11640,13 +13072,13 @@ const docTemplate = `{ "description": "Global WebSearch configuration for this tenant", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig" + "$ref": "#/definitions/types.WebSearchConfig" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.ToolCall": { + "types.ToolCall": { "type": "object", "properties": { "args": { @@ -11674,13 +13106,13 @@ const docTemplate = `{ "description": "Execution result (contains Output)", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult" + "$ref": "#/definitions/types.ToolResult" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.ToolResult": { + "types.ToolResult": { "type": "object", "properties": { "data": { @@ -11709,18 +13141,18 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": { + "types.UpdateMemberRoleRequest": { "type": "object", "required": [ "role" ], "properties": { "role": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } } }, - "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": { + "types.UpdateOrganizationRequest": { "type": "object", "properties": { "avatar": { @@ -11754,18 +13186,18 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": { + "types.UpdateSharePermissionRequest": { "type": "object", "required": [ "permission" ], "properties": { "permission": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } } }, - "github_com_Tencent_WeKnora_internal_types.User": { + "types.User": { "type": "object", "properties": { "avatar": { @@ -11804,7 +13236,7 @@ const docTemplate = `{ "description": "Association relationship, not stored in the database", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant" + "$ref": "#/definitions/types.Tenant" } ] }, @@ -11822,7 +13254,7 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.VLMConfig": { + "types.VLMConfig": { "type": "object", "properties": { "api_key": { @@ -11849,11 +13281,22 @@ const docTemplate = `{ } } }, - "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": { + "types.WeKnoraCloudCredentials": { + "type": "object", + "properties": { + "app_id": { + "type": "string" + }, + "app_secret": { + "type": "string" + } + } + }, + "types.WebSearchConfig": { "type": "object", "properties": { "api_key": { - "description": "API密钥(如果需要)", + "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.", "type": "string" }, "blacklist": { @@ -11888,7 +13331,7 @@ const docTemplate = `{ "type": "integer" }, "provider": { - "description": "搜索引擎提供商ID", + "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.", "type": "string" }, "rerank_model_id": { @@ -11896,731 +13339,6 @@ const docTemplate = `{ "type": "string" } } - }, - "gorm.DeletedAt": { - "type": "object", - "properties": { - "time": { - "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": { - "type": "string" - }, - "target_id": { - "type": "string" - }, - "task_id": { - "type": "string" - } - } - }, - "internal_handler.CreateAgentRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "avatar": { - "type": "string" - }, - "config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig" - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "internal_handler.CreateModelRequest": { - "type": "object", - "required": [ - "name", - "parameters", - "source", - "type" - ], - "properties": { - "description": { - "type": "string" - }, - "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" - } - } - }, - "internal_handler.DeleteTagRequest": { - "type": "object", - "properties": { - "exclude_ids": { - "description": "Chunk seq_ids to exclude from deletion", - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "internal_handler.EvaluationRequest": { - "type": "object", - "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" - } - } - }, - "internal_handler.FabriTextRequest": { - "type": "object", - "required": [ - "model_id" - ], - "properties": { - "model_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" - } - } - }, - "internal_handler.GetSystemInfoResponse": { - "type": "object", - "properties": { - "build_time": { - "type": "string" - }, - "commit_id": { - "type": "string" - }, - "db_version": { - "type": "string" - }, - "edition": { - "type": "string" - }, - "go_version": { - "type": "string" - }, - "graph_database_engine": { - "type": "string" - }, - "keyword_index_engine": { - "type": "string" - }, - "minio_enabled": { - "type": "boolean" - }, - "vector_store_engine": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "internal_handler.KBModelConfigRequest": { - "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" - }, - "llmModelId": { - "type": "string" - }, - "multimodal": { - "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)", - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - } - } - }, - "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" - } - } - }, - "questionGeneration": { - "description": "问题生成配置", - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "questionCount": { - "type": "integer" - } - } - }, - "storageProvider": { - "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取", - "type": "string" - }, - "vlm_config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig" - } - } - }, - "internal_handler.ListMinioBucketsResponse": { - "type": "object", - "properties": { - "buckets": { - "type": "array", - "items": { - "$ref": "#/definitions/internal_handler.MinioBucketInfo" - } - } - } - }, - "internal_handler.MinioBucketInfo": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "name": { - "type": "string" - }, - "policy": { - "description": "\"public\", \"private\", \"custom\"", - "type": "string" - } - } - }, - "internal_handler.RemoteModelCheckRequest": { - "type": "object", - "required": [ - "baseUrl", - "modelName" - ], - "properties": { - "apiKey": { - "type": "string" - }, - "baseUrl": { - "type": "string" - }, - "modelName": { - "type": "string" - } - } - }, - "internal_handler.SearchMessagesRequest": { - "type": "object", - "required": [ - "query" - ], - "properties": { - "limit": { - "description": "Maximum number of results to return (default: 20)", - "type": "integer" - }, - "mode": { - "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")", - "type": "string" - }, - "query": { - "description": "Query text for search", - "type": "string" - }, - "session_ids": { - "description": "Filter by specific session IDs (optional)", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "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\"", - "type": "string" - }, - "s3": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig" - }, - "tos": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig" - } - } - }, - "internal_handler.StorageCheckResponse": { - "type": "object", - "properties": { - "bucket_created": { - "type": "boolean" - }, - "message": { - "type": "string" - }, - "ok": { - "type": "boolean" - } - } - }, - "internal_handler.StorageEngineStatusItem": { - "type": "object", - "properties": { - "available": { - "description": "whether the engine can be used", - "type": "boolean" - }, - "description": { - "description": "short description for UI", - "type": "string" - }, - "name": { - "description": "\"local\", \"minio\", \"cos\", \"tos\"", - "type": "string" - } - } - }, - "internal_handler.TextRelationExtractionRequest": { - "type": "object", - "required": [ - "model_id", - "tags", - "text" - ], - "properties": { - "model_id": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "text": { - "type": "string" - } - } - }, - "internal_handler.UpdateAgentRequest": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig" - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "internal_handler.UpdateChunkRequest": { - "type": "object", - "properties": { - "chunk_index": { - "type": "integer" - }, - "content": { - "type": "string" - }, - "embedding": { - "type": "array", - "items": { - "type": "number" - } - }, - "end_at": { - "type": "integer" - }, - "image_info": { - "type": "string" - }, - "is_enabled": { - "type": "boolean" - }, - "start_at": { - "type": "integer" - } - } - }, - "internal_handler.UpdateKnowledgeBaseRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig" - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "internal_handler.UpdateModelRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "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" - } - } - }, - "internal_handler.addSimilarQuestionsRequest": { - "type": "object", - "required": [ - "similar_questions" - ], - "properties": { - "similar_questions": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - }, - "internal_handler.updateLastFAQImportResultDisplayStatusRequest": { - "type": "object", - "required": [ - "display_status" - ], - "properties": { - "display_status": { - "type": "string", - "enum": [ - "open", - "close" - ] - } - } - }, - "internal_handler_session.CreateKnowledgeQARequest": { - "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" - }, - "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", - "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", - "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)", - "type": "string" - }, - "web_search_enabled": { - "description": "Whether web search is enabled for this request", - "type": "boolean" - } - } - }, - "internal_handler_session.CreateSessionRequest": { - "type": "object", - "properties": { - "description": { - "description": "Description for the session (optional)", - "type": "string" - }, - "title": { - "description": "Title for the session (optional)", - "type": "string" - } - } - }, - "internal_handler_session.GenerateTitleRequest": { - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "description": "Messages to use as context for title generation", - "type": "array", - "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Message" - } - } - } - }, - "internal_handler_session.ImageAttachment": { - "type": "object", - "properties": { - "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" - } - } - }, - "internal_handler_session.MentionedItemRequest": { - "type": "object", - "properties": { - "id": { - "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" - } - } - }, - "internal_handler_session.SearchKnowledgeRequest": { - "type": "object", - "required": [ - "query" - ], - "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)", - "type": "array", - "items": { - "type": "string" - } - }, - "knowledge_ids": { - "description": "IDs of specific knowledge (files) to search", - "type": "array", - "items": { - "type": "string" - } - }, - "query": { - "description": "Query text to search for", - "type": "string" - } - } - }, - "internal_handler_session.StopSessionRequest": { - "type": "object", - "required": [ - "message_id" - ], - "properties": { - "message_id": { - "type": "string" - } - } - }, - "internal_handler_session.batchDeleteRequest": { - "type": "object", - "properties": { - "delete_all": { - "type": "boolean" - }, - "ids": { - "type": "array", - "items": { - "type": "string" - } - } - } } }, "securityDefinitions": { diff --git a/docs/swagger.json b/docs/swagger.json index 9891d92d..13adbdb1 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,7 +8608,41 @@ "ApiKeyAuth": [] } ], - "description": "Returns the list of available web search providers from configuration", + "description": "List all vector stores for the current tenant, including environment-configured and user-created stores", + "produces": [ + "application/json" + ], + "tags": [ + "VectorStore" + ], + "summary": "List vector stores", + "responses": { + "200": { + "description": "List of vector stores (env + DB)", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "post": { + "security": [ + { + "Bearer": [] + }, + { + "ApiKeyAuth": [] + } + ], + "description": "Create a new vector store configuration for the current tenant", "consumes": [ "application/json" ], @@ -8575,12 +8650,349 @@ "application/json" ], "tags": [ - "web-search" + "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" + } + } ], - "summary": "Get available web search providers", "responses": { "200": { - "description": "List of providers", + "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 @@ -8591,7 +9003,7 @@ } }, "definitions": { - "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": { + "datasource.ConnectorMetadata": { "type": "object", "properties": { "auth_type": { @@ -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,7 +9094,814 @@ "ErrAgentInvalidTemperature" ] }, - "github_com_Tencent_WeKnora_internal_types.AgentConfig": { + "github_com_Tencent_WeKnora_internal_errors.AppError": { + "type": "object", + "properties": { + "code": { + "$ref": "#/definitions/errors.ErrorCode" + }, + "details": {}, + "message": { + "type": "string" + } + } + }, + "gorm.DeletedAt": { + "type": "object", + "properties": { + "time": { + "type": "string" + }, + "valid": { + "description": "Valid is true if Time is not NULL", + "type": "boolean" + } + } + }, + "handler.CopyKnowledgeBaseRequest": { + "type": "object", + "required": [ + "source_id" + ], + "properties": { + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + }, + "task_id": { + "type": "string" + } + } + }, + "handler.CreateAgentRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "avatar": { + "type": "string" + }, + "config": { + "$ref": "#/definitions/types.CustomAgentConfig" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "handler.CreateModelRequest": { + "type": "object", + "required": [ + "name", + "parameters", + "source", + "type" + ], + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parameters": { + "$ref": "#/definitions/types.ModelParameters" + }, + "source": { + "$ref": "#/definitions/types.ModelSource" + }, + "type": { + "$ref": "#/definitions/types.ModelType" + } + } + }, + "handler.CreateStoreRequest": { + "type": "object", + "required": [ + "connection_config", + "engine_type", + "name" + ], + "properties": { + "connection_config": { + "$ref": "#/definitions/types.ConnectionConfig" + }, + "engine_type": { + "$ref": "#/definitions/types.RetrieverEngineType" + }, + "index_config": { + "$ref": "#/definitions/types.IndexConfig" + }, + "name": { + "type": "string" + } + } + }, + "handler.DeleteTagRequest": { + "type": "object", + "properties": { + "exclude_ids": { + "description": "Chunk seq_ids to exclude from deletion", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "handler.EvaluationRequest": { + "type": "object", + "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" + } + } + }, + "handler.FabriTextRequest": { + "type": "object", + "required": [ + "model_id" + ], + "properties": { + "model_id": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "handler.GetStorageEngineStatusResponse": { + "type": "object", + "properties": { + "engines": { + "type": "array", + "items": { + "$ref": "#/definitions/handler.StorageEngineStatusItem" + } + }, + "minio_env_available": { + "type": "boolean" + } + } + }, + "handler.GetSystemInfoResponse": { + "type": "object", + "properties": { + "build_time": { + "type": "string" + }, + "commit_id": { + "type": "string" + }, + "db_version": { + "type": "string" + }, + "edition": { + "type": "string" + }, + "go_version": { + "type": "string" + }, + "graph_database_engine": { + "type": "string" + }, + "keyword_index_engine": { + "type": "string" + }, + "minio_enabled": { + "type": "boolean" + }, + "vector_store_engine": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "handler.KBModelConfigRequest": { + "type": "object", + "required": [ + "embeddingModelId", + "llmModelId" + ], + "properties": { + "asr_config": { + "$ref": "#/definitions/types.ASRConfig" + }, + "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" + }, + "llmModelId": { + "type": "string" + }, + "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" + } + } + }, + "questionGeneration": { + "description": "问题生成配置", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "questionCount": { + "type": "integer" + } + } + }, + "storageProvider": { + "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取", + "type": "string" + }, + "vlm_config": { + "$ref": "#/definitions/types.VLMConfig" + } + } + }, + "handler.RemoteModelCheckRequest": { + "type": "object", + "required": [ + "baseUrl", + "modelName" + ], + "properties": { + "apiKey": { + "type": "string" + }, + "baseUrl": { + "type": "string" + }, + "modelName": { + "type": "string" + }, + "provider": { + "type": "string" + } + } + }, + "handler.SearchMessagesRequest": { + "type": "object", + "required": [ + "query" + ], + "properties": { + "limit": { + "description": "Maximum number of results to return (default: 20)", + "type": "integer" + }, + "mode": { + "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")", + "type": "string" + }, + "query": { + "description": "Query text for search", + "type": "string" + }, + "session_ids": { + "description": "Filter by specific session IDs (optional)", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "handler.StorageCheckRequest": { + "type": "object", + "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" + }, + "s3": { + "$ref": "#/definitions/types.S3EngineConfig" + }, + "tos": { + "$ref": "#/definitions/types.TOSEngineConfig" + } + } + }, + "handler.StorageCheckResponse": { + "type": "object", + "properties": { + "bucket_created": { + "type": "boolean" + }, + "message": { + "type": "string" + }, + "ok": { + "type": "boolean" + } + } + }, + "handler.StorageEngineStatusItem": { + "type": "object", + "properties": { + "available": { + "description": "whether the engine can be used", + "type": "boolean" + }, + "description": { + "description": "short description for UI", + "type": "string" + }, + "name": { + "description": "\"local\", \"minio\", \"cos\", \"tos\"", + "type": "string" + } + } + }, + "handler.TestStoreRequest": { + "type": "object", + "required": [ + "connection_config", + "engine_type" + ], + "properties": { + "connection_config": { + "$ref": "#/definitions/types.ConnectionConfig" + }, + "engine_type": { + "$ref": "#/definitions/types.RetrieverEngineType" + } + } + }, + "handler.TextRelationExtractionRequest": { + "type": "object", + "required": [ + "model_id", + "tags", + "text" + ], + "properties": { + "model_id": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "text": { + "type": "string" + } + } + }, + "handler.UpdateAgentRequest": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "config": { + "$ref": "#/definitions/types.CustomAgentConfig" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "handler.UpdateChunkRequest": { + "type": "object", + "properties": { + "chunk_index": { + "type": "integer" + }, + "content": { + "type": "string" + }, + "embedding": { + "type": "array", + "items": { + "type": "number" + } + }, + "end_at": { + "type": "integer" + }, + "image_info": { + "type": "string" + }, + "is_enabled": { + "type": "boolean" + }, + "start_at": { + "type": "integer" + } + } + }, + "handler.UpdateKnowledgeBaseRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "config": { + "$ref": "#/definitions/types.KnowledgeBaseConfig" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "handler.UpdateModelRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parameters": { + "$ref": "#/definitions/types.ModelParameters" + }, + "source": { + "$ref": "#/definitions/types.ModelSource" + }, + "type": { + "$ref": "#/definitions/types.ModelType" + } + } + }, + "handler.UpdateStoreRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "handler.addSimilarQuestionsRequest": { + "type": "object", + "required": [ + "similar_questions" + ], + "properties": { + "similar_questions": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + } + } + }, + "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" + }, + "file_name": { + "description": "Original filename", + "type": "string" + }, + "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" + }, + "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.)", + "type": "array", + "items": { + "$ref": "#/definitions/handler_session.AttachmentUpload" + } + }, + "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", + "type": "array", + "items": { + "$ref": "#/definitions/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", + "type": "array", + "items": { + "type": "string" + } + }, + "mentioned_items": { + "description": "@mentioned knowledge bases and files", + "type": "array", + "items": { + "$ref": "#/definitions/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)", + "type": "string" + }, + "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" + }, + "title": { + "description": "Title for the session (optional)", + "type": "string" + } + } + }, + "handler_session.GenerateTitleRequest": { + "type": "object", + "required": [ + "messages" + ], + "properties": { + "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" + }, + "data": { + "description": "base64 data URI from frontend (data:image/png;base64,...)", + "type": "string" + }, + "url": { + "description": "serving URL after saving to storage", + "type": "string" + } + } + }, + "handler_session.MentionedItemRequest": { + "type": "object", + "properties": { + "id": { + "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" + } + } + }, + "handler_session.SearchKnowledgeRequest": { + "type": "object", + "required": [ + "query" + ], + "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)", + "type": "array", + "items": { + "type": "string" + } + }, + "knowledge_ids": { + "description": "IDs of specific knowledge (files) to search", + "type": "array", + "items": { + "type": "string" + } + }, + "query": { + "description": "Query text to search for", + "type": "string" + } + } + }, + "handler_session.StopSessionRequest": { + "type": "object", + "required": [ + "message_id" + ], + "properties": { + "message_id": { + "type": "string" + } + } + }, + "handler_session.batchDeleteRequest": { + "type": "object", + "properties": { + "delete_all": { + "type": "boolean" + }, + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "types.ASRConfig": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "language": { + "description": "optional: language hint for transcription", + "type": "string" + }, + "model_id": { + "type": "string" + } + } + }, + "types.AgentConfig": { "type": "object", "properties": { "allowed_skills": { @@ -8798,10 +10017,14 @@ "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.AgentStep": { + "types.AgentStep": { "type": "object", "properties": { "iteration": { @@ -8820,12 +10043,12 @@ "description": "Tools called in this step (Act phase)", "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall" + "$ref": "#/definitions/types.ToolCall" } } } }, - "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": { + "types.AnswerStrategy": { "type": "string", "enum": [ "all", @@ -8836,7 +10059,7 @@ "AnswerStrategyRandom" ] }, - "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": { + "types.COSEngineConfig": { "type": "object", "properties": { "app_id": { @@ -8859,7 +10082,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": { + "types.ChatHistoryConfig": { "type": "object", "properties": { "embedding_model_id": { @@ -8876,7 +10099,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": { + "types.ChunkingConfig": { "type": "object", "properties": { "child_chunk_size": { @@ -8907,7 +10130,7 @@ "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": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule" + "$ref": "#/definitions/types.ParserEngineRule" } }, "separators": { @@ -8919,7 +10142,52 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": { + "types.ConnectionConfig": { + "type": "object", + "properties": { + "addr": { + "description": "Common", + "type": "string" + }, + "api_key": { + "description": "AES-GCM encrypted", + "type": "string" + }, + "grpc_address": { + "description": "Weaviate", + "type": "string" + }, + "host": { + "description": "Qdrant", + "type": "string" + }, + "password": { + "description": "AES-GCM encrypted", + "type": "string" + }, + "port": { + "type": "integer" + }, + "scheme": { + "type": "string" + }, + "use_default_connection": { + "description": "Postgres", + "type": "boolean" + }, + "use_tls": { + "type": "boolean" + }, + "username": { + "type": "string" + }, + "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" + } + } + }, + "types.ContextCompressionStrategy": { "type": "string", "enum": [ "sliding_window", @@ -8930,14 +10198,14 @@ "ContextCompressionSmart" ] }, - "github_com_Tencent_WeKnora_internal_types.ContextConfig": { + "types.ContextConfig": { "type": "object", "properties": { "compression_strategy": { "description": "Compression strategy: \"sliding_window\" or \"smart\"", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy" + "$ref": "#/definitions/types.ContextCompressionStrategy" } ] }, @@ -8955,7 +10223,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ConversationConfig": { + "types.ConversationConfig": { "type": "object", "properties": { "context_template": { @@ -9025,7 +10293,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": { + "types.CreateOrganizationRequest": { "type": "object", "required": [ "name" @@ -9055,7 +10323,15 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": { + "types.CredentialsConfig": { + "type": "object", + "properties": { + "weknoracloud": { + "$ref": "#/definitions/types.WeKnoraCloudCredentials" + } + } + }, + "types.CustomAgentConfig": { "type": "object", "properties": { "agent_mode": { @@ -9069,6 +10345,14 @@ "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" @@ -9140,6 +10424,10 @@ "type": "string" } }, + "llm_call_timeout": { + "description": "Timeout for a single LLM call in seconds (0 = use global default)", + "type": "integer" + }, "max_completion_tokens": { "description": "Maximum completion tokens (only for normal mode)", "type": "integer" @@ -9240,6 +10528,14 @@ "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)", "type": "string" }, + "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 =====\nWhether web search is enabled", "type": "boolean" @@ -9247,10 +10543,14 @@ "web_search_max_results": { "description": "Maximum web search results", "type": "integer" + }, + "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.DataSource": { + "types.DataSource": { "type": "object", "properties": { "config": { @@ -9310,7 +10610,7 @@ "description": "Latest sync log (not stored in DB, populated on query)", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog" + "$ref": "#/definitions/types.SyncLog" } ] }, @@ -9356,7 +10656,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": { + "types.EmbeddingParameters": { "type": "object", "properties": { "dimension": { @@ -9367,7 +10667,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ExtractConfig": { + "types.ExtractConfig": { "type": "object", "properties": { "enabled": { @@ -9376,13 +10676,13 @@ "nodes": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode" + "$ref": "#/definitions/types.GraphNode" } }, "relations": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation" + "$ref": "#/definitions/types.GraphRelation" } }, "tags": { @@ -9396,7 +10696,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": { + "types.FAQBatchUpsertPayload": { "type": "object", "required": [ "entries" @@ -9409,7 +10709,7 @@ "entries": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload" + "$ref": "#/definitions/types.FAQEntryPayload" } }, "knowledge_id": { @@ -9428,32 +10728,32 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQConfig": { + "types.FAQConfig": { "type": "object", "properties": { "index_mode": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode" + "$ref": "#/definitions/types.FAQIndexMode" }, "question_index_mode": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode" + "$ref": "#/definitions/types.FAQQuestionIndexMode" } } }, - "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": { + "types.FAQEntryFieldsBatchUpdate": { "type": "object", "properties": { "by_id": { "description": "ByID 按条目ID更新,key为条目ID (seq_id)", "type": "object", "additionalProperties": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate" + "$ref": "#/definitions/types.FAQEntryFieldsUpdate" } }, "by_tag": { "description": "ByTag 按Tag批量更新,key为TagID (seq_id)", "type": "object", "additionalProperties": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate" + "$ref": "#/definitions/types.FAQEntryFieldsUpdate" } }, "exclude_ids": { @@ -9465,7 +10765,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": { + "types.FAQEntryFieldsUpdate": { "type": "object", "properties": { "is_enabled": { @@ -9479,14 +10779,14 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": { + "types.FAQEntryPayload": { "type": "object", "required": [ "standard_question" ], "properties": { "answer_strategy": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy" + "$ref": "#/definitions/types.AnswerStrategy" }, "answers": { "type": "array", @@ -9527,7 +10827,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": { + "types.FAQIndexMode": { "type": "string", "enum": [ "question_only", @@ -9538,7 +10838,7 @@ "FAQIndexModeQuestionAnswer" ] }, - "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": { + "types.FAQQuestionIndexMode": { "type": "string", "enum": [ "combined", @@ -9549,7 +10849,7 @@ "FAQQuestionIndexModeSeparate" ] }, - "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": { + "types.FAQSearchRequest": { "type": "object", "required": [ "query_text" @@ -9584,7 +10884,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.GraphNode": { + "types.GraphNode": { "type": "object", "properties": { "attributes": { @@ -9604,7 +10904,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.GraphRelation": { + "types.GraphRelation": { "type": "object", "properties": { "node1": { @@ -9618,7 +10918,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": { + "types.ImageProcessingConfig": { "type": "object", "properties": { "model_id": { @@ -9627,7 +10927,32 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": { + "types.IndexConfig": { + "type": "object", + "properties": { + "collection_name": { + "description": "Milvus", + "type": "string" + }, + "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" + } + } + }, + "types.InviteMemberRequest": { "type": "object", "required": [ "role", @@ -9638,7 +10963,7 @@ "description": "Role to assign: admin/editor/viewer", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] }, @@ -9648,7 +10973,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": { + "types.JoinByOrganizationIDRequest": { "type": "object", "required": [ "organization_id" @@ -9666,13 +10991,13 @@ "description": "Optional: requested role (admin/editor/viewer); default viewer", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": { + "types.JoinOrganizationRequest": { "type": "object", "required": [ "invite_code" @@ -9685,7 +11010,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.Knowledge": { + "types.Knowledge": { "type": "object", "properties": { "channel": { @@ -9808,9 +11133,17 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": { + "types.KnowledgeBase": { "type": "object", "properties": { + "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" @@ -9819,7 +11152,7 @@ "description": "Chunking configuration", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig" + "$ref": "#/definitions/types.ChunkingConfig" } ] }, @@ -9847,7 +11180,7 @@ "description": "Extract config", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig" + "$ref": "#/definitions/types.ExtractConfig" } ] }, @@ -9855,7 +11188,7 @@ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig" + "$ref": "#/definitions/types.FAQConfig" } ] }, @@ -9867,7 +11200,7 @@ "description": "Image processing configuration", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig" + "$ref": "#/definitions/types.ImageProcessingConfig" } ] }, @@ -9903,7 +11236,7 @@ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig" + "$ref": "#/definitions/types.QuestionGenerationConfig" } ] }, @@ -9915,7 +11248,7 @@ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig" + "$ref": "#/definitions/types.StorageConfig" } ] }, @@ -9923,7 +11256,7 @@ "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig" + "$ref": "#/definitions/types.StorageProviderConfig" } ] }, @@ -9947,20 +11280,20 @@ "description": "VLM config", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig" + "$ref": "#/definitions/types.VLMConfig" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": { + "types.KnowledgeBaseConfig": { "type": "object", "properties": { "chunking_config": { "description": "Chunking configuration", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig" + "$ref": "#/definitions/types.ChunkingConfig" } ] }, @@ -9968,7 +11301,7 @@ "description": "FAQ configuration (only for FAQ type knowledge bases)", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig" + "$ref": "#/definitions/types.FAQConfig" } ] }, @@ -9976,13 +11309,13 @@ "description": "Image processing configuration", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig" + "$ref": "#/definitions/types.ImageProcessingConfig" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": { + "types.KnowledgeBaseShareResponse": { "type": "object", "properties": { "chunk_count": { @@ -10038,13 +11371,13 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": { + "types.ListMembersResponse": { "type": "object", "properties": { "members": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse" + "$ref": "#/definitions/types.OrganizationMemberResponse" } }, "total": { @@ -10052,20 +11385,20 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": { + "types.ListOrganizationsResponse": { "type": "object", "properties": { "organizations": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse" + "$ref": "#/definitions/types.OrganizationResponse" } }, "resource_counts": { "description": "各空间内知识库/智能体数量,供列表侧栏展示", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse" + "$ref": "#/definitions/types.ResourceCountsByOrgResponse" } ] }, @@ -10074,13 +11407,13 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": { + "types.ListSharesResponse": { "type": "object", "properties": { "shares": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse" + "$ref": "#/definitions/types.KnowledgeBaseShareResponse" } }, "total": { @@ -10088,7 +11421,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": { + "types.LocalEngineConfig": { "type": "object", "properties": { "path_prefix": { @@ -10096,7 +11429,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.LoginRequest": { + "types.LoginRequest": { "type": "object", "required": [ "email", @@ -10112,7 +11445,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.LoginResponse": { + "types.LoginResponse": { "type": "object", "properties": { "message": { @@ -10125,17 +11458,17 @@ "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.MCPAdvancedConfig": { + "types.MCPAdvancedConfig": { "type": "object", "properties": { "retry_count": { @@ -10152,7 +11485,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": { + "types.MCPAuthConfig": { "type": "object", "properties": { "api_key": { @@ -10169,26 +11502,26 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": { + "types.MCPEnvVars": { "type": "object", "additionalProperties": { "type": "string" } }, - "github_com_Tencent_WeKnora_internal_types.MCPHeaders": { + "types.MCPHeaders": { "type": "object", "additionalProperties": { "type": "string" } }, - "github_com_Tencent_WeKnora_internal_types.MCPService": { + "types.MCPService": { "type": "object", "properties": { "advanced_config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig" + "$ref": "#/definitions/types.MCPAdvancedConfig" }, "auth_config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig" + "$ref": "#/definitions/types.MCPAuthConfig" }, "created_at": { "type": "string" @@ -10206,12 +11539,12 @@ "description": "Environment variables for stdio", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars" + "$ref": "#/definitions/types.MCPEnvVars" } ] }, "headers": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders" + "$ref": "#/definitions/types.MCPHeaders" }, "id": { "type": "string" @@ -10227,7 +11560,7 @@ "description": "Required for stdio transport", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig" + "$ref": "#/definitions/types.MCPStdioConfig" } ] }, @@ -10235,7 +11568,7 @@ "type": "integer" }, "transport_type": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType" + "$ref": "#/definitions/types.MCPTransportType" }, "updated_at": { "type": "string" @@ -10246,7 +11579,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": { + "types.MCPStdioConfig": { "type": "object", "properties": { "args": { @@ -10262,7 +11595,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.MCPTransportType": { + "types.MCPTransportType": { "type": "string", "enum": [ "sse", @@ -10285,7 +11618,7 @@ "MCPTransportStdio" ] }, - "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": { + "types.ManualKnowledgePayload": { "type": "object", "properties": { "channel": { @@ -10305,7 +11638,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.MatchType": { + "types.MatchType": { "type": "integer", "enum": [ 0, @@ -10351,7 +11684,7 @@ "MatchTypeDataAnalysis" ] }, - "github_com_Tencent_WeKnora_internal_types.MentionedItem": { + "types.MentionedItem": { "type": "object", "properties": { "id": { @@ -10370,7 +11703,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.Message": { + "types.Message": { "type": "object", "properties": { "agent_duration_ms": { @@ -10381,7 +11714,14 @@ "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": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep" + "$ref": "#/definitions/types.AgentStep" + } + }, + "attachments": { + "description": "Attached files (documents, audio, etc., for user messages)", + "type": "array", + "items": { + "$ref": "#/definitions/types.MessageAttachment" } }, "channel": { @@ -10412,7 +11752,7 @@ "description": "Attached images with OCR/Caption text (for user messages)", "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage" + "$ref": "#/definitions/types.MessageImage" } }, "is_completed": { @@ -10431,14 +11771,14 @@ "description": "References to knowledge chunks used in the response", "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult" + "$ref": "#/definitions/types.SearchResult" } }, "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/github_com_Tencent_WeKnora_internal_types.MentionedItem" + "$ref": "#/definitions/types.MentionedItem" } }, "request_id": { @@ -10459,7 +11799,40 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.MessageImage": { + "types.MessageAttachment": { + "type": "object", + "properties": { + "content": { + "description": "Extracted text content (for small text files)", + "type": "string" + }, + "file_name": { + "description": "Original filename", + "type": "string" + }, + "file_size": { + "description": "File size in bytes", + "type": "integer" + }, + "file_type": { + "description": "File extension (e.g., \".pdf\", \".docx\")", + "type": "string" + }, + "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" + } + } + }, + "types.MessageImage": { "type": "object", "properties": { "caption": { @@ -10470,7 +11843,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": { + "types.MinIOEngineConfig": { "type": "object", "properties": { "access_key_id": { @@ -10497,17 +11870,25 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ModelParameters": { + "types.ModelParameters": { "type": "object", "properties": { "api_key": { "type": "string" }, + "app_id": { + "description": "WeKnoraCloud 厂商专用凭证", + "type": "string" + }, + "app_secret": { + "description": "AES-256 加密存储,实际承载上游 API Key", + "type": "string" + }, "base_url": { "type": "string" }, "embedding_parameters": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters" + "$ref": "#/definitions/types.EmbeddingParameters" }, "extra_config": { "description": "Provider-specific configuration", @@ -10533,7 +11914,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ModelSource": { + "types.ModelSource": { "type": "string", "enum": [ "local", @@ -10551,10 +11932,12 @@ "jina", "openrouter", "nvidia", - "novita" + "novita", + "azure_openai" ], "x-enum-comments": { "ModelSourceAliyun": "Aliyun DashScope model", + "ModelSourceAzureOpenAI": "Azure OpenAI model", "ModelSourceDeepseek": "Deepseek model", "ModelSourceGemini": "Gemini model", "ModelSourceHunyuan": "Hunyuan model", @@ -10587,7 +11970,8 @@ "Jina AI model", "OpenRouter model", "NVIDIA model", - "Novita AI model" + "Novita AI model", + "Azure OpenAI model" ], "x-enum-varnames": [ "ModelSourceLocal", @@ -10605,18 +11989,21 @@ "ModelSourceJina", "ModelSourceOpenRouter", "ModelSourceNvidia", - "ModelSourceNovita" + "ModelSourceNovita", + "ModelSourceAzureOpenAI" ] }, - "github_com_Tencent_WeKnora_internal_types.ModelType": { + "types.ModelType": { "type": "string", "enum": [ "Embedding", "Rerank", "KnowledgeQA", - "VLLM" + "VLLM", + "ASR" ], "x-enum-comments": { + "ModelTypeASR": "ASR (Automatic Speech Recognition) model", "ModelTypeEmbedding": "Embedding model", "ModelTypeKnowledgeQA": "KnowledgeQA model", "ModelTypeRerank": "Rerank model", @@ -10626,16 +12013,18 @@ "Embedding model", "Rerank model", "KnowledgeQA model", - "VLLM model" + "VLLM model", + "ASR (Automatic Speech Recognition) model" ], "x-enum-varnames": [ "ModelTypeEmbedding", "ModelTypeRerank", "ModelTypeKnowledgeQA", - "ModelTypeVLLM" + "ModelTypeVLLM", + "ModelTypeASR" ] }, - "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": { + "types.OIDCAuthURLResponse": { "type": "object", "properties": { "authorization_url": { @@ -10652,7 +12041,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": { + "types.OIDCConfigResponse": { "type": "object", "properties": { "enabled": { @@ -10666,7 +12055,39 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": { + "types.OSSEngineConfig": { + "type": "object", + "properties": { + "access_key": { + "type": "string" + }, + "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" + } + } + }, + "types.OrgMemberRole": { "type": "string", "enum": [ "admin", @@ -10679,7 +12100,7 @@ "OrgRoleViewer" ] }, - "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": { + "types.OrganizationMemberResponse": { "type": "object", "properties": { "avatar": { @@ -10708,7 +12129,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": { + "types.OrganizationResponse": { "type": "object", "properties": { "agent_share_count": { @@ -10778,13 +12199,9 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": { + "types.ParserEngineConfig": { "type": "object", "properties": { - "docreader_addr": { - "description": "文档解析服务地址", - "type": "string" - }, "mineru_api_key": { "description": "MinerU 云 API Key", "type": "string" @@ -10827,7 +12244,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": { + "types.ParserEngineRule": { "type": "object", "properties": { "engine": { @@ -10841,7 +12258,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": { + "types.QuestionGenerationConfig": { "type": "object", "properties": { "enabled": { @@ -10853,7 +12270,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.RegisterRequest": { + "types.RegisterRequest": { "type": "object", "required": [ "email", @@ -10875,7 +12292,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.RegisterResponse": { + "types.RegisterResponse": { "type": "object", "properties": { "message": { @@ -10885,14 +12302,14 @@ "type": "boolean" }, "tenant": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant" + "$ref": "#/definitions/types.Tenant" }, "user": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User" + "$ref": "#/definitions/types.User" } } }, - "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": { + "types.RequestRoleUpgradeRequest": { "type": "object", "required": [ "requested_role" @@ -10907,13 +12324,13 @@ "description": "The role user wants to upgrade to", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.Resource": { + "types.Resource": { "type": "object", "properties": { "description": { @@ -10924,6 +12341,10 @@ "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", @@ -10951,7 +12372,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": { + "types.ResourceCountsByOrgResponse": { "type": "object", "properties": { "agents": { @@ -10978,7 +12399,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": { + "types.RetrievalConfig": { "type": "object", "properties": { "embedding_top_k": { @@ -11007,14 +12428,14 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": { + "types.RetrieverEngineParams": { "type": "object", "properties": { "retriever_engine_type": { "description": "Retriever engine type", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType" + "$ref": "#/definitions/types.RetrieverEngineType" } ] }, @@ -11022,13 +12443,13 @@ "description": "Retriever type", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType" + "$ref": "#/definitions/types.RetrieverType" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": { + "types.RetrieverEngineType": { "type": "string", "enum": [ "postgres", @@ -11051,18 +12472,18 @@ "SQLiteRetrieverEngineType" ] }, - "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": { + "types.RetrieverEngines": { "type": "object", "properties": { "engines": { "type": "array", "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams" + "$ref": "#/definitions/types.RetrieverEngineParams" } } } }, - "github_com_Tencent_WeKnora_internal_types.RetrieverType": { + "types.RetrieverType": { "type": "string", "enum": [ "keywords", @@ -11085,7 +12506,7 @@ "WebSearchRetrieverType" ] }, - "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": { + "types.ReviewJoinRequestRequest": { "type": "object", "properties": { "approved": { @@ -11099,13 +12520,13 @@ "description": "Optional: role to assign when approving; overrides applicant's requested role", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": { + "types.S3EngineConfig": { "type": "object", "properties": { "access_key": { @@ -11128,7 +12549,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.SearchParams": { + "types.SearchParams": { "type": "object", "properties": { "disable_keywords_match": { @@ -11184,7 +12605,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.SearchResult": { + "types.SearchResult": { "type": "object", "properties": { "chunk_index": { @@ -11250,7 +12671,7 @@ "description": "Match type", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType" + "$ref": "#/definitions/types.MatchType" } ] }, @@ -11290,7 +12711,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.Session": { + "types.Session": { "type": "object", "properties": { "created_at": { @@ -11320,7 +12741,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": { + "types.ShareKnowledgeBaseRequest": { "type": "object", "required": [ "organization_id", @@ -11331,11 +12752,11 @@ "type": "string" }, "permission": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } } }, - "github_com_Tencent_WeKnora_internal_types.StorageConfig": { + "types.StorageConfig": { "type": "object", "properties": { "app_id": { @@ -11361,40 +12782,43 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": { + "types.StorageEngineConfig": { "type": "object", "properties": { "cos": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig" + "$ref": "#/definitions/types.COSEngineConfig" }, "default_provider": { - "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\"", + "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"", "type": "string" }, "local": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig" + "$ref": "#/definitions/types.LocalEngineConfig" }, "minio": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig" + "$ref": "#/definitions/types.MinIOEngineConfig" + }, + "oss": { + "$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" + "$ref": "#/definitions/types.TOSEngineConfig" } } }, - "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": { + "types.StorageProviderConfig": { "type": "object", "properties": { "provider": { - "description": "\"local\", \"minio\", \"cos\", \"tos\"", + "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"", "type": "string" } } }, - "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": { + "types.SubmitJoinRequestRequest": { "type": "object", "required": [ "invite_code" @@ -11413,13 +12837,13 @@ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.SyncLog": { + "types.SyncLog": { "type": "object", "properties": { "created_at": { @@ -11491,7 +12915,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": { + "types.TOSEngineConfig": { "type": "object", "properties": { "access_key": { @@ -11514,14 +12938,14 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.Tenant": { + "types.Tenant": { "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" + "$ref": "#/definitions/types.AgentConfig" } ] }, @@ -11537,7 +12961,7 @@ "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" + "$ref": "#/definitions/types.ChatHistoryConfig" } ] }, @@ -11545,7 +12969,7 @@ "description": "Global Context configuration for this tenant (default for all sessions)", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig" + "$ref": "#/definitions/types.ContextConfig" } ] }, @@ -11553,7 +12977,7 @@ "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" + "$ref": "#/definitions/types.ConversationConfig" } ] }, @@ -11561,6 +12985,14 @@ "description": "Creation time", "type": "string" }, + "credentials": { + "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)", + "allOf": [ + { + "$ref": "#/definitions/types.CredentialsConfig" + } + ] + }, "deleted_at": { "description": "Deletion time", "allOf": [ @@ -11585,7 +13017,7 @@ "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" + "$ref": "#/definitions/types.ParserEngineConfig" } ] }, @@ -11593,7 +13025,7 @@ "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig" + "$ref": "#/definitions/types.RetrievalConfig" } ] }, @@ -11601,7 +13033,7 @@ "description": "Retriever engines", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines" + "$ref": "#/definitions/types.RetrieverEngines" } ] }, @@ -11613,7 +13045,7 @@ "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" + "$ref": "#/definitions/types.StorageEngineConfig" } ] }, @@ -11633,13 +13065,13 @@ "description": "Global WebSearch configuration for this tenant", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig" + "$ref": "#/definitions/types.WebSearchConfig" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.ToolCall": { + "types.ToolCall": { "type": "object", "properties": { "args": { @@ -11667,13 +13099,13 @@ "description": "Execution result (contains Output)", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult" + "$ref": "#/definitions/types.ToolResult" } ] } } }, - "github_com_Tencent_WeKnora_internal_types.ToolResult": { + "types.ToolResult": { "type": "object", "properties": { "data": { @@ -11702,18 +13134,18 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": { + "types.UpdateMemberRoleRequest": { "type": "object", "required": [ "role" ], "properties": { "role": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } } }, - "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": { + "types.UpdateOrganizationRequest": { "type": "object", "properties": { "avatar": { @@ -11747,18 +13179,18 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": { + "types.UpdateSharePermissionRequest": { "type": "object", "required": [ "permission" ], "properties": { "permission": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + "$ref": "#/definitions/types.OrgMemberRole" } } }, - "github_com_Tencent_WeKnora_internal_types.User": { + "types.User": { "type": "object", "properties": { "avatar": { @@ -11797,7 +13229,7 @@ "description": "Association relationship, not stored in the database", "allOf": [ { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant" + "$ref": "#/definitions/types.Tenant" } ] }, @@ -11815,7 +13247,7 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.VLMConfig": { + "types.VLMConfig": { "type": "object", "properties": { "api_key": { @@ -11842,11 +13274,22 @@ } } }, - "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": { + "types.WeKnoraCloudCredentials": { + "type": "object", + "properties": { + "app_id": { + "type": "string" + }, + "app_secret": { + "type": "string" + } + } + }, + "types.WebSearchConfig": { "type": "object", "properties": { "api_key": { - "description": "API密钥(如果需要)", + "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.", "type": "string" }, "blacklist": { @@ -11881,7 +13324,7 @@ "type": "integer" }, "provider": { - "description": "搜索引擎提供商ID", + "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.", "type": "string" }, "rerank_model_id": { @@ -11889,731 +13332,6 @@ "type": "string" } } - }, - "gorm.DeletedAt": { - "type": "object", - "properties": { - "time": { - "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": { - "type": "string" - }, - "target_id": { - "type": "string" - }, - "task_id": { - "type": "string" - } - } - }, - "internal_handler.CreateAgentRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "avatar": { - "type": "string" - }, - "config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig" - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "internal_handler.CreateModelRequest": { - "type": "object", - "required": [ - "name", - "parameters", - "source", - "type" - ], - "properties": { - "description": { - "type": "string" - }, - "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" - } - } - }, - "internal_handler.DeleteTagRequest": { - "type": "object", - "properties": { - "exclude_ids": { - "description": "Chunk seq_ids to exclude from deletion", - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "internal_handler.EvaluationRequest": { - "type": "object", - "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" - } - } - }, - "internal_handler.FabriTextRequest": { - "type": "object", - "required": [ - "model_id" - ], - "properties": { - "model_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" - } - } - }, - "internal_handler.GetSystemInfoResponse": { - "type": "object", - "properties": { - "build_time": { - "type": "string" - }, - "commit_id": { - "type": "string" - }, - "db_version": { - "type": "string" - }, - "edition": { - "type": "string" - }, - "go_version": { - "type": "string" - }, - "graph_database_engine": { - "type": "string" - }, - "keyword_index_engine": { - "type": "string" - }, - "minio_enabled": { - "type": "boolean" - }, - "vector_store_engine": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "internal_handler.KBModelConfigRequest": { - "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" - }, - "llmModelId": { - "type": "string" - }, - "multimodal": { - "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)", - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - } - } - }, - "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" - } - } - }, - "questionGeneration": { - "description": "问题生成配置", - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "questionCount": { - "type": "integer" - } - } - }, - "storageProvider": { - "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取", - "type": "string" - }, - "vlm_config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig" - } - } - }, - "internal_handler.ListMinioBucketsResponse": { - "type": "object", - "properties": { - "buckets": { - "type": "array", - "items": { - "$ref": "#/definitions/internal_handler.MinioBucketInfo" - } - } - } - }, - "internal_handler.MinioBucketInfo": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "name": { - "type": "string" - }, - "policy": { - "description": "\"public\", \"private\", \"custom\"", - "type": "string" - } - } - }, - "internal_handler.RemoteModelCheckRequest": { - "type": "object", - "required": [ - "baseUrl", - "modelName" - ], - "properties": { - "apiKey": { - "type": "string" - }, - "baseUrl": { - "type": "string" - }, - "modelName": { - "type": "string" - } - } - }, - "internal_handler.SearchMessagesRequest": { - "type": "object", - "required": [ - "query" - ], - "properties": { - "limit": { - "description": "Maximum number of results to return (default: 20)", - "type": "integer" - }, - "mode": { - "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")", - "type": "string" - }, - "query": { - "description": "Query text for search", - "type": "string" - }, - "session_ids": { - "description": "Filter by specific session IDs (optional)", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "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\"", - "type": "string" - }, - "s3": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig" - }, - "tos": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig" - } - } - }, - "internal_handler.StorageCheckResponse": { - "type": "object", - "properties": { - "bucket_created": { - "type": "boolean" - }, - "message": { - "type": "string" - }, - "ok": { - "type": "boolean" - } - } - }, - "internal_handler.StorageEngineStatusItem": { - "type": "object", - "properties": { - "available": { - "description": "whether the engine can be used", - "type": "boolean" - }, - "description": { - "description": "short description for UI", - "type": "string" - }, - "name": { - "description": "\"local\", \"minio\", \"cos\", \"tos\"", - "type": "string" - } - } - }, - "internal_handler.TextRelationExtractionRequest": { - "type": "object", - "required": [ - "model_id", - "tags", - "text" - ], - "properties": { - "model_id": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "text": { - "type": "string" - } - } - }, - "internal_handler.UpdateAgentRequest": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig" - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "internal_handler.UpdateChunkRequest": { - "type": "object", - "properties": { - "chunk_index": { - "type": "integer" - }, - "content": { - "type": "string" - }, - "embedding": { - "type": "array", - "items": { - "type": "number" - } - }, - "end_at": { - "type": "integer" - }, - "image_info": { - "type": "string" - }, - "is_enabled": { - "type": "boolean" - }, - "start_at": { - "type": "integer" - } - } - }, - "internal_handler.UpdateKnowledgeBaseRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "config": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig" - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "internal_handler.UpdateModelRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "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" - } - } - }, - "internal_handler.addSimilarQuestionsRequest": { - "type": "object", - "required": [ - "similar_questions" - ], - "properties": { - "similar_questions": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - }, - "internal_handler.updateLastFAQImportResultDisplayStatusRequest": { - "type": "object", - "required": [ - "display_status" - ], - "properties": { - "display_status": { - "type": "string", - "enum": [ - "open", - "close" - ] - } - } - }, - "internal_handler_session.CreateKnowledgeQARequest": { - "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" - }, - "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", - "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", - "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)", - "type": "string" - }, - "web_search_enabled": { - "description": "Whether web search is enabled for this request", - "type": "boolean" - } - } - }, - "internal_handler_session.CreateSessionRequest": { - "type": "object", - "properties": { - "description": { - "description": "Description for the session (optional)", - "type": "string" - }, - "title": { - "description": "Title for the session (optional)", - "type": "string" - } - } - }, - "internal_handler_session.GenerateTitleRequest": { - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "description": "Messages to use as context for title generation", - "type": "array", - "items": { - "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Message" - } - } - } - }, - "internal_handler_session.ImageAttachment": { - "type": "object", - "properties": { - "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" - } - } - }, - "internal_handler_session.MentionedItemRequest": { - "type": "object", - "properties": { - "id": { - "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" - } - } - }, - "internal_handler_session.SearchKnowledgeRequest": { - "type": "object", - "required": [ - "query" - ], - "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)", - "type": "array", - "items": { - "type": "string" - } - }, - "knowledge_ids": { - "description": "IDs of specific knowledge (files) to search", - "type": "array", - "items": { - "type": "string" - } - }, - "query": { - "description": "Query text to search for", - "type": "string" - } - } - }, - "internal_handler_session.StopSessionRequest": { - "type": "object", - "required": [ - "message_id" - ], - "properties": { - "message_id": { - "type": "string" - } - } - }, - "internal_handler_session.batchDeleteRequest": { - "type": "object", - "properties": { - "delete_all": { - "type": "boolean" - }, - "ids": { - "type": "array", - "items": { - "type": "string" - } - } - } } }, "securityDefinitions": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ae6ca15c..ccb6fcdb 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,7 +74,554 @@ definitions: - ErrAgentMissingAllowedTools - ErrAgentInvalidMaxIterations - ErrAgentInvalidTemperature - github_com_Tencent_WeKnora_internal_types.AgentConfig: + github_com_Tencent_WeKnora_internal_errors.AppError: + properties: + code: + $ref: '#/definitions/errors.ErrorCode' + details: {} + message: + type: string + type: object + gorm.DeletedAt: + properties: + time: + type: string + valid: + description: Valid is true if Time is not NULL + type: boolean + type: object + handler.CopyKnowledgeBaseRequest: + properties: + source_id: + type: string + target_id: + type: string + task_id: + type: string + required: + - source_id + type: object + handler.CreateAgentRequest: + properties: + avatar: + type: string + config: + $ref: '#/definitions/types.CustomAgentConfig' + description: + type: string + name: + type: string + required: + - name + type: object + handler.CreateModelRequest: + properties: + description: + type: string + name: + type: string + 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 + handler.DeleteTagRequest: + properties: + 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 + 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 + handler.FabriTextRequest: + properties: + model_id: + type: string + tags: + items: + type: string + type: array + required: + - model_id + type: object + handler.GetStorageEngineStatusResponse: + properties: + engines: + items: + $ref: '#/definitions/handler.StorageEngineStatusItem' + type: array + minio_env_available: + type: boolean + type: object + handler.GetSystemInfoResponse: + properties: + build_time: + type: string + commit_id: + type: string + db_version: + type: string + edition: + type: string + go_version: + type: string + graph_database_engine: + type: string + keyword_index_engine: + type: string + minio_enabled: + type: boolean + vector_store_engine: + type: string + version: + type: string + type: object + handler.KBModelConfigRequest: + properties: + 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 + llmModelId: + type: string + 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: + - embeddingModelId + - llmModelId + type: object + handler.RemoteModelCheckRequest: + properties: + apiKey: + type: string + baseUrl: + type: string + modelName: + type: string + provider: + type: string + required: + - baseUrl + - modelName + type: object + handler.SearchMessagesRequest: + properties: + limit: + description: 'Maximum number of results to return (default: 20)' + type: integer + mode: + description: 'Search mode: "keyword", "vector", "hybrid" (default: "hybrid")' + type: string + query: + description: Query text for search + type: string + 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 + s3: + $ref: '#/definitions/types.S3EngineConfig' + tos: + $ref: '#/definitions/types.TOSEngineConfig' + type: object + handler.StorageCheckResponse: + properties: + bucket_created: + type: boolean + message: + type: string + ok: + type: boolean + type: object + handler.StorageEngineStatusItem: + properties: + available: + description: whether the engine can be used + type: boolean + description: + description: short description for UI + type: string + name: + description: '"local", "minio", "cos", "tos"' + type: string + 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 + text: + type: string + required: + - model_id + - tags + - text + type: object + handler.UpdateAgentRequest: + properties: + avatar: + type: string + config: + $ref: '#/definitions/types.CustomAgentConfig' + description: + type: string + name: + type: string + type: object + handler.UpdateChunkRequest: + properties: + chunk_index: + type: integer + content: + type: string + embedding: + items: + type: number + type: array + end_at: + type: integer + image_info: + type: string + is_enabled: + type: boolean + start_at: + type: integer + type: object + handler.UpdateKnowledgeBaseRequest: + properties: + config: + $ref: '#/definitions/types.KnowledgeBaseConfig' + description: + type: string + name: + type: string + required: + - name + type: object + handler.UpdateModelRequest: + properties: + description: + type: string + name: + type: string + parameters: + $ref: '#/definitions/types.ModelParameters' + source: + $ref: '#/definitions/types.ModelSource' + type: + $ref: '#/definitions/types.ModelType' + type: object + handler.UpdateStoreRequest: + properties: + name: + type: string + 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 + handler_session.AttachmentUpload: + properties: + 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 + handler_session.CreateKnowledgeQARequest: + 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 + attachment_uploads: + description: Attached files (documents, audio, etc.) + items: + $ref: '#/definitions/handler_session.AttachmentUpload' + type: array + 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/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 + items: + type: string + type: array + 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 + 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: + - query + type: object + handler_session.CreateSessionRequest: + properties: + description: + description: Description for the session (optional) + type: string + title: + description: Title for the session (optional) + type: string + type: object + handler_session.GenerateTitleRequest: + properties: + messages: + description: Messages to use as context for title generation + items: + $ref: '#/definitions/types.Message' + type: array + required: + - messages + type: object + handler_session.ImageAttachment: + properties: + 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 + handler_session.MentionedItemRequest: + properties: + id: + 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 + knowledge_ids: + description: IDs of specific knowledge (files) to search + items: + type: string + type: array + query: + description: Query text to search for + type: string + required: + - query + type: object + handler_session.StopSessionRequest: + properties: + message_id: + type: string + required: + - message_id + type: object + handler_session.batchDeleteRequest: + properties: + delete_all: + type: boolean + ids: + items: + type: string + type: array + type: object + types.ASRConfig: + properties: + enabled: + type: boolean + language: + description: 'optional: language hint for transcription' + type: string + model_id: + type: string + type: object + types.AgentConfig: properties: allowed_skills: description: Skill names whitelist (empty = allow all) @@ -172,8 +719,11 @@ definitions: 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.AgentStep: + types.AgentStep: properties: iteration: description: Iteration number (0-indexed) @@ -187,10 +737,10 @@ definitions: tool_calls: description: Tools called in this step (Act phase) items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall' + $ref: '#/definitions/types.ToolCall' type: array type: object - github_com_Tencent_WeKnora_internal_types.AnswerStrategy: + types.AnswerStrategy: enum: - all - random @@ -198,7 +748,7 @@ definitions: x-enum-varnames: - AnswerStrategyAll - AnswerStrategyRandom - github_com_Tencent_WeKnora_internal_types.COSEngineConfig: + types.COSEngineConfig: properties: app_id: type: string @@ -213,7 +763,7 @@ definitions: secret_key: type: string type: object - github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig: + types.ChatHistoryConfig: properties: embedding_model_id: description: |- @@ -229,7 +779,7 @@ definitions: This is set internally when the feature is first enabled; users should not set this directly. type: string type: object - github_com_Tencent_WeKnora_internal_types.ChunkingConfig: + types.ChunkingConfig: properties: child_chunk_size: description: |- @@ -262,7 +812,7 @@ definitions: 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' + $ref: '#/definitions/types.ParserEngineRule' type: array separators: description: Separators @@ -270,7 +820,41 @@ definitions: type: string type: array type: object - github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy: + types.ConnectionConfig: + properties: + addr: + description: Common + type: string + api_key: + description: AES-GCM encrypted + type: string + grpc_address: + description: Weaviate + type: string + host: + description: Qdrant + type: string + password: + description: AES-GCM encrypted + type: string + port: + type: integer + scheme: + type: string + use_default_connection: + description: Postgres + type: boolean + use_tls: + type: boolean + username: + type: string + 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 + types.ContextCompressionStrategy: enum: - sliding_window - smart @@ -278,11 +862,11 @@ definitions: x-enum-varnames: - ContextCompressionSlidingWindow - ContextCompressionSmart - github_com_Tencent_WeKnora_internal_types.ContextConfig: + types.ContextConfig: properties: compression_strategy: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy' + - $ref: '#/definitions/types.ContextCompressionStrategy' description: 'Compression strategy: "sliding_window" or "smart"' max_tokens: description: Maximum tokens allowed in LLM context @@ -296,7 +880,7 @@ definitions: description: 'Summarize threshold: number of messages before summarization' type: integer type: object - github_com_Tencent_WeKnora_internal_types.ConversationConfig: + types.ConversationConfig: properties: context_template: description: ContextTemplate is the prompt template for summarizing retrieval @@ -346,7 +930,7 @@ definitions: vector_threshold: type: number type: object - github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest: + types.CreateOrganizationRequest: properties: avatar: description: optional avatar URL @@ -368,7 +952,12 @@ definitions: required: - name type: object - github_com_Tencent_WeKnora_internal_types.CustomAgentConfig: + types.CredentialsConfig: + properties: + weknoracloud: + $ref: '#/definitions/types.WeKnoraCloudCredentials' + type: object + types.CustomAgentConfig: properties: agent_mode: description: |- @@ -380,6 +969,13 @@ definitions: items: type: string type: array + 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 @@ -429,7 +1025,7 @@ definitions: type: integer image_storage_provider: description: |- - Storage provider for image uploads: "local", "minio", "cos", "tos", "s3", "oss" + Storage provider for image uploads: "local", "minio", "cos", "tos" Empty means use the global/tenant default provider. type: string image_upload_enabled: @@ -451,6 +1047,9 @@ definitions: items: type: string type: array + llm_call_timeout: + description: Timeout for a single LLM call in seconds (0 = use global default) + type: integer max_completion_tokens: description: Maximum completion tokens (only for normal mode) type: integer @@ -549,6 +1148,13 @@ definitions: description: VLM model ID for image analysis (optional, falls back to tenant-level VLM) type: string + 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 ===== @@ -557,8 +1163,13 @@ definitions: 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.DataSource: + types.DataSource: properties: config: description: |- @@ -601,7 +1212,7 @@ definitions: type: array latest_sync_log: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog' + - $ref: '#/definitions/types.SyncLog' description: Latest sync log (not stored in DB, populated on query) name: description: User-friendly name @@ -635,24 +1246,24 @@ definitions: description: Last update timestamp type: string type: object - github_com_Tencent_WeKnora_internal_types.EmbeddingParameters: + types.EmbeddingParameters: properties: dimension: type: integer truncate_prompt_tokens: type: integer type: object - github_com_Tencent_WeKnora_internal_types.ExtractConfig: + types.ExtractConfig: properties: enabled: type: boolean nodes: items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode' + $ref: '#/definitions/types.GraphNode' type: array relations: items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation' + $ref: '#/definitions/types.GraphRelation' type: array tags: items: @@ -661,14 +1272,14 @@ definitions: text: type: string type: object - github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload: + types.FAQBatchUpsertPayload: properties: dry_run: description: 仅验证,不实际导入 type: boolean entries: items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload' + $ref: '#/definitions/types.FAQEntryPayload' type: array knowledge_id: type: string @@ -683,23 +1294,23 @@ definitions: required: - entries type: object - github_com_Tencent_WeKnora_internal_types.FAQConfig: + types.FAQConfig: properties: index_mode: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode' + $ref: '#/definitions/types.FAQIndexMode' question_index_mode: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode' + $ref: '#/definitions/types.FAQQuestionIndexMode' type: object - github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate: + types.FAQEntryFieldsBatchUpdate: properties: by_id: additionalProperties: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate' + $ref: '#/definitions/types.FAQEntryFieldsUpdate' description: ByID 按条目ID更新,key为条目ID (seq_id) type: object by_tag: additionalProperties: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate' + $ref: '#/definitions/types.FAQEntryFieldsUpdate' description: ByTag 按Tag批量更新,key为TagID (seq_id) type: object exclude_ids: @@ -708,7 +1319,7 @@ definitions: type: integer type: array type: object - github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate: + types.FAQEntryFieldsUpdate: properties: is_enabled: type: boolean @@ -717,10 +1328,10 @@ definitions: tag_id: type: integer type: object - github_com_Tencent_WeKnora_internal_types.FAQEntryPayload: + types.FAQEntryPayload: properties: answer_strategy: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy' + $ref: '#/definitions/types.AnswerStrategy' answers: items: type: string @@ -749,7 +1360,7 @@ definitions: required: - standard_question type: object - github_com_Tencent_WeKnora_internal_types.FAQIndexMode: + types.FAQIndexMode: enum: - question_only - question_answer @@ -757,7 +1368,7 @@ definitions: x-enum-varnames: - FAQIndexModeQuestionOnly - FAQIndexModeQuestionAnswer - github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode: + types.FAQQuestionIndexMode: enum: - combined - separate @@ -765,7 +1376,7 @@ definitions: x-enum-varnames: - FAQQuestionIndexModeCombined - FAQQuestionIndexModeSeparate - github_com_Tencent_WeKnora_internal_types.FAQSearchRequest: + types.FAQSearchRequest: properties: first_priority_tag_ids: description: 第一优先级标签ID列表,限定命中范围,优先级最高 @@ -789,7 +1400,7 @@ definitions: required: - query_text type: object - github_com_Tencent_WeKnora_internal_types.GraphNode: + types.GraphNode: properties: attributes: items: @@ -802,7 +1413,7 @@ definitions: name: type: string type: object - github_com_Tencent_WeKnora_internal_types.GraphRelation: + types.GraphRelation: properties: node1: type: string @@ -811,17 +1422,35 @@ definitions: type: type: string type: object - github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig: + types.ImageProcessingConfig: properties: model_id: description: Model ID type: string type: object - github_com_Tencent_WeKnora_internal_types.InviteMemberRequest: + types.IndexConfig: + properties: + collection_name: + description: Milvus + type: string + 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/github_com_Tencent_WeKnora_internal_types.OrgMemberRole' + - $ref: '#/definitions/types.OrgMemberRole' description: 'Role to assign: admin/editor/viewer' user_id: description: User ID to invite @@ -830,7 +1459,7 @@ definitions: - role - user_id type: object - github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest: + types.JoinByOrganizationIDRequest: properties: message: description: Optional message for join request @@ -840,12 +1469,12 @@ definitions: type: string role: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole' + - $ref: '#/definitions/types.OrgMemberRole' description: 'Optional: requested role (admin/editor/viewer); default viewer' required: - organization_id type: object - github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest: + types.JoinOrganizationRequest: properties: invite_code: maxLength: 32 @@ -854,7 +1483,7 @@ definitions: required: - invite_code type: object - github_com_Tencent_WeKnora_internal_types.Knowledge: + types.Knowledge: properties: channel: description: Channel indicates through which channel the knowledge was ingested @@ -945,14 +1574,18 @@ definitions: description: Last updated time of the knowledge type: string type: object - github_com_Tencent_WeKnora_internal_types.KnowledgeBase: + 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/github_com_Tencent_WeKnora_internal_types.ChunkingConfig' + - $ref: '#/definitions/types.ChunkingConfig' description: Chunking configuration created_at: description: Creation time of the knowledge base @@ -969,11 +1602,11 @@ definitions: type: string extract_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig' + - $ref: '#/definitions/types.ExtractConfig' description: Extract config faq_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig' + - $ref: '#/definitions/types.FAQConfig' description: FAQConfig stores FAQ specific configuration such as indexing strategy id: @@ -981,7 +1614,7 @@ definitions: type: string image_processing_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig' + - $ref: '#/definitions/types.ImageProcessingConfig' description: Image processing configuration is_pinned: description: Whether this knowledge base is pinned to the top of the list @@ -1009,7 +1642,7 @@ definitions: type: integer question_generation_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig' + - $ref: '#/definitions/types.QuestionGenerationConfig' description: QuestionGenerationConfig stores question generation configuration for document knowledge bases share_count: @@ -1018,12 +1651,12 @@ definitions: type: integer storage_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig' + - $ref: '#/definitions/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' + - $ref: '#/definitions/types.StorageProviderConfig' description: 'Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig' summary_model_id: @@ -1040,25 +1673,25 @@ definitions: type: string vlm_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig' + - $ref: '#/definitions/types.VLMConfig' description: VLM config type: object - github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig: + types.KnowledgeBaseConfig: properties: chunking_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig' + - $ref: '#/definitions/types.ChunkingConfig' description: Chunking configuration faq_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig' + - $ref: '#/definitions/types.FAQConfig' description: FAQ configuration (only for FAQ type knowledge bases) image_processing_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig' + - $ref: '#/definitions/types.ImageProcessingConfig' description: Image processing configuration type: object - github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse: + types.KnowledgeBaseShareResponse: properties: chunk_count: type: integer @@ -1096,43 +1729,43 @@ definitions: source_tenant_id: type: integer type: object - github_com_Tencent_WeKnora_internal_types.ListMembersResponse: + types.ListMembersResponse: properties: members: items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse' + $ref: '#/definitions/types.OrganizationMemberResponse' type: array total: type: integer type: object - github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse: + types.ListOrganizationsResponse: properties: organizations: items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse' + $ref: '#/definitions/types.OrganizationResponse' type: array resource_counts: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse' + - $ref: '#/definitions/types.ResourceCountsByOrgResponse' description: 各空间内知识库/智能体数量,供列表侧栏展示 total: type: integer type: object - github_com_Tencent_WeKnora_internal_types.ListSharesResponse: + types.ListSharesResponse: properties: shares: items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse' + $ref: '#/definitions/types.KnowledgeBaseShareResponse' type: array total: type: integer type: object - github_com_Tencent_WeKnora_internal_types.LocalEngineConfig: + types.LocalEngineConfig: properties: path_prefix: type: string type: object - github_com_Tencent_WeKnora_internal_types.LoginRequest: + types.LoginRequest: properties: email: type: string @@ -1143,7 +1776,7 @@ definitions: - email - password type: object - github_com_Tencent_WeKnora_internal_types.LoginResponse: + types.LoginResponse: properties: message: type: string @@ -1152,13 +1785,13 @@ definitions: 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.MCPAdvancedConfig: + types.MCPAdvancedConfig: properties: retry_count: description: 'Number of retries, default: 3' @@ -1170,7 +1803,7 @@ definitions: description: 'Timeout in seconds, default: 30' type: integer type: object - github_com_Tencent_WeKnora_internal_types.MCPAuthConfig: + types.MCPAuthConfig: properties: api_key: type: string @@ -1181,20 +1814,20 @@ definitions: token: type: string type: object - github_com_Tencent_WeKnora_internal_types.MCPEnvVars: + types.MCPEnvVars: additionalProperties: type: string type: object - github_com_Tencent_WeKnora_internal_types.MCPHeaders: + types.MCPHeaders: additionalProperties: type: string type: object - github_com_Tencent_WeKnora_internal_types.MCPService: + types.MCPService: properties: advanced_config: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig' + $ref: '#/definitions/types.MCPAdvancedConfig' auth_config: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig' + $ref: '#/definitions/types.MCPAuthConfig' created_at: type: string deleted_at: @@ -1205,10 +1838,10 @@ definitions: type: boolean env_vars: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars' + - $ref: '#/definitions/types.MCPEnvVars' description: Environment variables for stdio headers: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders' + $ref: '#/definitions/types.MCPHeaders' id: type: string is_builtin: @@ -1218,19 +1851,19 @@ definitions: type: string stdio_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig' + - $ref: '#/definitions/types.MCPStdioConfig' description: Required for stdio transport tenant_id: type: integer transport_type: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType' + $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.MCPStdioConfig: + types.MCPStdioConfig: properties: args: description: Command arguments array @@ -1241,7 +1874,7 @@ definitions: description: 'Command: "uvx" or "npx"' type: string type: object - github_com_Tencent_WeKnora_internal_types.MCPTransportType: + types.MCPTransportType: enum: - sse - http-streamable @@ -1259,7 +1892,7 @@ definitions: - MCPTransportSSE - MCPTransportHTTPStreamable - MCPTransportStdio - github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload: + types.ManualKnowledgePayload: properties: channel: type: string @@ -1272,7 +1905,7 @@ definitions: title: type: string type: object - github_com_Tencent_WeKnora_internal_types.MatchType: + types.MatchType: enum: - 0 - 1 @@ -1313,7 +1946,7 @@ definitions: - MatchTypeWebSearch - MatchTypeDirectLoad - MatchTypeDataAnalysis - github_com_Tencent_WeKnora_internal_types.MentionedItem: + types.MentionedItem: properties: id: type: string @@ -1326,7 +1959,7 @@ definitions: description: '"kb" for knowledge base, "file" for file' type: string type: object - github_com_Tencent_WeKnora_internal_types.Message: + types.Message: properties: agent_duration_ms: description: Agent total execution duration in milliseconds (from query start @@ -1338,7 +1971,12 @@ definitions: 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: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep' + $ref: '#/definitions/types.AgentStep' + type: array + attachments: + description: Attached files (documents, audio, etc., for user messages) + items: + $ref: '#/definitions/types.MessageAttachment' type: array channel: description: Channel indicates the source channel of this message (e.g., "web", @@ -1360,7 +1998,7 @@ definitions: images: description: Attached images with OCR/Caption text (for user messages) items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage' + $ref: '#/definitions/types.MessageImage' type: array is_completed: description: Whether message generation is complete @@ -1377,14 +2015,14 @@ definitions: knowledge_references: description: References to knowledge chunks used in the response items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult' + $ref: '#/definitions/types.SearchResult' type: array mentioned_items: description: |- Mentioned knowledge bases and files (for user messages) Stores the @mentioned items when user sends a message items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem' + $ref: '#/definitions/types.MentionedItem' type: array request_id: description: Request identifier for tracking API requests @@ -1399,14 +2037,38 @@ definitions: description: Last update timestamp type: string type: object - github_com_Tencent_WeKnora_internal_types.MessageImage: + types.MessageAttachment: + properties: + content: + description: Extracted text content (for small text files) + type: string + file_name: + description: Original filename + type: string + file_size: + description: File size in bytes + type: integer + file_type: + description: File extension (e.g., ".pdf", ".docx") + type: string + 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 + types.MessageImage: properties: caption: type: string url: type: string type: object - github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig: + types.MinIOEngineConfig: properties: access_key_id: type: string @@ -1424,14 +2086,20 @@ definitions: use_ssl: type: boolean type: object - github_com_Tencent_WeKnora_internal_types.ModelParameters: + types.ModelParameters: properties: api_key: type: string + app_id: + description: WeKnoraCloud 厂商专用凭证 + type: string + app_secret: + description: AES-256 加密存储,实际承载上游 API Key + type: string base_url: type: string embedding_parameters: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters' + $ref: '#/definitions/types.EmbeddingParameters' extra_config: additionalProperties: type: string @@ -1449,7 +2117,7 @@ definitions: description: Whether the model accepts image/multimodal input type: boolean type: object - github_com_Tencent_WeKnora_internal_types.ModelSource: + types.ModelSource: enum: - local - remote @@ -1467,9 +2135,11 @@ definitions: - 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 @@ -1502,6 +2172,7 @@ definitions: - OpenRouter model - NVIDIA model - Novita AI model + - Azure OpenAI model x-enum-varnames: - ModelSourceLocal - ModelSourceRemote @@ -1519,14 +2190,17 @@ definitions: - ModelSourceOpenRouter - ModelSourceNvidia - ModelSourceNovita - github_com_Tencent_WeKnora_internal_types.ModelType: + - 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 @@ -1536,12 +2210,14 @@ definitions: - Rerank model - KnowledgeQA model - VLLM model + - ASR (Automatic Speech Recognition) model x-enum-varnames: - ModelTypeEmbedding - ModelTypeRerank - ModelTypeKnowledgeQA - ModelTypeVLLM - github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse: + - ModelTypeASR + types.OIDCAuthURLResponse: properties: authorization_url: type: string @@ -1552,7 +2228,7 @@ definitions: success: type: boolean type: object - github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse: + types.OIDCConfigResponse: properties: enabled: type: boolean @@ -1561,7 +2237,28 @@ definitions: success: type: boolean type: object - github_com_Tencent_WeKnora_internal_types.OrgMemberRole: + types.OSSEngineConfig: + properties: + access_key: + type: string + 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 + type: object + types.OrgMemberRole: enum: - admin - editor @@ -1571,7 +2268,7 @@ definitions: - OrgRoleAdmin - OrgRoleEditor - OrgRoleViewer - github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse: + types.OrganizationMemberResponse: properties: avatar: type: string @@ -1590,7 +2287,7 @@ definitions: username: type: string type: object - github_com_Tencent_WeKnora_internal_types.OrganizationResponse: + types.OrganizationResponse: properties: agent_share_count: description: 共享到该组织的智能体数量 @@ -1638,11 +2335,8 @@ definitions: updated_at: type: string type: object - github_com_Tencent_WeKnora_internal_types.ParserEngineConfig: + types.ParserEngineConfig: properties: - docreader_addr: - description: 文档解析服务地址 - type: string mineru_api_key: description: MinerU 云 API Key type: string @@ -1672,7 +2366,7 @@ definitions: description: MinerU 自建解析参数 type: string type: object - github_com_Tencent_WeKnora_internal_types.ParserEngineRule: + types.ParserEngineRule: properties: engine: type: string @@ -1681,7 +2375,7 @@ definitions: type: string type: array type: object - github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig: + types.QuestionGenerationConfig: properties: enabled: type: boolean @@ -1690,7 +2384,7 @@ definitions: 10)' type: integer type: object - github_com_Tencent_WeKnora_internal_types.RegisterRequest: + types.RegisterRequest: properties: email: type: string @@ -1706,18 +2400,18 @@ definitions: - password - username type: object - github_com_Tencent_WeKnora_internal_types.RegisterResponse: + types.RegisterResponse: properties: message: type: string success: type: boolean tenant: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant' + $ref: '#/definitions/types.Tenant' user: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User' + $ref: '#/definitions/types.User' type: object - github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest: + types.RequestRoleUpgradeRequest: properties: message: description: Optional message explaining the reason @@ -1725,12 +2419,12 @@ definitions: type: string requested_role: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole' + - $ref: '#/definitions/types.OrgMemberRole' description: The role user wants to upgrade to required: - requested_role type: object - github_com_Tencent_WeKnora_internal_types.Resource: + types.Resource: properties: description: description: Optional description @@ -1738,6 +2432,9 @@ definitions: 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 @@ -1758,7 +2455,7 @@ definitions: description: URL to access in external system type: string type: object - github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse: + types.ResourceCountsByOrgResponse: properties: agents: properties: @@ -1775,7 +2472,7 @@ definitions: type: object type: object type: object - github_com_Tencent_WeKnora_internal_types.RetrievalConfig: + types.RetrievalConfig: properties: embedding_top_k: description: 'EmbeddingTopK is the maximum number of chunks returned by vector @@ -1802,18 +2499,18 @@ definitions: default: 0.15)' type: number type: object - github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams: + types.RetrieverEngineParams: properties: retriever_engine_type: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType' + - $ref: '#/definitions/types.RetrieverEngineType' description: Retriever engine type retriever_type: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType' + - $ref: '#/definitions/types.RetrieverType' description: Retriever type type: object - github_com_Tencent_WeKnora_internal_types.RetrieverEngineType: + types.RetrieverEngineType: enum: - postgres - elasticsearch @@ -1833,14 +2530,14 @@ definitions: - MilvusRetrieverEngineType - WeaviateRetrieverEngineType - SQLiteRetrieverEngineType - github_com_Tencent_WeKnora_internal_types.RetrieverEngines: + types.RetrieverEngines: properties: engines: items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams' + $ref: '#/definitions/types.RetrieverEngineParams' type: array type: object - github_com_Tencent_WeKnora_internal_types.RetrieverType: + types.RetrieverType: enum: - keywords - vector @@ -1858,7 +2555,7 @@ definitions: - KeywordsRetrieverType - VectorRetrieverType - WebSearchRetrieverType - github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest: + types.ReviewJoinRequestRequest: properties: approved: type: boolean @@ -1867,11 +2564,11 @@ definitions: type: string role: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole' + - $ref: '#/definitions/types.OrgMemberRole' description: 'Optional: role to assign when approving; overrides applicant''s requested role' type: object - github_com_Tencent_WeKnora_internal_types.S3EngineConfig: + types.S3EngineConfig: properties: access_key: type: string @@ -1886,7 +2583,7 @@ definitions: secret_key: type: string type: object - github_com_Tencent_WeKnora_internal_types.SearchParams: + types.SearchParams: properties: disable_keywords_match: type: boolean @@ -1930,7 +2627,7 @@ definitions: vector_threshold: type: number type: object - github_com_Tencent_WeKnora_internal_types.SearchResult: + types.SearchResult: properties: chunk_index: description: Chunk index @@ -1984,7 +2681,7 @@ definitions: type: string match_type: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType' + - $ref: '#/definitions/types.MatchType' description: Match type matched_content: description: |- @@ -2014,7 +2711,7 @@ definitions: type: string type: array type: object - github_com_Tencent_WeKnora_internal_types.Session: + types.Session: properties: created_at: type: string @@ -2035,17 +2732,17 @@ definitions: updated_at: type: string type: object - github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest: + types.ShareKnowledgeBaseRequest: properties: organization_id: type: string permission: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole' + $ref: '#/definitions/types.OrgMemberRole' required: - organization_id - permission type: object - github_com_Tencent_WeKnora_internal_types.StorageConfig: + types.StorageConfig: properties: app_id: type: string @@ -2062,31 +2759,31 @@ definitions: secret_key: type: string type: object - github_com_Tencent_WeKnora_internal_types.StorageEngineConfig: + types.StorageEngineConfig: properties: cos: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig' + $ref: '#/definitions/types.COSEngineConfig' default_provider: description: '"local", "minio", "cos", "tos", "s3", "oss"' type: string local: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig' + $ref: '#/definitions/types.LocalEngineConfig' minio: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig' + $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' + $ref: '#/definitions/types.TOSEngineConfig' type: object - github_com_Tencent_WeKnora_internal_types.StorageProviderConfig: + types.StorageProviderConfig: properties: provider: description: '"local", "minio", "cos", "tos", "s3", "oss"' type: string type: object - github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest: + types.SubmitJoinRequestRequest: properties: invite_code: maxLength: 32 @@ -2097,13 +2794,13 @@ definitions: type: string role: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole' + - $ref: '#/definitions/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: + types.SyncLog: properties: created_at: description: Creation timestamp (usually same as StartedAt) @@ -2156,7 +2853,7 @@ definitions: description: Last update timestamp type: string type: object - github_com_Tencent_WeKnora_internal_types.TOSEngineConfig: + types.TOSEngineConfig: properties: access_key: type: string @@ -2171,32 +2868,11 @@ definitions: secret_key: type: string type: object - github_com_Tencent_WeKnora_internal_types.OSSEngineConfig: - properties: - access_key: - type: string - 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 - type: object - github_com_Tencent_WeKnora_internal_types.Tenant: + types.Tenant: properties: agent_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig' + - $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. @@ -2208,23 +2884,28 @@ definitions: type: string chat_history_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig' + - $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/github_com_Tencent_WeKnora_internal_types.ContextConfig' + - $ref: '#/definitions/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' + - $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' @@ -2240,24 +2921,24 @@ definitions: type: string parser_engine_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig' + - $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/github_com_Tencent_WeKnora_internal_types.RetrievalConfig' + - $ref: '#/definitions/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' + - $ref: '#/definitions/types.RetrieverEngines' description: Retriever engines status: description: Status type: string storage_engine_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig' + - $ref: '#/definitions/types.StorageEngineConfig' description: 'Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.' storage_quota: @@ -2272,10 +2953,10 @@ definitions: type: string web_search_config: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig' + - $ref: '#/definitions/types.WebSearchConfig' description: Global WebSearch configuration for this tenant type: object - github_com_Tencent_WeKnora_internal_types.ToolCall: + types.ToolCall: properties: args: additionalProperties: true @@ -2295,10 +2976,10 @@ definitions: type: string result: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult' + - $ref: '#/definitions/types.ToolResult' description: Execution result (contains Output) type: object - github_com_Tencent_WeKnora_internal_types.ToolResult: + types.ToolResult: properties: data: additionalProperties: true @@ -2319,14 +3000,14 @@ definitions: description: Whether the tool executed successfully type: boolean type: object - github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest: + types.UpdateMemberRoleRequest: properties: role: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole' + $ref: '#/definitions/types.OrgMemberRole' required: - role type: object - github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest: + types.UpdateOrganizationRequest: properties: avatar: description: optional avatar URL @@ -2351,14 +3032,14 @@ definitions: description: open for search so others can discover and join type: boolean type: object - github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest: + types.UpdateSharePermissionRequest: properties: permission: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole' + $ref: '#/definitions/types.OrgMemberRole' required: - permission type: object - github_com_Tencent_WeKnora_internal_types.User: + types.User: properties: avatar: description: Avatar URL of the user @@ -2384,7 +3065,7 @@ definitions: type: boolean tenant: allOf: - - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant' + - $ref: '#/definitions/types.Tenant' description: Association relationship, not stored in the database tenant_id: description: Tenant ID that the user belongs to @@ -2396,7 +3077,7 @@ definitions: description: Username of the user type: string type: object - github_com_Tencent_WeKnora_internal_types.VLMConfig: + types.VLMConfig: properties: api_key: description: API Key @@ -2417,10 +3098,17 @@ definitions: Model Name type: string type: object - github_com_Tencent_WeKnora_internal_types.WebSearchConfig: + types.WeKnoraCloudCredentials: + properties: + app_id: + type: string + app_secret: + type: string + type: object + types.WebSearchConfig: properties: api_key: - description: API密钥(如果需要) + description: 'Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.' type: string blacklist: description: 黑名单规则列表 @@ -2446,505 +3134,12 @@ definitions: description: 最大搜索结果数 type: integer provider: - description: 搜索引擎提供商ID + description: 'Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.' type: string rerank_model_id: description: 重排模型ID(用于RAG压缩) type: string type: object - gorm.DeletedAt: - properties: - time: - type: string - valid: - description: Valid is true if Time is not NULL - type: boolean - type: object - internal_handler.CopyKnowledgeBaseRequest: - properties: - source_id: - type: string - target_id: - type: string - task_id: - type: string - required: - - source_id - type: object - internal_handler.CreateAgentRequest: - properties: - avatar: - type: string - config: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig' - description: - type: string - name: - type: string - required: - - name - type: object - internal_handler.CreateModelRequest: - properties: - description: - type: string - 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' - required: - - name - - parameters - - source - - type - type: object - internal_handler.DeleteTagRequest: - properties: - exclude_ids: - description: Chunk seq_ids to exclude from deletion - items: - type: integer - 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: - type: string - tags: - items: - type: string - type: array - required: - - model_id - type: object - internal_handler.GetStorageEngineStatusResponse: - properties: - engines: - items: - $ref: '#/definitions/internal_handler.StorageEngineStatusItem' - type: array - minio_env_available: - type: boolean - type: object - internal_handler.GetSystemInfoResponse: - properties: - build_time: - type: string - commit_id: - type: string - db_version: - type: string - edition: - type: string - go_version: - type: string - graph_database_engine: - type: string - keyword_index_engine: - type: string - minio_enabled: - type: boolean - vector_store_engine: - type: string - version: - 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: - type: string - llmModelId: - 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 - type: object - storageProvider: - description: 存储引擎选择("local" | "minio" | "cos"),影响文档上传与文档内图片存储,参数从全局设置读取 - type: string - vlm_config: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig' - required: - - embeddingModelId - - llmModelId - type: object - internal_handler.ListMinioBucketsResponse: - properties: - buckets: - items: - $ref: '#/definitions/internal_handler.MinioBucketInfo' - type: array - type: object - internal_handler.MinioBucketInfo: - properties: - created_at: - type: string - name: - type: string - policy: - description: '"public", "private", "custom"' - type: string - type: object - internal_handler.RemoteModelCheckRequest: - properties: - apiKey: - type: string - baseUrl: - type: string - modelName: - type: string - required: - - baseUrl - - modelName - type: object - internal_handler.SearchMessagesRequest: - properties: - limit: - description: 'Maximum number of results to return (default: 20)' - type: integer - mode: - description: 'Search mode: "keyword", "vector", "hybrid" (default: "hybrid")' - type: string - query: - description: Query text for search - type: string - session_ids: - description: Filter by specific session IDs (optional) - items: - type: string - type: array - required: - - query - type: object - internal_handler.StorageCheckRequest: - 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"' - type: string - 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 - 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: - description: '"local", "minio", "cos", "tos", "s3", "oss"' - type: string - type: object - internal_handler.TextRelationExtractionRequest: - properties: - model_id: - type: string - tags: - items: - type: string - type: array - text: - type: string - required: - - model_id - - tags - - text - type: object - internal_handler.UpdateAgentRequest: - properties: - avatar: - type: string - config: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig' - description: - type: string - name: - type: string - type: object - internal_handler.UpdateChunkRequest: - properties: - chunk_index: - type: integer - content: - type: string - embedding: - items: - type: number - type: array - end_at: - type: integer - image_info: - type: string - is_enabled: - type: boolean - start_at: - type: integer - type: object - internal_handler.UpdateKnowledgeBaseRequest: - properties: - config: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig' - description: - type: string - name: - type: string - required: - - name - type: object - internal_handler.UpdateModelRequest: - properties: - description: - type: string - 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 - type: object - internal_handler.updateLastFAQImportResultDisplayStatusRequest: - properties: - display_status: - enum: - - open - - close - type: string - required: - - display_status - type: object - internal_handler_session.CreateKnowledgeQARequest: - 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.' - 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 - 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) - type: string - web_search_enabled: - description: Whether web search is enabled for this request - type: boolean - required: - - query - type: object - internal_handler_session.CreateSessionRequest: - properties: - description: - description: Description for the session (optional) - type: string - title: - description: Title for the session (optional) - type: string - type: object - internal_handler_session.GenerateTitleRequest: - properties: - messages: - description: Messages to use as context for title generation - items: - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Message' - type: array - required: - - messages - type: object - internal_handler_session.ImageAttachment: - properties: - 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 - internal_handler_session.MentionedItemRequest: - properties: - id: - 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 - internal_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 - knowledge_ids: - description: IDs of specific knowledge (files) to search - items: - type: string - type: array - query: - description: Query text to search for - type: string - required: - - query - type: object - internal_handler_session.StopSessionRequest: - properties: - message_id: - type: string - required: - - message_id - type: object - internal_handler_session.batchDeleteRequest: - properties: - delete_all: - type: boolean - ids: - items: - type: string - type: array - type: object info: contact: name: WeKnora Github @@ -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: - consumes: - - application/json - description: Returns the list of available web search providers from configuration + description: List all vector stores for the current tenant, including environment-configured + and user-created stores produces: - application/json responses: "200": - description: List of providers + description: List of vector stores (env + DB) + schema: + additionalProperties: true + type: object + "401": + description: Unauthorized schema: additionalProperties: true type: object security: - Bearer: [] - ApiKeyAuth: [] - summary: Get available web search providers + summary: List vector stores tags: - - web-search + - 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: 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: 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: 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: + - VectorStore securityDefinitions: ApiKeyAuth: description: 租户身份认证:输入 sk- 开头的 API Key diff --git a/frontend/src/api/system/index.ts b/frontend/src/api/system/index.ts index 35ad2855..431bcb60 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 535161ee..efa579bc 100644 --- a/frontend/src/views/settings/ParserEngineSettings.vue +++ b/frontend/src/views/settings/ParserEngineSettings.vue @@ -25,195 +25,201 @@

{{ $t('settings.parser.noEngineDetected') }}

- - - -
- - {{ $t('settings.parser.checkWithParams') }} - - {{ $t('settings.parser.saveConfig') }} - {{ checkMessage }} - - {{ saveMessage }} -
+ + + +
+
+

{{ getEngineDisplayDesc(currentEngine.Name, currentEngine.Description) }} + {{ engineDocLabel(currentEngine.Name) }} ↗ +

+
+ + +
+
+ {{ $t('settings.parser.connected') }} + {{ $t('settings.parser.disconnected') }} + {{ docreaderTransport === 'http' ? 'HTTP' : 'gRPC' }} + {{ $t('settings.parser.currentAddr') }}: {{ docreaderAddrEnv }} +
+

+ {{ $t('settings.parser.envVarHint') }} +

+
+ + + + +
+ {{ ft }} +
+ + +
+
+ + +
+
+ + + + + + + + +
+
+ {{ $t('settings.parser.formulaRecognition') }} + {{ $t('settings.parser.tableRecognition') }} + OCR +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + + + +
+
+ {{ $t('settings.parser.formulaRecognition') }} + {{ $t('settings.parser.tableRecognition') }} + OCR +
+
+ + +
+
+
+ +
+ + {{ $t('settings.parser.testConnection', '测试连接') }} + + + {{ checkMessage || saveMessage }} + +
+
+
+ + +
@@ -278,6 +284,12 @@ const checkMessage = ref('') const hasBuiltinEngine = computed(() => engines.value.some(e => e.Name === 'builtin')) +const drawerVisible = ref(false) +const currentEngine = ref(null) +const drawerTitle = computed(() => { + return currentEngine.value ? getEngineDisplayName(currentEngine.value.Name) : '' +}) + /** 固定展示顺序,未列出的引擎排在末尾按名称排序 */ const ENGINE_ORDER: Record = { 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-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-item-header { - margin-bottom: 16px; - - p { - font-size: 13px; - color: var(--td-text-color-placeholder); - margin: 6px 0 0 0; - line-height: 1.5; - } -} - -.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,28 +703,35 @@ 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-label { + display: block; + margin-bottom: 8px; + font-size: 14px; + font-weight: 500; + color: var(--td-text-color-primary); + + &.required::after { + content: '*'; + color: var(--td-error-color); + margin-left: 4px; + font-weight: 600; } } @@ -622,35 +739,7 @@ onMounted(loadAll) 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); - } - - &.error { - color: var(--td-error-color); - } - - &.hint { - color: var(--td-text-color-secondary); - } + 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); + } + } + } +} diff --git a/frontend/src/views/settings/Settings.vue b/frontend/src/views/settings/Settings.vue index 703c7120..958f7c0a 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 694a5f45..ecb18259 100644 --- a/frontend/src/views/settings/StorageEngineSettings.vue +++ b/frontend/src/views/settings/StorageEngineSettings.vue @@ -28,7 +28,12 @@

{{ $t('settings.storage.defaultEngineDesc') }}

- + @@ -36,475 +41,472 @@ + + {{ saveMessage }} +
- -
-
-
-
-

{{ $t('settings.storage.localTitle') }}

- {{ $t('settings.storage.available') }} -
-

{{ $t('settings.storage.localDesc') }}

+
+ +
+
+

{{ $t('settings.storage.localTitle') }}

+ {{ $t('settings.storage.available') }}
+

{{ $t('settings.storage.localDesc') }}

-
-
- - + + +
+
+

MinIO

+ {{ $t('settings.storage.available') }} + {{ $t('settings.storage.needsConfig') }}
+

{{ $t('settings.storage.minioDesc') }}

+
+ + +
+
+

{{ $t('settings.storage.cosTitle') }}

+ {{ $t('settings.storage.configurable') }} +
+

{{ $t('settings.storage.cosDesc') }}

+
+ + +
+
+

{{ $t('settings.storage.tosTitle') }}

+ {{ $t('settings.storage.configurable') }} +
+

{{ $t('settings.storage.tosDesc') }}

+
+ + +
+
+

{{ $t('settings.storage.s3Title') }}

+ {{ $t('settings.storage.configurable') }} +
+

{{ $t('settings.storage.s3Desc') }}

+
+ + +
+
+

{{ $t('settings.storage.ossTitle') }}

+ {{ $t('settings.storage.configurable') }} +
+

{{ $t('settings.storage.ossDesc') }}

+ - -
-
-
-
-

MinIO

- {{ $t('settings.storage.available') }} - {{ $t('settings.storage.needsConfig') }} -
-

{{ $t('settings.storage.minioDesc') }}

-
-
- -
-
- {{ $t('settings.storage.minioDocker') }} - {{ $t('settings.storage.detected') }} - {{ $t('settings.storage.notDetected') }} -
-
- {{ $t('settings.storage.minioRemote') }} -
-
- - -
-
- {{ $t('settings.storage.minioDockerDetected') }} -
-
- {{ $t('settings.storage.minioDockerNotDetected') }} + + +
+ + + + + - -
-
-
-
-

{{ $t('settings.storage.cosTitle') }}

- {{ $t('settings.storage.configurable') }} -
-

+ + + + + + + + + + + +

+ +
+ + {{ $t('settings.storage.testConnection') }} + + + {{ currentCheckState.result.message }} +
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- {{ $t('settings.storage.testConnection') }} - - {{ ossCheckResult.message }} -
- -
- {{ $t('settings.storage.saveConfig') }} - - {{ saveMessage }} - -
- + +
@@ -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([]) -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(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 = { + 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; -.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; - } + &:hover { + border-color: var(--td-brand-color); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); } - p { - font-size: 13px; - color: var(--td-text-color-placeholder); + &.active { + border-color: var(--td-brand-color); + background: rgba(var(--td-brand-color-5-rgba), 0.05); + } +} + +.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; +} + +// ---- 抽屉内容 ---- +.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-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; - - &.success { - color: var(--td-success-color); - } - - &.created { - color: var(--td-warning-color); - } - - &.error { - color: var(--td-error-color); - } -} - -.save-bar { +.api-test-section { display: flex; align-items: center; 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; + + .test-message { + font-size: 13px; + line-height: 1.5; + flex: 1; + + &.success { + color: var(--td-brand-color-active); + } + + &.error { + color: var(--td-error-color); + } + + &.created { + color: var(--td-warning-color); + } + } + + :deep(.t-button) { + min-width: 88px; + height: 32px; + font-size: 13px; + border-radius: 6px; + flex-shrink: 0; + } +} + +.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); + } + } + } } .save-msg { diff --git a/internal/handler/system.go b/internal/handler/system.go index 1af6391d..55acee0a 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 cfa37736..d0673a98 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) } }