Skip to content

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

docs(api): regenerate swagger via make docs

nullkey54b6f2dc35c6
diff --git a/docs/docs.go b/docs/docs.go
index a050168f9..f9cb6f341 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -19,6 +19,69 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
+ "/agent/tool-approvals/{pending_id}": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "用户审批通过或驳回一次工具调用(用于 Agent 阻塞等待审批的场景)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "MCP服务"
+ ],
+ "summary": "处理 MCP 工具调用待审批请求",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "待审批记录 ID",
+ "name": "pending_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "{decision: \\",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "审批结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "待审批记录不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/agents": {
"get": {
"security": [
@@ -391,6 +454,57 @@ const docTemplate = `{
}
}
},
+ "/agents/{id}/shares/{share_id}": {
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "从智能体的共享列表中移除指定共享关系",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织"
+ ],
+ "summary": "取消智能体共享",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "智能体 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "共享记录 ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success: true",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/agents/{id}/suggested-questions": {
"get": {
"security": [
@@ -1052,7 +1166,7 @@ const docTemplate = `{
"Bearer": []
}
],
- "description": "Returns the wiki link graph data for visualization",
+ "description": "Returns a slice of the wiki link graph for visualization. Supports\n` + "`" + `mode=overview` + "`" + ` (top-N most-connected pages, default) and\n` + "`" + `mode=ego` + "`" + ` (BFS neighborhood of a center slug) to keep response\nsize tractable for knowledge bases with tens of thousands of pages.",
"produces": [
"application/json"
],
@@ -1067,6 +1181,36 @@ const docTemplate = `{
"name": "kb_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "overview (default) | ego",
+ "name": "mode",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Center slug for ego mode",
+ "name": "center",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Ego BFS depth (1-3, default 1)",
+ "name": "depth",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Comma-separated page_type allow-list",
+ "name": "types",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Max nodes to return (default 500, max 2000)",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
@@ -1086,14 +1230,14 @@ const docTemplate = `{
"Bearer": []
}
],
- "description": "Returns the wiki index page (creates default if not exists)",
+ "description": "Returns the wiki index as intro text plus per-type paginated\ndirectory groups. The heavy directory markdown that used to\nlive in wiki_pages.content was replaced with this structured\nresponse so a KB with tens of thousands of pages no longer\nmaterializes megabytes of TEXT on every index open.",
"produces": [
"application/json"
],
"tags": [
"Wiki"
],
- "summary": "Get wiki index page",
+ "summary": "Get wiki index view",
"parameters": [
{
"type": "string",
@@ -1101,13 +1245,31 @@ const docTemplate = `{
"name": "kb_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "Comma-separated page types (default: all content types)",
+ "name": "types",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Per-group window size, 1-200 (default 50)",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Opaque offset cursor from previous response",
+ "name": "cursor",
+ "in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiIndexResponse"
}
}
}
@@ -1265,7 +1427,7 @@ const docTemplate = `{
"Bearer": []
}
],
- "description": "Returns the wiki operation log page (creates default if not exists)",
+ "description": "Returns a paginated feed of wiki operation events (ingest, retract, ...)\nnewest-first. Pagination is cursor-based: pass ` + "`" + `next_cursor` + "`" + ` from the\nprevious response back as ` + "`" + `cursor` + "`" + ` to fetch the next page.",
"produces": [
"application/json"
],
@@ -1280,13 +1442,25 @@ const docTemplate = `{
"name": "kb_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "Opaque cursor from the previous page (empty = newest)",
+ "name": "cursor",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Page size, 1-200 (default 50)",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiLogEntryListResponse"
}
}
}
@@ -2112,6 +2286,69 @@ const docTemplate = `{
}
}
},
+ "/chunker/preview": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "对提交的文本运行自适应分块器并返回分块预览,不写入数据库不生成 embedding。文本最大 64k 字符",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块"
+ ],
+ "summary": "预览分块结果",
+ "parameters": [
+ {
+ "description": "{text, chunking_config}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkingRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "分块结果",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkingResponse"
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "413": {
+ "description": "文本超过预览限制",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "504": {
+ "description": "分块超时",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
"/chunks/by-id/{id}": {
"get": {
"security": [
@@ -2606,8 +2843,8 @@ const docTemplate = `{
}
}
},
- "/initialization/extract/relations": {
- "post": {
+ "/im-channels/{id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -2616,7 +2853,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "从文本中提取实体和关系",
+ "description": "更新指定 IM 渠道的名称、模式、知识库、凭证或启用状态",
"consumes": [
"application/json"
],
@@ -2624,23 +2861,31 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "IM 渠道"
],
- "summary": "提取文本关系",
+ "summary": "更新 IM 渠道",
"parameters": [
{
- "description": "提取请求",
+ "type": "string",
+ "description": "渠道 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新字段(name/mode/output_mode/knowledge_base_id/credentials/enabled)",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
+ "type": "object",
+ "additionalProperties": true
}
}
],
"responses": {
"200": {
- "description": "提取结果",
+ "description": "更新后的渠道",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2649,38 +2894,20 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "type": "object",
+ "additionalProperties": true
}
- }
- }
- }
- },
- "/initialization/fabri/tag": {
- "get": {
- "description": "随机生成一组标签",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "初始化"
- ],
- "summary": "生成随机标签",
- "responses": {
- "200": {
- "description": "生成的标签",
+ },
+ "404": {
+ "description": "渠道不存在",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
- }
- },
- "/initialization/fabri/text": {
- "post": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2689,31 +2916,26 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据标签生成示例文本",
- "consumes": [
- "application/json"
- ],
+ "description": "删除指定 IM 渠道",
"produces": [
"application/json"
],
"tags": [
- "初始化"
+ "IM 渠道"
],
- "summary": "生成示例文本",
+ "summary": "删除 IM 渠道",
"parameters": [
{
- "description": "生成请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler.FabriTextRequest"
- }
+ "type": "string",
+ "description": "渠道 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "生成的文本",
+ "description": "success: true",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2722,13 +2944,21 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "渠道不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/initialization/kb/{kbId}": {
+ "/im-channels/{id}/toggle": {
"post": {
"security": [
{
@@ -2738,7 +2968,51 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID执行完整配置更新",
+ "description": "切换指定 IM 渠道的启用状态",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IM 渠道"
+ ],
+ "summary": "启用/停用 IM 渠道",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "渠道 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的渠道",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "渠道不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/im/callback/{channel_id}": {
+ "get": {
+ "description": "接收各 IM 平台的事件回调;走平台自身签名校验,不使用 API Key",
"consumes": [
"application/json"
],
@@ -2746,30 +3020,123 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "IM 回调"
],
- "summary": "初始化知识库配置",
+ "summary": "IM 平台回调",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "kbId",
+ "description": "渠道 ID",
+ "name": "channel_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "处理结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "签名校验失败",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "post": {
+ "description": "接收各 IM 平台的事件回调;走平台自身签名校验,不使用 API Key",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IM 回调"
+ ],
+ "summary": "IM 平台回调",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "渠道 ID",
+ "name": "channel_id",
"in": "path",
"required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "处理结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "签名校验失败",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/asr/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
},
{
- "description": "初始化请求",
+ "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"
+ "$ref": "#/definitions/internal_handler.ModelTestRequest"
}
}
],
"responses": {
"200": {
- "description": "初始化成功",
+ "description": "检查结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2784,7 +3151,7 @@ const docTemplate = `{
}
}
},
- "/initialization/kb/{kbId}/config": {
+ "/initialization/config/{kbId}": {
"get": {
"security": [
{
@@ -2891,7 +3258,7 @@ const docTemplate = `{
}
}
},
- "/initialization/models/asr/check": {
+ "/initialization/embedding/test": {
"post": {
"security": [
{
@@ -2901,7 +3268,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点",
+ "description": "测试Embedding接口是否可用并返回向量维度",
"consumes": [
"application/json"
],
@@ -2911,21 +3278,21 @@ const docTemplate = `{
"tags": [
"初始化"
],
- "summary": "检查ASR模型",
+ "summary": "测试Embedding模型",
"parameters": [
{
- "description": "ASR检查请求",
+ "description": "Embedding测试请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.ModelTestRequest"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2940,7 +3307,31 @@ const docTemplate = `{
}
}
},
- "/initialization/models/embedding/test": {
+ "/initialization/extract/fabri-tag": {
+ "post": {
+ "description": "随机生成一组标签",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "生成随机标签",
+ "responses": {
+ "200": {
+ "description": "生成的标签",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/extract/fabri-text": {
"post": {
"security": [
{
@@ -2950,7 +3341,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "测试Embedding接口是否可用并返回向量维度",
+ "description": "根据标签生成示例文本",
"consumes": [
"application/json"
],
@@ -2960,21 +3351,21 @@ const docTemplate = `{
"tags": [
"初始化"
],
- "summary": "测试Embedding模型",
+ "summary": "生成示例文本",
"parameters": [
{
- "description": "Embedding测试请求",
+ "description": "生成请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.FabriTextRequest"
}
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "生成的文本",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2989,7 +3380,7 @@ const docTemplate = `{
}
}
},
- "/initialization/models/remote/check": {
+ "/initialization/extract/text-relation": {
"post": {
"security": [
{
@@ -2999,7 +3390,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "检查远程API模型连接是否正常",
+ "description": "从文本中提取实体和关系",
"consumes": [
"application/json"
],
@@ -3009,21 +3400,21 @@ const docTemplate = `{
"tags": [
"初始化"
],
- "summary": "检查远程模型",
+ "summary": "提取文本关系",
"parameters": [
{
- "description": "模型检查请求",
+ "description": "提取请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "提取结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3038,7 +3429,7 @@ const docTemplate = `{
}
}
},
- "/initialization/models/rerank/check": {
+ "/initialization/initialize/{kbId}": {
"post": {
"security": [
{
@@ -3048,7 +3439,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "检查Rerank模型连接和功能是否正常",
+ "description": "根据知识库ID执行完整配置更新",
"consumes": [
"application/json"
],
@@ -3058,21 +3449,28 @@ const docTemplate = `{
"tags": [
"初始化"
],
- "summary": "检查Rerank模型",
+ "summary": "初始化知识库配置",
"parameters": [
{
- "description": "Rerank检查请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "初始化请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.InitializationRequest"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "初始化成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3167,7 +3565,7 @@ const docTemplate = `{
}
}
},
- "/initialization/ollama/download/tasks": {
+ "/initialization/ollama/download/progress/{taskId}": {
"get": {
"security": [
{
@@ -3177,7 +3575,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "列出所有Ollama模型下载任务",
+ "description": "获取Ollama模型下载任务的进度",
"consumes": [
"application/json"
],
@@ -3187,19 +3585,34 @@ const docTemplate = `{
"tags": [
"初始化"
],
- "summary": "列出下载任务",
+ "summary": "获取下载进度",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "任务ID",
+ "name": "taskId",
+ "in": "path",
+ "required": true
+ }
+ ],
"responses": {
"200": {
- "description": "任务列表",
+ "description": "下载进度",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/initialization/ollama/download/{taskId}": {
+ "/initialization/ollama/download/tasks": {
"get": {
"security": [
{
@@ -3209,7 +3622,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取Ollama模型下载任务的进度",
+ "description": "列出所有Ollama模型下载任务",
"consumes": [
"application/json"
],
@@ -3219,29 +3632,14 @@ const docTemplate = `{
"tags": [
"初始化"
],
- "summary": "获取下载进度",
- "parameters": [
- {
- "type": "string",
- "description": "任务ID",
- "name": "taskId",
- "in": "path",
- "required": true
- }
- ],
+ "summary": "列出下载任务",
"responses": {
"200": {
- "description": "下载进度",
+ "description": "任务列表",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "404": {
- "description": "任务不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
@@ -3419,8 +3817,8 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases": {
- "get": {
+ "/initialization/remote/check": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3429,7 +3827,105 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
+ "description": "检查远程API模型连接是否正常",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查远程模型",
+ "parameters": [
+ {
+ "description": "模型检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/rerank/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查Rerank模型连接和功能是否正常",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Rerank模型",
+ "parameters": [
+ {
+ "description": "Rerank检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.ModelTestRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
"consumes": [
"application/json"
],
@@ -4889,6 +5385,56 @@ const docTemplate = `{
}
}
},
+ "/knowledge-bases/{id}/move-targets": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回与源知识库 Type 一致、EmbeddingModelID 一致、非临时且不是自身的目标知识库列表",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "获取可移动目标知识库列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "源知识库 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "可移动目标列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/knowledge-bases/{id}/pin": {
"put": {
"security": [
@@ -5452,6 +5998,61 @@ const docTemplate = `{
}
}
},
+ "/knowledge/batch-delete": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "按 ID 列表批量删除单个知识库下的多个知识条目",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识管理"
+ ],
+ "summary": "批量删除知识",
+ "parameters": [
+ {
+ "description": "批量删除请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.BatchDeleteKnowledgeRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "权限不足",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/knowledge/image/{id}/{chunk_id}": {
"put": {
"security": [
@@ -5576,8 +6177,8 @@ const docTemplate = `{
}
}
},
- "/knowledge/search": {
- "get": {
+ "/knowledge/move": {
+ "post": {
"security": [
{
"Bearer": []
@@ -5586,7 +6187,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
+ "description": "将一条或多条知识从源知识库移动到目标知识库(异步),返回任务 ID 用于查询进度",
"consumes": [
"application/json"
],
@@ -5594,51 +6195,29 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "Knowledge"
+ "知识"
],
- "summary": "Search knowledge",
+ "summary": "移动知识到其他知识库",
"parameters": [
{
- "type": "string",
- "description": "Keyword to search",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Offset for pagination",
- "name": "offset",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Limit for pagination (default 20)",
- "name": "limit",
- "in": "query"
- },
- {
- "type": "string",
- "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
- "name": "file_types",
- "in": "query"
- },
- {
- "type": "string",
- "description": "Shared agent ID (search within agent's KB scope)",
- "name": "agent_id",
- "in": "query"
+ "description": "{source_kb_id, target_kb_id, knowledge_ids}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.MoveKnowledgeRequest"
+ }
}
],
"responses": {
"200": {
- "description": "Search results",
+ "description": "任务信息",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MoveKnowledgeResponse"
}
},
"400": {
- "description": "Invalid request",
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -5646,8 +6225,8 @@ const docTemplate = `{
}
}
},
- "/knowledge/tags": {
- "put": {
+ "/knowledge/move/progress/{task_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5656,29 +6235,142 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
- "consumes": [
- "application/json"
- ],
+ "description": "按任务 ID 查询移动进度",
"produces": [
"application/json"
],
"tags": [
- "知识管理"
+ "知识"
],
- "summary": "批量更新知识标签",
+ "summary": "获取知识移动进度",
"parameters": [
{
- "description": "标签更新请求(updates 必填,kb_id 可选)",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
- }
- ],
- "responses": {
+ "type": "string",
+ "description": "移动任务 ID",
+ "name": "task_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "进度信息",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress"
+ }
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge/search": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Knowledge"
+ ],
+ "summary": "Search knowledge",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Keyword to search",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Offset for pagination",
+ "name": "offset",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Limit for pagination (default 20)",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
+ "name": "file_types",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Shared agent ID (search within agent's KB scope)",
+ "name": "agent_id",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Search results",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge/tags": {
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识管理"
+ ],
+ "summary": "批量更新知识标签",
+ "parameters": [
+ {
+ "description": "标签更新请求(updates 必填,kb_id 可选)",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
"200": {
"description": "更新成功",
"schema": {
@@ -6320,6 +7012,76 @@ const docTemplate = `{
}
}
},
+ "/mcp-services/{id}/tool-approvals/{tool_name}": {
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "为指定 MCP 服务下的某个工具设置/更新审批要求",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "MCP服务"
+ ],
+ "summary": "设置 MCP 工具人工审批策略",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "MCP 服务 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "工具名",
+ "name": "tool_name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "{require_approval: bool}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "MCP 服务或工具不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/mcp-services/{id}/tools": {
"get": {
"security": [
@@ -6687,6 +7449,42 @@ const docTemplate = `{
}
}
},
+ "/models/weknoracloud/status": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查当前租户的 WeKnoraCloud 凭证是否完好;needs_reinit=true 表示需要重新保存",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "WeKnoraCloud"
+ ],
+ "summary": "检查 WeKnoraCloud 凭证状态",
+ "responses": {
+ "200": {
+ "description": "凭证状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
"/models/{id}": {
"get": {
"security": [
@@ -7250,6 +8048,50 @@ const docTemplate = `{
}
}
},
+ "/organizations/{id}/agent-shares": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回所有被共享到指定组织的智能体(含我的有效权限)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织"
+ ],
+ "summary": "获取共享到本组织的智能体",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "智能体共享列表 + total",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "403": {
+ "description": "非组织成员",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/organizations/{id}/invite": {
"post": {
"security": [
@@ -7848,7 +8690,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的会话列表,支持分页",
+ "description": "获取当前租户的会话列表,支持分页、关键字搜索、按来源/Agent 筛选",
"consumes": [
"application/json"
],
@@ -7871,9 +8713,27 @@ const docTemplate = `{
"description": "每页数量",
"name": "page_size",
"in": "query"
- }
- ],
- "responses": {
+ },
+ {
+ "type": "string",
+ "description": "标题模糊搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "来源过滤:web / feishu / wechat / slack / ...",
+ "name": "source",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "按 Agent 过滤(仅对 IM 会话生效)",
+ "name": "agent_id",
+ "in": "query"
+ }
+ ],
+ "responses": {
"200": {
"description": "会话列表",
"schema": {
@@ -7986,6 +8846,60 @@ const docTemplate = `{
}
}
},
+ "/sessions/continue-stream/{session_id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "继续获取正在进行的流式响应",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "text/event-stream"
+ ],
+ "tags": [
+ "问答"
+ ],
+ "summary": "继续流式响应",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "消息ID",
+ "name": "message_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "流式响应",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "会话或消息不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/sessions/search": {
"post": {
"security": [
@@ -8234,6 +9148,50 @@ const docTemplate = `{
}
}
},
+ "/sessions/{id}/pin": {
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "取消指定会话的置顶",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "会话"
+ ],
+ "summary": "取消置顶会话",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "取消置顶成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "会话不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/sessions/{session_id}/agent-qa": {
"post": {
"security": [
@@ -8290,8 +9248,8 @@ const docTemplate = `{
}
}
},
- "/sessions/{session_id}/continue": {
- "get": {
+ "/sessions/{session_id}/knowledge-qa": {
+ "post": {
"security": [
{
"Bearer": []
@@ -8300,7 +9258,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "继续获取正在进行的流式响应",
+ "description": "基于知识库的问答(使用LLM总结),支持SSE流式响应",
"consumes": [
"application/json"
],
@@ -8310,7 +9268,7 @@ const docTemplate = `{
"tags": [
"问答"
],
- "summary": "继续流式响应",
+ "summary": "知识问答",
"parameters": [
{
"type": "string",
@@ -8320,23 +9278,25 @@ const docTemplate = `{
"required": true
},
{
- "type": "string",
- "description": "消息ID",
- "name": "message_id",
- "in": "query",
- "required": true
+ "description": "问答请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
+ }
}
],
"responses": {
"200": {
- "description": "流式响应",
+ "description": "问答结果(SSE流)",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "会话或消息不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -8344,7 +9304,7 @@ const docTemplate = `{
}
}
},
- "/sessions/{session_id}/knowledge-qa": {
+ "/sessions/{session_id}/pin": {
"post": {
"security": [
{
@@ -8354,17 +9314,14 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "基于知识库的问答(使用LLM总结),支持SSE流式响应",
- "consumes": [
- "application/json"
- ],
+ "description": "将指定会话置顶(用户维度)",
"produces": [
- "text/event-stream"
+ "application/json"
],
"tags": [
- "问答"
+ "会话"
],
- "summary": "知识问答",
+ "summary": "置顶会话",
"parameters": [
{
"type": "string",
@@ -8372,27 +9329,18 @@ const docTemplate = `{
"name": "session_id",
"in": "path",
"required": true
- },
- {
- "description": "问答请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
- }
}
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "置顶成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "会话不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -8512,6 +9460,41 @@ const docTemplate = `{
}
}
},
+ "/shared-agents": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回所有共享给当前用户所在组织的智能体",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织"
+ ],
+ "summary": "获取我可访问的共享智能体",
+ "responses": {
+ "200": {
+ "description": "智能体列表 + total",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/shared-knowledge-bases": {
"get": {
"security": [
@@ -9312,6 +10295,56 @@ const docTemplate = `{
}
}
},
+ "/tenants/{id}/api-key": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "为指定租户生成一个新的 API Key,旧 Key 立即失效",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "重置租户 API Key",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "租户ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "新生成的 API Key",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "权限不足",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/vector-stores": {
"get": {
"security": [
@@ -9714,27 +10747,473 @@ const docTemplate = `{
}
}
}
- }
- },
- "definitions": {
- "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue": {
- "type": "object",
- "properties": {
- "auto_fixable": {
- "type": "boolean"
- },
- "description": {
- "type": "string"
- },
- "page_slug": {
- "type": "string"
- },
- "severity": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity"
- },
- "target_slug": {
- "description": "TargetSlug identifies the other page involved in the issue (e.g. the\nbroken link target, or the entity slug for a missing cross-ref). It is\nthe structured field used by AutoFix instead of parsing Description.",
- "type": "string"
+ },
+ "/web-search-providers/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "使用前端表单中尚未保存的凭证测试连通性,用于\"测试连接\"按钮",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "使用原始凭证测试 Provider(不落库)",
+ "parameters": [
+ {
+ "description": "{provider, parameters}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.TestProviderRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "测试结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/web-search-providers/types": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回 UI 表单需要的 provider 类型及参数定义",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "获取网络搜索 Provider 类型元数据",
+ "responses": {
+ "200": {
+ "description": "provider 类型列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/web-search-providers/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据 ID 获取指定 provider 配置",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "获取网络搜索 Provider 详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Provider ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Provider 详情",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity"
+ }
+ },
+ "404": {
+ "description": "Provider 不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新指定 provider 的名称/描述/参数/是否默认",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "更新网络搜索 Provider",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Provider ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新字段",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.UpdateProviderRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的 Provider",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity"
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Provider 不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定 provider 配置",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "删除网络搜索 Provider",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Provider ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success: true",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Provider 不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/web-search-providers/{id}/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "使用数据库中已保存的凭证测试连通性",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "测试已保存的 Provider",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Provider ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "测试结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Provider 不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/web-search/providers": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回所有已注册的网络搜索 provider(含元数据)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "获取可用网络搜索 Provider 列表",
+ "responses": {
+ "200": {
+ "description": "provider 列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/wechat/qrcode": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "申请一个用于扫码登录绑定的微信二维码(无请求体)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IM 渠道"
+ ],
+ "summary": "获取微信扫码登录二维码",
+ "responses": {
+ "200": {
+ "description": "二维码信息(qrcode_url + qrcode 标识)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "二维码生成失败",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/wechat/qrcode/status": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "查询指定二维码是否已被扫描/确认/过期;confirmed 时返回凭证",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IM 渠道"
+ ],
+ "summary": "轮询微信二维码状态",
+ "parameters": [
+ {
+ "description": "{qrcode: string}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "扫码状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/weknoracloud/credentials": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "保存 APPID/APPSECRET 到当前租户配置(不自动创建模型)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "WeKnoraCloud"
+ ],
+ "summary": "保存 WeKnoraCloud 凭证",
+ "parameters": [
+ {
+ "description": "{app_id, app_secret}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success: true",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue": {
+ "type": "object",
+ "properties": {
+ "auto_fixable": {
+ "type": "boolean"
+ },
+ "description": {
+ "type": "string"
+ },
+ "page_slug": {
+ "type": "string"
+ },
+ "severity": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity"
+ },
+ "target_slug": {
+ "description": "TargetSlug identifies the other page involved in the issue (e.g. the\nbroken link target, or the entity slug for a missing cross-ref). It is\nthe structured field used by AutoFix instead of parsing Description.",
+ "type": "string"
},
"type": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueType"
@@ -9888,6 +11367,102 @@ const docTemplate = `{
"ErrAgentInvalidTemperature"
]
},
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile": {
+ "type": "object",
+ "properties": {
+ "all_caps_short_line_count": {
+ "type": "integer"
+ },
+ "avg_line_len": {
+ "type": "number"
+ },
+ "blank_paragraph_breaks": {
+ "type": "integer"
+ },
+ "chinese_chapter_count": {
+ "type": "integer"
+ },
+ "code_ratio": {
+ "type": "number"
+ },
+ "detected_langs": {
+ "description": "Detected language hints (best-effort)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "english_chapter_count": {
+ "type": "integer"
+ },
+ "form_feed_count": {
+ "type": "integer"
+ },
+ "german_chapter_count": {
+ "type": "integer"
+ },
+ "has_code": {
+ "type": "boolean"
+ },
+ "has_tables": {
+ "description": "Content characteristics",
+ "type": "boolean"
+ },
+ "md_heading_counts": {
+ "description": "Markdown structure",
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ },
+ "md_heading_total": {
+ "type": "integer"
+ },
+ "numbered_section_count": {
+ "description": "Heuristic indicators",
+ "type": "integer"
+ },
+ "repeated_footer_count": {
+ "type": "integer"
+ },
+ "std_line_len": {
+ "type": "number"
+ },
+ "total_chars": {
+ "type": "integer"
+ },
+ "total_lines": {
+ "type": "integer"
+ },
+ "visual_sep_count": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier": {
+ "type": "string",
+ "enum": [
+ "heading",
+ "heuristic",
+ "legacy"
+ ],
+ "x-enum-varnames": [
+ "TierHeading",
+ "TierHeuristic",
+ "TierLegacy"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.TierRejection": {
+ "type": "object",
+ "properties": {
+ "reason": {
+ "type": "string"
+ },
+ "tier": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.ASRConfig": {
"type": "object",
"properties": {
@@ -10128,6 +11703,13 @@ const docTemplate = `{
"description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
"type": "boolean"
},
+ "languages": {
+ "description": "Languages hints the heuristic patterns. Empty = auto-detect from content.\nExamples: [\"de\"], [\"en\", \"zh\"].",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"parent_chunk_size": {
"description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
"type": "integer"
@@ -10145,6 +11727,14 @@ const docTemplate = `{
"items": {
"type": "string"
}
+ },
+ "strategy": {
+ "description": "Strategy selects the adaptive chunking tier. Empty / \"legacy\" preserves\nthe historical recursive splitter; \"auto\" lets a profiler pick between\nheading-aware, heuristic and recursive tiers; \"heading\" / \"heuristic\" /\n\"recursive\" pin the tier explicitly.",
+ "type": "string"
+ },
+ "token_limit": {
+ "description": "TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize\nas a character count.",
+ "type": "integer"
}
}
},
@@ -10159,6 +11749,10 @@ const docTemplate = `{
"description": "AES-GCM encrypted",
"type": "string"
},
+ "database": {
+ "description": "Tencent VectorDB and Doris database name.",
+ "type": "string"
+ },
"grpc_address": {
"description": "Weaviate",
"type": "string"
@@ -10167,6 +11761,10 @@ const docTemplate = `{
"description": "Qdrant",
"type": "string"
},
+ "http_port": {
+ "description": "Doris: HTTP port for Stream Load API (FE default 8030).\nAddr is reused for the MySQL protocol \"host:9030\"; HTTPPort + the host of Addr\ntogether form the FE HTTP endpoint used by Stream Load.",
+ "type": "integer"
+ },
"password": {
"description": "AES-GCM encrypted",
"type": "string"
@@ -10412,7 +12010,7 @@ const docTemplate = `{
"type": "integer"
},
"image_storage_provider": {
- "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
+ "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\".\nEmpty means use the global/tenant default provider.",
"type": "string"
},
"image_upload_enabled": {
@@ -10944,6 +12542,10 @@ const docTemplate = `{
"github_com_Tencent_WeKnora_internal_types.IndexConfig": {
"type": "object",
"properties": {
+ "buckets_num": {
+ "description": "Doris: number of buckets per table (DISTRIBUTED BY HASH ... BUCKETS N)",
+ "type": "integer"
+ },
"collection_name": {
"description": "Milvus",
"type": "string"
@@ -10976,6 +12578,10 @@ const docTemplate = `{
"description": "Qdrant, Weaviate: number of replicas",
"type": "integer"
},
+ "replication_num": {
+ "description": "Doris: replication_num PROPERTIES",
+ "type": "integer"
+ },
"shard_number": {
"description": "--- Scalability fields ---",
"type": "integer"
@@ -11065,6 +12671,44 @@ const docTemplate = `{
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "processing",
+ "completed",
+ "failed"
+ ],
+ "x-enum-varnames": [
+ "KBCloneStatusPending",
+ "KBCloneStatusProcessing",
+ "KBCloneStatusCompleted",
+ "KBCloneStatusFailed"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.KS3EngineConfig": {
+ "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"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.Knowledge": {
"type": "object",
"properties": {
@@ -11462,6 +13106,55 @@ const docTemplate = `{
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "description": "任务创建时间",
+ "type": "integer"
+ },
+ "error": {
+ "description": "错误信息",
+ "type": "string"
+ },
+ "failed": {
+ "description": "失败数",
+ "type": "integer"
+ },
+ "message": {
+ "description": "状态消息",
+ "type": "string"
+ },
+ "processed": {
+ "description": "已处理数",
+ "type": "integer"
+ },
+ "progress": {
+ "description": "0-100",
+ "type": "integer"
+ },
+ "source_kb_id": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus"
+ },
+ "target_kb_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ },
+ "total": {
+ "description": "总知识数",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "最后更新时间",
+ "type": "integer"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
"type": "object",
"properties": {
@@ -12520,6 +14213,18 @@ const docTemplate = `{
"description": "RerankTopK is the maximum number of results after reranking (default: 10)",
"type": "integer"
},
+ "rrf_k": {
+ "description": "RRFK is the smoothing constant of Reciprocal Rank Fusion. Larger values\nflatten the curve, reducing the bias towards top-1 results.\nDefault: 60. Sensible range: 30..100 depending on corpus size.",
+ "type": "integer"
+ },
+ "rrf_keyword_weight": {
+ "description": "RRFKeywordWeight is the keyword counterpart. Default: 0.3.",
+ "type": "number"
+ },
+ "rrf_vector_weight": {
+ "description": "RRFVectorWeight is the weight applied to the vector retriever inside RRF.\nRRFVectorWeight + RRFKeywordWeight should usually sum to 1.0 but the math\nworks for any positive weights. Default: 0.7.",
+ "type": "number"
+ },
"vector_threshold": {
"description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
"type": "number"
@@ -12557,7 +14262,9 @@ const docTemplate = `{
"qdrant",
"milvus",
"weaviate",
- "sqlite"
+ "doris",
+ "sqlite",
+ "tencent_vectordb"
],
"x-enum-varnames": [
"PostgresRetrieverEngineType",
@@ -12567,7 +14274,9 @@ const docTemplate = `{
"QdrantRetrieverEngineType",
"MilvusRetrieverEngineType",
"WeaviateRetrieverEngineType",
- "SQLiteRetrieverEngineType"
+ "DorisRetrieverEngineType",
+ "SQLiteRetrieverEngineType",
+ "TencentVectorDBRetrieverEngineType"
]
},
"github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
@@ -12826,6 +14535,14 @@ const docTemplate = `{
"description": "ID",
"type": "string"
},
+ "is_pinned": {
+ "description": "IsPinned indicates whether the session is pinned in the list.",
+ "type": "boolean"
+ },
+ "pinned_at": {
+ "description": "PinnedAt records when the session was pinned; nil when not pinned.",
+ "type": "string"
+ },
"tenant_id": {
"description": "Tenant ID",
"type": "integer"
@@ -12836,6 +14553,10 @@ const docTemplate = `{
},
"updated_at": {
"type": "string"
+ },
+ "user_id": {
+ "description": "UserID is the owner of the session. Empty for legacy rows (visible at\ntenant level) and for IM-created sessions that do not map to a WeKnora user.",
+ "type": "string"
}
}
},
@@ -12887,9 +14608,12 @@ const docTemplate = `{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
},
"default_provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\"",
"type": "string"
},
+ "ks3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig"
+ },
"local": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
},
@@ -12911,7 +14635,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\"",
"type": "string"
}
}
@@ -13435,6 +15159,100 @@ const docTemplate = `{
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "description": "Timestamps",
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier (UUID, auto-generated)",
+ "type": "string"
+ },
+ "is_default": {
+ "description": "Whether this is the default provider for the tenant",
+ "type": "boolean"
+ },
+ "name": {
+ "description": "User-friendly name, e.g., \"Production Bing Search\"",
+ "type": "string"
+ },
+ "parameters": {
+ "description": "Provider-specific parameters (API key, engine ID, etc.) stored as encrypted JSON",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
+ }
+ ]
+ },
+ "provider": {
+ "description": "Provider type: bing, google, duckduckgo, tavily",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderType"
+ }
+ ]
+ },
+ "tenant_id": {
+ "description": "Tenant ID for scoping",
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "description": "API key for the search provider (encrypted in DB)",
+ "type": "string"
+ },
+ "engine_id": {
+ "description": "Google Custom Search Engine ID (only for Google provider)",
+ "type": "string"
+ },
+ "extra_config": {
+ "description": "Provider-specific extra configuration for future extensibility",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "proxy_url": {
+ "description": "Optional HTTP/HTTPS proxy URL for outbound search requests (e.g. http://host:port); validated with utils.ValidateURLForSSRF.\nDoes not replace the search API endpoint; only tunnels traffic to the official APIs.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderType": {
+ "type": "string",
+ "enum": [
+ "bing",
+ "google",
+ "duckduckgo",
+ "tavily",
+ "ollama",
+ "baidu"
+ ],
+ "x-enum-varnames": [
+ "WebSearchProviderTypeBing",
+ "WebSearchProviderTypeGoogle",
+ "WebSearchProviderTypeDuckDuckGo",
+ "WebSearchProviderTypeTavily",
+ "WebSearchProviderTypeOllama",
+ "WebSearchProviderTypeBaidu"
+ ]
+ },
"github_com_Tencent_WeKnora_internal_types.WikiConfig": {
"type": "object",
"properties": {
@@ -13446,6 +15264,18 @@ const docTemplate = `{
}
]
},
+ "ingest_batch_size": {
+ "description": "IngestBatchSize controls how many pending ops a single batch\nprocesses before scheduling a follow-up. 0 falls back to the\nhard-coded default (5). Operators on large KBs (4w+ docs) can\nraise this to 10–20 to amortize the lock-acquire / index-rebuild\noverhead across more documents per round.",
+ "type": "integer"
+ },
+ "ingest_map_parallel": {
+ "description": "IngestMapParallel sets the errgroup limit for the Map phase\n(per-document extraction + summary + chunk citation). 0 falls\nback to 10. Bound by the LLM provider's concurrency limit and\nthe worker's outbound HTTP pool.",
+ "type": "integer"
+ },
+ "ingest_reduce_parallel": {
+ "description": "IngestReduceParallel sets the errgroup limit for the Reduce phase\n(per-slug page write). 0 falls back to 10. Bound by the same\nLLM concurrency / HTTP pool considerations as the Map phase,\nplus DB connection pool size.",
+ "type": "integer"
+ },
"max_pages_per_ingest": {
"description": "MaxPagesPerIngest limits pages created/updated per ingest operation (0 = no limit)",
"type": "integer"
@@ -13478,6 +15308,9 @@ const docTemplate = `{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge"
}
},
+ "meta": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphMeta"
+ },
"nodes": {
"type": "array",
"items": {
@@ -13499,6 +15332,34 @@ const docTemplate = `{
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphMeta": {
+ "type": "object",
+ "properties": {
+ "center": {
+ "description": "populated in ego mode",
+ "type": "string"
+ },
+ "depth": {
+ "description": "populated in ego mode",
+ "type": "integer"
+ },
+ "mode": {
+ "type": "string"
+ },
+ "returned": {
+ "description": "number of nodes actually returned",
+ "type": "integer"
+ },
+ "total": {
+ "description": "total node count in the KB before filtering/limit",
+ "type": "integer"
+ },
+ "truncated": {
+ "description": "true when Returned \u003c Total (after filters)",
+ "type": "boolean"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.WikiGraphNode": {
"type": "object",
"properties": {
@@ -13517,6 +15378,126 @@ const docTemplate = `{
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.WikiIndexEntry": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiIndexGroup": {
+ "type": "object",
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiIndexEntry"
+ }
+ },
+ "next_cursor": {
+ "type": "string"
+ },
+ "total": {
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiIndexResponse": {
+ "type": "object",
+ "properties": {
+ "groups": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiIndexGroup"
+ }
+ },
+ "intro": {
+ "type": "string"
+ },
+ "version": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiLogEntry": {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Short operation tag: \"ingest\", \"retract\", etc. Matches the ` + "`" + `action` + "`" + `\nargument historically passed to appendLogEntry.",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "Server-side timestamp (UTC).",
+ "type": "string"
+ },
+ "doc_title": {
+ "description": "Document title at the time of the event. Stored verbatim rather than\njoined at read time so deleted knowledge still has a human-readable\nlabel in the log.",
+ "type": "string"
+ },
+ "id": {
+ "description": "Auto-increment identifier. Monotonic within a single database, so\nfrontend pagination uses it as a stable cursor without needing to\ndisambiguate identical created_at values.",
+ "type": "integer"
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base this event belongs to.",
+ "type": "string"
+ },
+ "knowledge_id": {
+ "description": "Knowledge ID the event was about (may be empty for KB-level events).",
+ "type": "string"
+ },
+ "pages_affected": {
+ "description": "Wiki pages affected by this event. Each ref carries both slug (for\nnavigation) and title (for display) so the log renders human-\nreadable text without a post-hoc slug→title lookup that might fail\nfor now-deleted pages.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiLogPageRef"
+ }
+ },
+ "summary": {
+ "description": "One-line summary of the change, as it was when the event was logged.",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant scope, mirrored from the enclosing knowledge base.",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiLogEntryListResponse": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiLogEntry"
+ }
+ },
+ "next_cursor": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiLogPageRef": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.WikiPage": {
"type": "object",
"properties": {
@@ -13740,6 +15721,24 @@ const docTemplate = `{
}
}
},
+ "internal_handler.BatchDeleteKnowledgeRequest": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.CopyKnowledgeBaseRequest": {
"type": "object",
"required": [
@@ -13878,6 +15877,12 @@ const docTemplate = `{
"internal_handler.GetStorageEngineStatusResponse": {
"type": "object",
"properties": {
+ "allowed_providers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"engines": {
"type": "array",
"items": {
@@ -13916,11 +15921,234 @@ const docTemplate = `{
"minio_enabled": {
"type": "boolean"
},
- "vector_store_engine": {
- "type": "string"
+ "vector_store_engine": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.InitializationRequest": {
+ "type": "object",
+ "required": [
+ "documentSplitting",
+ "embedding",
+ "llm"
+ ],
+ "properties": {
+ "documentSplitting": {
+ "type": "object",
+ "required": [
+ "chunkSize",
+ "separators"
+ ],
+ "properties": {
+ "chunkOverlap": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "chunkSize": {
+ "type": "integer",
+ "maximum": 10000,
+ "minimum": 100
+ },
+ "separators": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "embedding": {
+ "type": "object",
+ "required": [
+ "modelName",
+ "source"
+ ],
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "dimension": {
+ "description": "添加embedding维度字段",
+ "type": "integer"
+ },
+ "modelName": {
+ "type": "string"
+ },
+ "source": {
+ "type": "string"
+ }
+ }
+ },
+ "llm": {
+ "type": "object",
+ "required": [
+ "modelName",
+ "source"
+ ],
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "modelName": {
+ "type": "string"
+ },
+ "source": {
+ "type": "string"
+ }
+ }
+ },
+ "multimodal": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "type": "object",
+ "properties": {
+ "appId": {
+ "type": "string"
+ },
+ "bucketName": {
+ "type": "string"
+ },
+ "pathPrefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secretId": {
+ "type": "string"
+ },
+ "secretKey": {
+ "type": "string"
+ }
+ }
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "minio": {
+ "type": "object",
+ "properties": {
+ "bucketName": {
+ "type": "string"
+ },
+ "pathPrefix": {
+ "type": "string"
+ }
+ }
+ },
+ "storageType": {
+ "type": "string"
+ },
+ "vlm": {
+ "type": "object",
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "interfaceType": {
+ "description": "\"ollama\" or \"openai\"",
+ "type": "string"
+ },
+ "modelName": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "nodeExtract": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "attributes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "node1": {
+ "type": "string"
+ },
+ "node2": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "questionGeneration": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "questionCount": {
+ "type": "integer"
+ }
+ }
},
- "version": {
- "type": "string"
+ "rerank": {
+ "type": "object",
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "modelName": {
+ "type": "string"
+ }
+ }
}
}
},
@@ -13949,6 +16177,12 @@ const docTemplate = `{
"enableParentChild": {
"type": "boolean"
},
+ "languages": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"parentChunkSize": {
"type": "integer"
},
@@ -13963,6 +16197,13 @@ const docTemplate = `{
"items": {
"type": "string"
}
+ },
+ "strategy": {
+ "description": "Strategy / TokenLimit / Languages use pointer types so the\nhandler can distinguish \"field absent in payload\" (no change)\nfrom \"field present with empty/zero value\" (clear / disable).\nWithout that distinction, users could set strategy=\"auto\" once\nbut never reset it back to legacy / unset.",
+ "type": "string"
+ },
+ "tokenLimit": {
+ "type": "integer"
}
}
},
@@ -14033,6 +16274,221 @@ const docTemplate = `{
}
}
},
+ "internal_handler.ModelTestRequest": {
+ "type": "object",
+ "required": [
+ "modelName"
+ ],
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "customHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "dimension": {
+ "type": "integer"
+ },
+ "extraConfig": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "interfaceType": {
+ "type": "string"
+ },
+ "modelName": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "source": {
+ "description": "为空时按需默认为 \"remote\"",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.MoveKnowledgeRequest": {
+ "type": "object",
+ "required": [
+ "knowledge_ids",
+ "mode",
+ "source_kb_id",
+ "target_kb_id"
+ ],
+ "properties": {
+ "knowledge_ids": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ },
+ "mode": {
+ "type": "string",
+ "enum": [
+ "reuse_vectors",
+ "reparse"
+ ]
+ },
+ "source_kb_id": {
+ "type": "string"
+ },
+ "target_kb_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.MoveKnowledgeResponse": {
+ "type": "object",
+ "properties": {
+ "knowledge_count": {
+ "type": "integer"
+ },
+ "message": {
+ "type": "string"
+ },
+ "source_kb_id": {
+ "type": "string"
+ },
+ "target_kb_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.PreviewChunkResult": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "context_header": {
+ "type": "string"
+ },
+ "end": {
+ "type": "integer"
+ },
+ "seq": {
+ "type": "integer"
+ },
+ "size_chars": {
+ "type": "integer"
+ },
+ "size_tokens_approx": {
+ "type": "integer"
+ },
+ "start": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.PreviewChunkingPayload": {
+ "type": "object",
+ "properties": {
+ "chunk_overlap": {
+ "type": "integer"
+ },
+ "chunk_size": {
+ "type": "integer"
+ },
+ "languages": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "separators": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "strategy": {
+ "type": "string"
+ },
+ "token_limit": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.PreviewChunkingRequest": {
+ "type": "object",
+ "properties": {
+ "chunking_config": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkingPayload"
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.PreviewChunkingResponse": {
+ "type": "object",
+ "properties": {
+ "chunks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkResult"
+ }
+ },
+ "profile": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile"
+ },
+ "rejected": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.TierRejection"
+ }
+ },
+ "selected_tier": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
+ },
+ "stats": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkingStats"
+ },
+ "tier_chain": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
+ }
+ }
+ }
+ },
+ "internal_handler.PreviewChunkingStats": {
+ "type": "object",
+ "properties": {
+ "avg_chars": {
+ "type": "integer"
+ },
+ "count": {
+ "type": "integer"
+ },
+ "max_chars": {
+ "type": "integer"
+ },
+ "min_chars": {
+ "type": "integer"
+ },
+ "stddev_chars": {
+ "type": "integer"
+ },
+ "truncated_to": {
+ "description": "TruncatedTo, when set, is the original chunk count before the\nresponse was truncated to previewMaxChunks for transport.",
+ "type": "integer"
+ }
+ }
+ },
"internal_handler.RemoteModelCheckRequest": {
"type": "object",
"required": [
@@ -14108,6 +16564,9 @@ const docTemplate = `{
"cos": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
},
+ "ks3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig"
+ },
"minio": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
},
@@ -14115,7 +16574,7 @@ const docTemplate = `{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
},
"provider": {
- "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\"",
"type": "string"
},
"s3": {
@@ -14143,6 +16602,9 @@ const docTemplate = `{
"internal_handler.StorageEngineStatusItem": {
"type": "object",
"properties": {
+ "allowed": {
+ "type": "boolean"
+ },
"available": {
"description": "whether the engine can be used",
"type": "boolean"
@@ -14152,7 +16614,21 @@ const docTemplate = `{
"type": "string"
},
"name": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\"",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.TestProviderRequest": {
+ "type": "object",
+ "required": [
+ "provider"
+ ],
+ "properties": {
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
+ },
+ "provider": {
"type": "string"
}
}
@@ -14277,6 +16753,23 @@ const docTemplate = `{
}
}
},
+ "internal_handler.UpdateProviderRequest": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "is_default": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
+ }
+ }
+ },
"internal_handler.UpdateStoreRequest": {
"type": "object",
"required": [
diff --git a/docs/swagger.json b/docs/swagger.json
index 198bd8b70..960ddc716 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -12,6 +12,69 @@
},
"basePath": "/api/v1",
"paths": {
+ "/agent/tool-approvals/{pending_id}": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "用户审批通过或驳回一次工具调用(用于 Agent 阻塞等待审批的场景)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "MCP服务"
+ ],
+ "summary": "处理 MCP 工具调用待审批请求",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "待审批记录 ID",
+ "name": "pending_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "{decision: \\",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "审批结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "待审批记录不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/agents": {
"get": {
"security": [
@@ -384,6 +447,57 @@
}
}
},
+ "/agents/{id}/shares/{share_id}": {
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "从智能体的共享列表中移除指定共享关系",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织"
+ ],
+ "summary": "取消智能体共享",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "智能体 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "共享记录 ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success: true",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/agents/{id}/suggested-questions": {
"get": {
"security": [
@@ -1045,7 +1159,7 @@
"Bearer": []
}
],
- "description": "Returns the wiki link graph data for visualization",
+ "description": "Returns a slice of the wiki link graph for visualization. Supports\n`mode=overview` (top-N most-connected pages, default) and\n`mode=ego` (BFS neighborhood of a center slug) to keep response\nsize tractable for knowledge bases with tens of thousands of pages.",
"produces": [
"application/json"
],
@@ -1060,6 +1174,36 @@
"name": "kb_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "overview (default) | ego",
+ "name": "mode",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Center slug for ego mode",
+ "name": "center",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Ego BFS depth (1-3, default 1)",
+ "name": "depth",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Comma-separated page_type allow-list",
+ "name": "types",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Max nodes to return (default 500, max 2000)",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
@@ -1079,14 +1223,14 @@
"Bearer": []
}
],
- "description": "Returns the wiki index page (creates default if not exists)",
+ "description": "Returns the wiki index as intro text plus per-type paginated\ndirectory groups. The heavy directory markdown that used to\nlive in wiki_pages.content was replaced with this structured\nresponse so a KB with tens of thousands of pages no longer\nmaterializes megabytes of TEXT on every index open.",
"produces": [
"application/json"
],
"tags": [
"Wiki"
],
- "summary": "Get wiki index page",
+ "summary": "Get wiki index view",
"parameters": [
{
"type": "string",
@@ -1094,13 +1238,31 @@
"name": "kb_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "Comma-separated page types (default: all content types)",
+ "name": "types",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Per-group window size, 1-200 (default 50)",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Opaque offset cursor from previous response",
+ "name": "cursor",
+ "in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiIndexResponse"
}
}
}
@@ -1258,7 +1420,7 @@
"Bearer": []
}
],
- "description": "Returns the wiki operation log page (creates default if not exists)",
+ "description": "Returns a paginated feed of wiki operation events (ingest, retract, ...)\nnewest-first. Pagination is cursor-based: pass `next_cursor` from the\nprevious response back as `cursor` to fetch the next page.",
"produces": [
"application/json"
],
@@ -1273,13 +1435,25 @@
"name": "kb_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "Opaque cursor from the previous page (empty = newest)",
+ "name": "cursor",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Page size, 1-200 (default 50)",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiLogEntryListResponse"
}
}
}
@@ -2105,6 +2279,69 @@
}
}
},
+ "/chunker/preview": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "对提交的文本运行自适应分块器并返回分块预览,不写入数据库不生成 embedding。文本最大 64k 字符",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块"
+ ],
+ "summary": "预览分块结果",
+ "parameters": [
+ {
+ "description": "{text, chunking_config}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkingRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "分块结果",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkingResponse"
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "413": {
+ "description": "文本超过预览限制",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "504": {
+ "description": "分块超时",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
"/chunks/by-id/{id}": {
"get": {
"security": [
@@ -2599,8 +2836,8 @@
}
}
},
- "/initialization/extract/relations": {
- "post": {
+ "/im-channels/{id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -2609,7 +2846,7 @@
"ApiKeyAuth": []
}
],
- "description": "从文本中提取实体和关系",
+ "description": "更新指定 IM 渠道的名称、模式、知识库、凭证或启用状态",
"consumes": [
"application/json"
],
@@ -2617,23 +2854,31 @@
"application/json"
],
"tags": [
- "初始化"
+ "IM 渠道"
],
- "summary": "提取文本关系",
+ "summary": "更新 IM 渠道",
"parameters": [
{
- "description": "提取请求",
+ "type": "string",
+ "description": "渠道 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新字段(name/mode/output_mode/knowledge_base_id/credentials/enabled)",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
+ "type": "object",
+ "additionalProperties": true
}
}
],
"responses": {
"200": {
- "description": "提取结果",
+ "description": "更新后的渠道",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2642,38 +2887,20 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "type": "object",
+ "additionalProperties": true
}
- }
- }
- }
- },
- "/initialization/fabri/tag": {
- "get": {
- "description": "随机生成一组标签",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "初始化"
- ],
- "summary": "生成随机标签",
- "responses": {
- "200": {
- "description": "生成的标签",
+ },
+ "404": {
+ "description": "渠道不存在",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
- }
- },
- "/initialization/fabri/text": {
- "post": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2682,31 +2909,26 @@
"ApiKeyAuth": []
}
],
- "description": "根据标签生成示例文本",
- "consumes": [
- "application/json"
- ],
+ "description": "删除指定 IM 渠道",
"produces": [
"application/json"
],
"tags": [
- "初始化"
+ "IM 渠道"
],
- "summary": "生成示例文本",
+ "summary": "删除 IM 渠道",
"parameters": [
{
- "description": "生成请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler.FabriTextRequest"
- }
+ "type": "string",
+ "description": "渠道 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "生成的文本",
+ "description": "success: true",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2715,13 +2937,21 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "渠道不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/initialization/kb/{kbId}": {
+ "/im-channels/{id}/toggle": {
"post": {
"security": [
{
@@ -2731,7 +2961,51 @@
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID执行完整配置更新",
+ "description": "切换指定 IM 渠道的启用状态",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IM 渠道"
+ ],
+ "summary": "启用/停用 IM 渠道",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "渠道 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的渠道",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "渠道不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/im/callback/{channel_id}": {
+ "get": {
+ "description": "接收各 IM 平台的事件回调;走平台自身签名校验,不使用 API Key",
"consumes": [
"application/json"
],
@@ -2739,30 +3013,123 @@
"application/json"
],
"tags": [
- "初始化"
+ "IM 回调"
],
- "summary": "初始化知识库配置",
+ "summary": "IM 平台回调",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "kbId",
+ "description": "渠道 ID",
+ "name": "channel_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "处理结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "签名校验失败",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "post": {
+ "description": "接收各 IM 平台的事件回调;走平台自身签名校验,不使用 API Key",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IM 回调"
+ ],
+ "summary": "IM 平台回调",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "渠道 ID",
+ "name": "channel_id",
"in": "path",
"required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "处理结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "签名校验失败",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/asr/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
},
{
- "description": "初始化请求",
+ "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"
+ "$ref": "#/definitions/internal_handler.ModelTestRequest"
}
}
],
"responses": {
"200": {
- "description": "初始化成功",
+ "description": "检查结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2777,7 +3144,7 @@
}
}
},
- "/initialization/kb/{kbId}/config": {
+ "/initialization/config/{kbId}": {
"get": {
"security": [
{
@@ -2884,7 +3251,7 @@
}
}
},
- "/initialization/models/asr/check": {
+ "/initialization/embedding/test": {
"post": {
"security": [
{
@@ -2894,7 +3261,7 @@
"ApiKeyAuth": []
}
],
- "description": "检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点",
+ "description": "测试Embedding接口是否可用并返回向量维度",
"consumes": [
"application/json"
],
@@ -2904,21 +3271,21 @@
"tags": [
"初始化"
],
- "summary": "检查ASR模型",
+ "summary": "测试Embedding模型",
"parameters": [
{
- "description": "ASR检查请求",
+ "description": "Embedding测试请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.ModelTestRequest"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2933,7 +3300,31 @@
}
}
},
- "/initialization/models/embedding/test": {
+ "/initialization/extract/fabri-tag": {
+ "post": {
+ "description": "随机生成一组标签",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "生成随机标签",
+ "responses": {
+ "200": {
+ "description": "生成的标签",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/extract/fabri-text": {
"post": {
"security": [
{
@@ -2943,7 +3334,7 @@
"ApiKeyAuth": []
}
],
- "description": "测试Embedding接口是否可用并返回向量维度",
+ "description": "根据标签生成示例文本",
"consumes": [
"application/json"
],
@@ -2953,21 +3344,21 @@
"tags": [
"初始化"
],
- "summary": "测试Embedding模型",
+ "summary": "生成示例文本",
"parameters": [
{
- "description": "Embedding测试请求",
+ "description": "生成请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.FabriTextRequest"
}
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "生成的文本",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2982,7 +3373,7 @@
}
}
},
- "/initialization/models/remote/check": {
+ "/initialization/extract/text-relation": {
"post": {
"security": [
{
@@ -2992,7 +3383,7 @@
"ApiKeyAuth": []
}
],
- "description": "检查远程API模型连接是否正常",
+ "description": "从文本中提取实体和关系",
"consumes": [
"application/json"
],
@@ -3002,21 +3393,21 @@
"tags": [
"初始化"
],
- "summary": "检查远程模型",
+ "summary": "提取文本关系",
"parameters": [
{
- "description": "模型检查请求",
+ "description": "提取请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "提取结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3031,7 +3422,7 @@
}
}
},
- "/initialization/models/rerank/check": {
+ "/initialization/initialize/{kbId}": {
"post": {
"security": [
{
@@ -3041,7 +3432,7 @@
"ApiKeyAuth": []
}
],
- "description": "检查Rerank模型连接和功能是否正常",
+ "description": "根据知识库ID执行完整配置更新",
"consumes": [
"application/json"
],
@@ -3051,21 +3442,28 @@
"tags": [
"初始化"
],
- "summary": "检查Rerank模型",
+ "summary": "初始化知识库配置",
"parameters": [
{
- "description": "Rerank检查请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "初始化请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.InitializationRequest"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "初始化成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3160,7 +3558,7 @@
}
}
},
- "/initialization/ollama/download/tasks": {
+ "/initialization/ollama/download/progress/{taskId}": {
"get": {
"security": [
{
@@ -3170,7 +3568,7 @@
"ApiKeyAuth": []
}
],
- "description": "列出所有Ollama模型下载任务",
+ "description": "获取Ollama模型下载任务的进度",
"consumes": [
"application/json"
],
@@ -3180,19 +3578,34 @@
"tags": [
"初始化"
],
- "summary": "列出下载任务",
+ "summary": "获取下载进度",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "任务ID",
+ "name": "taskId",
+ "in": "path",
+ "required": true
+ }
+ ],
"responses": {
"200": {
- "description": "任务列表",
+ "description": "下载进度",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/initialization/ollama/download/{taskId}": {
+ "/initialization/ollama/download/tasks": {
"get": {
"security": [
{
@@ -3202,7 +3615,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取Ollama模型下载任务的进度",
+ "description": "列出所有Ollama模型下载任务",
"consumes": [
"application/json"
],
@@ -3212,29 +3625,14 @@
"tags": [
"初始化"
],
- "summary": "获取下载进度",
- "parameters": [
- {
- "type": "string",
- "description": "任务ID",
- "name": "taskId",
- "in": "path",
- "required": true
- }
- ],
+ "summary": "列出下载任务",
"responses": {
"200": {
- "description": "下载进度",
+ "description": "任务列表",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "404": {
- "description": "任务不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
@@ -3412,8 +3810,8 @@
}
}
},
- "/knowledge-bases": {
- "get": {
+ "/initialization/remote/check": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3422,7 +3820,105 @@
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
+ "description": "检查远程API模型连接是否正常",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查远程模型",
+ "parameters": [
+ {
+ "description": "模型检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/rerank/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查Rerank模型连接和功能是否正常",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Rerank模型",
+ "parameters": [
+ {
+ "description": "Rerank检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.ModelTestRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
"consumes": [
"application/json"
],
@@ -4882,6 +5378,56 @@
}
}
},
+ "/knowledge-bases/{id}/move-targets": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回与源知识库 Type 一致、EmbeddingModelID 一致、非临时且不是自身的目标知识库列表",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "获取可移动目标知识库列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "源知识库 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "可移动目标列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/knowledge-bases/{id}/pin": {
"put": {
"security": [
@@ -5445,6 +5991,61 @@
}
}
},
+ "/knowledge/batch-delete": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "按 ID 列表批量删除单个知识库下的多个知识条目",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识管理"
+ ],
+ "summary": "批量删除知识",
+ "parameters": [
+ {
+ "description": "批量删除请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.BatchDeleteKnowledgeRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "权限不足",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/knowledge/image/{id}/{chunk_id}": {
"put": {
"security": [
@@ -5569,8 +6170,8 @@
}
}
},
- "/knowledge/search": {
- "get": {
+ "/knowledge/move": {
+ "post": {
"security": [
{
"Bearer": []
@@ -5579,7 +6180,7 @@
"ApiKeyAuth": []
}
],
- "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
+ "description": "将一条或多条知识从源知识库移动到目标知识库(异步),返回任务 ID 用于查询进度",
"consumes": [
"application/json"
],
@@ -5587,51 +6188,29 @@
"application/json"
],
"tags": [
- "Knowledge"
+ "知识"
],
- "summary": "Search knowledge",
+ "summary": "移动知识到其他知识库",
"parameters": [
{
- "type": "string",
- "description": "Keyword to search",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Offset for pagination",
- "name": "offset",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Limit for pagination (default 20)",
- "name": "limit",
- "in": "query"
- },
- {
- "type": "string",
- "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
- "name": "file_types",
- "in": "query"
- },
- {
- "type": "string",
- "description": "Shared agent ID (search within agent's KB scope)",
- "name": "agent_id",
- "in": "query"
+ "description": "{source_kb_id, target_kb_id, knowledge_ids}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.MoveKnowledgeRequest"
+ }
}
],
"responses": {
"200": {
- "description": "Search results",
+ "description": "任务信息",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MoveKnowledgeResponse"
}
},
"400": {
- "description": "Invalid request",
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -5639,8 +6218,8 @@
}
}
},
- "/knowledge/tags": {
- "put": {
+ "/knowledge/move/progress/{task_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5649,29 +6228,142 @@
"ApiKeyAuth": []
}
],
- "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
- "consumes": [
- "application/json"
- ],
+ "description": "按任务 ID 查询移动进度",
"produces": [
"application/json"
],
"tags": [
- "知识管理"
+ "知识"
],
- "summary": "批量更新知识标签",
+ "summary": "获取知识移动进度",
"parameters": [
{
- "description": "标签更新请求(updates 必填,kb_id 可选)",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
- }
- ],
- "responses": {
+ "type": "string",
+ "description": "移动任务 ID",
+ "name": "task_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "进度信息",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress"
+ }
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge/search": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Knowledge"
+ ],
+ "summary": "Search knowledge",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Keyword to search",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Offset for pagination",
+ "name": "offset",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Limit for pagination (default 20)",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
+ "name": "file_types",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Shared agent ID (search within agent's KB scope)",
+ "name": "agent_id",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Search results",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge/tags": {
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识管理"
+ ],
+ "summary": "批量更新知识标签",
+ "parameters": [
+ {
+ "description": "标签更新请求(updates 必填,kb_id 可选)",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
"200": {
"description": "更新成功",
"schema": {
@@ -6313,6 +7005,76 @@
}
}
},
+ "/mcp-services/{id}/tool-approvals/{tool_name}": {
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "为指定 MCP 服务下的某个工具设置/更新审批要求",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "MCP服务"
+ ],
+ "summary": "设置 MCP 工具人工审批策略",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "MCP 服务 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "工具名",
+ "name": "tool_name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "{require_approval: bool}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "MCP 服务或工具不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/mcp-services/{id}/tools": {
"get": {
"security": [
@@ -6680,6 +7442,42 @@
}
}
},
+ "/models/weknoracloud/status": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查当前租户的 WeKnoraCloud 凭证是否完好;needs_reinit=true 表示需要重新保存",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "WeKnoraCloud"
+ ],
+ "summary": "检查 WeKnoraCloud 凭证状态",
+ "responses": {
+ "200": {
+ "description": "凭证状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
"/models/{id}": {
"get": {
"security": [
@@ -7243,6 +8041,50 @@
}
}
},
+ "/organizations/{id}/agent-shares": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回所有被共享到指定组织的智能体(含我的有效权限)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织"
+ ],
+ "summary": "获取共享到本组织的智能体",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织 ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "智能体共享列表 + total",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "403": {
+ "description": "非组织成员",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/organizations/{id}/invite": {
"post": {
"security": [
@@ -7841,7 +8683,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的会话列表,支持分页",
+ "description": "获取当前租户的会话列表,支持分页、关键字搜索、按来源/Agent 筛选",
"consumes": [
"application/json"
],
@@ -7864,9 +8706,27 @@
"description": "每页数量",
"name": "page_size",
"in": "query"
- }
- ],
- "responses": {
+ },
+ {
+ "type": "string",
+ "description": "标题模糊搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "来源过滤:web / feishu / wechat / slack / ...",
+ "name": "source",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "按 Agent 过滤(仅对 IM 会话生效)",
+ "name": "agent_id",
+ "in": "query"
+ }
+ ],
+ "responses": {
"200": {
"description": "会话列表",
"schema": {
@@ -7979,6 +8839,60 @@
}
}
},
+ "/sessions/continue-stream/{session_id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "继续获取正在进行的流式响应",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "text/event-stream"
+ ],
+ "tags": [
+ "问答"
+ ],
+ "summary": "继续流式响应",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "消息ID",
+ "name": "message_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "流式响应",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "会话或消息不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/sessions/search": {
"post": {
"security": [
@@ -8227,6 +9141,50 @@
}
}
},
+ "/sessions/{id}/pin": {
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "取消指定会话的置顶",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "会话"
+ ],
+ "summary": "取消置顶会话",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "取消置顶成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "会话不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/sessions/{session_id}/agent-qa": {
"post": {
"security": [
@@ -8283,8 +9241,8 @@
}
}
},
- "/sessions/{session_id}/continue": {
- "get": {
+ "/sessions/{session_id}/knowledge-qa": {
+ "post": {
"security": [
{
"Bearer": []
@@ -8293,7 +9251,7 @@
"ApiKeyAuth": []
}
],
- "description": "继续获取正在进行的流式响应",
+ "description": "基于知识库的问答(使用LLM总结),支持SSE流式响应",
"consumes": [
"application/json"
],
@@ -8303,7 +9261,7 @@
"tags": [
"问答"
],
- "summary": "继续流式响应",
+ "summary": "知识问答",
"parameters": [
{
"type": "string",
@@ -8313,23 +9271,25 @@
"required": true
},
{
- "type": "string",
- "description": "消息ID",
- "name": "message_id",
- "in": "query",
- "required": true
+ "description": "问答请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
+ }
}
],
"responses": {
"200": {
- "description": "流式响应",
+ "description": "问答结果(SSE流)",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "会话或消息不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -8337,7 +9297,7 @@
}
}
},
- "/sessions/{session_id}/knowledge-qa": {
+ "/sessions/{session_id}/pin": {
"post": {
"security": [
{
@@ -8347,17 +9307,14 @@
"ApiKeyAuth": []
}
],
- "description": "基于知识库的问答(使用LLM总结),支持SSE流式响应",
- "consumes": [
- "application/json"
- ],
+ "description": "将指定会话置顶(用户维度)",
"produces": [
- "text/event-stream"
+ "application/json"
],
"tags": [
- "问答"
+ "会话"
],
- "summary": "知识问答",
+ "summary": "置顶会话",
"parameters": [
{
"type": "string",
@@ -8365,27 +9322,18 @@
"name": "session_id",
"in": "path",
"required": true
- },
- {
- "description": "问答请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
- }
}
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "置顶成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "会话不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -8505,6 +9453,41 @@
}
}
},
+ "/shared-agents": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回所有共享给当前用户所在组织的智能体",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织"
+ ],
+ "summary": "获取我可访问的共享智能体",
+ "responses": {
+ "200": {
+ "description": "智能体列表 + total",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/shared-knowledge-bases": {
"get": {
"security": [
@@ -9305,6 +10288,56 @@
}
}
},
+ "/tenants/{id}/api-key": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "为指定租户生成一个新的 API Key,旧 Key 立即失效",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "重置租户 API Key",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "租户ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "新生成的 API Key",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "权限不足",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/vector-stores": {
"get": {
"security": [
@@ -9707,27 +10740,473 @@
}
}
}
- }
- },
- "definitions": {
- "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue": {
- "type": "object",
- "properties": {
- "auto_fixable": {
- "type": "boolean"
- },
- "description": {
- "type": "string"
- },
- "page_slug": {
- "type": "string"
- },
- "severity": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity"
- },
- "target_slug": {
- "description": "TargetSlug identifies the other page involved in the issue (e.g. the\nbroken link target, or the entity slug for a missing cross-ref). It is\nthe structured field used by AutoFix instead of parsing Description.",
- "type": "string"
+ },
+ "/web-search-providers/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "使用前端表单中尚未保存的凭证测试连通性,用于\"测试连接\"按钮",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "使用原始凭证测试 Provider(不落库)",
+ "parameters": [
+ {
+ "description": "{provider, parameters}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.TestProviderRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "测试结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/web-search-providers/types": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回 UI 表单需要的 provider 类型及参数定义",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "获取网络搜索 Provider 类型元数据",
+ "responses": {
+ "200": {
+ "description": "provider 类型列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/web-search-providers/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据 ID 获取指定 provider 配置",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "获取网络搜索 Provider 详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Provider ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Provider 详情",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity"
+ }
+ },
+ "404": {
+ "description": "Provider 不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新指定 provider 的名称/描述/参数/是否默认",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "更新网络搜索 Provider",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Provider ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新字段",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.UpdateProviderRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的 Provider",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity"
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Provider 不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定 provider 配置",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "删除网络搜索 Provider",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Provider ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success: true",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Provider 不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/web-search-providers/{id}/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "使用数据库中已保存的凭证测试连通性",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "测试已保存的 Provider",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Provider ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "测试结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Provider 不存在",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/web-search/providers": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回所有已注册的网络搜索 provider(含元数据)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "网络搜索"
+ ],
+ "summary": "获取可用网络搜索 Provider 列表",
+ "responses": {
+ "200": {
+ "description": "provider 列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/wechat/qrcode": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "申请一个用于扫码登录绑定的微信二维码(无请求体)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IM 渠道"
+ ],
+ "summary": "获取微信扫码登录二维码",
+ "responses": {
+ "200": {
+ "description": "二维码信息(qrcode_url + qrcode 标识)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "二维码生成失败",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/wechat/qrcode/status": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "查询指定二维码是否已被扫描/确认/过期;confirmed 时返回凭证",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IM 渠道"
+ ],
+ "summary": "轮询微信二维码状态",
+ "parameters": [
+ {
+ "description": "{qrcode: string}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "扫码状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/weknoracloud/credentials": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "保存 APPID/APPSECRET 到当前租户配置(不自动创建模型)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "WeKnoraCloud"
+ ],
+ "summary": "保存 WeKnoraCloud 凭证",
+ "parameters": [
+ {
+ "description": "{app_id, app_secret}",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success: true",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue": {
+ "type": "object",
+ "properties": {
+ "auto_fixable": {
+ "type": "boolean"
+ },
+ "description": {
+ "type": "string"
+ },
+ "page_slug": {
+ "type": "string"
+ },
+ "severity": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity"
+ },
+ "target_slug": {
+ "description": "TargetSlug identifies the other page involved in the issue (e.g. the\nbroken link target, or the entity slug for a missing cross-ref). It is\nthe structured field used by AutoFix instead of parsing Description.",
+ "type": "string"
},
"type": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueType"
@@ -9881,6 +11360,102 @@
"ErrAgentInvalidTemperature"
]
},
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile": {
+ "type": "object",
+ "properties": {
+ "all_caps_short_line_count": {
+ "type": "integer"
+ },
+ "avg_line_len": {
+ "type": "number"
+ },
+ "blank_paragraph_breaks": {
+ "type": "integer"
+ },
+ "chinese_chapter_count": {
+ "type": "integer"
+ },
+ "code_ratio": {
+ "type": "number"
+ },
+ "detected_langs": {
+ "description": "Detected language hints (best-effort)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "english_chapter_count": {
+ "type": "integer"
+ },
+ "form_feed_count": {
+ "type": "integer"
+ },
+ "german_chapter_count": {
+ "type": "integer"
+ },
+ "has_code": {
+ "type": "boolean"
+ },
+ "has_tables": {
+ "description": "Content characteristics",
+ "type": "boolean"
+ },
+ "md_heading_counts": {
+ "description": "Markdown structure",
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ },
+ "md_heading_total": {
+ "type": "integer"
+ },
+ "numbered_section_count": {
+ "description": "Heuristic indicators",
+ "type": "integer"
+ },
+ "repeated_footer_count": {
+ "type": "integer"
+ },
+ "std_line_len": {
+ "type": "number"
+ },
+ "total_chars": {
+ "type": "integer"
+ },
+ "total_lines": {
+ "type": "integer"
+ },
+ "visual_sep_count": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier": {
+ "type": "string",
+ "enum": [
+ "heading",
+ "heuristic",
+ "legacy"
+ ],
+ "x-enum-varnames": [
+ "TierHeading",
+ "TierHeuristic",
+ "TierLegacy"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.TierRejection": {
+ "type": "object",
+ "properties": {
+ "reason": {
+ "type": "string"
+ },
+ "tier": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.ASRConfig": {
"type": "object",
"properties": {
@@ -10121,6 +11696,13 @@
"description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
"type": "boolean"
},
+ "languages": {
+ "description": "Languages hints the heuristic patterns. Empty = auto-detect from content.\nExamples: [\"de\"], [\"en\", \"zh\"].",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"parent_chunk_size": {
"description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
"type": "integer"
@@ -10138,6 +11720,14 @@
"items": {
"type": "string"
}
+ },
+ "strategy": {
+ "description": "Strategy selects the adaptive chunking tier. Empty / \"legacy\" preserves\nthe historical recursive splitter; \"auto\" lets a profiler pick between\nheading-aware, heuristic and recursive tiers; \"heading\" / \"heuristic\" /\n\"recursive\" pin the tier explicitly.",
+ "type": "string"
+ },
+ "token_limit": {
+ "description": "TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize\nas a character count.",
+ "type": "integer"
}
}
},
@@ -10152,6 +11742,10 @@
"description": "AES-GCM encrypted",
"type": "string"
},
+ "database": {
+ "description": "Tencent VectorDB and Doris database name.",
+ "type": "string"
+ },
"grpc_address": {
"description": "Weaviate",
"type": "string"
@@ -10160,6 +11754,10 @@
"description": "Qdrant",
"type": "string"
},
+ "http_port": {
+ "description": "Doris: HTTP port for Stream Load API (FE default 8030).\nAddr is reused for the MySQL protocol \"host:9030\"; HTTPPort + the host of Addr\ntogether form the FE HTTP endpoint used by Stream Load.",
+ "type": "integer"
+ },
"password": {
"description": "AES-GCM encrypted",
"type": "string"
@@ -10405,7 +12003,7 @@
"type": "integer"
},
"image_storage_provider": {
- "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
+ "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\".\nEmpty means use the global/tenant default provider.",
"type": "string"
},
"image_upload_enabled": {
@@ -10937,6 +12535,10 @@
"github_com_Tencent_WeKnora_internal_types.IndexConfig": {
"type": "object",
"properties": {
+ "buckets_num": {
+ "description": "Doris: number of buckets per table (DISTRIBUTED BY HASH ... BUCKETS N)",
+ "type": "integer"
+ },
"collection_name": {
"description": "Milvus",
"type": "string"
@@ -10969,6 +12571,10 @@
"description": "Qdrant, Weaviate: number of replicas",
"type": "integer"
},
+ "replication_num": {
+ "description": "Doris: replication_num PROPERTIES",
+ "type": "integer"
+ },
"shard_number": {
"description": "--- Scalability fields ---",
"type": "integer"
@@ -11058,6 +12664,44 @@
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "processing",
+ "completed",
+ "failed"
+ ],
+ "x-enum-varnames": [
+ "KBCloneStatusPending",
+ "KBCloneStatusProcessing",
+ "KBCloneStatusCompleted",
+ "KBCloneStatusFailed"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.KS3EngineConfig": {
+ "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"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.Knowledge": {
"type": "object",
"properties": {
@@ -11455,6 +13099,55 @@
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "description": "任务创建时间",
+ "type": "integer"
+ },
+ "error": {
+ "description": "错误信息",
+ "type": "string"
+ },
+ "failed": {
+ "description": "失败数",
+ "type": "integer"
+ },
+ "message": {
+ "description": "状态消息",
+ "type": "string"
+ },
+ "processed": {
+ "description": "已处理数",
+ "type": "integer"
+ },
+ "progress": {
+ "description": "0-100",
+ "type": "integer"
+ },
+ "source_kb_id": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus"
+ },
+ "target_kb_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ },
+ "total": {
+ "description": "总知识数",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "最后更新时间",
+ "type": "integer"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
"type": "object",
"properties": {
@@ -12513,6 +14206,18 @@
"description": "RerankTopK is the maximum number of results after reranking (default: 10)",
"type": "integer"
},
+ "rrf_k": {
+ "description": "RRFK is the smoothing constant of Reciprocal Rank Fusion. Larger values\nflatten the curve, reducing the bias towards top-1 results.\nDefault: 60. Sensible range: 30..100 depending on corpus size.",
+ "type": "integer"
+ },
+ "rrf_keyword_weight": {
+ "description": "RRFKeywordWeight is the keyword counterpart. Default: 0.3.",
+ "type": "number"
+ },
+ "rrf_vector_weight": {
+ "description": "RRFVectorWeight is the weight applied to the vector retriever inside RRF.\nRRFVectorWeight + RRFKeywordWeight should usually sum to 1.0 but the math\nworks for any positive weights. Default: 0.7.",
+ "type": "number"
+ },
"vector_threshold": {
"description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
"type": "number"
@@ -12550,7 +14255,9 @@
"qdrant",
"milvus",
"weaviate",
- "sqlite"
+ "doris",
+ "sqlite",
+ "tencent_vectordb"
],
"x-enum-varnames": [
"PostgresRetrieverEngineType",
@@ -12560,7 +14267,9 @@
"QdrantRetrieverEngineType",
"MilvusRetrieverEngineType",
"WeaviateRetrieverEngineType",
- "SQLiteRetrieverEngineType"
+ "DorisRetrieverEngineType",
+ "SQLiteRetrieverEngineType",
+ "TencentVectorDBRetrieverEngineType"
]
},
"github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
@@ -12819,6 +14528,14 @@
"description": "ID",
"type": "string"
},
+ "is_pinned": {
+ "description": "IsPinned indicates whether the session is pinned in the list.",
+ "type": "boolean"
+ },
+ "pinned_at": {
+ "description": "PinnedAt records when the session was pinned; nil when not pinned.",
+ "type": "string"
+ },
"tenant_id": {
"description": "Tenant ID",
"type": "integer"
@@ -12829,6 +14546,10 @@
},
"updated_at": {
"type": "string"
+ },
+ "user_id": {
+ "description": "UserID is the owner of the session. Empty for legacy rows (visible at\ntenant level) and for IM-created sessions that do not map to a WeKnora user.",
+ "type": "string"
}
}
},
@@ -12880,9 +14601,12 @@
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
},
"default_provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\"",
"type": "string"
},
+ "ks3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig"
+ },
"local": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
},
@@ -12904,7 +14628,7 @@
"type": "object",
"properties": {
"provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\"",
"type": "string"
}
}
@@ -13428,6 +15152,100 @@
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "description": "Timestamps",
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier (UUID, auto-generated)",
+ "type": "string"
+ },
+ "is_default": {
+ "description": "Whether this is the default provider for the tenant",
+ "type": "boolean"
+ },
+ "name": {
+ "description": "User-friendly name, e.g., \"Production Bing Search\"",
+ "type": "string"
+ },
+ "parameters": {
+ "description": "Provider-specific parameters (API key, engine ID, etc.) stored as encrypted JSON",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
+ }
+ ]
+ },
+ "provider": {
+ "description": "Provider type: bing, google, duckduckgo, tavily",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderType"
+ }
+ ]
+ },
+ "tenant_id": {
+ "description": "Tenant ID for scoping",
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "description": "API key for the search provider (encrypted in DB)",
+ "type": "string"
+ },
+ "engine_id": {
+ "description": "Google Custom Search Engine ID (only for Google provider)",
+ "type": "string"
+ },
+ "extra_config": {
+ "description": "Provider-specific extra configuration for future extensibility",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "proxy_url": {
+ "description": "Optional HTTP/HTTPS proxy URL for outbound search requests (e.g. http://host:port); validated with utils.ValidateURLForSSRF.\nDoes not replace the search API endpoint; only tunnels traffic to the official APIs.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderType": {
+ "type": "string",
+ "enum": [
+ "bing",
+ "google",
+ "duckduckgo",
+ "tavily",
+ "ollama",
+ "baidu"
+ ],
+ "x-enum-varnames": [
+ "WebSearchProviderTypeBing",
+ "WebSearchProviderTypeGoogle",
+ "WebSearchProviderTypeDuckDuckGo",
+ "WebSearchProviderTypeTavily",
+ "WebSearchProviderTypeOllama",
+ "WebSearchProviderTypeBaidu"
+ ]
+ },
"github_com_Tencent_WeKnora_internal_types.WikiConfig": {
"type": "object",
"properties": {
@@ -13439,6 +15257,18 @@
}
]
},
+ "ingest_batch_size": {
+ "description": "IngestBatchSize controls how many pending ops a single batch\nprocesses before scheduling a follow-up. 0 falls back to the\nhard-coded default (5). Operators on large KBs (4w+ docs) can\nraise this to 10–20 to amortize the lock-acquire / index-rebuild\noverhead across more documents per round.",
+ "type": "integer"
+ },
+ "ingest_map_parallel": {
+ "description": "IngestMapParallel sets the errgroup limit for the Map phase\n(per-document extraction + summary + chunk citation). 0 falls\nback to 10. Bound by the LLM provider's concurrency limit and\nthe worker's outbound HTTP pool.",
+ "type": "integer"
+ },
+ "ingest_reduce_parallel": {
+ "description": "IngestReduceParallel sets the errgroup limit for the Reduce phase\n(per-slug page write). 0 falls back to 10. Bound by the same\nLLM concurrency / HTTP pool considerations as the Map phase,\nplus DB connection pool size.",
+ "type": "integer"
+ },
"max_pages_per_ingest": {
"description": "MaxPagesPerIngest limits pages created/updated per ingest operation (0 = no limit)",
"type": "integer"
@@ -13471,6 +15301,9 @@
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge"
}
},
+ "meta": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphMeta"
+ },
"nodes": {
"type": "array",
"items": {
@@ -13492,6 +15325,34 @@
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphMeta": {
+ "type": "object",
+ "properties": {
+ "center": {
+ "description": "populated in ego mode",
+ "type": "string"
+ },
+ "depth": {
+ "description": "populated in ego mode",
+ "type": "integer"
+ },
+ "mode": {
+ "type": "string"
+ },
+ "returned": {
+ "description": "number of nodes actually returned",
+ "type": "integer"
+ },
+ "total": {
+ "description": "total node count in the KB before filtering/limit",
+ "type": "integer"
+ },
+ "truncated": {
+ "description": "true when Returned \u003c Total (after filters)",
+ "type": "boolean"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.WikiGraphNode": {
"type": "object",
"properties": {
@@ -13510,6 +15371,126 @@
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.WikiIndexEntry": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiIndexGroup": {
+ "type": "object",
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiIndexEntry"
+ }
+ },
+ "next_cursor": {
+ "type": "string"
+ },
+ "total": {
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiIndexResponse": {
+ "type": "object",
+ "properties": {
+ "groups": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiIndexGroup"
+ }
+ },
+ "intro": {
+ "type": "string"
+ },
+ "version": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiLogEntry": {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Short operation tag: \"ingest\", \"retract\", etc. Matches the `action`\nargument historically passed to appendLogEntry.",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "Server-side timestamp (UTC).",
+ "type": "string"
+ },
+ "doc_title": {
+ "description": "Document title at the time of the event. Stored verbatim rather than\njoined at read time so deleted knowledge still has a human-readable\nlabel in the log.",
+ "type": "string"
+ },
+ "id": {
+ "description": "Auto-increment identifier. Monotonic within a single database, so\nfrontend pagination uses it as a stable cursor without needing to\ndisambiguate identical created_at values.",
+ "type": "integer"
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base this event belongs to.",
+ "type": "string"
+ },
+ "knowledge_id": {
+ "description": "Knowledge ID the event was about (may be empty for KB-level events).",
+ "type": "string"
+ },
+ "pages_affected": {
+ "description": "Wiki pages affected by this event. Each ref carries both slug (for\nnavigation) and title (for display) so the log renders human-\nreadable text without a post-hoc slug→title lookup that might fail\nfor now-deleted pages.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiLogPageRef"
+ }
+ },
+ "summary": {
+ "description": "One-line summary of the change, as it was when the event was logged.",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant scope, mirrored from the enclosing knowledge base.",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiLogEntryListResponse": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiLogEntry"
+ }
+ },
+ "next_cursor": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiLogPageRef": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.WikiPage": {
"type": "object",
"properties": {
@@ -13733,6 +15714,24 @@
}
}
},
+ "internal_handler.BatchDeleteKnowledgeRequest": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.CopyKnowledgeBaseRequest": {
"type": "object",
"required": [
@@ -13871,6 +15870,12 @@
"internal_handler.GetStorageEngineStatusResponse": {
"type": "object",
"properties": {
+ "allowed_providers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"engines": {
"type": "array",
"items": {
@@ -13909,11 +15914,234 @@
"minio_enabled": {
"type": "boolean"
},
- "vector_store_engine": {
- "type": "string"
+ "vector_store_engine": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.InitializationRequest": {
+ "type": "object",
+ "required": [
+ "documentSplitting",
+ "embedding",
+ "llm"
+ ],
+ "properties": {
+ "documentSplitting": {
+ "type": "object",
+ "required": [
+ "chunkSize",
+ "separators"
+ ],
+ "properties": {
+ "chunkOverlap": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "chunkSize": {
+ "type": "integer",
+ "maximum": 10000,
+ "minimum": 100
+ },
+ "separators": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "embedding": {
+ "type": "object",
+ "required": [
+ "modelName",
+ "source"
+ ],
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "dimension": {
+ "description": "添加embedding维度字段",
+ "type": "integer"
+ },
+ "modelName": {
+ "type": "string"
+ },
+ "source": {
+ "type": "string"
+ }
+ }
+ },
+ "llm": {
+ "type": "object",
+ "required": [
+ "modelName",
+ "source"
+ ],
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "modelName": {
+ "type": "string"
+ },
+ "source": {
+ "type": "string"
+ }
+ }
+ },
+ "multimodal": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "type": "object",
+ "properties": {
+ "appId": {
+ "type": "string"
+ },
+ "bucketName": {
+ "type": "string"
+ },
+ "pathPrefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secretId": {
+ "type": "string"
+ },
+ "secretKey": {
+ "type": "string"
+ }
+ }
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "minio": {
+ "type": "object",
+ "properties": {
+ "bucketName": {
+ "type": "string"
+ },
+ "pathPrefix": {
+ "type": "string"
+ }
+ }
+ },
+ "storageType": {
+ "type": "string"
+ },
+ "vlm": {
+ "type": "object",
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "interfaceType": {
+ "description": "\"ollama\" or \"openai\"",
+ "type": "string"
+ },
+ "modelName": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "nodeExtract": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "attributes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "node1": {
+ "type": "string"
+ },
+ "node2": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "questionGeneration": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "questionCount": {
+ "type": "integer"
+ }
+ }
},
- "version": {
- "type": "string"
+ "rerank": {
+ "type": "object",
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "modelName": {
+ "type": "string"
+ }
+ }
}
}
},
@@ -13942,6 +16170,12 @@
"enableParentChild": {
"type": "boolean"
},
+ "languages": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"parentChunkSize": {
"type": "integer"
},
@@ -13956,6 +16190,13 @@
"items": {
"type": "string"
}
+ },
+ "strategy": {
+ "description": "Strategy / TokenLimit / Languages use pointer types so the\nhandler can distinguish \"field absent in payload\" (no change)\nfrom \"field present with empty/zero value\" (clear / disable).\nWithout that distinction, users could set strategy=\"auto\" once\nbut never reset it back to legacy / unset.",
+ "type": "string"
+ },
+ "tokenLimit": {
+ "type": "integer"
}
}
},
@@ -14026,6 +16267,221 @@
}
}
},
+ "internal_handler.ModelTestRequest": {
+ "type": "object",
+ "required": [
+ "modelName"
+ ],
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "customHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "dimension": {
+ "type": "integer"
+ },
+ "extraConfig": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "interfaceType": {
+ "type": "string"
+ },
+ "modelName": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "source": {
+ "description": "为空时按需默认为 \"remote\"",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.MoveKnowledgeRequest": {
+ "type": "object",
+ "required": [
+ "knowledge_ids",
+ "mode",
+ "source_kb_id",
+ "target_kb_id"
+ ],
+ "properties": {
+ "knowledge_ids": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ },
+ "mode": {
+ "type": "string",
+ "enum": [
+ "reuse_vectors",
+ "reparse"
+ ]
+ },
+ "source_kb_id": {
+ "type": "string"
+ },
+ "target_kb_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.MoveKnowledgeResponse": {
+ "type": "object",
+ "properties": {
+ "knowledge_count": {
+ "type": "integer"
+ },
+ "message": {
+ "type": "string"
+ },
+ "source_kb_id": {
+ "type": "string"
+ },
+ "target_kb_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.PreviewChunkResult": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "context_header": {
+ "type": "string"
+ },
+ "end": {
+ "type": "integer"
+ },
+ "seq": {
+ "type": "integer"
+ },
+ "size_chars": {
+ "type": "integer"
+ },
+ "size_tokens_approx": {
+ "type": "integer"
+ },
+ "start": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.PreviewChunkingPayload": {
+ "type": "object",
+ "properties": {
+ "chunk_overlap": {
+ "type": "integer"
+ },
+ "chunk_size": {
+ "type": "integer"
+ },
+ "languages": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "separators": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "strategy": {
+ "type": "string"
+ },
+ "token_limit": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.PreviewChunkingRequest": {
+ "type": "object",
+ "properties": {
+ "chunking_config": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkingPayload"
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.PreviewChunkingResponse": {
+ "type": "object",
+ "properties": {
+ "chunks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkResult"
+ }
+ },
+ "profile": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile"
+ },
+ "rejected": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.TierRejection"
+ }
+ },
+ "selected_tier": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
+ },
+ "stats": {
+ "$ref": "#/definitions/internal_handler.PreviewChunkingStats"
+ },
+ "tier_chain": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
+ }
+ }
+ }
+ },
+ "internal_handler.PreviewChunkingStats": {
+ "type": "object",
+ "properties": {
+ "avg_chars": {
+ "type": "integer"
+ },
+ "count": {
+ "type": "integer"
+ },
+ "max_chars": {
+ "type": "integer"
+ },
+ "min_chars": {
+ "type": "integer"
+ },
+ "stddev_chars": {
+ "type": "integer"
+ },
+ "truncated_to": {
+ "description": "TruncatedTo, when set, is the original chunk count before the\nresponse was truncated to previewMaxChunks for transport.",
+ "type": "integer"
+ }
+ }
+ },
"internal_handler.RemoteModelCheckRequest": {
"type": "object",
"required": [
@@ -14101,6 +16557,9 @@
"cos": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
},
+ "ks3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig"
+ },
"minio": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
},
@@ -14108,7 +16567,7 @@
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
},
"provider": {
- "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\"",
"type": "string"
},
"s3": {
@@ -14136,6 +16595,9 @@
"internal_handler.StorageEngineStatusItem": {
"type": "object",
"properties": {
+ "allowed": {
+ "type": "boolean"
+ },
"available": {
"description": "whether the engine can be used",
"type": "boolean"
@@ -14145,7 +16607,21 @@
"type": "string"
},
"name": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\"",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.TestProviderRequest": {
+ "type": "object",
+ "required": [
+ "provider"
+ ],
+ "properties": {
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
+ },
+ "provider": {
"type": "string"
}
}
@@ -14270,6 +16746,23 @@
}
}
},
+ "internal_handler.UpdateProviderRequest": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "is_default": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
+ }
+ }
+ },
"internal_handler.UpdateStoreRequest": {
"type": "object",
"required": [
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 88c48e5ec..f78feeba5 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -135,6 +135,72 @@ definitions:
- ErrAgentMissingAllowedTools
- ErrAgentInvalidMaxIterations
- ErrAgentInvalidTemperature
+ github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile:
+ properties:
+ all_caps_short_line_count:
+ type: integer
+ avg_line_len:
+ type: number
+ blank_paragraph_breaks:
+ type: integer
+ chinese_chapter_count:
+ type: integer
+ code_ratio:
+ type: number
+ detected_langs:
+ description: Detected language hints (best-effort)
+ items:
+ type: string
+ type: array
+ english_chapter_count:
+ type: integer
+ form_feed_count:
+ type: integer
+ german_chapter_count:
+ type: integer
+ has_code:
+ type: boolean
+ has_tables:
+ description: Content characteristics
+ type: boolean
+ md_heading_counts:
+ additionalProperties:
+ type: integer
+ description: Markdown structure
+ type: object
+ md_heading_total:
+ type: integer
+ numbered_section_count:
+ description: Heuristic indicators
+ type: integer
+ repeated_footer_count:
+ type: integer
+ std_line_len:
+ type: number
+ total_chars:
+ type: integer
+ total_lines:
+ type: integer
+ visual_sep_count:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier:
+ enum:
+ - heading
+ - heuristic
+ - legacy
+ type: string
+ x-enum-varnames:
+ - TierHeading
+ - TierHeuristic
+ - TierLegacy
+ github_com_Tencent_WeKnora_internal_infrastructure_chunker.TierRejection:
+ properties:
+ reason:
+ type: string
+ tier:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier'
+ type: object
github_com_Tencent_WeKnora_internal_types.ASRConfig:
properties:
enabled:
@@ -330,6 +396,13 @@ definitions:
When enabled, large parent chunks provide context while small child chunks
are used for vector matching. Retrieval matches on child but returns parent content.
type: boolean
+ languages:
+ description: |-
+ Languages hints the heuristic patterns. Empty = auto-detect from content.
+ Examples: ["de"], ["en", "zh"].
+ items:
+ type: string
+ type: array
parent_chunk_size:
description: |-
ParentChunkSize is the size of parent chunks (default: 4096).
@@ -347,6 +420,18 @@ definitions:
items:
type: string
type: array
+ strategy:
+ description: |-
+ Strategy selects the adaptive chunking tier. Empty / "legacy" preserves
+ the historical recursive splitter; "auto" lets a profiler pick between
+ heading-aware, heuristic and recursive tiers; "heading" / "heuristic" /
+ "recursive" pin the tier explicitly.
+ type: string
+ token_limit:
+ description: |-
+ TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize
+ as a character count.
+ type: integer
type: object
github_com_Tencent_WeKnora_internal_types.ConnectionConfig:
properties:
@@ -356,12 +441,21 @@ definitions:
api_key:
description: AES-GCM encrypted
type: string
+ database:
+ description: Tencent VectorDB and Doris database name.
+ type: string
grpc_address:
description: Weaviate
type: string
host:
description: Qdrant
type: string
+ http_port:
+ description: |-
+ Doris: HTTP port for Stream Load API (FE default 8030).
+ Addr is reused for the MySQL protocol "host:9030"; HTTPPort + the host of Addr
+ together form the FE HTTP endpoint used by Stream Load.
+ type: integer
password:
description: AES-GCM encrypted
type: string
@@ -561,7 +655,7 @@ definitions:
type: integer
image_storage_provider:
description: |-
- Storage provider for image uploads: "local", "minio", "cos", "tos"
+ Storage provider for image uploads: "local", "minio", "cos", "tos", "s3", "oss", "ks3".
Empty means use the global/tenant default provider.
type: string
image_upload_enabled:
@@ -969,6 +1063,10 @@ definitions:
type: object
github_com_Tencent_WeKnora_internal_types.IndexConfig:
properties:
+ buckets_num:
+ description: 'Doris: number of buckets per table (DISTRIBUTED BY HASH ...
+ BUCKETS N)'
+ type: integer
collection_name:
description: Milvus
type: string
@@ -993,6 +1091,9 @@ definitions:
replication_factor:
description: 'Qdrant, Weaviate: number of replicas'
type: integer
+ replication_num:
+ description: 'Doris: replication_num PROPERTIES'
+ type: integer
shard_number:
description: '--- Scalability fields ---'
type: integer
@@ -1052,6 +1153,33 @@ definitions:
required:
- invite_code
type: object
+ github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus:
+ enum:
+ - pending
+ - processing
+ - completed
+ - failed
+ type: string
+ x-enum-varnames:
+ - KBCloneStatusPending
+ - KBCloneStatusProcessing
+ - KBCloneStatusCompleted
+ - KBCloneStatusFailed
+ github_com_Tencent_WeKnora_internal_types.KS3EngineConfig:
+ properties:
+ access_key:
+ type: string
+ bucket_name:
+ type: string
+ endpoint:
+ type: string
+ path_prefix:
+ type: string
+ region:
+ type: string
+ secret_key:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.Knowledge:
properties:
channel:
@@ -1328,6 +1456,41 @@ definitions:
source_tenant_id:
type: integer
type: object
+ github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress:
+ properties:
+ created_at:
+ description: 任务创建时间
+ type: integer
+ error:
+ description: 错误信息
+ type: string
+ failed:
+ description: 失败数
+ type: integer
+ message:
+ description: 状态消息
+ type: string
+ processed:
+ description: 已处理数
+ type: integer
+ progress:
+ description: 0-100
+ type: integer
+ source_kb_id:
+ type: string
+ status:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus'
+ target_kb_id:
+ type: string
+ task_id:
+ type: string
+ total:
+ description: 总知识数
+ type: integer
+ updated_at:
+ description: 最后更新时间
+ type: integer
+ type: object
github_com_Tencent_WeKnora_internal_types.ListMembersResponse:
properties:
members:
@@ -2102,6 +2265,21 @@ definitions:
description: 'RerankTopK is the maximum number of results after reranking
(default: 10)'
type: integer
+ rrf_k:
+ description: |-
+ RRFK is the smoothing constant of Reciprocal Rank Fusion. Larger values
+ flatten the curve, reducing the bias towards top-1 results.
+ Default: 60. Sensible range: 30..100 depending on corpus size.
+ type: integer
+ rrf_keyword_weight:
+ description: 'RRFKeywordWeight is the keyword counterpart. Default: 0.3.'
+ type: number
+ rrf_vector_weight:
+ description: |-
+ RRFVectorWeight is the weight applied to the vector retriever inside RRF.
+ RRFVectorWeight + RRFKeywordWeight should usually sum to 1.0 but the math
+ works for any positive weights. Default: 0.7.
+ type: number
vector_threshold:
description: 'VectorThreshold is the minimum vector similarity score (0-1,
default: 0.15)'
@@ -2127,7 +2305,9 @@ definitions:
- qdrant
- milvus
- weaviate
+ - doris
- sqlite
+ - tencent_vectordb
type: string
x-enum-varnames:
- PostgresRetrieverEngineType
@@ -2137,7 +2317,9 @@ definitions:
- QdrantRetrieverEngineType
- MilvusRetrieverEngineType
- WeaviateRetrieverEngineType
+ - DorisRetrieverEngineType
- SQLiteRetrieverEngineType
+ - TencentVectorDBRetrieverEngineType
github_com_Tencent_WeKnora_internal_types.RetrieverEngines:
properties:
engines:
@@ -2331,6 +2513,12 @@ definitions:
id:
description: ID
type: string
+ is_pinned:
+ description: IsPinned indicates whether the session is pinned in the list.
+ type: boolean
+ pinned_at:
+ description: PinnedAt records when the session was pinned; nil when not pinned.
+ type: string
tenant_id:
description: Tenant ID
type: integer
@@ -2339,6 +2527,11 @@ definitions:
type: string
updated_at:
type: string
+ user_id:
+ description: |-
+ UserID is the owner of the session. Empty for legacy rows (visible at
+ tenant level) and for IM-created sessions that do not map to a WeKnora user.
+ type: string
type: object
github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest:
properties:
@@ -2372,8 +2565,10 @@ definitions:
cos:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig'
default_provider:
- description: '"local", "minio", "cos", "tos", "s3", "oss"'
+ description: '"local", "minio", "cos", "tos", "s3", "oss", "ks3"'
type: string
+ ks3:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig'
local:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig'
minio:
@@ -2388,7 +2583,7 @@ definitions:
github_com_Tencent_WeKnora_internal_types.StorageProviderConfig:
properties:
provider:
- description: '"local", "minio", "cos", "tos", "s3", "oss"'
+ description: '"local", "minio", "cos", "tos", "s3", "oss", "ks3"'
type: string
type: object
github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest:
@@ -2752,6 +2947,75 @@ definitions:
description: 重排模型ID(用于RAG压缩)
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity:
+ properties:
+ created_at:
+ description: Timestamps
+ type: string
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ description:
+ description: Description
+ type: string
+ id:
+ description: Unique identifier (UUID, auto-generated)
+ type: string
+ is_default:
+ description: Whether this is the default provider for the tenant
+ type: boolean
+ name:
+ description: User-friendly name, e.g., "Production Bing Search"
+ type: string
+ parameters:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters'
+ description: Provider-specific parameters (API key, engine ID, etc.) stored
+ as encrypted JSON
+ provider:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderType'
+ description: 'Provider type: bing, google, duckduckgo, tavily'
+ tenant_id:
+ description: Tenant ID for scoping
+ type: integer
+ updated_at:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters:
+ properties:
+ api_key:
+ description: API key for the search provider (encrypted in DB)
+ type: string
+ engine_id:
+ description: Google Custom Search Engine ID (only for Google provider)
+ type: string
+ extra_config:
+ additionalProperties:
+ type: string
+ description: Provider-specific extra configuration for future extensibility
+ type: object
+ proxy_url:
+ description: |-
+ Optional HTTP/HTTPS proxy URL for outbound search requests (e.g. http://host:port); validated with utils.ValidateURLForSSRF.
+ Does not replace the search API endpoint; only tunnels traffic to the official APIs.
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WebSearchProviderType:
+ enum:
+ - bing
+ - google
+ - duckduckgo
+ - tavily
+ - ollama
+ - baidu
+ type: string
+ x-enum-varnames:
+ - WebSearchProviderTypeBing
+ - WebSearchProviderTypeGoogle
+ - WebSearchProviderTypeDuckDuckGo
+ - WebSearchProviderTypeTavily
+ - WebSearchProviderTypeOllama
+ - WebSearchProviderTypeBaidu
github_com_Tencent_WeKnora_internal_types.WikiConfig:
properties:
extraction_granularity:
@@ -2760,6 +3024,28 @@ definitions:
description: |-
ExtractionGranularity controls how many candidate slugs Pass 0 extracts
per document. Empty / unknown value is treated as WikiExtractionStandard.
+ ingest_batch_size:
+ description: |-
+ IngestBatchSize controls how many pending ops a single batch
+ processes before scheduling a follow-up. 0 falls back to the
+ hard-coded default (5). Operators on large KBs (4w+ docs) can
+ raise this to 10–20 to amortize the lock-acquire / index-rebuild
+ overhead across more documents per round.
+ type: integer
+ ingest_map_parallel:
+ description: |-
+ IngestMapParallel sets the errgroup limit for the Map phase
+ (per-document extraction + summary + chunk citation). 0 falls
+ back to 10. Bound by the LLM provider's concurrency limit and
+ the worker's outbound HTTP pool.
+ type: integer
+ ingest_reduce_parallel:
+ description: |-
+ IngestReduceParallel sets the errgroup limit for the Reduce phase
+ (per-slug page write). 0 falls back to 10. Bound by the same
+ LLM concurrency / HTTP pool considerations as the Map phase,
+ plus DB connection pool size.
+ type: integer
max_pages_per_ingest:
description: MaxPagesPerIngest limits pages created/updated per ingest operation
(0 = no limit)
@@ -2785,6 +3071,8 @@ definitions:
items:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge'
type: array
+ meta:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphMeta'
nodes:
items:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphNode'
@@ -2799,6 +3087,26 @@ definitions:
description: target slug
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.WikiGraphMeta:
+ properties:
+ center:
+ description: populated in ego mode
+ type: string
+ depth:
+ description: populated in ego mode
+ type: integer
+ mode:
+ type: string
+ returned:
+ description: number of nodes actually returned
+ type: integer
+ total:
+ description: total node count in the KB before filtering/limit
+ type: integer
+ truncated:
+ description: true when Returned < Total (after filters)
+ type: boolean
+ type: object
github_com_Tencent_WeKnora_internal_types.WikiGraphNode:
properties:
link_count:
@@ -2811,6 +3119,100 @@ definitions:
title:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.WikiIndexEntry:
+ properties:
+ slug:
+ type: string
+ summary:
+ type: string
+ title:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WikiIndexGroup:
+ properties:
+ items:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiIndexEntry'
+ type: array
+ next_cursor:
+ type: string
+ total:
+ type: integer
+ type:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WikiIndexResponse:
+ properties:
+ groups:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiIndexGroup'
+ type: array
+ intro:
+ type: string
+ version:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WikiLogEntry:
+ properties:
+ action:
+ description: |-
+ Short operation tag: "ingest", "retract", etc. Matches the `action`
+ argument historically passed to appendLogEntry.
+ type: string
+ created_at:
+ description: Server-side timestamp (UTC).
+ type: string
+ doc_title:
+ description: |-
+ Document title at the time of the event. Stored verbatim rather than
+ joined at read time so deleted knowledge still has a human-readable
+ label in the log.
+ type: string
+ id:
+ description: |-
+ Auto-increment identifier. Monotonic within a single database, so
+ frontend pagination uses it as a stable cursor without needing to
+ disambiguate identical created_at values.
+ type: integer
+ knowledge_base_id:
+ description: Knowledge base this event belongs to.
+ type: string
+ knowledge_id:
+ description: Knowledge ID the event was about (may be empty for KB-level events).
+ type: string
+ pages_affected:
+ description: |-
+ Wiki pages affected by this event. Each ref carries both slug (for
+ navigation) and title (for display) so the log renders human-
+ readable text without a post-hoc slug→title lookup that might fail
+ for now-deleted pages.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiLogPageRef'
+ type: array
+ summary:
+ description: One-line summary of the change, as it was when the event was
+ logged.
+ type: string
+ tenant_id:
+ description: Tenant scope, mirrored from the enclosing knowledge base.
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WikiLogEntryListResponse:
+ properties:
+ entries:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiLogEntry'
+ type: array
+ next_cursor:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WikiLogPageRef:
+ properties:
+ slug:
+ type: string
+ title:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.WikiPage:
properties:
aliases:
@@ -2984,6 +3386,18 @@ definitions:
description: Valid is true if Time is not NULL
type: boolean
type: object
+ internal_handler.BatchDeleteKnowledgeRequest:
+ properties:
+ ids:
+ items:
+ type: string
+ type: array
+ kb_id:
+ type: string
+ required:
+ - ids
+ - kb_id
+ type: object
internal_handler.CopyKnowledgeBaseRequest:
properties:
source_id:
@@ -3077,6 +3491,10 @@ definitions:
type: object
internal_handler.GetStorageEngineStatusResponse:
properties:
+ allowed_providers:
+ items:
+ type: string
+ type: array
engines:
items:
$ref: '#/definitions/internal_handler.StorageEngineStatusItem'
@@ -3107,55 +3525,217 @@ definitions:
version:
type: string
type: object
- internal_handler.KBModelConfigRequest:
+ internal_handler.InitializationRequest:
properties:
- asr_config:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig'
documentSplitting:
- description: 文档分块配置
properties:
- childChunkSize:
- type: integer
chunkOverlap:
+ minimum: 0
type: integer
chunkSize:
+ maximum: 10000
+ minimum: 100
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
+ minItems: 1
type: array
+ required:
+ - chunkSize
+ - separators
type: object
- embeddingModelId:
- description: optional when RAG indexing is disabled
- type: string
- llmModelId:
- type: string
- multimodal:
- description: 多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)
+ embedding:
properties:
- enabled:
- type: boolean
+ apiKey:
+ type: string
+ baseUrl:
+ type: string
+ dimension:
+ description: 添加embedding维度字段
+ type: integer
+ modelName:
+ type: string
+ source:
+ type: string
+ required:
+ - modelName
+ - source
type: object
- nodeExtract:
- description: 知识图谱配置
+ llm:
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'
+ apiKey:
+ type: string
+ baseUrl:
+ type: string
+ modelName:
+ type: string
+ source:
+ type: string
+ required:
+ - modelName
+ - source
+ type: object
+ multimodal:
+ properties:
+ cos:
+ properties:
+ appId:
+ type: string
+ bucketName:
+ type: string
+ pathPrefix:
+ type: string
+ region:
+ type: string
+ secretId:
+ type: string
+ secretKey:
+ type: string
+ type: object
+ enabled:
+ type: boolean
+ minio:
+ properties:
+ bucketName:
+ type: string
+ pathPrefix:
+ type: string
+ type: object
+ storageType:
+ type: string
+ vlm:
+ properties:
+ apiKey:
+ type: string
+ baseUrl:
+ type: string
+ interfaceType:
+ description: '"ollama" or "openai"'
+ type: string
+ modelName:
+ type: string
+ type: object
+ type: object
+ nodeExtract:
+ properties:
+ enabled:
+ type: boolean
+ nodes:
+ items:
+ properties:
+ attributes:
+ items:
+ type: string
+ type: array
+ name:
+ type: string
+ type: object
+ type: array
+ relations:
+ items:
+ properties:
+ node1:
+ type: string
+ node2:
+ type: string
+ type:
+ type: string
+ type: object
+ type: array
+ tags:
+ items:
+ type: string
+ type: array
+ text:
+ type: string
+ type: object
+ questionGeneration:
+ properties:
+ enabled:
+ type: boolean
+ questionCount:
+ type: integer
+ type: object
+ rerank:
+ properties:
+ apiKey:
+ type: string
+ baseUrl:
+ type: string
+ enabled:
+ type: boolean
+ modelName:
+ type: string
+ type: object
+ required:
+ - documentSplitting
+ - embedding
+ - llm
+ type: object
+ internal_handler.KBModelConfigRequest:
+ properties:
+ asr_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig'
+ documentSplitting:
+ description: 文档分块配置
+ properties:
+ childChunkSize:
+ type: integer
+ chunkOverlap:
+ type: integer
+ chunkSize:
+ type: integer
+ enableParentChild:
+ type: boolean
+ languages:
+ items:
+ type: string
+ type: array
+ parentChunkSize:
+ type: integer
+ parserEngineRules:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule'
+ type: array
+ separators:
+ items:
+ type: string
+ type: array
+ strategy:
+ description: |-
+ Strategy / TokenLimit / Languages use pointer types so the
+ handler can distinguish "field absent in payload" (no change)
+ from "field present with empty/zero value" (clear / disable).
+ Without that distinction, users could set strategy="auto" once
+ but never reset it back to legacy / unset.
+ type: string
+ tokenLimit:
+ type: integer
+ type: object
+ embeddingModelId:
+ description: optional when RAG indexing is disabled
+ 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:
@@ -3180,6 +3760,151 @@ definitions:
required:
- llmModelId
type: object
+ internal_handler.ModelTestRequest:
+ properties:
+ apiKey:
+ type: string
+ baseUrl:
+ type: string
+ customHeaders:
+ additionalProperties:
+ type: string
+ type: object
+ dimension:
+ type: integer
+ extraConfig:
+ additionalProperties:
+ type: string
+ type: object
+ interfaceType:
+ type: string
+ modelName:
+ type: string
+ provider:
+ type: string
+ source:
+ description: 为空时按需默认为 "remote"
+ type: string
+ required:
+ - modelName
+ type: object
+ internal_handler.MoveKnowledgeRequest:
+ properties:
+ knowledge_ids:
+ items:
+ type: string
+ minItems: 1
+ type: array
+ mode:
+ enum:
+ - reuse_vectors
+ - reparse
+ type: string
+ source_kb_id:
+ type: string
+ target_kb_id:
+ type: string
+ required:
+ - knowledge_ids
+ - mode
+ - source_kb_id
+ - target_kb_id
+ type: object
+ internal_handler.MoveKnowledgeResponse:
+ properties:
+ knowledge_count:
+ type: integer
+ message:
+ type: string
+ source_kb_id:
+ type: string
+ target_kb_id:
+ type: string
+ task_id:
+ type: string
+ type: object
+ internal_handler.PreviewChunkResult:
+ properties:
+ content:
+ type: string
+ context_header:
+ type: string
+ end:
+ type: integer
+ seq:
+ type: integer
+ size_chars:
+ type: integer
+ size_tokens_approx:
+ type: integer
+ start:
+ type: integer
+ type: object
+ internal_handler.PreviewChunkingPayload:
+ properties:
+ chunk_overlap:
+ type: integer
+ chunk_size:
+ type: integer
+ languages:
+ items:
+ type: string
+ type: array
+ separators:
+ items:
+ type: string
+ type: array
+ strategy:
+ type: string
+ token_limit:
+ type: integer
+ type: object
+ internal_handler.PreviewChunkingRequest:
+ properties:
+ chunking_config:
+ $ref: '#/definitions/internal_handler.PreviewChunkingPayload'
+ text:
+ type: string
+ type: object
+ internal_handler.PreviewChunkingResponse:
+ properties:
+ chunks:
+ items:
+ $ref: '#/definitions/internal_handler.PreviewChunkResult'
+ type: array
+ profile:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile'
+ rejected:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.TierRejection'
+ type: array
+ selected_tier:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier'
+ stats:
+ $ref: '#/definitions/internal_handler.PreviewChunkingStats'
+ tier_chain:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier'
+ type: array
+ type: object
+ internal_handler.PreviewChunkingStats:
+ properties:
+ avg_chars:
+ type: integer
+ count:
+ type: integer
+ max_chars:
+ type: integer
+ min_chars:
+ type: integer
+ stddev_chars:
+ type: integer
+ truncated_to:
+ description: |-
+ TruncatedTo, when set, is the original chunk count before the
+ response was truncated to previewMaxChunks for transport.
+ type: integer
+ type: object
internal_handler.RemoteModelCheckRequest:
properties:
apiKey:
@@ -3231,12 +3956,14 @@ definitions:
properties:
cos:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig'
+ ks3:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig'
minio:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig'
oss:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig'
provider:
- description: '"minio", "cos", "tos", "s3", "oss"'
+ description: '"minio", "cos", "tos", "s3", "oss", "ks3"'
type: string
s3:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig'
@@ -3254,6 +3981,8 @@ definitions:
type: object
internal_handler.StorageEngineStatusItem:
properties:
+ allowed:
+ type: boolean
available:
description: whether the engine can be used
type: boolean
@@ -3261,8 +3990,17 @@ definitions:
description: short description for UI
type: string
name:
- description: '"local", "minio", "cos", "tos"'
+ description: '"local", "minio", "cos", "tos", "s3", "oss", "ks3"'
+ type: string
+ type: object
+ internal_handler.TestProviderRequest:
+ properties:
+ parameters:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters'
+ provider:
type: string
+ required:
+ - provider
type: object
internal_handler.TestStoreRequest:
properties:
@@ -3343,6 +4081,17 @@ definitions:
type:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
type: object
+ internal_handler.UpdateProviderRequest:
+ properties:
+ description:
+ type: string
+ is_default:
+ type: boolean
+ name:
+ type: string
+ parameters:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters'
+ type: object
internal_handler.UpdateStoreRequest:
properties:
name:
@@ -3528,6 +4277,46 @@ info:
title: WeKnora API
version: "1.0"
paths:
+ /agent/tool-approvals/{pending_id}:
+ post:
+ consumes:
+ - application/json
+ description: 用户审批通过或驳回一次工具调用(用于 Agent 阻塞等待审批的场景)
+ parameters:
+ - description: 待审批记录 ID
+ in: path
+ name: pending_id
+ required: true
+ type: string
+ - description: '{decision: \'
+ in: body
+ name: request
+ required: true
+ schema:
+ additionalProperties: true
+ type: object
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 审批结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 待审批记录不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 处理 MCP 工具调用待审批请求
+ tags:
+ - MCP服务
/agents:
get:
consumes:
@@ -3720,6 +4509,38 @@ paths:
summary: 复制智能体
tags:
- 智能体
+ /agents/{id}/shares/{share_id}:
+ delete:
+ description: 从智能体的共享列表中移除指定共享关系
+ parameters:
+ - description: 智能体 ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 共享记录 ID
+ in: path
+ name: share_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 'success: true'
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: 无权限
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 取消智能体共享
+ tags:
+ - 组织
/agents/{id}/suggested-questions:
get:
consumes:
@@ -4189,13 +5010,37 @@ paths:
- Wiki
/api/v1/knowledgebase/{kb_id}/wiki/graph:
get:
- description: Returns the wiki link graph data for visualization
+ description: |-
+ Returns a slice of the wiki link graph for visualization. Supports
+ `mode=overview` (top-N most-connected pages, default) and
+ `mode=ego` (BFS neighborhood of a center slug) to keep response
+ size tractable for knowledge bases with tens of thousands of pages.
parameters:
- description: Knowledge base ID
in: path
name: kb_id
required: true
type: string
+ - description: overview (default) | ego
+ in: query
+ name: mode
+ type: string
+ - description: Center slug for ego mode
+ in: query
+ name: center
+ type: string
+ - description: Ego BFS depth (1-3, default 1)
+ in: query
+ name: depth
+ type: integer
+ - description: Comma-separated page_type allow-list
+ in: query
+ name: types
+ type: string
+ - description: Max nodes to return (default 500, max 2000)
+ in: query
+ name: limit
+ type: integer
produces:
- application/json
responses:
@@ -4210,23 +5055,40 @@ paths:
- Wiki
/api/v1/knowledgebase/{kb_id}/wiki/index:
get:
- description: Returns the wiki index page (creates default if not exists)
+ description: |-
+ Returns the wiki index as intro text plus per-type paginated
+ directory groups. The heavy directory markdown that used to
+ live in wiki_pages.content was replaced with this structured
+ response so a KB with tens of thousands of pages no longer
+ materializes megabytes of TEXT on every index open.
parameters:
- description: Knowledge base ID
in: path
name: kb_id
required: true
type: string
+ - description: 'Comma-separated page types (default: all content types)'
+ in: query
+ name: types
+ type: string
+ - description: Per-group window size, 1-200 (default 50)
+ in: query
+ name: limit
+ type: integer
+ - description: Opaque offset cursor from previous response
+ in: query
+ name: cursor
+ type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiIndexResponse'
security:
- Bearer: []
- summary: Get wiki index page
+ summary: Get wiki index view
tags:
- Wiki
/api/v1/knowledgebase/{kb_id}/wiki/issues:
@@ -4323,20 +5185,31 @@ paths:
- Wiki
/api/v1/knowledgebase/{kb_id}/wiki/log:
get:
- description: Returns the wiki operation log page (creates default if not exists)
+ description: |-
+ Returns a paginated feed of wiki operation events (ingest, retract, ...)
+ newest-first. Pagination is cursor-based: pass `next_cursor` from the
+ previous response back as `cursor` to fetch the next page.
parameters:
- description: Knowledge base ID
in: path
name: kb_id
required: true
type: string
+ - description: Opaque cursor from the previous page (empty = newest)
+ in: query
+ name: cursor
+ type: string
+ - description: Page size, 1-200 (default 50)
+ in: query
+ name: limit
+ type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiLogEntryListResponse'
security:
- Bearer: []
summary: Get wiki operation log
@@ -4868,6 +5741,46 @@ paths:
summary: 验证令牌
tags:
- 认证
+ /chunker/preview:
+ post:
+ consumes:
+ - application/json
+ description: 对提交的文本运行自适应分块器并返回分块预览,不写入数据库不生成 embedding。文本最大 64k 字符
+ parameters:
+ - description: '{text, chunking_config}'
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.PreviewChunkingRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 分块结果
+ schema:
+ $ref: '#/definitions/internal_handler.PreviewChunkingResponse'
+ "400":
+ description: 请求参数错误
+ schema:
+ additionalProperties: true
+ type: object
+ "413":
+ description: 文本超过预览限制
+ schema:
+ additionalProperties: true
+ type: object
+ "504":
+ description: 分块超时
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 预览分块结果
+ tags:
+ - 分块
/chunks/{knowledge_id}:
delete:
consumes:
@@ -5175,107 +6088,196 @@ paths:
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 获取FAQ导入进度
+ summary: 获取FAQ导入进度
+ tags:
+ - FAQ管理
+ /im-channels/{id}:
+ delete:
+ description: 删除指定 IM 渠道
+ parameters:
+ - description: 渠道 ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 'success: true'
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: 渠道不存在
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 删除 IM 渠道
+ tags:
+ - IM 渠道
+ put:
+ consumes:
+ - application/json
+ description: 更新指定 IM 渠道的名称、模式、知识库、凭证或启用状态
+ parameters:
+ - description: 渠道 ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 更新字段(name/mode/output_mode/knowledge_base_id/credentials/enabled)
+ in: body
+ name: request
+ required: true
+ schema:
+ additionalProperties: true
+ type: object
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 更新后的渠道
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: 渠道不存在
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 更新 IM 渠道
tags:
- - FAQ管理
- /initialization/extract/relations:
+ - IM 渠道
+ /im-channels/{id}/toggle:
post:
- consumes:
- - application/json
- description: 从文本中提取实体和关系
+ description: 切换指定 IM 渠道的启用状态
parameters:
- - description: 提取请求
- in: body
- name: request
+ - description: 渠道 ID
+ in: path
+ name: id
required: true
- schema:
- $ref: '#/definitions/internal_handler.TextRelationExtractionRequest'
+ type: string
produces:
- application/json
responses:
"200":
- description: 提取结果
+ description: 更新后的渠道
schema:
additionalProperties: true
type: object
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ additionalProperties: true
+ type: object
+ "404":
+ description: 渠道不存在
+ schema:
+ additionalProperties: true
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 提取文本关系
+ summary: 启用/停用 IM 渠道
tags:
- - 初始化
- /initialization/fabri/tag:
+ - IM 渠道
+ /im/callback/{channel_id}:
get:
consumes:
- application/json
- description: 随机生成一组标签
+ description: 接收各 IM 平台的事件回调;走平台自身签名校验,不使用 API Key
+ parameters:
+ - description: 渠道 ID
+ in: path
+ name: channel_id
+ required: true
+ type: string
produces:
- application/json
responses:
"200":
- description: 生成的标签
+ description: 处理结果
schema:
additionalProperties: true
type: object
- summary: 生成随机标签
+ "400":
+ description: 请求参数错误
+ schema:
+ additionalProperties: true
+ type: object
+ "401":
+ description: 签名校验失败
+ schema:
+ additionalProperties: true
+ type: object
+ summary: IM 平台回调
tags:
- - 初始化
- /initialization/fabri/text:
+ - IM 回调
post:
consumes:
- application/json
- description: 根据标签生成示例文本
+ description: 接收各 IM 平台的事件回调;走平台自身签名校验,不使用 API Key
parameters:
- - description: 生成请求
- in: body
- name: request
+ - description: 渠道 ID
+ in: path
+ name: channel_id
required: true
- schema:
- $ref: '#/definitions/internal_handler.FabriTextRequest'
+ type: string
produces:
- application/json
responses:
"200":
- description: 生成的文本
+ description: 处理结果
schema:
additionalProperties: true
type: object
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
- security:
- - Bearer: []
- - ApiKeyAuth: []
- summary: 生成示例文本
+ additionalProperties: true
+ type: object
+ "401":
+ description: 签名校验失败
+ schema:
+ additionalProperties: true
+ type: object
+ summary: IM 平台回调
tags:
- - 初始化
- /initialization/kb/{kbId}:
+ - IM 回调
+ /initialization/asr/check:
post:
consumes:
- application/json
- description: 根据知识库ID执行完整配置更新
+ description: 检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点
parameters:
- - description: 知识库ID
- in: path
- name: kbId
- required: true
- type: string
- - description: 初始化请求
+ - description: ASR检查请求
in: body
name: request
required: true
schema:
- type: object
+ $ref: '#/definitions/internal_handler.ModelTestRequest'
produces:
- application/json
responses:
"200":
- description: 初始化成功
+ description: 检查结果
schema:
additionalProperties: true
type: object
@@ -5286,10 +6288,10 @@ paths:
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 初始化知识库配置
+ summary: 检查ASR模型
tags:
- 初始化
- /initialization/kb/{kbId}/config:
+ /initialization/config/{kbId}:
get:
consumes:
- application/json
@@ -5356,23 +6358,23 @@ paths:
summary: 更新知识库配置
tags:
- 初始化
- /initialization/models/asr/check:
+ /initialization/embedding/test:
post:
consumes:
- application/json
- description: 检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点
+ description: 测试Embedding接口是否可用并返回向量维度
parameters:
- - description: ASR检查请求
+ - description: Embedding测试请求
in: body
name: request
required: true
schema:
- type: object
+ $ref: '#/definitions/internal_handler.ModelTestRequest'
produces:
- application/json
responses:
"200":
- description: 检查结果
+ description: 测试结果
schema:
additionalProperties: true
type: object
@@ -5383,26 +6385,42 @@ paths:
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 检查ASR模型
+ summary: 测试Embedding模型
tags:
- 初始化
- /initialization/models/embedding/test:
+ /initialization/extract/fabri-tag:
post:
consumes:
- application/json
- description: 测试Embedding接口是否可用并返回向量维度
+ description: 随机生成一组标签
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 生成的标签
+ schema:
+ additionalProperties: true
+ type: object
+ summary: 生成随机标签
+ tags:
+ - 初始化
+ /initialization/extract/fabri-text:
+ post:
+ consumes:
+ - application/json
+ description: 根据标签生成示例文本
parameters:
- - description: Embedding测试请求
+ - description: 生成请求
in: body
name: request
required: true
schema:
- type: object
+ $ref: '#/definitions/internal_handler.FabriTextRequest'
produces:
- application/json
responses:
"200":
- description: 测试结果
+ description: 生成的文本
schema:
additionalProperties: true
type: object
@@ -5413,26 +6431,26 @@ paths:
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 测试Embedding模型
+ summary: 生成示例文本
tags:
- 初始化
- /initialization/models/remote/check:
+ /initialization/extract/text-relation:
post:
consumes:
- application/json
- description: 检查远程API模型连接是否正常
+ description: 从文本中提取实体和关系
parameters:
- - description: 模型检查请求
+ - description: 提取请求
in: body
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.RemoteModelCheckRequest'
+ $ref: '#/definitions/internal_handler.TextRelationExtractionRequest'
produces:
- application/json
responses:
"200":
- description: 检查结果
+ description: 提取结果
schema:
additionalProperties: true
type: object
@@ -5443,26 +6461,31 @@ paths:
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 检查远程模型
+ summary: 提取文本关系
tags:
- 初始化
- /initialization/models/rerank/check:
+ /initialization/initialize/{kbId}:
post:
consumes:
- application/json
- description: 检查Rerank模型连接和功能是否正常
+ description: 根据知识库ID执行完整配置更新
parameters:
- - description: Rerank检查请求
+ - description: 知识库ID
+ in: path
+ name: kbId
+ required: true
+ type: string
+ - description: 初始化请求
in: body
name: request
required: true
schema:
- type: object
+ $ref: '#/definitions/internal_handler.InitializationRequest'
produces:
- application/json
responses:
"200":
- description: 检查结果
+ description: 初始化成功
schema:
additionalProperties: true
type: object
@@ -5473,7 +6496,7 @@ paths:
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 检查Rerank模型
+ summary: 初始化知识库配置
tags:
- 初始化
/initialization/multimodal/test:
@@ -5528,7 +6551,7 @@ paths:
summary: 测试多模态功能
tags:
- 初始化
- /initialization/ollama/download/{taskId}:
+ /initialization/ollama/download/progress/{taskId}:
get:
consumes:
- application/json
@@ -5683,6 +6706,66 @@ paths:
summary: 检查Ollama服务状态
tags:
- 初始化
+ /initialization/remote/check:
+ post:
+ consumes:
+ - application/json
+ description: 检查远程API模型连接是否正常
+ parameters:
+ - description: 模型检查请求
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.RemoteModelCheckRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 检查结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 检查远程模型
+ tags:
+ - 初始化
+ /initialization/rerank/check:
+ post:
+ consumes:
+ - application/json
+ description: 检查Rerank模型连接和功能是否正常
+ parameters:
+ - description: Rerank检查请求
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.ModelTestRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 检查结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 检查Rerank模型
+ tags:
+ - 初始化
/knowledge-bases:
get:
consumes:
@@ -6552,6 +7635,37 @@ paths:
summary: 从URL创建知识
tags:
- 知识管理
+ /knowledge-bases/{id}/move-targets:
+ get:
+ description: 返回与源知识库 Type 一致、EmbeddingModelID 一致、非临时且不是自身的目标知识库列表
+ parameters:
+ - description: 源知识库 ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 可移动目标列表
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 知识库不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取可移动目标知识库列表
+ tags:
+ - 知识库
/knowledge-bases/{id}/pin:
put:
consumes:
@@ -7122,27 +8236,57 @@ paths:
- application/json
description: 根据ID列表批量获取知识条目。可选 kb_id:指定时按该知识库校验权限并用于共享知识库的租户解析;可选 agent_id:使用共享智能体时传此参数,后端按智能体所属租户查询(用于刷新后恢复共享知识库下的文件)
parameters:
- - collectionFormat: csv
- description: 知识ID列表
- in: query
- items:
- type: string
- name: ids
+ - collectionFormat: csv
+ description: 知识ID列表
+ in: query
+ items:
+ type: string
+ name: ids
+ required: true
+ type: array
+ - description: 可选,知识库ID(用于共享知识库时指定范围)
+ in: query
+ name: kb_id
+ type: string
+ - description: 可选,共享智能体ID(用于按智能体租户批量拉取文件详情)
+ in: query
+ name: agent_id
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 知识列表
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 批量获取知识
+ tags:
+ - 知识管理
+ /knowledge/batch-delete:
+ post:
+ consumes:
+ - application/json
+ description: 按 ID 列表批量删除单个知识库下的多个知识条目
+ parameters:
+ - description: 批量删除请求
+ in: body
+ name: request
required: true
- type: array
- - description: 可选,知识库ID(用于共享知识库时指定范围)
- in: query
- name: kb_id
- type: string
- - description: 可选,共享智能体ID(用于按智能体租户批量拉取文件详情)
- in: query
- name: agent_id
- type: string
+ schema:
+ $ref: '#/definitions/internal_handler.BatchDeleteKnowledgeRequest'
produces:
- application/json
responses:
"200":
- description: 知识列表
+ description: 删除成功
schema:
additionalProperties: true
type: object
@@ -7150,10 +8294,14 @@ paths:
description: 请求参数错误
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ description: 权限不足
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 批量获取知识
+ summary: 批量删除知识
tags:
- 知识管理
/knowledge/image/{id}/{chunk_id}:
@@ -7234,6 +8382,61 @@ paths:
summary: 更新手工知识
tags:
- 知识管理
+ /knowledge/move:
+ post:
+ consumes:
+ - application/json
+ description: 将一条或多条知识从源知识库移动到目标知识库(异步),返回任务 ID 用于查询进度
+ parameters:
+ - description: '{source_kb_id, target_kb_id, knowledge_ids}'
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.MoveKnowledgeRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 任务信息
+ schema:
+ $ref: '#/definitions/internal_handler.MoveKnowledgeResponse'
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 移动知识到其他知识库
+ tags:
+ - 知识
+ /knowledge/move/progress/{task_id}:
+ get:
+ description: 按任务 ID 查询移动进度
+ parameters:
+ - description: 移动任务 ID
+ in: path
+ name: task_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 进度信息
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress'
+ "404":
+ description: 任务不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取知识移动进度
+ tags:
+ - 知识
/knowledge/search:
get:
consumes:
@@ -7510,6 +8713,51 @@ paths:
summary: 测试MCP服务连接
tags:
- MCP服务
+ /mcp-services/{id}/tool-approvals/{tool_name}:
+ put:
+ consumes:
+ - application/json
+ description: 为指定 MCP 服务下的某个工具设置/更新审批要求
+ parameters:
+ - description: MCP 服务 ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 工具名
+ in: path
+ name: tool_name
+ required: true
+ type: string
+ - description: '{require_approval: bool}'
+ in: body
+ name: request
+ required: true
+ schema:
+ additionalProperties: true
+ type: object
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 更新结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: MCP 服务或工具不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 设置 MCP 工具人工审批策略
+ tags:
+ - MCP服务
/mcp-services/{id}/tools:
get:
consumes:
@@ -7827,6 +9075,28 @@ paths:
summary: 获取模型厂商列表
tags:
- 模型管理
+ /models/weknoracloud/status:
+ get:
+ description: 检查当前租户的 WeKnoraCloud 凭证是否完好;needs_reinit=true 表示需要重新保存
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 凭证状态
+ schema:
+ additionalProperties: true
+ type: object
+ "500":
+ description: 服务器错误
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 检查 WeKnoraCloud 凭证状态
+ tags:
+ - WeKnoraCloud
/organizations:
get:
description: 获取当前用户所属的所有组织,并附带各空间内知识库/智能体数量
@@ -7952,6 +9222,33 @@ paths:
summary: 更新组织
tags:
- 组织管理
+ /organizations/{id}/agent-shares:
+ get:
+ description: 返回所有被共享到指定组织的智能体(含我的有效权限)
+ parameters:
+ - description: 组织 ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 智能体共享列表 + total
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: 非组织成员
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取共享到本组织的智能体
+ tags:
+ - 组织
/organizations/{id}/invite:
post:
consumes:
@@ -8471,7 +9768,7 @@ paths:
get:
consumes:
- application/json
- description: 获取当前租户的会话列表,支持分页
+ description: 获取当前租户的会话列表,支持分页、关键字搜索、按来源/Agent 筛选
parameters:
- description: 页码
in: query
@@ -8481,6 +9778,18 @@ paths:
in: query
name: page_size
type: integer
+ - description: 标题模糊搜索
+ in: query
+ name: keyword
+ type: string
+ - description: 来源过滤:web / feishu / wechat / slack / ...
+ in: query
+ name: source
+ type: string
+ - description: 按 Agent 过滤(仅对 IM 会话生效)
+ in: query
+ name: agent_id
+ type: string
produces:
- application/json
responses:
@@ -8652,6 +9961,33 @@ paths:
summary: 清空会话消息
tags:
- 会话
+ /sessions/{id}/pin:
+ delete:
+ description: 取消指定会话的置顶
+ parameters:
+ - description: 会话ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 取消置顶成功
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: 会话不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 取消置顶会话
+ tags:
+ - 会话
/sessions/{session_id}/agent-qa:
post:
consumes:
@@ -8687,75 +10023,68 @@ paths:
summary: Agent问答
tags:
- 问答
- /sessions/{session_id}/continue:
- get:
+ /sessions/{session_id}/knowledge-qa:
+ post:
consumes:
- application/json
- description: 继续获取正在进行的流式响应
+ description: 基于知识库的问答(使用LLM总结),支持SSE流式响应
parameters:
- description: 会话ID
in: path
name: session_id
required: true
type: string
- - description: 消息ID
- in: query
- name: message_id
+ - description: 问答请求
+ in: body
+ name: request
required: true
- type: string
+ schema:
+ $ref: '#/definitions/internal_handler_session.CreateKnowledgeQARequest'
produces:
- text/event-stream
responses:
"200":
- description: 流式响应
+ description: 问答结果(SSE流)
schema:
additionalProperties: true
type: object
- "404":
- description: 会话或消息不存在
+ "400":
+ description: 请求参数错误
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 继续流式响应
+ summary: 知识问答
tags:
- 问答
- /sessions/{session_id}/knowledge-qa:
+ /sessions/{session_id}/pin:
post:
- consumes:
- - application/json
- description: 基于知识库的问答(使用LLM总结),支持SSE流式响应
+ description: 将指定会话置顶(用户维度)
parameters:
- description: 会话ID
in: path
name: session_id
required: true
type: string
- - description: 问答请求
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/internal_handler_session.CreateKnowledgeQARequest'
produces:
- - text/event-stream
+ - application/json
responses:
"200":
- description: 问答结果(SSE流)
+ description: 置顶成功
schema:
additionalProperties: true
type: object
- "400":
- description: 请求参数错误
+ "404":
+ description: 会话不存在
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 知识问答
+ summary: 置顶会话
tags:
- - 问答
+ - 会话
/sessions/{session_id}/stop:
post:
consumes:
@@ -8856,6 +10185,40 @@ paths:
summary: 批量删除会话
tags:
- 会话
+ /sessions/continue-stream/{session_id}:
+ get:
+ consumes:
+ - application/json
+ description: 继续获取正在进行的流式响应
+ parameters:
+ - description: 会话ID
+ in: path
+ name: session_id
+ required: true
+ type: string
+ - description: 消息ID
+ in: query
+ name: message_id
+ required: true
+ type: string
+ produces:
+ - text/event-stream
+ responses:
+ "200":
+ description: 流式响应
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: 会话或消息不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 继续流式响应
+ tags:
+ - 问答
/sessions/search:
post:
consumes:
@@ -8872,20 +10235,41 @@ paths:
- application/json
responses:
"200":
- description: 搜索结果
+ description: 搜索结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 知识搜索
+ tags:
+ - 问答
+ /shared-agents:
+ get:
+ description: 返回所有共享给当前用户所在组织的智能体
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 智能体列表 + total
schema:
additionalProperties: true
type: object
- "400":
- description: 请求参数错误
+ "500":
+ description: 服务器错误
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
- summary: 知识搜索
+ summary: 获取我可访问的共享智能体
tags:
- - 问答
+ - 组织
/shared-knowledge-bases:
get:
description: 获取通过组织共享给当前用户的所有知识库
@@ -9169,6 +10553,38 @@ paths:
summary: 更新租户
tags:
- 租户管理
+ /tenants/{id}/api-key:
+ post:
+ consumes:
+ - application/json
+ description: 为指定租户生成一个新的 API Key,旧 Key 立即失效
+ parameters:
+ - description: 租户ID
+ in: path
+ name: id
+ required: true
+ type: integer
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 新生成的 API Key
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ description: 权限不足
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 重置租户 API Key
+ tags:
+ - 租户管理
/tenants/all:
get:
consumes:
@@ -9651,6 +11067,283 @@ paths:
summary: List vector store types
tags:
- VectorStore
+ /web-search-providers/{id}:
+ delete:
+ description: 删除指定 provider 配置
+ parameters:
+ - description: Provider ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 'success: true'
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: Provider 不存在
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 删除网络搜索 Provider
+ tags:
+ - 网络搜索
+ get:
+ description: 根据 ID 获取指定 provider 配置
+ parameters:
+ - description: Provider ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: Provider 详情
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity'
+ "404":
+ description: Provider 不存在
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取网络搜索 Provider 详情
+ tags:
+ - 网络搜索
+ put:
+ consumes:
+ - application/json
+ description: 更新指定 provider 的名称/描述/参数/是否默认
+ parameters:
+ - description: Provider ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 更新字段
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.UpdateProviderRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 更新后的 Provider
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity'
+ "400":
+ description: 请求参数错误
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: Provider 不存在
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 更新网络搜索 Provider
+ tags:
+ - 网络搜索
+ /web-search-providers/{id}/test:
+ post:
+ description: 使用数据库中已保存的凭证测试连通性
+ parameters:
+ - description: Provider ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 测试结果
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: Provider 不存在
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 测试已保存的 Provider
+ tags:
+ - 网络搜索
+ /web-search-providers/test:
+ post:
+ consumes:
+ - application/json
+ description: 使用前端表单中尚未保存的凭证测试连通性,用于"测试连接"按钮
+ parameters:
+ - description: '{provider, parameters}'
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.TestProviderRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 测试结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 使用原始凭证测试 Provider(不落库)
+ tags:
+ - 网络搜索
+ /web-search-providers/types:
+ get:
+ description: 返回 UI 表单需要的 provider 类型及参数定义
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: provider 类型列表
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取网络搜索 Provider 类型元数据
+ tags:
+ - 网络搜索
+ /web-search/providers:
+ get:
+ description: 返回所有已注册的网络搜索 provider(含元数据)
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: provider 列表
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取可用网络搜索 Provider 列表
+ tags:
+ - 网络搜索
+ /wechat/qrcode:
+ post:
+ description: 申请一个用于扫码登录绑定的微信二维码(无请求体)
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 二维码信息(qrcode_url + qrcode 标识)
+ schema:
+ additionalProperties: true
+ type: object
+ "500":
+ description: 二维码生成失败
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取微信扫码登录二维码
+ tags:
+ - IM 渠道
+ /wechat/qrcode/status:
+ post:
+ consumes:
+ - application/json
+ description: 查询指定二维码是否已被扫描/确认/过期;confirmed 时返回凭证
+ parameters:
+ - description: '{qrcode: string}'
+ in: body
+ name: request
+ required: true
+ schema:
+ additionalProperties: true
+ type: object
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 扫码状态
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ additionalProperties: true
+ type: object
+ "500":
+ description: 服务器错误
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 轮询微信二维码状态
+ tags:
+ - IM 渠道
+ /weknoracloud/credentials:
+ post:
+ consumes:
+ - application/json
+ description: 保存 APPID/APPSECRET 到当前租户配置(不自动创建模型)
+ parameters:
+ - description: '{app_id, app_secret}'
+ in: body
+ name: request
+ required: true
+ schema:
+ additionalProperties: true
+ type: object
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 'success: true'
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 保存 WeKnoraCloud 凭证
+ tags:
+ - WeKnoraCloud
securityDefinitions:
ApiKeyAuth:
description: 租户身份认证:输入 sk- 开头的 API Key