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(swagger): document the real request and response types (#4304)

lyingbug234aa948db29
diff --git a/.golangci.yml b/.golangci.yml
index 86a590755..14b8656c0 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -12,6 +12,12 @@ linters:
paths:
# swag embeds OpenAPI as single-line JSON strings; line-length is not meaningful.
- docs/docs\.go$
+ rules:
+ # swag annotations and struct tags cannot wrap, so a parameter with its
+ # enum list, a composed response type or a field's swag tags have to
+ # stay on one line.
+ - linters: [lll]
+ source: '^\s*// @(Param|Success|Failure|x-)|(swaggertype|extensions):"'
formatters:
enable:
- gofmt
diff --git a/Makefile b/Makefile
index 616c59627..69c328ad9 100644
--- a/Makefile
+++ b/Makefile
@@ -257,7 +257,7 @@ migrate-goto:
docs:
@echo "生成 Swagger API 文档..."
swag init -g $(MAIN_PATH)/main.go -o ./docs --parseDependency --parseInternal \
- --exclude ./internal/localsandbox
+ --exclude ./internal/localsandbox --overridesFile ./docs/swag.overrides
@echo "文档已生成到 ./docs 目录"
@echo "启动服务后访问 http://localhost:8080/swagger/index.html 查看文档"
diff --git a/docs/docs.go b/docs/docs.go
index 5c5bd2106..45ed7276b 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -71,10 +71,9 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "SSE 事件流",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "string"
}
},
"400": {
@@ -127,8 +126,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -173,13 +171,75 @@ const docTemplate = `{
"responses": {
"200": {
"description": "OK",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/agent/prompts/{prompt_id}": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "回答 Agent 运行中发起的交互(ask_user 提问或工具审批)。\nkind 须与交互一致,response 为该类型的回答 JSON(不接受未知字段):\nask_user 为 {selected?, values?, text?, declined?};\ntool_approval 为 {approved: bool, modified_args?: object, reason?: string}。\n返回 resumed=true 表示运行已挂起并在本次回答后恢复,客户端需重新接入该消息的事件流",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Agent"
+ ],
+ "summary": "回答 Agent 的交互请求",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "交互 ID(事件中的 pending_id)",
+ "name": "prompt_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "{kind: \\",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{success: true, resumed: bool}",
"schema": {
"type": "object",
"additionalProperties": true
}
},
+ "400": {
+ "description": "回答不合法或交互已结束",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
"404": {
- "description": "Not Found",
+ "description": "交互不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -271,12 +331,23 @@ const docTemplate = `{
"智能体"
],
"summary": "获取智能体列表",
+ "parameters": [
+ {
+ "enum": [
+ "mine",
+ "others"
+ ],
+ "type": "string",
+ "description": "创建者过滤,仅 mine 与 others 生效",
+ "name": "creator",
+ "in": "query"
+ }
+ ],
"responses": {
"200": {
"description": "智能体列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListAgentsResponse"
}
},
"500": {
@@ -322,8 +393,7 @@ const docTemplate = `{
"201": {
"description": "创建的智能体",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.AgentWriteResponse"
}
},
"400": {
@@ -360,8 +430,19 @@ const docTemplate = `{
"200": {
"description": "占位符定义",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.PlaceholderGroups"
+ }
+ }
+ }
+ ]
}
}
}
@@ -392,8 +473,19 @@ const docTemplate = `{
"200": {
"description": "工具目录",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.AgentToolCatalog"
+ }
+ }
+ }
+ ]
}
}
}
@@ -424,8 +516,22 @@ const docTemplate = `{
"200": {
"description": "预设列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetEntry"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -465,8 +571,19 @@ const docTemplate = `{
"200": {
"description": "智能体详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -525,8 +642,7 @@ const docTemplate = `{
"200": {
"description": "更新后的智能体",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.AgentWriteResponse"
}
},
"400": {
@@ -576,8 +692,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -635,8 +750,19 @@ const docTemplate = `{
"201": {
"description": "复制成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -692,8 +818,7 @@ const docTemplate = `{
"200": {
"description": "success: true",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -763,8 +888,19 @@ const docTemplate = `{
"200": {
"description": "推荐问题列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.SuggestedQuestionsData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -966,8 +1102,7 @@ const docTemplate = `{
"200": {
"description": "修改成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -996,8 +1131,7 @@ const docTemplate = `{
"200": {
"description": "认证配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.GetAuthConfigResponse"
}
}
}
@@ -1105,8 +1239,7 @@ const docTemplate = `{
"200": {
"description": "登出成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -1140,8 +1273,19 @@ const docTemplate = `{
"200": {
"description": "用户信息",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.CurrentUserData"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -1186,8 +1330,19 @@ const docTemplate = `{
"200": {
"description": "更新后的偏好",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -1359,8 +1514,7 @@ const docTemplate = `{
"200": {
"description": "新令牌",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.RefreshTokenResponse"
}
},
"401": {
@@ -1557,8 +1711,7 @@ const docTemplate = `{
"200": {
"description": "令牌有效",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ValidateTokenResponse"
}
},
"401": {
@@ -1667,8 +1820,19 @@ const docTemplate = `{
"200": {
"description": "分块详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Chunk"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -1734,8 +1898,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -1763,7 +1926,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取指定知识下的所有分块列表,支持分页",
+ "description": "获取指定知识下的所有分块列表,支持分页。chunk_type 可重复,缺省 text\n取值 text, parent_text, image_ocr, image_caption, image_vector, summary, entity,\nrelationship, faq, web_search, table_summary, table_column, wiki_page",
"consumes": [
"application/json"
],
@@ -1783,6 +1946,7 @@ const docTemplate = `{
"required": true
},
{
+ "minimum": 1,
"type": "integer",
"default": 1,
"description": "页码",
@@ -1790,19 +1954,45 @@ const docTemplate = `{
"in": "query"
},
{
+ "maximum": 100,
+ "minimum": 1,
"type": "integer",
"default": 10,
"description": "每页数量",
"name": "page_size",
"in": "query"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "multi",
+ "description": "分块类型,可重复,缺省 text",
+ "name": "chunk_type",
+ "in": "query"
}
],
"responses": {
"200": {
"description": "分块列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.PageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Chunk"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -1846,8 +2036,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -1909,8 +2098,7 @@ const docTemplate = `{
"200": {
"description": "更新后的分块",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.UpdateChunkResponse"
}
},
"400": {
@@ -1967,8 +2155,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -2630,8 +2817,19 @@ const docTemplate = `{
"200": {
"description": "评估结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationDetail"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -2677,8 +2875,19 @@ const docTemplate = `{
"200": {
"description": "评估任务",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationDetail"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -2724,8 +2933,19 @@ const docTemplate = `{
"200": {
"description": "导入进度",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQImportProgress"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -2781,8 +3001,7 @@ const docTemplate = `{
"200": {
"description": "更新后的渠道",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.UpdateIMChannelResponse"
}
},
"400": {
@@ -2831,8 +3050,7 @@ const docTemplate = `{
"200": {
"description": "success: true",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -2883,8 +3101,7 @@ const docTemplate = `{
"200": {
"description": "更新后的渠道",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.UpdateIMChannelResponse"
}
},
"400": {
@@ -2996,6 +3213,46 @@ const docTemplate = `{
}
}
},
+ "/image-attrs/schema": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回当前版本的图片属性注册表、提示词版本和默认动作。全局只读,不绑定知识库。",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "获取图片属性字典",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.ImageAttrSchemaData"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/initialization/asr/check": {
"post": {
"security": [
@@ -3133,8 +3390,7 @@ const docTemplate = `{
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -3218,8 +3474,19 @@ const docTemplate = `{
"200": {
"description": "生成的标签",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.FabriTagResponse"
+ }
+ }
+ }
+ ]
}
}
}
@@ -3261,8 +3528,19 @@ const docTemplate = `{
"200": {
"description": "生成的文本",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.FabriTextResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -3310,8 +3588,19 @@ const docTemplate = `{
"200": {
"description": "提取结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TextRelationExtractionResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -3493,8 +3782,19 @@ const docTemplate = `{
"200": {
"description": "下载进度",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.DownloadTask"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -3531,8 +3831,22 @@ const docTemplate = `{
"200": {
"description": "任务列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.DownloadTask"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -3836,14 +4150,44 @@ const docTemplate = `{
"description": "共享智能体 ID(传入时返回该智能体可用的知识库)",
"name": "agent_id",
"in": "query"
+ },
+ {
+ "enum": [
+ "mine",
+ "others"
+ ],
+ "type": "string",
+ "description": "按创建者过滤,仅 mine 与 others 生效",
+ "name": "creator",
+ "in": "query"
}
],
"responses": {
"200": {
"description": "知识库列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ }
+ ]
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"500": {
@@ -3889,8 +4233,19 @@ const docTemplate = `{
"201": {
"description": "创建的知识库",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -3898,6 +4253,12 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -3938,8 +4299,19 @@ const docTemplate = `{
"200": {
"description": "任务ID",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -3947,6 +4319,18 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "401": {
+ "description": "未认证",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -3985,8 +4369,25 @@ const docTemplate = `{
"200": {
"description": "进度信息",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneProgress"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
@@ -4038,8 +4439,19 @@ const docTemplate = `{
"200": {
"description": "知识库详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4048,6 +4460,12 @@ const docTemplate = `{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
+ "403": {
+ "description": "无权访问知识库",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
"404": {
"description": "知识库不存在",
"schema": {
@@ -4098,8 +4516,19 @@ const docTemplate = `{
"200": {
"description": "更新后的知识库",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4107,6 +4536,18 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
},
@@ -4143,8 +4584,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -4152,6 +4592,18 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "仅所有者可删除",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -4163,7 +4615,7 @@ const docTemplate = `{
"Bearer": []
}
],
- "description": "返回知识库的重要变更与后台任务入口。仅知识库创建者或所属空间管理员可读,共享空间不可读。",
+ "description": "返回知识库的重要变更与后台任务入口。仅知识库创建者或所属空间管理员可读,共享空间不可读。\n按 id 倒序;把 next_cursor 作为 after_id 取下一页,返回空列表表示没有更多。",
"produces": [
"application/json"
],
@@ -4186,20 +4638,31 @@ const docTemplate = `{
"in": "query"
},
{
+ "maximum": 100,
+ "minimum": 1,
"type": "integer",
- "description": "页大小,1-100,默认 50",
+ "default": 50,
+ "description": "页大小",
"name": "limit",
"in": "query"
},
{
"type": "string",
- "description": "按 action 精确过滤",
+ "description": "按 action 精确过滤,如 knowledge.deleted",
"name": "action",
"in": "query"
},
{
+ "enum": [
+ "success",
+ "accepted",
+ "partial",
+ "failed",
+ "denied",
+ "canceled"
+ ],
"type": "string",
- "description": "按 outcome 精确过滤",
+ "description": "结果过滤",
"name": "outcome",
"in": "query"
},
@@ -4218,7 +4681,13 @@ const docTemplate = `{
}
},
"403": {
- "description": "Forbidden",
+ "description": "非创建者或管理员,或知识库来自其他空间",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4257,8 +4726,19 @@ const docTemplate = `{
"201": {
"description": "创建后的知识库副本",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.DuplicateKnowledgeBaseData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4266,6 +4746,18 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -4352,8 +4844,19 @@ const docTemplate = `{
"200": {
"description": "FAQ列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PageResult"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4406,8 +4909,19 @@ const docTemplate = `{
"200": {
"description": "任务ID",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TaskIDData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4468,8 +4982,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -4577,8 +5090,7 @@ const docTemplate = `{
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -4633,8 +5145,7 @@ const docTemplate = `{
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -4687,8 +5198,19 @@ const docTemplate = `{
"200": {
"description": "FAQ条目详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4754,8 +5276,19 @@ const docTemplate = `{
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4817,8 +5350,19 @@ const docTemplate = `{
"200": {
"description": "更新后的FAQ条目",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4879,8 +5423,19 @@ const docTemplate = `{
"200": {
"description": "创建的FAQ条目",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4935,8 +5490,7 @@ const docTemplate = `{
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -4997,8 +5551,22 @@ const docTemplate = `{
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5064,8 +5632,7 @@ const docTemplate = `{
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.HybridSearchResponse"
}
},
"400": {
@@ -5073,6 +5640,12 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
},
@@ -5129,8 +5702,7 @@ const docTemplate = `{
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.HybridSearchResponse"
}
},
"400": {
@@ -5138,6 +5710,12 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -5236,8 +5814,22 @@ const docTemplate = `{
"200": {
"description": "图片资产分页列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.PageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAsset"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5289,8 +5881,22 @@ const docTemplate = `{
"200": {
"description": "图片资产分页列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.PageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAsset"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5312,7 +5918,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的知识列表,支持分页和筛选",
+ "description": "获取知识库下的知识列表,支持分页和筛选\n不传 parse_status 时不返回删除中(deleting)的文档。",
"consumes": [
"application/json"
],
@@ -5332,13 +5938,18 @@ const docTemplate = `{
"required": true
},
{
+ "minimum": 1,
"type": "integer",
+ "default": 1,
"description": "页码",
"name": "page",
"in": "query"
},
{
+ "maximum": 1000,
+ "minimum": 1,
"type": "integer",
+ "default": 20,
"description": "每页数量",
"name": "page_size",
"in": "query"
@@ -5362,8 +5973,17 @@ const docTemplate = `{
"in": "query"
},
{
+ "enum": [
+ "pending",
+ "processing",
+ "finalizing",
+ "completed",
+ "failed",
+ "cancelled",
+ "deleting"
+ ],
"type": "string",
- "description": "解析状态筛选 (pending/processing/completed/failed)",
+ "description": "状态",
"name": "parse_status",
"in": "query"
},
@@ -5398,14 +6018,25 @@ const docTemplate = `{
"in": "query"
},
{
+ "enum": [
+ "created_at",
+ "updated_at",
+ "file_name"
+ ],
"type": "string",
- "description": "排序字段: updated_at/created_at/file_name,默认 created_at",
+ "default": "created_at",
+ "description": "排序字段",
"name": "sort_by",
"in": "query"
},
{
+ "enum": [
+ "asc",
+ "desc"
+ ],
"type": "string",
- "description": "排序方向: asc/desc,默认 desc",
+ "default": "desc",
+ "description": "排序方向",
"name": "sort_order",
"in": "query"
}
@@ -5414,8 +6045,22 @@ const docTemplate = `{
"200": {
"description": "知识列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.PageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5423,6 +6068,12 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "无权访问知识库",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
},
@@ -5459,8 +6110,7 @@ const docTemplate = `{
"200": {
"description": "清空任务已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SubmittedTaskResponse"
}
},
"400": {
@@ -5634,8 +6284,19 @@ const docTemplate = `{
"200": {
"description": "创建的知识",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5688,8 +6349,19 @@ const docTemplate = `{
"200": {
"description": "目录树",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeFolderTree"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5742,8 +6414,19 @@ const docTemplate = `{
"200": {
"description": "重命名成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.FolderMoveData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5804,8 +6487,19 @@ const docTemplate = `{
"200": {
"description": "创建的知识",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5883,8 +6577,19 @@ const docTemplate = `{
"201": {
"description": "创建的知识",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5934,8 +6639,22 @@ const docTemplate = `{
"200": {
"description": "可移动目标列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5944,6 +6663,18 @@ const docTemplate = `{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
+ "401": {
+ "description": "未认证",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
"404": {
"description": "知识库不存在",
"schema": {
@@ -5987,8 +6718,25 @@ const docTemplate = `{
"200": {
"description": "更新后的知识库",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
@@ -5996,6 +6744,12 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -6031,8 +6785,19 @@ const docTemplate = `{
"200": {
"description": "生成的知识库画像",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6040,6 +6805,18 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -6116,8 +6893,19 @@ const docTemplate = `{
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -6176,8 +6964,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -6219,8 +7006,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -6284,8 +7070,19 @@ const docTemplate = `{
"200": {
"description": "标签列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PageResult"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6349,8 +7146,19 @@ const docTemplate = `{
"200": {
"description": "创建的标签",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeTag"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6412,8 +7220,19 @@ const docTemplate = `{
"200": {
"description": "更新后的标签",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeTag"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6484,8 +7303,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -6549,10 +7367,9 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "SSE 事件流",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "string"
}
},
"400": {
@@ -6674,8 +7491,22 @@ const docTemplate = `{
"200": {
"description": "知识列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6723,8 +7554,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SubmittedTaskResponse"
}
},
"400": {
@@ -6778,8 +7608,7 @@ const docTemplate = `{
"200": {
"description": "任务已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SubmittedTaskResponse"
}
},
"400": {
@@ -6833,8 +7662,19 @@ const docTemplate = `{
"200": {
"description": "移动成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.FolderMoveData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6907,8 +7747,7 @@ const docTemplate = `{
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -6963,8 +7802,19 @@ const docTemplate = `{
"200": {
"description": "更新后的知识",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -7133,8 +7983,7 @@ const docTemplate = `{
"200": {
"description": "Search results",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.KnowledgeSearchKnowledgeResponse"
}
},
"400": {
@@ -7182,8 +8031,7 @@ const docTemplate = `{
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -7229,8 +8077,19 @@ const docTemplate = `{
"200": {
"description": "知识详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -7239,6 +8098,12 @@ const docTemplate = `{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
+ "403": {
+ "description": "无权访问所属知识库",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
"404": {
"description": "知识不存在",
"schema": {
@@ -7289,8 +8154,7 @@ const docTemplate = `{
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.UpdateKnowledgeResponse"
}
},
"400": {
@@ -7332,14 +8196,37 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "任务已提交,返回 task_id",
+ "description": "任务已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataMessageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TaskIDData"
+ }
+ }
+ }
+ ]
}
},
"400": {
- "description": "请求参数错误",
+ "description": "请求参数错误或知识正在移动",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "需要编辑权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -7381,8 +8268,19 @@ const docTemplate = `{
"200": {
"description": "取消已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataMessageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -7531,11 +8429,11 @@ const docTemplate = `{
"required": true
},
{
- "description": "可选的处理配置覆盖:{\\",
+ "description": "可选;不传则沿用上传时的处理配置",
"name": "body",
"in": "body",
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.ReparseKnowledgeRequest"
}
}
],
@@ -7543,8 +8441,19 @@ const docTemplate = `{
"200": {
"description": "重新解析任务已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataMessageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -7558,6 +8467,12 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "知识不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -7592,8 +8507,9 @@ const docTemplate = `{
"required": true
},
{
+ "minimum": 1,
"type": "integer",
- "description": "指定尝试号;省略=最新",
+ "description": "指定尝试号;省略或非正数=最新",
"name": "attempt",
"in": "query"
}
@@ -7602,8 +8518,31 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeSpansData"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "403": {
+ "description": "无权访问所属知识库",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -7637,8 +8576,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.AutoFixResponse"
}
}
}
@@ -8008,8 +8946,13 @@ const docTemplate = `{
"in": "query"
},
{
+ "enum": [
+ "pending",
+ "ignored",
+ "resolved"
+ ],
"type": "string",
- "description": "Filter by status (pending, ignored, resolved)",
+ "description": "Filter by status",
"name": "status",
"in": "query"
}
@@ -8023,6 +8966,18 @@ const docTemplate = `{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageIssue"
}
}
+ },
+ "400": {
+ "description": "Not a Wiki knowledge base, or no access",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
+ },
+ "500": {
+ "description": "Internal Server Error",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
}
}
}
@@ -8119,6 +9074,18 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintReport"
}
+ },
+ "400": {
+ "description": "Not a Wiki knowledge base, or no access",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
+ },
+ "500": {
+ "description": "Internal Server Error",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
}
}
}
@@ -8470,6 +9437,9 @@ const docTemplate = `{
}
],
"description": "Re-parse all pages and rebuild bidirectional link references",
+ "produces": [
+ "application/json"
+ ],
"tags": [
"Wiki"
],
@@ -8487,10 +9457,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "$ref": "#/definitions/internal_handler.WikiMessageResponse"
+ }
+ },
+ "400": {
+ "description": "Not a Wiki knowledge base, or no access",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
+ },
+ "500": {
+ "description": "Internal Server Error",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
}
}
}
@@ -8705,6 +9684,18 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiStats"
}
+ },
+ "400": {
+ "description": "Not a Wiki knowledge base, or no access",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
+ },
+ "500": {
+ "description": "Internal Server Error",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
}
}
}
@@ -8947,8 +9938,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"404": {
@@ -9045,8 +10035,22 @@ const docTemplate = `{
"200": {
"description": "MCP服务列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9098,8 +10102,19 @@ const docTemplate = `{
"200": {
"description": "创建的MCP服务",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9179,8 +10194,19 @@ const docTemplate = `{
"200": {
"description": "MCP服务详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -9233,10 +10259,21 @@ const docTemplate = `{
"200": {
"description": "更新后的MCP服务",
"schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse"
+ }
+ }
+ }
+ ]
+ }
+ },
"400": {
"description": "请求参数错误",
"schema": {
@@ -9278,8 +10315,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"500": {
@@ -9335,8 +10371,19 @@ const docTemplate = `{
"200": {
"description": "写入后的凭据状态",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialsResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9584,8 +10631,19 @@ const docTemplate = `{
"200": {
"description": "与 oauth/status 相同",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_mcp.OAuthAuthorizationStatus"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9763,8 +10821,22 @@ const docTemplate = `{
"200": {
"description": "资源列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPResource"
+ }
+ }
+ }
+ }
+ ]
}
},
"500": {
@@ -9810,8 +10882,19 @@ const docTemplate = `{
"200": {
"description": "测试结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTestResult"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9874,8 +10957,7 @@ const docTemplate = `{
"200": {
"description": "更新结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -9927,8 +11009,22 @@ const docTemplate = `{
"200": {
"description": "工具列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTool"
+ }
+ }
+ }
+ }
+ ]
}
},
"500": {
@@ -9959,8 +11055,22 @@ const docTemplate = `{
"200": {
"description": "One group per sandbox config",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.ConfigEnvGroup"
+ }
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -10006,8 +11116,7 @@ const docTemplate = `{
"200": {
"description": "Stored",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -10050,8 +11159,7 @@ const docTemplate = `{
"200": {
"description": "Deleted",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"404": {
@@ -10096,8 +11204,7 @@ const docTemplate = `{
"200": {
"description": "Stored",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -10140,8 +11247,7 @@ const docTemplate = `{
"200": {
"description": "Deleted",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"404": {
@@ -10322,8 +11428,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10348,8 +11453,19 @@ const docTemplate = `{
"200": {
"description": "整理结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConsolidationResult"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10389,8 +11505,7 @@ const docTemplate = `{
"200": {
"description": "文档列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListDocumentsResponse"
}
}
}
@@ -10424,8 +11539,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10450,8 +11564,7 @@ const docTemplate = `{
"200": {
"description": "记忆导出",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ExportResponse"
}
}
}
@@ -10503,8 +11616,7 @@ const docTemplate = `{
"200": {
"description": "记忆列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListItemsResponse"
}
}
}
@@ -10541,8 +11653,19 @@ const docTemplate = `{
"200": {
"description": "新增的记忆",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10565,8 +11688,7 @@ const docTemplate = `{
"200": {
"description": "清空成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ClearResponse"
}
}
}
@@ -10612,8 +11734,19 @@ const docTemplate = `{
"200": {
"description": "更新后的记忆",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10645,8 +11778,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10680,8 +11812,19 @@ const docTemplate = `{
"200": {
"description": "确认成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10715,8 +11858,7 @@ const docTemplate = `{
"200": {
"description": "否决成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10741,8 +11883,19 @@ const docTemplate = `{
"200": {
"description": "记忆设置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemorySettings"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10779,8 +11932,19 @@ const docTemplate = `{
"200": {
"description": "更新后的设置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemorySettings"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10820,8 +11984,7 @@ const docTemplate = `{
"200": {
"description": "主题列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListTopicsResponse"
}
}
}
@@ -10855,8 +12018,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10890,8 +12052,19 @@ const docTemplate = `{
"200": {
"description": "新增的记忆",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10922,8 +12095,19 @@ const docTemplate = `{
"200": {
"description": "统计信息",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryKBStats"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10965,8 +12149,19 @@ const docTemplate = `{
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSearchResult"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11036,8 +12231,22 @@ const docTemplate = `{
"200": {
"description": "消息列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Message"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11090,8 +12299,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"500": {
@@ -11128,8 +12336,22 @@ const docTemplate = `{
"200": {
"description": "模型列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11175,8 +12397,19 @@ const docTemplate = `{
"201": {
"description": "创建的模型",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11280,8 +12513,22 @@ const docTemplate = `{
"200": {
"description": "厂商列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.ModelProviderDTO"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -11309,8 +12556,7 @@ const docTemplate = `{
"200": {
"description": "凭证状态",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudStatusResult"
}
},
"500": {
@@ -11357,8 +12603,19 @@ const docTemplate = `{
"200": {
"description": "模型详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -11411,8 +12668,19 @@ const docTemplate = `{
"200": {
"description": "更新后的模型",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -11456,8 +12724,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -11518,8 +12785,19 @@ const docTemplate = `{
"201": {
"description": "复制的模型",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11593,8 +12871,19 @@ const docTemplate = `{
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11639,8 +12928,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -11685,8 +12985,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -11731,8 +13042,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationJoinRequest"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11819,8 +13141,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SearchOrganizationsResponse"
}
}
}
@@ -11854,8 +13175,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -11905,8 +13237,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -11941,8 +13284,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12038,8 +13380,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -12126,8 +13467,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListJoinRequestsResponse"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -12186,8 +13538,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12224,8 +13575,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12318,8 +13668,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12361,8 +13710,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12414,8 +13762,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationJoinRequest"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -12461,8 +13820,22 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInviteCandidate"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -12502,8 +13875,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListOrganizationSharedAgentsResponse"
}
}
}
@@ -12537,8 +13909,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListOrganizationSharedKnowledgeBasesResponse"
}
}
}
@@ -12648,8 +14019,19 @@ const docTemplate = `{
"201": {
"description": "Created sandbox config",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.sandboxConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -12699,8 +14081,19 @@ const docTemplate = `{
"200": {
"description": "Sandbox config",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.sandboxConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -12760,8 +14153,19 @@ const docTemplate = `{
"200": {
"description": "Updated sandbox config",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.sandboxConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -12835,8 +14239,7 @@ const docTemplate = `{
"200": {
"description": "Deletion success",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"401": {
@@ -12887,8 +14290,19 @@ const docTemplate = `{
"200": {
"description": "Sandbox inventory",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SandboxInventory"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -12932,8 +14346,22 @@ const docTemplate = `{
"200": {
"description": "Installed skills",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.skillResponse"
+ }
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -13063,8 +14491,19 @@ const docTemplate = `{
"200": {
"description": "Installed skill",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.skillResponse"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -13187,8 +14626,19 @@ const docTemplate = `{
"200": {
"description": "Updated skill",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.skillResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -13251,8 +14701,22 @@ const docTemplate = `{
"200": {
"description": "Skill files",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileEntry"
+ }
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -13316,8 +14780,19 @@ const docTemplate = `{
"200": {
"description": "Skill file",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileContent"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -13501,8 +14976,19 @@ const docTemplate = `{
"200": {
"description": "Stopped skill",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.skillResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -13806,10 +15292,9 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "流式响应",
+ "description": "SSE 事件流",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "string"
}
},
"404": {
@@ -14388,8 +15873,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet"
+ }
+ }
+ }
+ ]
}
}
}
@@ -14442,15 +15938,37 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet"
+ }
+ }
+ }
+ ]
}
},
"202": {
"description": "Accepted",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet"
+ }
+ }
+ }
+ ]
}
}
}
@@ -14882,8 +16400,7 @@ const docTemplate = `{
"200": {
"description": "智能体列表 + total",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListSharedAgentsResponse"
}
},
"500": {
@@ -14914,8 +16431,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListSharedKnowledgeBasesResponse"
}
}
}
@@ -14966,8 +16482,7 @@ const docTemplate = `{
"200": {
"description": "Skills列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListSkillsResponse"
}
},
"403": {
@@ -15051,8 +16566,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -15081,8 +16595,22 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileEntry"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -15117,8 +16645,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileContent"
+ }
+ }
+ }
+ ]
}
}
}
@@ -15179,8 +16718,7 @@ const docTemplate = `{
"200": {
"description": "List of storage backends and default_storage_backend_id",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListResponse"
}
},
"401": {
@@ -15227,8 +16765,19 @@ const docTemplate = `{
"201": {
"description": "Created storage backend",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -15289,8 +16838,7 @@ const docTemplate = `{
"200": {
"description": "Connectivity test result (success, error)",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessErrorResponse"
}
},
"400": {
@@ -15331,8 +16879,22 @@ const docTemplate = `{
"200": {
"description": "List of allowed storage provider types",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -15369,8 +16931,19 @@ const docTemplate = `{
"200": {
"description": "Storage backend details",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -15430,8 +17003,19 @@ const docTemplate = `{
"200": {
"description": "Updated storage backend",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -15485,8 +17069,7 @@ const docTemplate = `{
"200": {
"description": "Deletion success",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -15542,8 +17125,7 @@ const docTemplate = `{
"200": {
"description": "Default set successfully",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -15599,8 +17181,7 @@ const docTemplate = `{
"200": {
"description": "Connectivity test result (success, error)",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessErrorResponse"
}
},
"401": {
@@ -15638,8 +17219,22 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.tenantAPIKeyResponse"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -15676,8 +17271,19 @@ const docTemplate = `{
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.tenantAPIKeyCreateResponse"
+ }
+ }
+ }
+ ]
}
}
}
@@ -15711,8 +17317,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -16171,8 +17776,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.PurgeArchivedRuntimeTasksResponse"
}
}
}
@@ -16398,8 +18002,7 @@ const docTemplate = `{
"200": {
"description": "Reset acknowledged",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -16433,8 +18036,7 @@ const docTemplate = `{
"200": {
"description": "{ affected: int64, quota_bytes: int64 }",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ApplyDefaultStorageQuotaToAllTenantsResponse"
}
},
"500": {
@@ -16586,8 +18188,7 @@ const docTemplate = `{
"200": {
"description": "Password reset successfully",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ResetUserPasswordResponse"
}
},
"400": {
@@ -16642,8 +18243,7 @@ const docTemplate = `{
"200": {
"description": "Status updated",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SetUserStatusResponse"
}
},
"400": {
@@ -16675,10 +18275,9 @@ const docTemplate = `{
"summary": "获取部署能力清单",
"responses": {
"200": {
- "description": "标准 code/msg/data 包装,data 为 DeploymentCapabilitiesData",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.GetDeploymentCapabilitiesResponse"
}
}
}
@@ -16750,8 +18349,7 @@ const docTemplate = `{
"200": {
"description": "解析引擎列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListParserEnginesResponse"
}
}
}
@@ -16897,8 +18495,19 @@ const docTemplate = `{
"200": {
"description": "空间列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TenantListData"
+ }
+ }
+ }
+ ]
}
},
"500": {
@@ -16976,8 +18585,19 @@ const docTemplate = `{
"200": {
"description": "所有空间列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TenantListData"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -17014,8 +18634,19 @@ const docTemplate = `{
"200": {
"description": "提示词模板配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplatesConfig"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17052,8 +18683,19 @@ const docTemplate = `{
"200": {
"description": "网络搜索配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17208,6 +18850,8 @@ const docTemplate = `{
"in": "query"
},
{
+ "maximum": 100,
+ "minimum": 1,
"type": "integer",
"default": 20,
"description": "每页数量",
@@ -17219,8 +18863,19 @@ const docTemplate = `{
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TenantSearchData"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -17266,8 +18921,19 @@ const docTemplate = `{
"200": {
"description": "空间详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17323,8 +18989,19 @@ const docTemplate = `{
"200": {
"description": "更新后的空间",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17365,8 +19042,7 @@ const docTemplate = `{
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -17409,8 +19085,19 @@ const docTemplate = `{
"200": {
"description": "API principal 配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.apiPrincipalConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17466,8 +19153,19 @@ const docTemplate = `{
"200": {
"description": "更新后的配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.apiPrincipalConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17525,8 +19223,19 @@ const docTemplate = `{
"200": {
"description": "短期 JWT",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.apiPrincipalTestTokenResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17710,8 +19419,19 @@ const docTemplate = `{
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInvitationResponse"
+ }
+ }
+ }
+ ]
}
}
}
@@ -17752,8 +19472,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -17799,8 +19518,19 @@ const docTemplate = `{
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInvitationResponse"
+ }
+ }
+ }
+ ]
}
}
}
@@ -17834,8 +19564,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -17987,8 +19716,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -18027,8 +19755,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -18054,8 +19781,22 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserResourceFavorite"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -18080,8 +19821,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -18113,8 +19853,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -18142,10 +19881,24 @@ const docTemplate = `{
"200": {
"description": "List of vector stores (env + DB)",
"schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreResponse"
+ }
+ }
+ }
+ }
+ ]
+ }
+ },
"401": {
"description": "Unauthorized",
"schema": {
@@ -18190,8 +19943,19 @@ const docTemplate = `{
"201": {
"description": "Created vector store",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -18252,8 +20016,7 @@ const docTemplate = `{
"200": {
"description": "Connection test result (success, version)",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.TestStoreRawResponse"
}
},
"400": {
@@ -18284,10 +20047,24 @@ const docTemplate = `{
"summary": "List vector store types",
"responses": {
"200": {
- "description": "List of engine types with config schemas",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreTypeInfo"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -18324,8 +20101,19 @@ const docTemplate = `{
"200": {
"description": "Vector store details",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreResponse"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -18443,8 +20231,7 @@ const docTemplate = `{
"200": {
"description": "Deletion success",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -18502,8 +20289,7 @@ const docTemplate = `{
"200": {
"description": "Connection test result (success, version)",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.TestStoreByIDResponse"
}
},
"401": {
@@ -18559,8 +20345,7 @@ const docTemplate = `{
"200": {
"description": "测试结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessErrorResponse"
}
},
"400": {
@@ -18595,8 +20380,22 @@ const docTemplate = `{
"200": {
"description": "provider 类型列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderTypeInfo"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -18736,8 +20535,7 @@ const docTemplate = `{
"200": {
"description": "success: true",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"404": {
@@ -18781,8 +20579,7 @@ const docTemplate = `{
"200": {
"description": "测试结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessErrorResponse"
}
},
"404": {
@@ -18817,8 +20614,22 @@ const docTemplate = `{
"200": {
"description": "provider 列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderTypeInfo"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -18955,8 +20766,7 @@ const docTemplate = `{
"200": {
"description": "success: true",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -19005,8 +20815,22 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.WikiSearchHit"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -19020,6 +20844,90 @@ const docTemplate = `{
}
},
"definitions": {
+ "github_com_Tencent_WeKnora_internal_agent_tools.AgentToolCatalog": {
+ "type": "object",
+ "properties": {
+ "default_tools": {
+ "description": "DefaultTools apply when an agent's allowed_tools was never set (null).",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "switch_managed_tools": {
+ "description": "SwitchManagedTools follow other agent settings; naming them in the list\ndoes not register them.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tools": {
+ "description": "Tools are the selectable tools, in display order.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.AgentToolInfo"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_agent_tools.AgentToolInfo": {
+ "type": "object",
+ "properties": {
+ "danger": {
+ "description": "Danger marks tools that modify content, which the editor highlights.",
+ "type": "boolean"
+ },
+ "description": {
+ "type": "string"
+ },
+ "group": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "requirement": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.AgentToolRequirement"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_agent_tools.AgentToolRequirement": {
+ "type": "object",
+ "properties": {
+ "all_of": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.KBCapability"
+ }
+ },
+ "any_of": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.KBCapability"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_agent_tools.KBCapability": {
+ "type": "string",
+ "enum": [
+ "vector",
+ "keyword",
+ "wiki",
+ "graph",
+ "faq"
+ ],
+ "x-enum-varnames": [
+ "CapVector",
+ "CapKeyword",
+ "CapWiki",
+ "CapGraph",
+ "CapFAQ"
+ ]
+ },
"github_com_Tencent_WeKnora_internal_application_service.CatalogProviderView": {
"type": "object",
"properties": {
@@ -19145,6 +21053,142 @@ const docTemplate = `{
}
}
},
+ "github_com_Tencent_WeKnora_internal_application_service.ConfigEnvGroup": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "sandbox_config_id": {
+ "type": "string"
+ },
+ "sandbox_config_name": {
+ "type": "string"
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillEnvGroup"
+ }
+ },
+ "vars": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.EnvVarView"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.EnvVarView": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "required": {
+ "type": "boolean"
+ },
+ "source": {
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "UpdatedAt is set only for the caller's own value; a workspace value has\nno per-variable timestamp to report.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SandboxInventory": {
+ "type": "object",
+ "properties": {
+ "agent_names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "sandbox_count": {
+ "type": "integer"
+ },
+ "session_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "unverifiable": {
+ "description": "Unverifiable reports that SandboxCount is unknown rather than zero\nbecause the provider could not be reached. The management page must say\nso instead of rendering a reassuring \"0 sandboxes\".",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SkillEnvGroup": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "skill_id": {
+ "type": "string"
+ },
+ "skill_name": {
+ "type": "string"
+ },
+ "vars": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.EnvVarView"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SkillFileContent": {
+ "type": "object",
+ "properties": {
+ "binary": {
+ "type": "boolean"
+ },
+ "content": {
+ "type": "string"
+ },
+ "encoding": {
+ "type": "string"
+ },
+ "media_type": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "size": {
+ "type": "integer"
+ },
+ "truncated": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SkillFileEntry": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string"
+ },
+ "size": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SkillServedInfo": {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue": {
"type": "object",
"properties": {
@@ -19225,43 +21269,156 @@ const docTemplate = `{
}
}
},
- "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": {
+ "github_com_Tencent_WeKnora_internal_config.PromptTemplate": {
"type": "object",
"properties": {
- "auth_type": {
- "description": "\"oauth2\", \"api_key\", \"token\", etc.",
+ "content": {
"type": "string"
},
- "capabilities": {
- "description": "\"incremental\", \"webhook\", \"deletion_sync\", etc.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "default": {
+ "type": "boolean"
},
"description": {
"type": "string"
},
- "icon": {
+ "has_knowledge_base": {
+ "type": "boolean"
+ },
+ "has_web_search": {
+ "type": "boolean"
+ },
+ "id": {
"type": "string"
},
- "name": {
+ "mode": {
"type": "string"
},
- "priority": {
- "description": "Priority order for UI display (lower = higher priority)",
- "type": "integer"
+ "name": {
+ "type": "string"
},
- "type": {
+ "user": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "github_com_Tencent_WeKnora_internal_config.PromptTemplatesConfig": {
"type": "object",
"properties": {
- "code": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode"
+ "agent_system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "context_template": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "fallback": {
+ "description": "Fallback 合并了固定回复模板和模型兜底 prompt(通过 mode:\"model\" 区分)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "generate_kb_description": {
+ "description": "GenerateKBDescription writes the knowledge-base gist from the document profile aggregate.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "generate_questions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "generate_session_title": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "generate_summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "graph_extraction": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "intent_prompts": {
+ "description": "IntentPrompts holds per-intent system prompt overrides (template ID = intent value).",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "keywords_extraction": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "rewrite": {
+ "description": "Rewrite 合并了前端可选模板和运行时默认模板,每个模板同时包含 content + user",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": {
+ "type": "object",
+ "properties": {
+ "auth_type": {
+ "description": "\"oauth2\", \"api_key\", \"token\", etc.",
+ "type": "string"
+ },
+ "capabilities": {
+ "description": "\"incremental\", \"webhook\", \"deletion_sync\", etc.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": {
+ "type": "string"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "priority": {
+ "description": "Priority order for UI display (lower = higher priority)",
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode"
},
"details": {},
"message": {
@@ -19324,6220 +21481,6459 @@ const docTemplate = `{
"ErrModelInUse"
]
},
- "github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile": {
+ "github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata": {
"type": "object",
"properties": {
- "all_caps_short_line_count": {
- "type": "integer"
+ "configured": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.CredentialsResponse": {
+ "type": "object",
+ "properties": {
+ "fields": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.MCPAuthConfigResponse": {
+ "type": "object",
+ "properties": {
+ "api_key_header": {
+ "type": "string"
},
- "avg_line_len": {
- "type": "number"
+ "auth_server_metadata_url": {
+ "type": "string"
},
- "blank_paragraph_breaks": {
- "type": "integer"
+ "auth_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthType"
},
- "chinese_chapter_count": {
- "type": "integer"
+ "client_id": {
+ "type": "string"
},
- "code_ratio": {
- "type": "number"
+ "custom_headers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "detected_langs": {
- "description": "Detected language hints (best-effort)",
+ "scopes": {
"type": "array",
"items": {
"type": "string"
}
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.MCPCatalogSummary": {
+ "type": "object",
+ "properties": {
+ "stale": {
+ "type": "boolean"
},
- "english_chapter_count": {
- "type": "integer"
+ "synced_at": {
+ "type": "string"
},
- "form_feed_count": {
+ "tool_count": {
"type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse": {
+ "type": "object",
+ "properties": {
+ "advanced_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
},
- "german_chapter_count": {
- "type": "integer"
+ "auth_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPAuthConfigResponse"
},
- "has_code": {
- "type": "boolean"
+ "catalog": {
+ "description": "Catalog is the persisted tool-directory summary for list cards.\nOmitted when this principal has never synchronized the service.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPCatalogSummary"
+ }
+ ]
},
- "has_tables": {
- "description": "Content characteristics",
- "type": "boolean"
+ "created_at": {
+ "type": "string"
},
- "md_heading_counts": {
- "description": "Markdown structure",
+ "credentials": {
+ "description": "Credentials is the per-field \"configured?\" map. Embedded on the main\nresponse so the credential UI doesn't need a follow-up GET. The\nfrontend never sees the actual secret value — only whether one is\nstored. Omitted entirely for builtin services (they can't have\nper-tenant credentials).",
"type": "object",
"additionalProperties": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata"
}
},
- "md_heading_total": {
- "type": "integer"
+ "description": {
+ "type": "string"
},
- "numbered_section_count": {
- "description": "Heuristic indicators",
- "type": "integer"
+ "enabled": {
+ "type": "boolean"
},
- "repeated_footer_count": {
- "type": "integer"
+ "env_vars": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
},
- "std_line_len": {
- "type": "number"
+ "headers": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
},
- "total_chars": {
- "type": "integer"
+ "id": {
+ "type": "string"
},
- "total_lines": {
- "type": "integer"
+ "is_builtin": {
+ "type": "boolean"
},
- "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": {
+ "name": {
"type": "string"
},
- "tier": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_models.ModelCost": {
- "type": "object",
- "properties": {
- "cache_read": {
- "type": "number"
+ "stdio_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
},
- "cache_write": {
- "type": "number"
+ "tenant_id": {
+ "type": "integer"
},
- "currency": {
+ "transport_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
+ },
+ "updated_at": {
"type": "string"
},
- "input": {
- "type": "number"
+ "url": {
+ "type": "string"
},
- "output": {
- "type": "number"
+ "usage_instructions": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_models.ModelSpec": {
+ "github_com_Tencent_WeKnora_internal_handler_dto.ModelParametersDTO": {
"type": "object",
"properties": {
- "aliases": {
- "description": "Aliases are additional ids that resolve to this entry (dated\nsnapshots, vendor-prefixed names on gateways).",
- "type": "array",
- "items": {
+ "app_id": {
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "context_window": {
+ "type": "integer"
+ },
+ "custom_headers": {
+ "type": "object",
+ "additionalProperties": {
"type": "string"
}
},
- "api": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
+ "embedding_parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
},
- "compat": {
- "description": "Compat is the protocol-specific overlay for this model (flat object,\nfields depend on API). Decoded lazily by Resolve.",
- "type": "array",
- "items": {
- "type": "integer"
+ "extra_config": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
},
- "context_window": {
+ "interface_type": {
+ "type": "string"
+ },
+ "max_concurrency": {
"type": "integer"
},
- "cost": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models.ModelCost"
+ "max_output_tokens": {
+ "type": "integer"
},
- "deprecated": {
- "description": "Deprecated hides the entry from pickers but keeps resolution working.",
- "type": "boolean"
+ "parameter_size": {
+ "type": "string"
},
- "dimension": {
- "description": "Dimension is the embedding vector width (embedding entries only).",
- "type": "integer"
+ "provider": {
+ "type": "string"
},
- "id": {
+ "spec": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSpecOverride"
+ },
+ "supports_vision": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse": {
+ "type": "object",
+ "properties": {
+ "capabilities": {
+ "description": "Capabilities is the catalog view of the model. Chat models get the\nprotocol, thinking levels and context window; embedding and rerank\nmodels get input modalities, including support for image input.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_runtime.Capabilities"
+ }
+ ]
+ },
+ "created_at": {
"type": "string"
},
- "input": {
- "description": "Input lists accepted modalities: text, image, audio, video.",
- "type": "array",
- "items": {
- "type": "string"
+ "credentials": {
+ "description": "Per-field \"configured?\" map. Omitted for builtin models unless the\ncaller is a system administrator. See MCPServiceResponse.Credentials.",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata"
}
},
- "match": {
- "description": "Match is a case-insensitive glob (\"gpt-5*\", \"*deepseek-r1*\") that lets\none entry describe a family. Exact ids and aliases win over patterns;\namong patterns the longest literal prefix wins.",
+ "description": {
"type": "string"
},
- "max_output_tokens": {
- "type": "integer"
+ "display_name": {
+ "type": "string"
},
- "name": {
+ "id": {
"type": "string"
},
- "reasoning": {
- "description": "Reasoning reports whether the model can emit thinking at all.",
+ "is_builtin": {
"type": "boolean"
},
- "source": {
- "description": "Source is the documentation URL the facts were taken from.",
+ "is_default": {
+ "type": "boolean"
+ },
+ "name": {
"type": "string"
},
- "thinking_levels": {
- "description": "ThinkingLevels maps protocol-neutral levels to vendor values; missing\nkeys inherit the vendor map. See api.ThinkingLevelMap.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap"
- }
- ]
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelParametersDTO"
+ },
+ "source": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ },
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelStatus"
+ },
+ "tenant_id": {
+ "type": "integer"
},
"type": {
- "description": "Type is the WeKnora model type this entry describes. Chat models with\nimage input are still KnowledgeQA; the UI derives VLM eligibility from\nInput. Embedding / Rerank / ASR entries exist for the model picker.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
- }
- ]
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ },
+ "updated_at": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_models_api.API": {
- "type": "string",
- "enum": [
- "openai-completions",
- "openai-responses",
- "anthropic-messages",
- "google-generative-ai",
- "ollama"
- ],
- "x-enum-varnames": [
- "APIOpenAICompletions",
- "APIOpenAIResponses",
- "APIAnthropicMessages",
- "APIGoogleGenerativeAI",
- "APIOllama"
- ]
- },
- "github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort": {
- "type": "string",
- "enum": [
- "off",
- "auto",
- "minimal",
- "low",
- "medium",
- "high",
- "xhigh",
- "max"
- ],
- "x-enum-varnames": [
- "ReasoningOff",
- "ReasoningAuto",
- "ReasoningMinimal",
- "ReasoningLow",
- "ReasoningMedium",
- "ReasoningHigh",
- "ReasoningXHigh",
- "ReasoningMax"
- ]
- },
- "github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat": {
+ "github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse": {
"type": "object",
"properties": {
- "active": {
- "type": "integer"
+ "business": {
+ "type": "string"
},
- "limit": {
- "type": "integer"
+ "chat_history_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
},
- "model_id": {
+ "context_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
+ },
+ "created_at": {
"type": "string"
},
- "name": {
+ "credentials": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
"type": "string"
},
- "waiting": {
+ "id": {
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.APIPrincipalMode": {
- "type": "string",
- "enum": [
- "tenant",
- "direct_header",
- "signed_token"
- ],
- "x-enum-varnames": [
- "APIPrincipalModeTenant",
- "APIPrincipalModeDirect",
- "APIPrincipalModeSignedToken"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ASRConfig": {
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
},
- "language": {
- "description": "optional: language hint for transcription",
- "type": "string"
+ "memory_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConfig"
},
- "model_id": {
+ "name": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.AdminCreateUserRequest": {
- "type": "object",
- "required": [
- "email",
- "username"
- ],
- "properties": {
- "email": {
+ },
+ "parser_engine_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
+ },
+ "retrieval_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
+ },
+ "retriever_engines": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
+ },
+ "status": {
"type": "string"
},
- "password": {
+ "storage_engine_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
+ },
+ "storage_quota": {
+ "type": "integer"
+ },
+ "storage_used": {
+ "type": "integer"
+ },
+ "updated_at": {
"type": "string"
},
- "username": {
- "type": "string",
- "maxLength": 50,
- "minLength": 2
+ "web_search_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AgentStep": {
+ "github_com_Tencent_WeKnora_internal_im.IMChannel": {
"type": "object",
"properties": {
- "intermediate_answer": {
- "description": "IntermediateAnswer preserves a plain answer followed by a loop-end steer.\nThe canonical final answer is still stored in Message.Content.",
- "type": "boolean"
+ "agent_id": {
+ "type": "string"
},
- "iteration": {
- "description": "Iteration number (0-indexed)",
- "type": "integer"
+ "bot_identity": {
+ "type": "string"
},
- "reasoning_content": {
- "description": "ReasoningContent stores the OpenAI-protocol reasoning_content emitted by the\nmodel in this round. Persisted on AgentStep so cross-turn replay can put it\nback on the assistant message — required by MiMo / DeepSeek V3.2+ thinking\nmode, ignored by providers that don't recognize the field.",
+ "created_at": {
"type": "string"
},
- "reasoning_metadata": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ProviderMetadata"
+ "credentials": {
+ "type": "object"
},
- "reasoning_signature": {
- "description": "ReasoningSignature / ReasoningMetadata are the provider artifacts that\nmust accompany ReasoningContent on replay (Anthropic signatures,\nOpenAI Responses encrypted reasoning items).",
- "type": "string"
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
},
- "thought": {
- "description": "LLM's reasoning/thinking (Think phase)",
+ "enabled": {
+ "type": "boolean"
+ },
+ "id": {
"type": "string"
},
- "timestamp": {
- "description": "When this step occurred",
+ "knowledge_base_id": {
"type": "string"
},
- "tool_calls": {
- "description": "Tools called in this step (Act phase)",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall"
- }
+ "locale": {
+ "type": "string"
},
- "truncated": {
- "description": "Truncated marks the round the completion-token cap cut off. It rides in\nthe agent_steps JSON so a reloaded, shared or re-opened conversation can\nstill show that the answer stops mid-sentence by design, rather than\nlooking finished. Live streaming carries the same fact on the answer\nevent; this is what survives the round trip.",
- "type": "boolean"
+ "mode": {
+ "type": "string"
},
- "user_messages_before": {
- "description": "UserMessagesBefore records consumed steer rows in delivery order, before\nthis model response. Unlike timestamps, this remains unambiguous on replay.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "name": {
+ "type": "string"
+ },
+ "output_mode": {
+ "type": "string"
+ },
+ "platform": {
+ "type": "string"
+ },
+ "session_mode": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": {
- "type": "string",
- "enum": [
- "all",
- "random"
- ],
- "x-enum-varnames": [
- "AnswerStrategyAll",
- "AnswerStrategyRandom"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.AuditAction": {
- "type": "string",
- "enum": [
- "rbac.member_added",
- "rbac.member_removed",
- "rbac.member_role_changed",
- "rbac.member_left",
- "rbac.access_denied",
- "rbac.invitation_sent",
- "rbac.invitation_accepted",
- "rbac.invitation_declined",
- "rbac.invitation_revoked",
- "rbac.invitation_expired",
- "vector_store.created",
- "vector_store.updated",
- "vector_store.deleted",
- "opensearch.index_created",
- "opensearch.index_deleted",
- "opensearch.reindex_executed",
- "system.setting_changed",
- "system.admin_promoted",
- "system.admin_revoked",
- "system.user_password_reset",
- "system.user_created",
- "system.api_key_created",
- "system.api_key_revoked",
- "system.queue_task_retried",
- "system.queue_task_deleted",
- "system.queue_task_run_now",
- "system.queue_task_cancelled",
- "system.queue_archived_purged",
- "kb.created",
- "kb.updated",
- "kb.deleted",
- "kb.duplicated",
- "kb.clone_started",
- "kb.clone_completed",
- "kb.clone_failed",
- "knowledge.created",
- "knowledge.updated",
- "knowledge.deleted",
- "knowledge.batch_deleted",
- "knowledge.reparse_started",
- "knowledge.parse_canceled",
- "knowledge.move_started",
- "knowledge.move_completed",
- "knowledge.move_failed",
- "tag.created",
- "tag.updated",
- "tag.deleted",
- "datasource.created",
- "datasource.updated",
- "datasource.deleted",
- "datasource.sync_started",
- "datasource.sync_completed",
- "datasource.sync_failed",
- "datasource.paused",
- "datasource.resumed",
- "kb.share_added",
- "kb.share_permission_changed",
- "kb.share_removed",
- "wiki.content_changed",
- "faq.import_started",
- "faq.import_completed",
- "faq.import_failed"
- ],
- "x-enum-varnames": [
- "AuditActionMemberAdded",
- "AuditActionMemberRemoved",
- "AuditActionMemberRoleChanged",
- "AuditActionMemberLeft",
- "AuditActionAccessDenied",
- "AuditActionInvitationSent",
- "AuditActionInvitationAccepted",
- "AuditActionInvitationDeclined",
- "AuditActionInvitationRevoked",
- "AuditActionInvitationExpired",
- "AuditActionVectorStoreCreated",
- "AuditActionVectorStoreUpdated",
- "AuditActionVectorStoreDeleted",
- "AuditActionOpenSearchIndexCreated",
- "AuditActionOpenSearchIndexDeleted",
- "AuditActionOpenSearchReindexExecuted",
- "AuditActionSystemSettingChanged",
- "AuditActionSystemAdminPromoted",
- "AuditActionSystemAdminRevoked",
- "AuditActionSystemUserPasswordReset",
- "AuditActionSystemUserCreated",
- "AuditActionSystemAPIKeyCreated",
- "AuditActionSystemAPIKeyRevoked",
- "AuditActionSystemQueueTaskRetried",
- "AuditActionSystemQueueTaskDeleted",
- "AuditActionSystemQueueTaskRunNow",
- "AuditActionSystemQueueTaskCancelled",
- "AuditActionSystemQueueArchivedPurged",
- "AuditActionKBCreated",
- "AuditActionKBUpdated",
- "AuditActionKBDeleted",
- "AuditActionKBDuplicated",
- "AuditActionKBCloneStarted",
- "AuditActionKBCloneCompleted",
- "AuditActionKBCloneFailed",
- "AuditActionKnowledgeCreated",
- "AuditActionKnowledgeUpdated",
- "AuditActionKnowledgeDeleted",
- "AuditActionKnowledgeBatchDeleted",
- "AuditActionKnowledgeReparseStarted",
- "AuditActionKnowledgeParseCanceled",
- "AuditActionKnowledgeMoveStarted",
- "AuditActionKnowledgeMoveCompleted",
- "AuditActionKnowledgeMoveFailed",
- "AuditActionTagCreated",
- "AuditActionTagUpdated",
- "AuditActionTagDeleted",
- "AuditActionDataSourceCreated",
- "AuditActionDataSourceUpdated",
- "AuditActionDataSourceDeleted",
- "AuditActionDataSourceSyncStarted",
- "AuditActionDataSourceSyncCompleted",
- "AuditActionDataSourceSyncFailed",
- "AuditActionDataSourcePaused",
- "AuditActionDataSourceResumed",
- "AuditActionKBShareAdded",
- "AuditActionKBSharePermissionChanged",
- "AuditActionKBShareRemoved",
- "AuditActionWikiContentChanged",
- "AuditActionFAQImportStarted",
- "AuditActionFAQImportCompleted",
- "AuditActionFAQImportFailed"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.AuditLog": {
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile": {
"type": "object",
"properties": {
- "action": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AuditAction"
+ "all_caps_short_line_count": {
+ "type": "integer"
},
- "actor_role": {
- "type": "string"
+ "avg_line_len": {
+ "type": "number"
},
- "actor_user_id": {
- "type": "string"
+ "blank_paragraph_breaks": {
+ "type": "integer"
},
- "created_at": {
- "type": "string"
+ "chinese_chapter_count": {
+ "type": "integer"
},
- "details": {
+ "code_ratio": {
+ "type": "number"
+ },
+ "detected_langs": {
+ "description": "Detected language hints (best-effort)",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
},
- "id": {
+ "english_chapter_count": {
"type": "integer"
},
- "outcome": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AuditOutcome"
+ "form_feed_count": {
+ "type": "integer"
},
- "request_method": {
- "type": "string"
+ "german_chapter_count": {
+ "type": "integer"
},
- "request_path": {
- "type": "string"
+ "has_code": {
+ "type": "boolean"
},
- "scope_id": {
- "type": "string"
+ "has_tables": {
+ "description": "Content characteristics",
+ "type": "boolean"
},
- "scope_type": {
- "type": "string"
+ "md_heading_counts": {
+ "description": "Markdown structure",
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
},
- "target_id": {
- "type": "string"
+ "md_heading_total": {
+ "type": "integer"
},
- "target_type": {
- "type": "string"
+ "numbered_section_count": {
+ "description": "Heuristic indicators",
+ "type": "integer"
},
- "target_user_id": {
- "type": "string"
+ "repeated_footer_count": {
+ "type": "integer"
},
- "tenant_id": {
+ "std_line_len": {
+ "type": "number"
+ },
+ "total_chars": {
+ "type": "integer"
+ },
+ "total_lines": {
+ "type": "integer"
+ },
+ "visual_sep_count": {
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AuditOutcome": {
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier": {
"type": "string",
"enum": [
- "success",
- "accepted",
- "denied",
- "failed",
- "partial",
- "canceled"
+ "heading",
+ "heuristic",
+ "legacy"
],
"x-enum-varnames": [
- "AuditOutcomeSuccess",
- "AuditOutcomeAccepted",
- "AuditOutcomeDenied",
- "AuditOutcomeFailed",
- "AuditOutcomePartial",
- "AuditOutcomeCanceled"
+ "TierHeading",
+ "TierHeuristic",
+ "TierLegacy"
]
},
- "github_com_Tencent_WeKnora_internal_types.AutoTagConfig": {
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.TierRejection": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "max_tags": {
- "type": "integer"
- },
- "model_id": {
+ "reason": {
"type": "string"
},
- "skip_if_tagged": {
- "description": "SkipIfTagged leaves documents that already carry tags untouched, so a\ndeliberate manual classification is not diluted by model guesses. It is\na pointer because the default is true: rows written before this field\nexisted decode to nil and must not silently flip to \"always append\".",
- "type": "boolean"
+ "tier": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_mcp.OAuthAuthorizationStatus": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
- },
- "path_prefix": {
- "type": "string"
- },
- "region": {
- "type": "string"
- },
- "secret_id": {
- "type": "string"
+ "authorized": {
+ "type": "boolean"
},
- "secret_key": {
+ "expires_at": {
"type": "string"
},
- "temp_bucket_name": {
- "type": "string"
+ "refresh_available": {
+ "type": "boolean"
},
- "temp_region": {
+ "state": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": {
+ "github_com_Tencent_WeKnora_internal_models.ModelCost": {
"type": "object",
"properties": {
- "embedding_model_id": {
- "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
- "type": "string"
+ "cache_read": {
+ "type": "number"
},
- "enabled": {
- "description": "Enabled controls whether chat history indexing is active",
- "type": "boolean"
+ "cache_write": {
+ "type": "number"
},
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
+ "currency": {
"type": "string"
+ },
+ "input": {
+ "type": "number"
+ },
+ "output": {
+ "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": {
+ "github_com_Tencent_WeKnora_internal_models.ModelSpec": {
"type": "object",
"properties": {
- "child_chunk_size": {
- "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
- "type": "integer"
- },
- "chunk_overlap": {
- "description": "Chunk overlap",
- "type": "integer"
- },
- "chunk_size": {
- "description": "Chunk size",
- "type": "integer"
- },
- "enable_parent_child": {
- "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
- "type": "boolean"
- },
- "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"
- },
- "parser_engine_rules": {
- "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, DefaultParserEngine is used (builtin/simple routing, except\ntypes that only a specific engine can parse: ppt/pptx fall back to\nmarkitdown). A linked anydoc binding is preferred for every type it\nconverts.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
- },
- "separators": {
- "description": "Separators",
+ "aliases": {
+ "description": "Aliases are additional ids that resolve to this entry (dated\nsnapshots, vendor-prefixed names on gateways).",
"type": "array",
"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"
+ "api": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
},
- "table_metadata_instructions": {
- "description": "TableMetadataInstructions contains optional business guidance used when\ngenerating searchable summaries for CSV/Excel tables. The system-owned\noutput contract remains fixed; these instructions only add domain context.",
- "type": "string"
+ "compat": {
+ "description": "Compat is the protocol-specific overlay for this model (flat object,\nfields depend on API). Decoded lazily by Resolve.",
+ "type": "object"
},
- "token_limit": {
- "description": "TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize\nas a character count.",
+ "context_window": {
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ConnectionConfig": {
- "type": "object",
- "properties": {
- "addr": {
- "description": "Common",
- "type": "string"
},
- "api_key": {
- "description": "AES-GCM encrypted",
- "type": "string"
+ "cost": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models.ModelCost"
},
- "database": {
- "description": "Database name used by engines that support database-level namespaces\n(currently Milvus, Tencent VectorDB, and Doris).",
- "type": "string"
+ "deprecated": {
+ "description": "Deprecated hides the entry from pickers but keeps resolution working.",
+ "type": "boolean"
},
- "grpc_address": {
- "description": "Weaviate",
- "type": "string"
+ "dimension": {
+ "description": "Dimension is the embedding vector width (embedding entries only).",
+ "type": "integer"
},
- "host": {
- "description": "Qdrant",
+ "id": {
"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"
- },
- "insecure_skip_verify": {
- "description": "InsecureSkipVerify disables TLS certificate verification when\ntalking to the backing store over HTTPS. Defaults to false\n(secure). Set to true ONLY for self-signed development clusters;\nproduction deployments should provide trusted certificates via\nthe system CA pool. Cross-driver applicable but currently only\nthe OpenSearch driver (Phase 3) reads this field. Note: this\ndiffers from the Qdrant-specific UseTLS below, which *enables*\nTLS on gRPC connections — InsecureSkipVerify only controls\n*verification* of an already-TLS connection.",
- "type": "boolean"
+ "input": {
+ "description": "Input lists accepted modalities: text, image, audio, video.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "password": {
- "description": "AES-GCM encrypted",
+ "match": {
+ "description": "Match is a case-insensitive glob (\"gpt-5*\", \"*deepseek-r1*\") that lets\none entry describe a family. Exact ids and aliases win over patterns;\namong patterns the longest literal prefix wins.",
"type": "string"
},
- "port": {
+ "max_output_tokens": {
"type": "integer"
},
- "scheme": {
+ "name": {
"type": "string"
},
- "use_default_connection": {
- "description": "Postgres",
- "type": "boolean"
- },
- "use_tls": {
+ "reasoning": {
+ "description": "Reasoning reports whether the model can emit thinking at all.",
"type": "boolean"
},
- "username": {
+ "source": {
+ "description": "Source is the documentation URL the facts were taken from.",
"type": "string"
},
- "version": {
- "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
- "type": "string"
+ "thinking_levels": {
+ "description": "ThinkingLevels maps protocol-neutral levels to vendor values; missing\nkeys inherit the vendor map. See api.ThinkingLevelMap.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap"
+ }
+ ]
+ },
+ "type": {
+ "description": "Type is the WeKnora model type this entry describes. Chat models with\nimage input are still KnowledgeQA; the UI derives VLM eligibility from\nInput. Embedding / Rerank / ASR entries exist for the model picker.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": {
+ "github_com_Tencent_WeKnora_internal_models_api.API": {
"type": "string",
"enum": [
- "sliding_window",
- "smart"
+ "openai-completions",
+ "openai-responses",
+ "anthropic-messages",
+ "google-generative-ai",
+ "ollama"
],
"x-enum-varnames": [
- "ContextCompressionSlidingWindow",
- "ContextCompressionSmart"
+ "APIOpenAICompletions",
+ "APIOpenAIResponses",
+ "APIAnthropicMessages",
+ "APIGoogleGenerativeAI",
+ "APIOllama"
]
},
- "github_com_Tencent_WeKnora_internal_types.ContextConfig": {
+ "github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort": {
+ "type": "string",
+ "enum": [
+ "off",
+ "auto",
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
+ "x-enum-varnames": [
+ "ReasoningOff",
+ "ReasoningAuto",
+ "ReasoningMinimal",
+ "ReasoningLow",
+ "ReasoningMedium",
+ "ReasoningHigh",
+ "ReasoningXHigh",
+ "ReasoningMax"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat": {
"type": "object",
"properties": {
- "compression_strategy": {
- "description": "Compression strategy: \"sliding_window\" or \"smart\"",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
- }
- ]
- },
- "max_tokens": {
- "description": "Maximum tokens allowed in LLM context",
+ "active": {
"type": "integer"
},
- "recent_message_count": {
- "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "limit": {
"type": "integer"
},
- "summarize_threshold": {
- "description": "Summarize threshold: number of messages before summarization",
+ "model_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "waiting": {
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
- "type": "object",
- "required": [
- "name"
+ "github_com_Tencent_WeKnora_internal_models_providers.AuthStyle": {
+ "type": "string",
+ "enum": [
+ "bearer",
+ "api-key",
+ "x-api-key",
+ "x-goog-api-key",
+ "none",
+ "signed"
],
+ "x-enum-varnames": [
+ "AuthBearer",
+ "AuthAPIKeyHeader",
+ "AuthXAPIKey",
+ "AuthGoogleAPIKey",
+ "AuthNone",
+ "AuthSigned"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_models_providers.CredentialLabel": {
+ "type": "object",
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
+ "hint": {
+ "description": "Hint is rendered under the input, for a warning the label cannot carry.",
+ "type": "string"
},
- "description": {
- "type": "string",
- "maxLength": 1000
+ "hints": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "invite_code_validity_days": {
- "description": "optional: 0=never, 1, 7, 30; default 7",
- "type": "integer"
+ "label": {
+ "type": "string"
},
- "member_limit": {
- "description": "optional: max members; 0=unlimited; default 50",
- "type": "integer"
+ "labels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.CredentialsConfig": {
- "type": "object",
- "properties": {
- "weknoracloud": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials"
+ "model_types": {
+ "description": "ModelTypes restricts the override; empty means every type.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ }
+ },
+ "placeholder": {
+ "type": "string"
+ },
+ "placeholders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "required": {
+ "description": "Required marks the credential mandatory even where the generic label\ncalls it optional.",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CubeEgressRule": {
+ "github_com_Tencent_WeKnora_internal_models_providers.ExtraField": {
"type": "object",
"properties": {
- "audit": {
- "description": "Audit is none | metadata | full. Empty uses the server default.",
+ "default": {
"type": "string"
},
- "deny": {
- "description": "Deny inverts the action, which defaults to allow. A deny rule still\nneeds Host or SNI: the target has to reach CubeEgress for it to answer\nwith a request-level 403 instead of the network layer dropping it.",
- "type": "boolean"
+ "key": {
+ "type": "string"
},
- "host": {
+ "label": {
"type": "string"
},
- "inject": {
- "description": "Inject adds credential headers on allowed HTTPS requests.",
+ "labels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "model_types": {
+ "description": "ModelTypes restricts the field to some model types; empty means all.",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeHeaderInject"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
}
},
- "methods": {
+ "options": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption"
}
},
- "name": {
+ "placeholder": {
"type": "string"
},
- "path": {
- "type": "string"
+ "placeholders": {
+ "description": "Placeholders carries localized variants of Placeholder.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "scheme": {
- "type": "string"
+ "required": {
+ "type": "boolean"
},
- "sni": {
+ "secret": {
+ "description": "Secret marks values that must never be echoed back to the UI.",
+ "type": "boolean"
+ },
+ "type": {
+ "description": "\"string\", \"number\", \"boolean\", \"select\", \"password\"",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CubeHeaderInject": {
+ "github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption": {
"type": "object",
"properties": {
- "format": {
+ "label": {
"type": "string"
},
- "header": {
- "type": "string"
+ "labels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "secret": {
+ "value": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CubeSandboxConfig": {
+ "github_com_Tencent_WeKnora_internal_models_runtime.Capabilities": {
"type": "object",
"properties": {
- "api_key": {
- "description": "加密",
- "type": "string"
+ "api": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
},
- "api_url": {
- "type": "string"
+ "cataloged": {
+ "type": "boolean"
},
- "cube_sandbox_ttl_seconds": {
+ "context_window": {
"type": "integer"
},
- "dns_servers": {
- "description": "DNSServers are Cube template nameserver IPs. Empty uses Cubelet's default.",
+ "input": {
"type": "array",
"items": {
"type": "string"
}
},
- "http_timeout_sec": {
- "description": "HTTPTimeoutSec bounds each HTTP call to the sandbox control plane.\n0 means use the built-in default (30s), never the deployment's value.",
+ "max_output_tokens": {
"type": "integer"
},
- "proxy_url": {
+ "max_tokens_field": {
"type": "string"
},
- "sandbox_domain": {
+ "provider": {
"type": "string"
},
- "template_id": {
+ "reasoning": {
+ "type": "boolean"
+ },
+ "thinking_format": {
"type": "string"
+ },
+ "thinking_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
+ "github_com_Tencent_WeKnora_internal_types.APIKeyScopeType": {
+ "type": "string",
+ "enum": [
+ "tenant",
+ "platform"
+ ],
+ "x-enum-varnames": [
+ "APIKeyScopeTenant",
+ "APIKeyScopePlatform"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.APIPrincipalMode": {
+ "type": "string",
+ "enum": [
+ "tenant",
+ "direct_header",
+ "signed_token"
+ ],
+ "x-enum-varnames": [
+ "APIPrincipalModeTenant",
+ "APIPrincipalModeDirect",
+ "APIPrincipalModeSignedToken"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ASRConfig": {
"type": "object",
"properties": {
- "agent_mode": {
- "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
- "type": "string"
+ "enabled": {
+ "type": "boolean"
},
- "agent_type": {
- "description": "AgentType is a preset category under smart-reasoning mode that pre-fills\nsystem prompt, allowed tools and recommended KB compatibility.\nValid values: \"rag-qa\", \"wiki-qa\", \"hybrid-rag-wiki\", \"custom\".\nEmpty / unknown values are treated as \"custom\" (no preset applied).\nIgnored for quick-answer mode.",
+ "language": {
+ "description": "optional: language hint for transcription",
"type": "string"
},
- "allowed_tools": {
- "description": "Allowed tools (only for agent type)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "model_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AdminCreateUserRequest": {
+ "type": "object",
+ "required": [
+ "email",
+ "username"
+ ],
+ "properties": {
+ "email": {
+ "type": "string"
},
- "asr_model_id": {
- "description": "ASR model ID for audio transcription (optional)",
+ "password": {
"type": "string"
},
- "attachment_image_understanding": {
- "description": "AttachmentImageUnderstanding enables VLM OCR fallback for image-only /\nscanned documents (PDF/PPT whose pages are images). Disabled by default\nbecause it materially increases parse latency; only triggers when the\nextracted text is below a threshold and a VLM model is configured.",
+ "username": {
+ "type": "string",
+ "maxLength": 50,
+ "minLength": 2
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentStep": {
+ "type": "object",
+ "properties": {
+ "intermediate_answer": {
+ "description": "IntermediateAnswer preserves a plain answer followed by a loop-end steer.\nThe canonical final answer is still stored in Message.Content.",
"type": "boolean"
},
- "attachment_ocr_max_pages": {
- "description": "AttachmentOCRMaxPages caps how many pages of a scanned / image-only\ndocument this agent sends to the VLM for OCR. 0 falls back to the global\ndefault (WEKNORA_CHAT_ATTACHMENT_OCR_MAX_PAGES). More pages means higher\ncoverage but slower parsing and more VLM cost.",
- "type": "integer"
- },
- "attachment_parse_wait_timeout_sec": {
- "description": "AttachmentParseWaitTimeoutSec bounds, in seconds, how long a chat turn\nwaits for this agent's still-parsing attachments before proceeding with\nonly the finished ones. 0 falls back to the global default\n(WEKNORA_CHAT_ATTACHMENT_WAIT_TIMEOUT_SEC).",
+ "iteration": {
+ "description": "Iteration number (0-indexed)",
"type": "integer"
},
- "audio_upload_enabled": {
- "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
- "type": "boolean"
+ "reasoning_content": {
+ "description": "ReasoningContent stores the OpenAI-protocol reasoning_content emitted by the\nmodel in this round. Persisted on AgentStep so cross-turn replay can put it\nback on the assistant message — required by MiMo / DeepSeek V3.2+ thinking\nmode, ignored by providers that don't recognize the field.",
+ "type": "string"
},
- "chat_parser_engine_rules": {
- "description": "===== Chat Attachment Parsing Settings =====\nChatParserEngineRules selects parser engines for session-scoped chat\nattachments by file type. Takes precedence over the tenant-level\nParserEngineConfig.ChatParserEngineRules; an explicit per-request\nparser_engine still overrides both.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
+ "reasoning_metadata": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ProviderMetadata"
},
- "citation_enabled": {
- "description": "Whether final answers include knowledge/web source citations. Nil defaults to true\nso agents saved before this option was introduced keep their existing behavior.",
- "type": "boolean"
+ "reasoning_signature": {
+ "description": "ReasoningSignature / ReasoningMetadata are the provider artifacts that\nmust accompany ReasoningContent on replay (Anthropic signatures,\nOpenAI Responses encrypted reasoning items).",
+ "type": "string"
},
- "context_template": {
- "description": "Context template for normal mode (how to format retrieved chunks)",
- "type": "string"
- },
- "context_template_id": {
- "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content is resolved at request time for saved agents.",
- "type": "string"
- },
- "data_analysis_enabled": {
- "description": "===== Data Analysis Settings =====\nWhether to run the legacy in-pipeline DuckDB SQL data-analysis stage when\nthe retrieved chunks include CSV/Excel files. This issues an extra LLM\ncall to generate a SQL query and is disabled by default because most\nquick-answer / RAG-style agents do not want the added latency.",
- "type": "boolean"
- },
- "embedding_top_k": {
- "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
- "type": "integer"
- },
- "enable_query_expansion": {
- "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
- "type": "boolean"
- },
- "enable_rewrite": {
- "description": "Whether to enable query rewrite for multi-turn conversations",
- "type": "boolean"
- },
- "fallback_prompt": {
- "description": "Fallback prompt (when FallbackStrategy is \"model\")",
- "type": "string"
- },
- "fallback_response": {
- "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
+ "thought": {
+ "description": "LLM's reasoning/thinking (Think phase)",
"type": "string"
},
- "fallback_strategy": {
- "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
+ "timestamp": {
+ "description": "When this step occurred",
"type": "string"
},
- "faq_direct_answer_threshold": {
- "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
- "type": "number"
- },
- "faq_priority_enabled": {
- "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
- "type": "boolean"
- },
- "faq_score_boost": {
- "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
- "type": "number"
- },
- "history_turns": {
- "description": "Number of history turns to keep in context. Quick-answer only; smart-reasoning sizes history by context window",
- "type": "integer"
- },
- "image_storage_provider": {
- "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\".\nEmpty means use the global/workspace default provider.",
- "type": "string"
+ "tool_calls": {
+ "description": "Tools called in this step (Act phase)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall"
+ }
},
- "image_upload_enabled": {
- "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "truncated": {
+ "description": "Truncated marks the round the completion-token cap cut off. It rides in\nthe agent_steps JSON so a reloaded, shared or re-opened conversation can\nstill show that the answer stops mid-sentence by design, rather than\nlooking finished. Live streaming carries the same fact on the answer\nevent; this is what survives the round trip.",
"type": "boolean"
},
- "intent_prompts": {
- "description": "IntentPrompts holds per-intent system prompt overrides for non-retrieval\nintents (greeting, chitchat, etc.). Empty values fall back to templates\nunder config/prompt_templates/intent_prompts.yaml.",
- "type": "object",
- "additionalProperties": {
+ "user_messages_before": {
+ "description": "UserMessagesBefore records consumed steer rows in delivery order, before\nthis model response. Unlike timestamps, this remains unambiguous on replay.",
+ "type": "array",
+ "items": {
"type": "string"
}
- },
- "kb_selection_mode": {
- "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
- "type": "string"
- },
- "keyword_threshold": {
- "description": "Keyword retrieval threshold",
- "type": "number"
- },
- "knowledge_bases": {
- "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentTypeKBFilter": {
+ "type": "object",
+ "properties": {
+ "all_of": {
+ "description": "AllOf: KB must expose ALL of these capability flags.",
"type": "array",
"items": {
"type": "string"
}
},
- "llm_call_timeout": {
- "description": "Timeout for a single LLM call in seconds (0 = use global default)",
- "type": "integer"
- },
- "max_completion_tokens": {
- "description": "Maximum completion tokens. Quick-answer uses this for the RAG answer.\nSmart-reasoning ReAct rounds send this value as-is (zero becomes\nDefaultMaxCompletionTokens at call time: 4096, or 24576 with a sandbox).",
- "type": "integer"
- },
- "max_iterations": {
- "description": "===== Agent Mode Settings =====\nMaximum iterations for the ReAct loop. Zero is unset (filled with a\ndefault). A negative value is unlimited: the loop runs until the model\nstops, the user cancels, or another guard fires.",
- "type": "integer"
- },
- "mcp_auth_wait_timeout": {
- "description": "MCPAuthWaitTimeout is how many seconds to wait for in-conversation OAuth\nauthorization before skipping. \u003c=0 uses the gate's configured timeout.",
- "type": "integer"
- },
- "mcp_selection_mode": {
- "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
- "type": "string"
- },
- "mcp_services": {
- "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "any_of": {
+ "description": "AnyOf: KB must expose at least ONE of these capability flags.",
"type": "array",
"items": {
"type": "string"
}
},
- "memory_enabled": {
- "description": "Whether this agent may read the user's long-term memory. Nil inherits\nthe workspace setting; false opts a single agent out of memory even when\nthe workspace has it on. There is no \"on\" that overrides the workspace.",
- "type": "boolean"
- },
- "model_id": {
- "description": "===== Model Settings =====\nModel ID to use for conversations",
- "type": "string"
+ "none_of": {
+ "description": "NoneOf: KB must expose NONE of these capability flags.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentTypePresetConfig": {
+ "type": "object",
+ "properties": {
+ "allowed_tools": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "multi_turn_enabled": {
- "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
+ "faq_priority_enabled": {
"type": "boolean"
},
- "query_understand_model_id": {
- "description": "Dedicated chat model ID for the query-understanding (rewrite + intent) step.\nWhen empty, the main conversation ModelID is used as a fallback.",
- "type": "string"
- },
- "question_suggestions": {
- "description": "===== Conversation Question Suggestions =====\nQuestionSuggestions owns both the static/knowledge-backed prompts shown\nbefore the first user turn and the contextual follow-up questions shown\nafter a completed assistant answer.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig"
- }
- ]
- },
- "reasoning_effort": {
- "description": "ReasoningEffort selects the thinking intensity (off | auto | minimal |\nlow | medium | high | xhigh | max). Empty keeps the boolean Thinking\nsemantics: true means \"auto\". See internal/models/api.ReasoningEffort.",
- "type": "string"
- },
- "rerank_model_id": {
- "description": "ReRank model ID for retrieval",
+ "kb_selection_mode": {
+ "description": "KBSelectionMode presets the KB picker mode: \"all\" | \"selected\" | \"none\".\nWhen empty, the user's current value stays untouched.",
"type": "string"
},
- "rerank_threshold": {
- "description": "Rerank threshold",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "Rerank top K",
+ "max_iterations": {
"type": "integer"
},
"retain_retrieval_history": {
- "description": "Whether to retain retrieval history across turns",
- "type": "boolean"
- },
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
"type": "boolean"
},
- "rewrite_prompt_system": {
- "description": "Rewrite prompt system message",
- "type": "string"
- },
- "rewrite_prompt_user": {
- "description": "Rewrite prompt user message template",
- "type": "string"
- },
- "sandbox_config_id": {
- "description": "===== Sandbox Settings =====\nSandboxConfigID selects which workspace sandbox config this agent's\nskill scripts run on. Empty means sandbox execution is disabled.\n\nThis references the LOGICAL config, never a specific revision: keeping\nthe indirection here is what would let credential rotation happen\nwithout re-pointing every agent (see the spec's §4.8).",
- "type": "string"
- },
- "selected_skills": {
- "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "skills_selection_mode": {
- "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all installed skills, \"selected\" = specific skills, \"none\" = no skills",
- "type": "string"
- },
"supported_file_types": {
- "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
"type": "array",
"items": {
"type": "string"
}
},
- "system_prompt": {
- "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
- "type": "string"
- },
"system_prompt_id": {
- "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content is resolved at request time for saved agents.",
"type": "string"
},
"temperature": {
- "description": "Temperature for LLM (0-1)",
"type": "number"
},
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "web_search_enabled": {
"type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentTypePresetEntry": {
+ "type": "object",
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetConfig"
},
- "vector_threshold": {
- "description": "Vector retrieval threshold",
- "type": "number"
+ "i18n": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n"
+ }
},
- "vlm_model_id": {
- "description": "VLM model ID for image analysis (optional, falls back to workspace-level VLM)",
+ "id": {
"type": "string"
},
- "web_fetch_enabled": {
- "description": "Whether to auto-fetch full page content for reranked web search results",
- "type": "boolean"
- },
- "web_fetch_top_n": {
- "description": "Max number of pages to fetch after rerank (default: 3)",
- "type": "integer"
- },
- "web_search_enabled": {
- "description": "===== Web Search Settings =====\nWhether web search is enabled",
- "type": "boolean"
- },
- "web_search_max_results": {
- "description": "Maximum web search results",
- "type": "integer"
+ "kb_filter": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypeKBFilter"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
},
- "web_search_provider_id": {
- "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the workspace's default provider (is_default=true) is used.",
+ "label": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.DataSource": {
+ "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": {
+ "type": "string",
+ "enum": [
+ "all",
+ "random"
+ ],
+ "x-enum-varnames": [
+ "AnswerStrategyAll",
+ "AnswerStrategyRandom"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.AttrSpec": {
"type": "object",
"properties": {
- "config": {
- "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "consumers": {
+ "description": "downstream steps that read this attribute",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
},
- "conflict_strategy": {
- "description": "Conflict resolution strategy: overwrite or skip",
+ "description": {
+ "description": "one line explaining what the attribute measures",
"type": "string"
},
- "created_at": {
- "description": "Creation timestamp",
+ "label": {
+ "description": "human-readable name for the settings panel",
"type": "string"
},
- "deleted_at": {
- "description": "Soft delete timestamp",
+ "name": {
+ "description": "stable key, e.g. \"contain.text\"",
+ "type": "string"
+ },
+ "question": {
+ "description": "sentence shown to the model in the describe round",
+ "type": "string"
+ },
+ "type": {
+ "description": "extent | presence",
"allOf": [
{
- "$ref": "#/definitions/gorm.DeletedAt"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AttrType"
}
]
},
- "error_message": {
- "description": "Error message if status is \"error\"",
+ "values": {
+ "description": "ordered low-\u003ehigh for extent attrs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AttrValue"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AttrType": {
+ "type": "string",
+ "enum": [
+ "extent",
+ "presence"
+ ],
+ "x-enum-varnames": [
+ "AttrTypeExtent",
+ "AttrTypePresence"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.AttrValue": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "description": "sentence explaining the value",
"type": "string"
},
- "id": {
- "description": "Unique identifier",
+ "label": {
+ "description": "short on-screen name",
"type": "string"
},
- "knowledge_base_id": {
- "description": "Target knowledge base ID",
+ "value": {
+ "description": "raw machine value, never localized",
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AuditAction": {
+ "type": "string",
+ "enum": [
+ "rbac.member_added",
+ "rbac.member_removed",
+ "rbac.member_role_changed",
+ "rbac.member_left",
+ "rbac.access_denied",
+ "rbac.invitation_sent",
+ "rbac.invitation_accepted",
+ "rbac.invitation_declined",
+ "rbac.invitation_revoked",
+ "rbac.invitation_expired",
+ "vector_store.created",
+ "vector_store.updated",
+ "vector_store.deleted",
+ "opensearch.index_created",
+ "opensearch.index_deleted",
+ "opensearch.reindex_executed",
+ "system.setting_changed",
+ "system.admin_promoted",
+ "system.admin_revoked",
+ "system.user_password_reset",
+ "system.user_created",
+ "system.api_key_created",
+ "system.api_key_revoked",
+ "system.queue_task_retried",
+ "system.queue_task_deleted",
+ "system.queue_task_run_now",
+ "system.queue_task_cancelled",
+ "system.queue_archived_purged",
+ "kb.created",
+ "kb.updated",
+ "kb.deleted",
+ "kb.duplicated",
+ "kb.clone_started",
+ "kb.clone_completed",
+ "kb.clone_failed",
+ "knowledge.created",
+ "knowledge.updated",
+ "knowledge.deleted",
+ "knowledge.batch_deleted",
+ "knowledge.reparse_started",
+ "knowledge.parse_canceled",
+ "knowledge.move_started",
+ "knowledge.move_completed",
+ "knowledge.move_failed",
+ "tag.created",
+ "tag.updated",
+ "tag.deleted",
+ "datasource.created",
+ "datasource.updated",
+ "datasource.deleted",
+ "datasource.sync_started",
+ "datasource.sync_completed",
+ "datasource.sync_failed",
+ "datasource.paused",
+ "datasource.resumed",
+ "kb.share_added",
+ "kb.share_permission_changed",
+ "kb.share_removed",
+ "wiki.content_changed",
+ "faq.import_started",
+ "faq.import_completed",
+ "faq.import_failed"
+ ],
+ "x-enum-varnames": [
+ "AuditActionMemberAdded",
+ "AuditActionMemberRemoved",
+ "AuditActionMemberRoleChanged",
+ "AuditActionMemberLeft",
+ "AuditActionAccessDenied",
+ "AuditActionInvitationSent",
+ "AuditActionInvitationAccepted",
+ "AuditActionInvitationDeclined",
+ "AuditActionInvitationRevoked",
+ "AuditActionInvitationExpired",
+ "AuditActionVectorStoreCreated",
+ "AuditActionVectorStoreUpdated",
+ "AuditActionVectorStoreDeleted",
+ "AuditActionOpenSearchIndexCreated",
+ "AuditActionOpenSearchIndexDeleted",
+ "AuditActionOpenSearchReindexExecuted",
+ "AuditActionSystemSettingChanged",
+ "AuditActionSystemAdminPromoted",
+ "AuditActionSystemAdminRevoked",
+ "AuditActionSystemUserPasswordReset",
+ "AuditActionSystemUserCreated",
+ "AuditActionSystemAPIKeyCreated",
+ "AuditActionSystemAPIKeyRevoked",
+ "AuditActionSystemQueueTaskRetried",
+ "AuditActionSystemQueueTaskDeleted",
+ "AuditActionSystemQueueTaskRunNow",
+ "AuditActionSystemQueueTaskCancelled",
+ "AuditActionSystemQueueArchivedPurged",
+ "AuditActionKBCreated",
+ "AuditActionKBUpdated",
+ "AuditActionKBDeleted",
+ "AuditActionKBDuplicated",
+ "AuditActionKBCloneStarted",
+ "AuditActionKBCloneCompleted",
+ "AuditActionKBCloneFailed",
+ "AuditActionKnowledgeCreated",
+ "AuditActionKnowledgeUpdated",
+ "AuditActionKnowledgeDeleted",
+ "AuditActionKnowledgeBatchDeleted",
+ "AuditActionKnowledgeReparseStarted",
+ "AuditActionKnowledgeParseCanceled",
+ "AuditActionKnowledgeMoveStarted",
+ "AuditActionKnowledgeMoveCompleted",
+ "AuditActionKnowledgeMoveFailed",
+ "AuditActionTagCreated",
+ "AuditActionTagUpdated",
+ "AuditActionTagDeleted",
+ "AuditActionDataSourceCreated",
+ "AuditActionDataSourceUpdated",
+ "AuditActionDataSourceDeleted",
+ "AuditActionDataSourceSyncStarted",
+ "AuditActionDataSourceSyncCompleted",
+ "AuditActionDataSourceSyncFailed",
+ "AuditActionDataSourcePaused",
+ "AuditActionDataSourceResumed",
+ "AuditActionKBShareAdded",
+ "AuditActionKBSharePermissionChanged",
+ "AuditActionKBShareRemoved",
+ "AuditActionWikiContentChanged",
+ "AuditActionFAQImportStarted",
+ "AuditActionFAQImportCompleted",
+ "AuditActionFAQImportFailed"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.AuditLog": {
+ "type": "object",
+ "properties": {
+ "action": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AuditAction"
},
- "last_sync_at": {
- "description": "Last successful sync timestamp",
+ "actor_role": {
"type": "string"
},
- "last_sync_cursor": {
- "description": "Cursor or state for incremental sync (connector-specific)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "last_sync_result": {
- "description": "Summary of last sync result",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "latest_sync_log": {
- "description": "Latest sync log (not stored in DB, populated on query)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
- }
- ]
- },
- "name": {
- "description": "User-friendly name",
+ "actor_user_id": {
"type": "string"
},
- "status": {
- "description": "Current status: active, paused, error",
+ "created_at": {
"type": "string"
},
- "sync_deletions": {
- "description": "Whether to sync deletions from source",
- "type": "boolean"
+ "details": {
+ "type": "object"
},
- "sync_log_retention_days": {
- "description": "Number of days to keep sync logs (default: 30)",
+ "id": {
"type": "integer"
},
- "sync_mode": {
- "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
- "type": "string"
+ "outcome": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AuditOutcome"
},
- "sync_schedule": {
- "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
+ "request_method": {
"type": "string"
},
- "tenant_id": {
- "description": "Workspace ID for multi-workspace isolation",
- "type": "integer"
+ "request_path": {
+ "type": "string"
},
- "total_items_synced": {
- "description": "Total items synced (not stored in DB, calculated on query)",
- "type": "integer"
+ "scope_id": {
+ "type": "string"
},
- "type": {
- "description": "Connector type (feishu, notion, confluence, etc.)",
+ "scope_type": {
"type": "string"
},
- "updated_at": {
- "description": "Last update timestamp",
+ "target_id": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.DockerSandboxConfig": {
- "type": "object",
- "properties": {
- "cpu_limit": {
- "description": "CPULimit is the number of CPU cores one sandbox may use. 0 uses the\nbuilt-in default.",
- "type": "number"
},
- "host": {
- "description": "Host is the daemon endpoint in DOCKER_HOST form. Empty means the local\nunix socket.",
+ "target_type": {
"type": "string"
},
- "http_timeout_sec": {
- "description": "HTTPTimeoutSec bounds each Engine API call. 0 uses the built-in default.",
- "type": "integer"
+ "target_user_id": {
+ "type": "string"
},
- "idle_ttl_seconds": {
- "description": "IdleTTLSeconds is how long a session container may go unused before it\nis reclaimed. The daemon has no idle timeout of its own, so this is what\nstops an abandoned session from pinning host memory indefinitely.",
+ "tenant_id": {
"type": "integer"
- },
- "image": {
- "type": "string"
- },
- "memory_limit_mb": {
- "description": "MemoryLimitMB caps one sandbox's memory. 0 uses the built-in default.",
- "type": "integer"
- },
- "network_mode": {
- "description": "NetworkMode is the Docker network sandboxes join: \"bridge\" (default) or\n\"none\" for no egress. Nothing else is accepted — host and container:\nmodes share another namespace outright, and a named network is usually\nthe deployment's own compose network, which would put the sandbox next\nto Postgres and Redis.",
- "type": "string"
- },
- "pids_limit": {
- "description": "PidsLimit caps how many processes one sandbox may run. 0 uses the\nbuilt-in default.",
- "type": "integer"
- },
- "runtime": {
- "description": "Runtime selects an alternative OCI runtime such as \"runsc\" (gVisor).\nEmpty uses the daemon default.",
- "type": "string"
- },
- "tls_cert_path": {
- "description": "TLSCertPath is a directory on the WeKnora host containing ca.pem,\ncert.pem and key.pem. Required when Host is a TCP endpoint.",
- "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.E2BHostRule": {
+ "github_com_Tencent_WeKnora_internal_types.AuditOutcome": {
+ "type": "string",
+ "enum": [
+ "success",
+ "accepted",
+ "denied",
+ "failed",
+ "partial",
+ "canceled"
+ ],
+ "x-enum-varnames": [
+ "AuditOutcomeSuccess",
+ "AuditOutcomeAccepted",
+ "AuditOutcomeDenied",
+ "AuditOutcomeFailed",
+ "AuditOutcomePartial",
+ "AuditOutcomeCanceled"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.AutoTagConfig": {
"type": "object",
"properties": {
- "headers": {
- "description": "Headers values are credentials and are encrypted at rest; names stay\nreadable so operators can see which headers are injected.",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "enabled": {
+ "type": "boolean"
},
- "host": {
+ "max_tags": {
+ "type": "integer"
+ },
+ "model_id": {
"type": "string"
+ },
+ "skip_if_tagged": {
+ "description": "SkipIfTagged leaves documents that already carry tags untouched, so a\ndeliberate manual classification is not diluted by model guesses. It is\na pointer because the default is true: rows written before this field\nexisted decode to nil and must not silently flip to \"always append\".",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.E2BSandboxConfig": {
+ "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": {
"type": "object",
"properties": {
- "api_key": {
- "description": "加密",
+ "app_id": {
"type": "string"
},
- "api_url": {
+ "bucket_name": {
"type": "string"
},
- "e2b_sandbox_ttl_seconds": {
- "type": "integer"
+ "path_prefix": {
+ "type": "string"
},
- "http_timeout_sec": {
- "description": "HTTPTimeoutSec bounds each HTTP call to the sandbox control plane.\n0 means use the built-in default (30s), never the deployment's value.",
- "type": "integer"
+ "region": {
+ "type": "string"
},
- "proxy_url": {
- "description": "ProxyURL is the data-plane gateway that fronts envd. E2B Cloud resolves\n\"\u003cport\u003e-\u003csandboxID\u003e.\u003csandbox_domain\u003e\" through public DNS and TLS, so it\nneeds no value here. Self-hosted E2B-compatible control planes usually\nserve every sandbox from one gateway address and expect the sandbox\nauthority in the Host header; setting this makes WeKnora dial the\ngateway directly instead of requiring wildcard DNS and a certificate\nfor the sandbox domain. An \"http://\" gateway also downgrades the\ndata-plane scheme, which the E2B SDK otherwise pins to https.",
+ "secret_id": {
"type": "string"
},
- "sandbox_domain": {
+ "secret_key": {
"type": "string"
},
- "template_id": {
+ "temp_bucket_name": {
+ "type": "string"
+ },
+ "temp_region": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": {
+ "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": {
"type": "object",
"properties": {
- "dimension": {
- "type": "integer"
+ "embedding_model_id": {
+ "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
+ "type": "string"
},
- "supports_dimension_override": {
+ "enabled": {
+ "description": "Enabled controls whether chat history indexing is active",
"type": "boolean"
},
- "truncate_prompt_tokens": {
- "type": "integer"
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ChatHistoryKBStats": {
"type": "object",
"properties": {
- "custom_instructions": {
- "description": "CustomInstructions adds domain-specific extraction guidance while the\nsystem keeps ownership of the structured graph output protocol.",
+ "embedding_model_id": {
+ "description": "ID of the embedding model used",
"type": "string"
},
"enabled": {
+ "description": "Whether the chat history KB is configured and enabled",
"type": "boolean"
},
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
- }
+ "has_indexed_messages": {
+ "description": "Whether there are any indexed messages (used by frontend to lock embedding model)",
+ "type": "boolean"
},
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
- }
+ "indexed_message_count": {
+ "description": "Number of indexed message entries (Knowledge count)",
+ "type": "integer"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base used for chat history",
+ "type": "string"
},
- "text": {
+ "knowledge_base_name": {
+ "description": "Name of the knowledge base",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": {
+ "github_com_Tencent_WeKnora_internal_types.ChatManage": {
"type": "object",
- "required": [
- "entries"
- ],
"properties": {
- "dry_run": {
- "description": "仅验证,不实际导入",
- "type": "boolean"
- },
- "entries": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
- }
- },
- "knowledge_id": {
+ "chat_model_id": {
+ "description": "Chat model parameters",
"type": "string"
},
- "mode": {
- "type": "string",
- "enum": [
- "append",
- "replace"
- ]
+ "citation_enabled": {
+ "description": "CitationEnabled controls only final knowledge/web source citations. Nil\ndefaults to true for requests and agents created before this option existed.",
+ "type": "boolean"
},
- "task_id": {
- "description": "可选,如果不传则自动生成UUID",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQConfig": {
- "type": "object",
- "properties": {
- "index_mode": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
+ "disable_keywords_match": {
+ "type": "boolean"
},
- "question_index_mode": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": {
- "type": "object",
- "properties": {
- "by_id": {
- "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
- }
+ "disable_vector_match": {
+ "description": "DisableVectorMatch / DisableKeywordsMatch turn off one recall path for\nevery search target. Set by the knowledge-search API.",
+ "type": "boolean"
},
- "by_tag": {
- "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
- }
+ "embedding_top_k": {
+ "type": "integer"
},
- "exclude_ids": {
- "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": {
- "type": "object",
- "properties": {
- "is_enabled": {
+ "enable_query_expansion": {
"type": "boolean"
},
- "is_recommended": {
+ "enable_rewrite": {
+ "description": "Rewrite parameters",
"type": "boolean"
},
- "tag_id": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": {
- "type": "object",
- "required": [
- "standard_question"
- ],
- "properties": {
- "answer_strategy": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
+ "fallback_prompt": {
+ "type": "string"
},
- "answers": {
+ "fallback_response": {
+ "type": "string"
+ },
+ "fallback_strategy": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy"
+ },
+ "history": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.History"
}
},
- "id": {
- "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
- "type": "integer"
- },
- "is_enabled": {
- "type": "boolean"
+ "intent": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QueryIntent"
},
- "is_recommended": {
- "type": "boolean"
+ "keyword_threshold": {
+ "type": "number"
},
- "negative_questions": {
+ "knowledge_base_ids": {
+ "description": "Knowledge base retrieval parameters",
"type": "array",
"items": {
"type": "string"
}
},
- "similar_questions": {
+ "knowledge_ids": {
"type": "array",
"items": {
"type": "string"
}
},
- "standard_question": {
+ "max_rounds": {
+ "type": "integer"
+ },
+ "query": {
"type": "string"
},
- "tag_id": {
- "type": "integer"
+ "query_understand_model_id": {
+ "description": "QueryUnderstandModelID, when set, overrides the chat model used for\nthe query-understanding (rewrite + intent classification) stage only.\nEmpty means fall back to ChatModelID.",
+ "type": "string"
},
- "tag_name": {
+ "rerank_model_id": {
+ "description": "Rerank parameters",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": {
- "type": "string",
- "enum": [
- "question_only",
- "question_answer"
- ],
- "x-enum-varnames": [
- "FAQIndexModeQuestionOnly",
- "FAQIndexModeQuestionAnswer"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": {
- "type": "string",
- "enum": [
- "combined",
- "separate"
- ],
- "x-enum-varnames": [
- "FAQQuestionIndexModeCombined",
- "FAQQuestionIndexModeSeparate"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": {
- "type": "object",
- "required": [
- "query_text"
- ],
- "properties": {
- "first_priority_tag_ids": {
- "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
- "type": "array",
- "items": {
- "type": "integer"
- }
},
- "match_count": {
+ "rerank_threshold": {
+ "type": "number"
+ },
+ "rerank_top_k": {
"type": "integer"
},
- "only_recommended": {
- "description": "是否仅返回推荐的条目",
- "type": "boolean"
+ "rewrite_prompt_system": {
+ "type": "string"
},
- "query_text": {
+ "rewrite_prompt_user": {
"type": "string"
},
- "second_priority_tag_ids": {
- "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "rewrite_query": {
+ "type": "string"
+ },
+ "session_id": {
+ "type": "string"
+ },
+ "summary_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig"
+ },
+ "user_id": {
+ "type": "string"
+ },
+ "vector_database": {
+ "type": "string"
},
"vector_threshold": {
"type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig": {
+ "github_com_Tencent_WeKnora_internal_types.Chunk": {
"type": "object",
"properties": {
- "additional_instruction": {
+ "chunk_index": {
+ "description": "Index position of the chunk in the original document",
+ "type": "integer"
+ },
+ "chunk_type": {
+ "description": "Chunk 类型,用于区分不同类型的 Chunk",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkType"
+ }
+ ]
+ },
+ "content": {
+ "description": "Actual text content of the chunk",
"type": "string"
},
- "allow_regenerate": {
- "type": "boolean"
+ "content_hash": {
+ "description": "ContentHash 存储内容的 hash 值,用于快速匹配(主要用于 FAQ)",
+ "type": "string"
},
- "categories": {
+ "content_revision": {
+ "description": "ContentRevision is incremented for every user edit or rollback.",
+ "type": "integer"
+ },
+ "created_at": {
+ "description": "Chunk creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete marker, supports data recovery",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "end_at": {
+ "description": "Ending character position in the original text",
+ "type": "integer"
+ },
+ "flags": {
+ "description": "Flags 存储多个布尔状态的位标志(如推荐状态等)\n默认值为 ChunkFlagRecommended (1),表示默认可推荐",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkFlags"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the chunk, using UUID format",
+ "type": "string"
+ },
+ "image_info": {
+ "description": "图片信息,存储为 JSON",
+ "type": "string"
+ },
+ "index_status": {
+ "description": "IndexStatus reports whether the current content is reflected in the\nretrieval stores: ready | processing | failed.",
+ "type": "string"
+ },
+ "indirect_relation_chunks": {
+ "description": "间接关系 Chunk ID,用于关联间接关系 Chunk 和原始文本 Chunk",
"type": "array",
"items": {
"type": "string"
}
},
- "count": {
- "type": "integer"
- },
- "enabled": {
+ "is_enabled": {
+ "description": "Whether the chunk is enabled, can be used to temporarily disable certain chunks",
"type": "boolean"
},
- "knowledge_fallback": {
- "type": "boolean"
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base, for quick location",
+ "type": "string"
},
- "max_context_turns": {
- "type": "integer"
+ "knowledge_id": {
+ "description": "ID of the parent knowledge, associated with the Knowledge model",
+ "type": "string"
},
- "mode": {
+ "last_editor_id": {
+ "description": "LastEditorID records the actor that produced the current revision.",
"type": "string"
},
- "model_id": {
+ "metadata": {
+ "description": "Metadata 存储 chunk 级别的扩展信息,例如 FAQ 元数据",
+ "type": "object"
+ },
+ "next_chunk_id": {
+ "description": "Next chunk ID",
"type": "string"
},
- "suppress_on_fallback": {
- "type": "boolean"
+ "parent_chunk_id": {
+ "description": "父 Chunk ID,用于关联图片 Chunk 和原始文本 Chunk",
+ "type": "string"
},
- "suppress_when_answer_asks_question": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.GalleryUserPrefs": {
- "type": "object",
- "properties": {
- "mode": {
- "description": "Mode is \"all\" (every search-eligible field active) or \"custom\"\n(per-field Status governs). Empty = \"all\".",
+ "pre_chunk_id": {
+ "description": "Previous chunk ID",
"type": "string"
},
- "status": {
- "description": "Status maps a namespaced attribute id (\"builtin:caption\") to\n\"on\"/\"off\". Only consulted in custom mode; an unrecorded field is\noff. Source-declared on/off does not exist — activation is always\nthe user's own record.",
- "type": "object",
- "additionalProperties": {
+ "relation_chunks": {
+ "description": "关系 Chunk ID,用于关联关系 Chunk 和原始文本 Chunk",
+ "type": "array",
+ "items": {
"type": "string"
}
+ },
+ "seq_id": {
+ "description": "SeqID is an auto-increment integer ID for external API usage (FAQ entries)",
+ "type": "integer"
+ },
+ "source_locators": {
+ "description": "SourceLocators point back into the original file (page and region,\nslide, sheet rows, ...) so citations can open the file at this chunk.\nEmpty when the parser reported no positions.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SourceLocator"
+ }
+ },
+ "start_at": {
+ "description": "Starting character position in the original text",
+ "type": "integer"
+ },
+ "status": {
+ "description": "Status of the chunk",
+ "type": "integer"
+ },
+ "tag_id": {
+ "description": "Optional tag ID for categorization within a knowledge base (used for FAQ)",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant ID, used for multi-tenant isolation",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Chunk last update time",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.GraphNode": {
+ "github_com_Tencent_WeKnora_internal_types.ChunkFlags": {
+ "type": "integer",
+ "enum": [
+ 1
+ ],
+ "x-enum-varnames": [
+ "ChunkFlagRecommended"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ChunkType": {
+ "type": "string",
+ "enum": [
+ "text",
+ "parent_text",
+ "image_ocr",
+ "image_caption",
+ "image_vector",
+ "entity",
+ "relationship",
+ "faq",
+ "web_search",
+ "table_summary",
+ "table_column",
+ "wiki_page"
+ ],
+ "x-enum-varnames": [
+ "ChunkTypeText",
+ "ChunkTypeParentText",
+ "ChunkTypeImageOCR",
+ "ChunkTypeImageCaption",
+ "ChunkTypeImageVector",
+ "ChunkTypeEntity",
+ "ChunkTypeRelationship",
+ "ChunkTypeFAQ",
+ "ChunkTypeWebSearch",
+ "ChunkTypeTableSummary",
+ "ChunkTypeTableColumn",
+ "ChunkTypeWikiPage"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": {
"type": "object",
"properties": {
- "attributes": {
+ "child_chunk_size": {
+ "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
+ },
+ "chunk_overlap": {
+ "description": "Chunk overlap",
+ "type": "integer"
+ },
+ "chunk_size": {
+ "description": "Chunk size",
+ "type": "integer"
+ },
+ "enable_parent_child": {
+ "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
+ "type": "boolean"
+ },
+ "languages": {
+ "description": "Languages hints the heuristic patterns. Empty = auto-detect from content.\nExamples: [\"de\"], [\"en\", \"zh\"].",
"type": "array",
"items": {
"type": "string"
}
},
- "chunks": {
+ "parent_chunk_size": {
+ "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
+ },
+ "parser_engine_rules": {
+ "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, DefaultParserEngine is used (builtin/simple routing, except\ntypes that only a specific engine can parse: ppt/pptx fall back to\nmarkitdown). A linked anydoc binding is preferred for every type it\nconverts.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "description": "Separators",
"type": "array",
"items": {
"type": "string"
}
},
- "name": {
+ "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"
+ },
+ "table_metadata_instructions": {
+ "description": "TableMetadataInstructions contains optional business guidance used when\ngenerating searchable summaries for CSV/Excel tables. The system-owned\noutput contract remains fixed; these instructions only add domain context.",
+ "type": "string"
+ },
+ "token_limit": {
+ "description": "TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize\nas a character count.",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.GraphRelation": {
+ "github_com_Tencent_WeKnora_internal_types.ConnectionConfig": {
"type": "object",
"properties": {
- "node1": {
+ "addr": {
+ "description": "Common",
"type": "string"
},
- "node2": {
+ "api_key": {
+ "description": "AES-GCM encrypted",
"type": "string"
},
- "type": {
+ "database": {
+ "description": "Database name used by engines that support database-level namespaces\n(currently Milvus, Tencent VectorDB, and Doris).",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ImageActionsConfig": {
- "type": "object",
- "properties": {
- "ocr": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageOCRAction"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ImageAttrCondition": {
- "type": "object",
- "properties": {
- "is": {
+ },
+ "grpc_address": {
+ "description": "Weaviate",
"type": "string"
},
- "prop": {
+ "host": {
+ "description": "Qdrant",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ImageOCRAction": {
- "type": "object",
- "properties": {
- "on": {
- "description": "On is the list of attribute conditions that enable OCR. Matching any one\nturns OCR on.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAttrCondition"
- }
},
- "on_unobserved": {
- "description": "OnUnobserved is the OCR decision used when the observation does not\nanswer for one of the attributes the policy reads — the attribute is\nabsent because the model skipped the line, or because the value it wrote\nwas not one of the allowed ones. The default is true: an incomplete\nobservation keeps extracting, so a missed block of text costs one extra\ncall instead of being lost. Turn it off only with a model reliable enough\nto answer every attribute line.",
+ "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"
+ },
+ "insecure_skip_verify": {
+ "description": "InsecureSkipVerify disables TLS certificate verification when\ntalking to the backing store over HTTPS. Defaults to false\n(secure). Set to true ONLY for self-signed development clusters;\nproduction deployments should provide trusted certificates via\nthe system CA pool. Cross-driver applicable but currently only\nthe OpenSearch driver (Phase 3) reads this field. Note: this\ndiffers from the Qdrant-specific UseTLS below, which *enables*\nTLS on gRPC connections — InsecureSkipVerify only controls\n*verification* of an already-TLS connection.",
+ "type": "boolean"
+ },
+ "password": {
+ "description": "AES-GCM encrypted",
+ "type": "string"
+ },
+ "port": {
+ "type": "integer"
+ },
+ "scheme": {
+ "type": "string"
+ },
+ "use_default_connection": {
+ "description": "Postgres",
+ "type": "boolean"
+ },
+ "use_tls": {
"type": "boolean"
+ },
+ "username": {
+ "type": "string"
+ },
+ "version": {
+ "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": {
+ "type": "string",
+ "enum": [
+ "sliding_window",
+ "smart"
+ ],
+ "x-enum-varnames": [
+ "ContextCompressionSlidingWindow",
+ "ContextCompressionSmart"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ContextConfig": {
"type": "object",
"properties": {
- "image_actions": {
- "description": "ImageActions overrides the built-in attribute→work table (see\nDefaultImageActions). A nil value keeps the conservative default: run OCR\nfor block text, data visuals, and unobserved images.",
+ "compression_strategy": {
+ "description": "Compression strategy: \"sliding_window\" or \"smart\"",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
}
]
},
- "image_attrs_enabled": {
- "description": "ImageAttrsEnabled turns the attribute-observed image pipeline on for this\nknowledge base. It is off by default on purpose, so upgrading an\nexisting deployment never changes what happens to documents already\nbeing ingested: with it off every image is described and OCR'd exactly\nas before. When on, the describe round also observes image attributes and\nthe attribute policy decides whether OCR runs for it. A single upload can\noverride it per document through\nKnowledgeProcessOverrides.ImageAttrsEnabled.",
- "type": "boolean"
+ "max_tokens": {
+ "description": "Maximum tokens allowed in LLM context",
+ "type": "integer"
},
- "image_vector_enabled": {
- "description": "ImageVectorEnabled lets a knowledge base whose embedding model takes\nimages index each image by its own vector and recall it with one. It\nis off by default on purpose: a model that takes images is also used\nfor plain text, and turning this on costs an embedding call per image\nand widens vector recall. Existing knowledge bases stay off after an\nupgrade because the stored JSON has no such key.",
- "type": "boolean"
+ "recent_message_count": {
+ "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "type": "integer"
},
- "model_id": {
- "description": "Model ID",
- "type": "string"
+ "summarize_threshold": {
+ "description": "Summarize threshold: number of messages before summarization",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.IndexConfig": {
+ "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
"type": "object",
+ "required": [
+ "name"
+ ],
"properties": {
- "buckets_num": {
- "description": "Doris: number of buckets per table (DISTRIBUTED BY HASH ... BUCKETS N)",
- "type": "integer"
- },
- "collection_name": {
- "description": "Milvus",
- "type": "string"
- },
- "collection_prefix": {
- "description": "Qdrant, Weaviate",
- "type": "string"
- },
- "desired_shard_count": {
- "description": "Weaviate: number of shards per collection",
- "type": "integer"
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "hnsw_ef_construction": {
- "description": "OpenSearch: HNSW index-build candidate list size",
- "type": "integer"
+ "description": {
+ "type": "string",
+ "maxLength": 1000
},
- "hnsw_ef_search": {
- "description": "OpenSearch: HNSW search candidate list size (faiss; lucene reads at query time)",
+ "invite_code_validity_days": {
+ "description": "optional: 0=never, 1, 7, 30; default 7",
"type": "integer"
},
- "hnsw_m": {
- "description": "--- OpenSearch k-NN HNSW fields ---\nAll omitempty so other engines' serialized IndexConfig is unchanged.\nZero / empty values fall back to the driver defaults in buildInternalCfg.",
+ "member_limit": {
+ "description": "optional: max members; 0=unlimited; default 50",
"type": "integer"
},
- "index_name": {
- "description": "--- Existing fields ---",
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.CredentialsConfig": {
+ "type": "object",
+ "properties": {
+ "weknoracloud": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.CubeEgressRule": {
+ "type": "object",
+ "properties": {
+ "audit": {
+ "description": "Audit is none | metadata | full. Empty uses the server default.",
"type": "string"
},
- "knn_engine": {
- "description": "OpenSearch: k-NN backend (\"lucene\" | \"faiss\")",
- "type": "string"
+ "deny": {
+ "description": "Deny inverts the action, which defaults to allow. A deny rule still\nneeds Host or SNI: the target has to reach CubeEgress for it to answer\nwith a request-level 403 instead of the network layer dropping it.",
+ "type": "boolean"
},
- "number_of_replicas": {
- "description": "ES, OpenSearch",
- "type": "integer"
+ "host": {
+ "type": "string"
},
- "number_of_shards": {
- "description": "ES, OpenSearch",
- "type": "integer"
+ "inject": {
+ "description": "Inject adds credential headers on allowed HTTPS requests.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeHeaderInject"
+ }
},
- "replica_number": {
- "description": "Milvus LoadCollection / Tencent VectorDB CreateCollection replicas",
- "type": "integer"
+ "methods": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "replication_factor": {
- "description": "Qdrant, Weaviate: number of replicas",
- "type": "integer"
+ "name": {
+ "type": "string"
},
- "replication_num": {
- "description": "Doris: replication_num PROPERTIES",
- "type": "integer"
+ "path": {
+ "type": "string"
},
- "shard_number": {
- "description": "--- Scalability fields ---",
- "type": "integer"
+ "scheme": {
+ "type": "string"
},
- "shards_num": {
- "description": "Milvus: number of shards per collection (CreateCollection)",
- "type": "integer"
+ "sni": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.IndexingStrategy": {
+ "github_com_Tencent_WeKnora_internal_types.CubeHeaderInject": {
"type": "object",
"properties": {
- "graph_enabled": {
- "description": "GraphEnabled enables knowledge graph entity/relation extraction",
- "type": "boolean"
- },
- "keyword_enabled": {
- "description": "KeywordEnabled enables keyword-based (BM25) search",
- "type": "boolean"
+ "format": {
+ "type": "string"
},
- "vector_enabled": {
- "description": "VectorEnabled enables semantic vector embedding and search",
- "type": "boolean"
+ "header": {
+ "type": "string"
},
- "wiki_enabled": {
- "description": "WikiEnabled enables automatic wiki page generation from documents",
- "type": "boolean"
+ "secret": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CubeSandboxConfig": {
"type": "object",
- "required": [
- "role"
- ],
"properties": {
- "representative_user_id": {
- "description": "RepresentativeUserID is accepted for compatibility and ignored: a\ndirect add attaches no user of the enrolled workspace, since the\ninviter must not choose whose details the roster shows.",
+ "api_key": {
+ "description": "加密",
"type": "string"
},
- "role": {
- "description": "Role to assign: admin/editor/viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "api_url": {
+ "type": "string"
},
- "tenant_id": {
- "description": "TenantID is the workspace to enrol as an org member. Preferred field.",
+ "cube_sandbox_ttl_seconds": {
"type": "integer"
},
- "user_id": {
- "description": "UserID is retained for backward compatibility. When set without\nTenantID, the handler resolves the user's TenantID.",
+ "dns_servers": {
+ "description": "DNSServers are Cube template nameserver IPs. Empty uses Cubelet's default.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "http_timeout_sec": {
+ "description": "HTTPTimeoutSec bounds each HTTP call to the sandbox control plane.\n0 means use the built-in default (30s), never the deployment's value.",
+ "type": "integer"
+ },
+ "proxy_url": {
+ "type": "string"
+ },
+ "sandbox_domain": {
+ "type": "string"
+ },
+ "template_id": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CustomAgent": {
"type": "object",
- "required": [
- "organization_id"
- ],
"properties": {
- "message": {
- "description": "Optional message for join request",
- "type": "string",
- "maxLength": 500
- },
- "organization_id": {
+ "avatar": {
+ "description": "Avatar/Icon of the agent (emoji or icon name)",
"type": "string"
},
- "role": {
- "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "config": {
+ "description": "Agent configuration",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
}
]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
- "type": "object",
- "required": [
- "invite_code"
- ],
- "properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
- }
- }
- },
- "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": {
+ },
+ "created_at": {
+ "description": "Timestamps",
"type": "string"
},
- "bucket_name": {
+ "created_by": {
+ "description": "Created by user ID",
"type": "string"
},
- "endpoint": {
+ "creator_name": {
+ "description": "CreatorName 由 list handler 在返回前批量回填,作用同 KnowledgeBase.CreatorName:\n让前端列表卡片区分「我创建」与「同空间其他成员创建」。不落库,内建 agent / 老数据\n仍可能为空。",
"type": "string"
},
- "path_prefix": {
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description of the agent",
"type": "string"
},
- "region": {
+ "id": {
+ "description": "Unique identifier of the agent (composite primary key with TenantID)\nFor built-in agents, this is 'builtin-quick-answer' or 'builtin-smart-reasoning'\nFor custom agents, this is a UUID",
"type": "string"
},
- "secret_key": {
+ "is_builtin": {
+ "description": "Whether this is a built-in agent (normal mode / agent mode)",
+ "type": "boolean"
+ },
+ "name": {
+ "description": "Name of the agent",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant ID (composite primary key with ID)",
+ "type": "integer"
+ },
+ "updated_at": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": {
+ "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
"type": "object",
"properties": {
- "asr_config": {
- "description": "ASR config (Automatic Speech Recognition)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
- }
- ]
- },
- "auto_tag_config": {
- "description": "AutoTagConfig controls asynchronous association of existing tags after parsing.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
- }
- ]
- },
- "chunk_count": {
- "description": "Chunk count (not stored in database, calculated on query)",
- "type": "integer"
- },
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
- },
- "created_at": {
- "description": "Creation time of the knowledge base",
+ "agent_mode": {
+ "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
"type": "string"
},
- "creator_id": {
- "description": "CreatorID records the user ID of whoever originally created the KB.\nUsed by the workspace-level RBAC middleware to let Contributors edit\ntheir own KBs without granting them access to everyone else's.\nNullable for backward compatibility with rows created before the\nRBAC migration backfilled the column to the workspace Owner.",
+ "agent_type": {
+ "description": "AgentType is a preset category under smart-reasoning mode that pre-fills\nsystem prompt, allowed tools and recommended KB compatibility.\nValid values: \"rag-qa\", \"wiki-qa\", \"hybrid-rag-wiki\", \"custom\".\nEmpty / unknown values are treated as \"custom\" (no preset applied).\nIgnored for quick-answer mode.",
"type": "string"
},
- "creator_name": {
- "description": "CreatorName 是 CreatorID 对应用户的展示名(username / email 等),\n仅在列表场景由 handler 批量回填,不落库;为空表示创建者无法解析(用户已删除、\nCreatorID 为空的老数据等)。前端用它在卡片来源徽章上做 mine vs workspace 的二分。",
+ "allowed_tools": {
+ "description": "Allowed tools (only for agent type)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "asr_model_id": {
+ "description": "ASR model ID for audio transcription (optional)",
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time of the knowledge base",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "attachment_image_understanding": {
+ "description": "AttachmentImageUnderstanding enables VLM OCR fallback for image-only /\nscanned documents (PDF/PPT whose pages are images). Disabled by default\nbecause it materially increases parse latency; only triggers when the\nextracted text is below a threshold and a VLM model is configured.",
+ "type": "boolean"
},
- "description": {
- "description": "Description of the knowledge base",
- "type": "string"
+ "attachment_ocr_max_pages": {
+ "description": "AttachmentOCRMaxPages caps how many pages of a scanned / image-only\ndocument this agent sends to the VLM for OCR. 0 falls back to the global\ndefault (WEKNORA_CHAT_ATTACHMENT_OCR_MAX_PAGES). More pages means higher\ncoverage but slower parsing and more VLM cost.",
+ "type": "integer"
},
- "embedding_model_id": {
- "description": "ID of the embedding model",
- "type": "string"
+ "attachment_parse_wait_timeout_sec": {
+ "description": "AttachmentParseWaitTimeoutSec bounds, in seconds, how long a chat turn\nwaits for this agent's still-parsing attachments before proceeding with\nonly the finished ones. 0 falls back to the global default\n(WEKNORA_CHAT_ATTACHMENT_WAIT_TIMEOUT_SEC).",
+ "type": "integer"
},
- "extract_config": {
- "description": "Extract config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
- }
- ]
+ "audio_upload_enabled": {
+ "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
+ "type": "boolean"
},
- "faq_config": {
- "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
- }
- ]
+ "chat_parser_engine_rules": {
+ "description": "===== Chat Attachment Parsing Settings =====\nChatParserEngineRules selects parser engines for session-scoped chat\nattachments by file type. Takes precedence over the tenant-level\nParserEngineConfig.ChatParserEngineRules; an explicit per-request\nparser_engine still overrides both.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
},
- "generated_profile": {
- "description": "GeneratedProfile is the machine-generated description: a gist, merged\ntopics, typical questions and the aggregate snapshot they came from. It\nnever overwrites the user-authored Description; both are shown to agents.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile"
- }
- ]
+ "citation_enabled": {
+ "description": "Whether final answers include knowledge/web source citations. Nil defaults to true\nso agents saved before this option was introduced keep their existing behavior.",
+ "type": "boolean"
},
- "id": {
- "description": "Unique identifier of the knowledge base",
+ "context_template": {
+ "description": "Context template for normal mode (how to format retrieved chunks)",
"type": "string"
},
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
- }
- ]
- },
- "indexing_strategy": {
- "description": "IndexingStrategy controls which indexing pipelines are active for this knowledge base.\nPipelines: vector search, keyword search, wiki generation, knowledge graph extraction.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
- }
- ]
+ "context_template_id": {
+ "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content is resolved at request time for saved agents.",
+ "type": "string"
},
- "is_pinned": {
- "description": "IsPinned and PinnedAt are computed per-caller from user_kb_pins\n(see migration 000050). They used to be stored on the row itself,\nwhich made pinning a workspace-wide ordering decision gated behind\nthe kb-edit RBAC guard. The columns are still present in legacy\nschemas for rollback safety but are no longer read or written by\nthe application — both fields are tagged ` + "`" + `gorm:\"-\"` + "`" + ` so GORM\nignores them on every CRUD call and the list handler stamps them\nafter enriching with the caller's pin set.",
+ "data_analysis_enabled": {
+ "description": "===== Data Analysis Settings =====\nWhether to run the legacy in-pipeline DuckDB SQL data-analysis stage when\nthe retrieved chunks include CSV/Excel files. This issues an extra LLM\ncall to generate a SQL query and is disabled by default because most\nquick-answer / RAG-style agents do not want the added latency.",
"type": "boolean"
},
- "is_processing": {
- "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
+ "embedding_top_k": {
+ "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
+ "type": "integer"
+ },
+ "enable_query_expansion": {
+ "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
"type": "boolean"
},
- "is_temporary": {
- "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
+ "enable_rewrite": {
+ "description": "Whether to enable query rewrite for multi-turn conversations",
"type": "boolean"
},
- "knowledge_count": {
- "description": "Knowledge count (not stored in database, calculated on query)",
- "type": "integer"
+ "fallback_prompt": {
+ "description": "Fallback prompt (when FallbackStrategy is \"model\")",
+ "type": "string"
},
- "name": {
- "description": "Name of the knowledge base",
+ "fallback_response": {
+ "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
"type": "string"
},
- "pinned_at": {
- "description": "PinnedAt records when the current caller pinned this knowledge\nbase; nil when they have not.",
+ "fallback_strategy": {
+ "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
"type": "string"
},
- "processing_count": {
- "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
- "type": "integer"
+ "faq_direct_answer_threshold": {
+ "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
+ "type": "number"
},
- "profile_config": {
- "description": "ProfileConfig controls automatic generation of the knowledge-base\ndescription from per-document profiles (document knowledge bases only).",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
- }
- ]
+ "faq_priority_enabled": {
+ "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "type": "boolean"
},
- "question_generation_config": {
- "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
- }
- ]
+ "faq_score_boost": {
+ "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
+ "type": "number"
},
- "share_count": {
- "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "history_turns": {
+ "description": "Number of history turns to keep in context. Quick-answer only; smart-reasoning sizes history by context window",
"type": "integer"
},
- "storage_backend_id": {
- "description": "StorageBackendID binds this KB to one concrete storage instance. The\nlegacy provider field remains readable during migration only.",
+ "image_storage_provider": {
+ "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\".\nEmpty means use the global/workspace default provider.",
"type": "string"
},
- "storage_config": {
- "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
- }
- ]
+ "image_upload_enabled": {
+ "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "type": "boolean"
},
- "storage_provider_config": {
- "description": "Storage provider config (new): only stores provider selection; credentials from workspace StorageEngineConfig",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
- }
- ]
+ "intent_prompts": {
+ "description": "IntentPrompts holds per-intent system prompt overrides for non-retrieval\nintents (greeting, chitchat, etc.). Empty values fall back to templates\nunder config/prompt_templates/intent_prompts.yaml.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "summary_model_id": {
- "description": "Summary model ID",
+ "kb_selection_mode": {
+ "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
"type": "string"
},
- "tenant_id": {
- "description": "Workspace ID",
+ "keyword_threshold": {
+ "description": "Keyword retrieval threshold",
+ "type": "number"
+ },
+ "knowledge_bases": {
+ "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "llm_call_timeout": {
+ "description": "Timeout for a single LLM call in seconds (0 = use global default)",
"type": "integer"
},
- "type": {
- "description": "Type of the knowledge base (document, faq, etc.)",
- "type": "string"
+ "max_completion_tokens": {
+ "description": "Maximum completion tokens. Quick-answer uses this for the RAG answer.\nSmart-reasoning ReAct rounds send this value as-is (zero becomes\nDefaultMaxCompletionTokens at call time: 4096, or 24576 with a sandbox).",
+ "type": "integer"
},
- "updated_at": {
- "description": "Last updated time of the knowledge base",
- "type": "string"
+ "max_iterations": {
+ "description": "===== Agent Mode Settings =====\nMaximum iterations for the ReAct loop. Zero is unset (filled with a\ndefault). A negative value is unlimited: the loop runs until the model\nstops, the user cancels, or another guard fires.",
+ "type": "integer"
},
- "vector_store_id": {
- "description": "VectorStoreID references the VectorStore this knowledge base is bound to.\nWhen nil, the KB falls back to the workspace's effective engines derived from\nthe RETRIEVE_DRIVER environment variable (env store flow).\nThis field is set once at creation time and must not be modified afterwards;\nenforcement lives at the GORM layer (` + "`" + `\u003c-:create` + "`" + `) plus the service-layer\nKB update path, which omits this field from its update DTO.",
- "type": "string"
+ "mcp_auth_wait_timeout": {
+ "description": "MCPAuthWaitTimeout is how many seconds to wait for in-conversation OAuth\nauthorization before skipping. \u003c=0 uses the gate's configured timeout.",
+ "type": "integer"
},
- "vlm_config": {
- "description": "VLM config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
- }
- ]
+ "mcp_selection_mode": {
+ "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
+ "type": "string"
},
- "wiki_config": {
- "description": "WikiConfig stores wiki-specific configuration (only for wiki type knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
- "type": "object",
- "properties": {
- "auto_tag_config": {
- "description": "AutoTagConfig controls optional automatic association of existing KB tags.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
- }
- ]
+ "mcp_services": {
+ "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
+ "memory_enabled": {
+ "description": "Whether this agent may read the user's long-term memory. Nil inherits\nthe workspace setting; false opts a single agent out of memory even when\nthe workspace has it on. There is no \"on\" that overrides the workspace.",
+ "type": "boolean"
},
- "faq_config": {
- "description": "FAQ configuration (only for FAQ type knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
- }
- ]
+ "model_id": {
+ "description": "===== Model Settings =====\nModel ID to use for conversations",
+ "type": "string"
},
- "image_processing_config": {
- "description": "Image processing configuration.\n\nnil means \"no change\" when updating, the same contract IndexingStrategy\nuses. A request that does not mention this field must leave the image\nsettings alone: the attribute-observation switch and the attribute policy\nare things a knowledge base accumulates, and a client that predates them\nwould otherwise reset the lot on any save. Sending an object — empty\nincluded — replaces the whole configuration.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
- }
- ]
+ "multi_turn_enabled": {
+ "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
+ "type": "boolean"
},
- "indexing_strategy": {
- "description": "IndexingStrategy controls which indexing pipelines are active.\nnil means \"no change\" when updating (preserves existing strategy).",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
- }
- ]
+ "query_understand_model_id": {
+ "description": "Dedicated chat model ID for the query-understanding (rewrite + intent) step.\nWhen empty, the main conversation ModelID is used as a fallback.",
+ "type": "string"
},
- "profile_config": {
- "description": "ProfileConfig controls optional automatic knowledge-base description\ngeneration. nil means \"no change\" when updating.",
+ "question_suggestions": {
+ "description": "===== Conversation Question Suggestions =====\nQuestionSuggestions owns both the static/knowledge-backed prompts shown\nbefore the first user turn and the contextual follow-up questions shown\nafter a completed assistant answer.",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig"
}
]
},
- "wiki_config": {
- "description": "Wiki configuration (only for wiki-enabled knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile": {
- "type": "object",
- "properties": {
- "aggregate_hash": {
- "description": "AggregateHash identifies the aggregate the gist was generated from. A\nmismatch with the live aggregate means the text is stale.",
+ "reasoning_effort": {
+ "description": "ReasoningEffort selects the thinking intensity (off | auto | minimal |\nlow | medium | high | xhigh | max). Empty keeps the boolean Thinking\nsemantics: true means \"auto\". See internal/models/api.ReasoningEffort.",
"type": "string"
},
- "error": {
- "description": "Error holds the last generation error when Status is failed.",
+ "rerank_model_id": {
+ "description": "ReRank model ID for retrieval",
"type": "string"
},
- "generated_at": {
- "description": "GeneratedAt records when the text was produced.",
- "type": "string"
+ "rerank_threshold": {
+ "description": "Rerank threshold",
+ "type": "number"
},
- "gist": {
- "description": "Gist is a short statement of what the knowledge base covers.",
- "type": "string"
+ "rerank_top_k": {
+ "description": "Rerank top K",
+ "type": "integer"
},
- "model_id": {
- "description": "ModelID records which chat model produced the text.",
+ "retain_retrieval_history": {
+ "description": "Whether to retain retrieval history across turns",
+ "type": "boolean"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
+ "type": "boolean"
+ },
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompt system message",
"type": "string"
},
- "stats": {
- "description": "Stats is the aggregate snapshot the text was generated from.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileStats"
- }
- ]
+ "rewrite_prompt_user": {
+ "description": "Rewrite prompt user message template",
+ "type": "string"
},
- "status": {
- "description": "Status is one of the KnowledgeBaseProfileStatus* values.",
+ "sandbox_config_id": {
+ "description": "===== Sandbox Settings =====\nSandboxConfigID selects which workspace sandbox config this agent's\nskill scripts run on. Empty means sandbox execution is disabled.\n\nThis references the LOGICAL config, never a specific revision: keeping\nthe indirection here is what would let credential rotation happen\nwithout re-pointing every agent (see the spec's §4.8).",
"type": "string"
},
- "topics": {
- "description": "Topics is the merged topic list (at most KnowledgeBaseProfileMaxTopics).",
+ "selected_skills": {
+ "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
"type": "array",
"items": {
"type": "string"
}
},
- "typical_questions": {
- "description": "TypicalQuestions lists questions this knowledge base can answer.",
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig": {
- "type": "object",
- "properties": {
- "custom_instructions": {
- "description": "CustomInstructions is appended to the stable system prompt, e.g. the\naudience the description should address or terms to keep.",
+ "skills_selection_mode": {
+ "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all installed skills, \"selected\" = specific skills, \"none\" = no skills",
"type": "string"
},
- "enabled": {
- "type": "boolean"
- },
- "model_id": {
- "description": "ModelID overrides the chat model; empty falls back to the KB summary model.",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileStats": {
- "type": "object",
- "properties": {
- "doc_types": {
- "description": "DocTypes counts documents per model-assigned document type.",
+ "supported_file_types": {
+ "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ "type": "string"
}
},
- "document_count": {
- "description": "DocumentCount is the number of eligible documents at generation time.",
- "type": "integer"
+ "system_prompt": {
+ "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
+ "type": "string"
},
- "earliest_at": {
- "description": "EarliestAt and LatestAt bound document creation times.",
+ "system_prompt_id": {
+ "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content is resolved at request time for saved agents.",
"type": "string"
},
- "file_types": {
- "description": "FileTypes counts documents per file extension.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
- }
+ "temperature": {
+ "description": "Temperature for LLM (0-1)",
+ "type": "number"
},
- "folders": {
- "description": "Folders lists the top-level folder names present.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
},
- "latest_at": {
+ "vector_threshold": {
+ "description": "Vector retrieval threshold",
+ "type": "number"
+ },
+ "vlm_model_id": {
+ "description": "VLM model ID for image analysis (optional, falls back to workspace-level VLM)",
"type": "string"
},
- "profiled_count": {
- "description": "ProfiledCount is how many of them carried a document profile.",
+ "web_fetch_enabled": {
+ "description": "Whether to auto-fetch full page content for reranked web search results",
+ "type": "boolean"
+ },
+ "web_fetch_top_n": {
+ "description": "Max number of pages to fetch after rerank (default: 3)",
"type": "integer"
},
- "raw_topics": {
- "description": "RawTopics counts documents per normalized topic keyword before merging.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
- }
+ "web_search_enabled": {
+ "description": "===== Web Search Settings =====\nWhether web search is enabled",
+ "type": "boolean"
},
- "tags": {
- "description": "Tags counts documents per knowledge-base tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
- }
+ "web_search_max_results": {
+ "description": "Maximum web search results",
+ "type": "integer"
+ },
+ "web_search_provider_id": {
+ "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the workspace's default provider (is_default=true) is used.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
+ "github_com_Tencent_WeKnora_internal_types.DataSource": {
"type": "object",
"properties": {
- "chunk_count": {
- "type": "integer"
+ "config": {
+ "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "type": "object"
+ },
+ "conflict_strategy": {
+ "description": "Conflict resolution strategy: overwrite or skip",
+ "type": "string"
},
"created_at": {
+ "description": "Creation timestamp",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "error_message": {
+ "description": "Error message if status is \"error\"",
"type": "string"
},
"id": {
+ "description": "Unique identifier",
"type": "string"
},
"knowledge_base_id": {
+ "description": "Target knowledge base ID",
"type": "string"
},
- "knowledge_base_name": {
+ "last_sync_at": {
+ "description": "Last successful sync timestamp",
"type": "string"
},
- "knowledge_base_type": {
- "type": "string"
+ "last_sync_cursor": {
+ "description": "Cursor or state for incremental sync (connector-specific)",
+ "type": "object"
},
- "knowledge_count": {
- "type": "integer"
+ "last_sync_result": {
+ "description": "Summary of last sync result",
+ "type": "object"
},
- "my_permission": {
- "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
- "type": "string"
+ "latest_sync_log": {
+ "description": "Latest sync log (not stored in DB, populated on query)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ }
+ ]
},
- "my_role_in_org": {
- "description": "Current user's role in this organization (admin/editor/viewer)",
+ "name": {
+ "description": "User-friendly name",
"type": "string"
},
- "organization_id": {
+ "status": {
+ "description": "Current status: active, paused, error",
"type": "string"
},
- "organization_name": {
+ "sync_deletions": {
+ "description": "Whether to sync deletions from source",
+ "type": "boolean"
+ },
+ "sync_log_retention_days": {
+ "description": "Number of days to keep sync logs (default: 30)",
+ "type": "integer"
+ },
+ "sync_mode": {
+ "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
"type": "string"
},
- "permission": {
- "description": "Share permission (what the space was granted: viewer/editor)",
+ "sync_schedule": {
+ "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
"type": "string"
},
- "require_approval": {
- "type": "boolean"
+ "tenant_id": {
+ "description": "Workspace ID for multi-workspace isolation",
+ "type": "integer"
},
- "shared_by_user_id": {
- "type": "string"
+ "total_items_synced": {
+ "description": "Total items synced (not stored in DB, calculated on query)",
+ "type": "integer"
},
- "shared_by_username": {
+ "type": {
+ "description": "Connector type (feishu, notion, confluence, etc.)",
"type": "string"
},
- "source_tenant_id": {
- "type": "integer"
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress": {
+ "github_com_Tencent_WeKnora_internal_types.DockerSandboxConfig": {
"type": "object",
"properties": {
- "created_at": {
- "description": "任务创建时间",
- "type": "integer"
+ "cpu_limit": {
+ "description": "CPULimit is the number of CPU cores one sandbox may use. 0 uses the\nbuilt-in default.",
+ "type": "number"
},
- "error": {
- "description": "错误信息",
+ "host": {
+ "description": "Host is the daemon endpoint in DOCKER_HOST form. Empty means the local\nunix socket.",
"type": "string"
},
- "failed": {
- "description": "失败数",
+ "http_timeout_sec": {
+ "description": "HTTPTimeoutSec bounds each Engine API call. 0 uses the built-in default.",
"type": "integer"
},
- "message": {
- "description": "状态消息",
+ "idle_ttl_seconds": {
+ "description": "IdleTTLSeconds is how long a session container may go unused before it\nis reclaimed. The daemon has no idle timeout of its own, so this is what\nstops an abandoned session from pinning host memory indefinitely.",
+ "type": "integer"
+ },
+ "image": {
"type": "string"
},
- "processed": {
- "description": "已处理数",
+ "memory_limit_mb": {
+ "description": "MemoryLimitMB caps one sandbox's memory. 0 uses the built-in default.",
"type": "integer"
},
- "progress": {
- "description": "0-100",
+ "network_mode": {
+ "description": "NetworkMode is the Docker network sandboxes join: \"bridge\" (default) or\n\"none\" for no egress. Nothing else is accepted — host and container:\nmodes share another namespace outright, and a named network is usually\nthe deployment's own compose network, which would put the sandbox next\nto Postgres and Redis.",
+ "type": "string"
+ },
+ "pids_limit": {
+ "description": "PidsLimit caps how many processes one sandbox may run. 0 uses the\nbuilt-in default.",
"type": "integer"
},
- "source_kb_id": {
+ "runtime": {
+ "description": "Runtime selects an alternative OCI runtime such as \"runsc\" (gVisor).\nEmpty uses the daemon default.",
"type": "string"
},
- "status": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus"
+ "tls_cert_path": {
+ "description": "TLSCertPath is a directory on the WeKnora host containing ca.pem,\ncert.pem and key.pem. Required when Host is a TCP endpoint.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.E2BHostRule": {
+ "type": "object",
+ "properties": {
+ "headers": {
+ "description": "Headers values are credentials and are encrypted at rest; names stay\nreadable so operators can see which headers are injected.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "target_kb_id": {
+ "host": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.E2BSandboxConfig": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "description": "加密",
"type": "string"
},
- "task_id": {
+ "api_url": {
"type": "string"
},
- "total": {
- "description": "总知识数",
+ "e2b_sandbox_ttl_seconds": {
"type": "integer"
},
- "updated_at": {
- "description": "最后更新时间",
+ "http_timeout_sec": {
+ "description": "HTTPTimeoutSec bounds each HTTP call to the sandbox control plane.\n0 means use the built-in default (30s), never the deployment's value.",
"type": "integer"
+ },
+ "proxy_url": {
+ "description": "ProxyURL is the data-plane gateway that fronts envd. E2B Cloud resolves\n\"\u003cport\u003e-\u003csandboxID\u003e.\u003csandbox_domain\u003e\" through public DNS and TLS, so it\nneeds no value here. Self-hosted E2B-compatible control planes usually\nserve every sandbox from one gateway address and expect the sandbox\nauthority in the Host header; setting this makes WeKnora dial the\ngateway directly instead of requiring wildcard DNS and a certificate\nfor the sandbox domain. An \"http://\" gateway also downgrades the\ndata-plane scheme, which the E2B SDK otherwise pins to https.",
+ "type": "string"
+ },
+ "sandbox_domain": {
+ "type": "string"
+ },
+ "template_id": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides": {
+ "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": {
"type": "object",
"properties": {
- "asr_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
- },
- "chunking_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ "dimension": {
+ "type": "integer"
},
- "enable_multimodel": {
+ "supports_dimension_override": {
"type": "boolean"
},
- "extract_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
- },
- "graph_enabled": {
- "type": "boolean"
+ "truncate_prompt_tokens": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.EvaluationDetail": {
+ "type": "object",
+ "properties": {
+ "metric": {
+ "description": "Evaluation metrics",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MetricResult"
+ }
+ ]
},
- "image_actions": {
- "description": "ImageActions overrides rows of the attribute-\u003ework table for this document\n(merged per action key on top of the knowledge base's table).\nnil keeps the knowledge base's setting.",
+ "params": {
+ "description": "Evaluation parameters",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatManage"
}
]
},
- "image_attrs_enabled": {
- "description": "ImageAttrsEnabled overrides the knowledge base's attribute-observed image\npipeline switch for this one document. nil keeps the knowledge base's\nsetting.",
- "type": "boolean"
- },
- "image_vector_enabled": {
- "description": "ImageVectorEnabled overrides image vector indexing for this document.\nIt does not change the KB-wide retrieval setting or embedding model.",
- "type": "boolean"
- },
- "parser_engine_overrides": {
- "description": "ParserEngineOverrides passes key-value configuration to docreader parsers\n(e.g. pdf_force_scanned=true). Merged with workspace-level overrides in the\nparse pipeline; per-upload values take priority on conflict.",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "parser_engine_rules": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
- },
- "question_generation_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
- },
- "summary_enabled": {
- "description": "SummaryEnabled defaults to true when omitted for backward compatibility.",
- "type": "boolean"
- },
- "vlm_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ "task": {
+ "description": "Evaluation task info",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationTask"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
+ "github_com_Tencent_WeKnora_internal_types.EvaluationStatue": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "x-enum-comments": {
+ "EvaluationStatueFailed": "Task failed",
+ "EvaluationStatuePending": "Task is waiting to start",
+ "EvaluationStatueRunning": "Task is in progress",
+ "EvaluationStatueSuccess": "Task completed successfully"
+ },
+ "x-enum-descriptions": [
+ "Task is waiting to start",
+ "Task is in progress",
+ "Task completed successfully",
+ "Task failed"
+ ],
+ "x-enum-varnames": [
+ "EvaluationStatuePending",
+ "EvaluationStatueRunning",
+ "EvaluationStatueSuccess",
+ "EvaluationStatueFailed"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.EvaluationTask": {
"type": "object",
"properties": {
- "members": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
- }
+ "dataset_id": {
+ "description": "Dataset ID for evaluation",
+ "type": "string"
},
- "total": {
+ "err_msg": {
+ "description": "Error message if failed",
+ "type": "string"
+ },
+ "finished": {
+ "description": "Completed items count",
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
- "type": "object",
- "properties": {
- "organizations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
- }
},
- "resource_counts": {
- "description": "各空间内知识库/智能体数量,供列表侧栏展示",
+ "id": {
+ "description": "Unique task ID",
+ "type": "string"
+ },
+ "start_time": {
+ "description": "Task start time",
+ "type": "string"
+ },
+ "status": {
+ "description": "Current task status",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationStatue"
}
]
},
+ "tenant_id": {
+ "description": "Tenant/Organization ID",
+ "type": "integer"
+ },
"total": {
+ "description": "Total items to evaluate",
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
+ "github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
"type": "object",
"properties": {
- "shares": {
+ "custom_instructions": {
+ "description": "CustomInstructions adds domain-specific extraction guidance while the\nsystem keeps ownership of the structured graph output protocol.",
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
}
},
- "total": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": {
- "type": "object",
- "properties": {
- "path_prefix": {
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.LoginRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": {
"type": "object",
"required": [
- "email",
- "password"
+ "entries"
],
"properties": {
- "email": {
- "type": "string"
- },
- "password": {
- "type": "string",
- "minLength": 6
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LoginResponse": {
- "type": "object",
- "properties": {
- "active_tenant": {
- "description": "ActiveTenant is the workspace whose ID is encoded in the issued JWT;\nfuture requests are scoped to it until the client calls /auth/switch-tenant.\nDefaults to the user's home workspace on a fresh login.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
- }
- ]
+ "dry_run": {
+ "description": "仅验证,不实际导入",
+ "type": "boolean"
},
- "memberships": {
- "description": "Memberships lists every workspace the user can authenticate into,\nalong with their role in each. Always populated (length 1 for users\nwho only belong to their home workspace) so frontends can render a\nworkspace switcher without a follow-up request. Serialised without\nomitempty so the field is always present as a JSON array (possibly\nempty) — the \"always populated\" contract relies on the server side\nguaranteeing a non-nil slice.",
+ "entries": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Membership"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
}
},
- "message": {
- "type": "string"
- },
- "refresh_token": {
+ "knowledge_id": {
"type": "string"
},
- "success": {
- "type": "boolean"
+ "mode": {
+ "type": "string",
+ "enum": [
+ "append",
+ "replace"
+ ]
},
- "token": {
+ "task_id": {
+ "description": "可选,如果不传则自动生成UUID",
"type": "string"
- },
- "user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig": {
+ "github_com_Tencent_WeKnora_internal_types.FAQConfig": {
"type": "object",
"properties": {
- "retry_count": {
- "description": "Number of retries, default: 3",
- "type": "integer"
- },
- "retry_delay": {
- "description": "Delay between retries in seconds, default: 1",
- "type": "integer"
+ "index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
},
- "timeout": {
- "description": "Timeout in seconds, default: 30",
- "type": "integer"
+ "question_index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntry": {
"type": "object",
"properties": {
- "api_key": {
- "type": "string"
+ "answer_strategy": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
},
- "api_key_header": {
- "description": "APIKeyHeader is the header name that carries APIKey when AuthType is\napi_key. Empty defaults to \"X-API-Key\". This is non-secret structural\nconfig (the secret is APIKey), so it is not encrypted and is safe to echo\nback in responses. It lets services that expect the key in a different\nheader (e.g. the raw token directly in \"Authorization\") work without\nresorting to plaintext custom headers.",
+ "answers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "chunk_id": {
"type": "string"
},
- "auth_server_metadata_url": {
- "description": "AuthServerMetadataURL optionally pins the OAuth authorization server\nmetadata URL. When empty, the server is discovered automatically from\nthe MCP URL (RFC 9728 / RFC 8414).",
+ "chunk_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkType"
+ },
+ "created_at": {
"type": "string"
},
- "auth_type": {
- "description": "AuthType selects the authentication strategy. Empty (\"\") is treated as\nnone for backward compatibility with rows that pre-date this field.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthType"
- }
- ]
+ "id": {
+ "type": "integer"
},
- "client_id": {
- "description": "ClientID optionally names an OAuth client registered with the\nauthorization server in advance. When set it is used instead of dynamic\nclient registration, for servers that offer no registration endpoint or\nallow grants only to clients an administrator registered. Non-secret.",
+ "index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
+ },
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "is_recommended": {
+ "type": "boolean"
+ },
+ "knowledge_base_id": {
"type": "string"
},
- "client_secret": {
- "description": "ClientSecret is the secret of ClientID for a confidential client.\nSecret: encrypted at rest like APIKey and Token, never returned, and\nchanged only through the credentials subresource after creation.",
+ "knowledge_id": {
"type": "string"
},
- "custom_headers": {
- "type": "object",
- "additionalProperties": {
+ "match_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
+ },
+ "matched_question": {
+ "description": "MatchedQuestion is the actual question text that was matched in FAQ search\nCould be the standard question or one of the similar questions",
+ "type": "string"
+ },
+ "negative_questions": {
+ "type": "array",
+ "items": {
"type": "string"
}
},
- "scopes": {
- "description": "Scopes are the OAuth scopes requested during authorization. Optional.",
+ "score": {
+ "type": "number"
+ },
+ "similar_questions": {
"type": "array",
"items": {
"type": "string"
}
},
- "token": {
+ "standard_question": {
+ "type": "string"
+ },
+ "tag_id": {
+ "type": "integer"
+ },
+ "tag_name": {
+ "type": "string"
+ },
+ "updated_at": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPAuthType": {
- "type": "string",
- "enum": [
- "",
- "api_key",
- "bearer",
- "oauth"
- ],
- "x-enum-varnames": [
- "MCPAuthNone",
- "MCPAuthAPIKey",
- "MCPAuthBearer",
- "MCPAuthOAuth"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": {
"type": "object",
- "additionalProperties": {
- "type": "string"
+ "properties": {
+ "by_id": {
+ "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
+ }
+ },
+ "by_tag": {
+ "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
+ }
+ },
+ "exclude_ids": {
+ "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPHeaders": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": {
"type": "object",
- "additionalProperties": {
- "type": "string"
+ "properties": {
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "is_recommended": {
+ "type": "boolean"
+ },
+ "tag_id": {
+ "type": "integer"
+ }
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPService": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": {
"type": "object",
+ "required": [
+ "standard_question"
+ ],
"properties": {
- "advanced_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
- },
- "auth_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig"
+ "answer_strategy": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
},
- "created_at": {
- "type": "string"
+ "answers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
+ "id": {
+ "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "type": "integer"
},
- "description": {
- "type": "string"
+ "is_enabled": {
+ "type": "boolean"
},
- "enabled": {
+ "is_recommended": {
"type": "boolean"
},
- "env_vars": {
- "description": "Environment variables for stdio",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
- }
- ]
+ "negative_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "headers": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
+ "similar_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "id": {
+ "standard_question": {
"type": "string"
},
- "is_builtin": {
- "description": "Whether this is a builtin MCP service (visible to all workspaces)",
- "type": "boolean"
+ "tag_id": {
+ "type": "integer"
},
- "name": {
+ "tag_name": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQFailedEntry": {
+ "type": "object",
+ "properties": {
+ "answer_all": {
+ "description": "是否全部回复",
+ "type": "boolean"
},
- "stdio_config": {
- "description": "Required for stdio transport",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
- }
- ]
+ "answers": {
+ "description": "答案",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "tenant_id": {
+ "failure_type": {
+ "description": "失败类型:pre_validation / post_validation",
+ "type": "string"
+ },
+ "index": {
+ "description": "条目在批次中的索引(从0开始)",
"type": "integer"
},
- "transport_type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
+ "is_disabled": {
+ "description": "是否停用",
+ "type": "boolean"
},
- "updated_at": {
+ "is_partial_failure": {
+ "description": "是否为部分失败(相似问/反例被移除,但整条仍可导入)",
+ "type": "boolean"
+ },
+ "negative_questions": {
+ "description": "反例问题",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "reason": {
+ "description": "失败原因",
"type": "string"
},
- "url": {
- "description": "Optional: required for SSE/HTTP Streamable",
+ "removed_negative_questions": {
+ "description": "被移除的反例及原因",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "removed_similar_questions": {
+ "description": "部分失败详情(当 IsPartialFailure 为 true 时)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "similar_questions": {
+ "description": "相似问题",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "standard_question": {
+ "description": "标准问题",
"type": "string"
},
- "usage_instructions": {
- "description": "UsageInstructions is maintained locally and is not overwritten by directory refresh.",
+ "tag_name": {
+ "description": "分类",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": {
+ "github_com_Tencent_WeKnora_internal_types.FAQImportProgress": {
"type": "object",
"properties": {
- "args": {
- "description": "Command arguments array",
+ "added_count": {
+ "description": "新增的条目数",
+ "type": "integer"
+ },
+ "created_at": {
+ "description": "Task creation timestamp",
+ "type": "integer"
+ },
+ "display_status": {
+ "description": "显示状态:open 或 close",
+ "type": "string"
+ },
+ "dry_run": {
+ "description": "是否为 dry run 模式",
+ "type": "boolean"
+ },
+ "error": {
+ "description": "Error message if failed",
+ "type": "string"
+ },
+ "failed_count": {
+ "description": "失败的条目数",
+ "type": "integer"
+ },
+ "failed_entries": {
+ "description": "失败条目详情(少量时直接返回)",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQFailedEntry"
}
},
- "command": {
- "description": "Command: \"uvx\" or \"npx\"",
+ "failed_entries_url": {
+ "description": "失败条目CSV下载URL(大量时返回URL)",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPTransportType": {
- "type": "string",
- "enum": [
- "sse",
- "http-streamable",
- "stdio"
- ],
- "x-enum-comments": {
- "MCPTransportHTTPStreamable": "HTTP Streamable",
- "MCPTransportSSE": "Server-Sent Events",
- "MCPTransportStdio": "Stdio (Standard Input/Output)"
- },
- "x-enum-descriptions": [
- "Server-Sent Events",
- "HTTP Streamable",
- "Stdio (Standard Input/Output)"
- ],
- "x-enum-varnames": [
- "MCPTransportSSE",
- "MCPTransportHTTPStreamable",
- "MCPTransportStdio"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": {
- "type": "object",
- "properties": {
- "channel": {
+ },
+ "import_mode": {
+ "description": "Result fields (populated when Status == \"completed\")",
"type": "string"
},
- "content": {
+ "imported_at": {
+ "description": "导入完成时间",
"type": "string"
},
- "process_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides"
+ "kb_id": {
+ "description": "Knowledge Base ID",
+ "type": "string"
},
- "status": {
+ "knowledge_id": {
+ "description": "FAQ Knowledge ID",
"type": "string"
},
- "tag_ids": {
+ "merge_details": {
+ "description": "合并详情",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQMergeDetail"
}
},
- "title": {
+ "merge_entry_indices": {
+ "description": "需要合并的条目索引(内部使用,用于重试时跳过识别)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "merged_count": {
+ "description": "合并更新的条目数",
+ "type": "integer"
+ },
+ "message": {
+ "description": "Status message",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MatchType": {
- "type": "integer",
- "enum": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "x-enum-comments": {
- "MatchTypeDataAnalysis": "数据分析匹配类型",
- "MatchTypeDirectLoad": "Deprecated: reserved to preserve serialized enum values",
- "MatchTypeParentChunk": "父Chunk匹配类型",
- "MatchTypeRelationChunk": "关系Chunk匹配类型",
- "MatchTypeWebSearch": "网络搜索匹配类型"
- },
- "x-enum-descriptions": [
- "",
- "",
- "",
- "",
- "父Chunk匹配类型",
- "关系Chunk匹配类型",
- "",
- "网络搜索匹配类型",
- "Deprecated: reserved to preserve serialized enum values",
- "数据分析匹配类型"
+ },
+ "partial_failed_count": {
+ "description": "部分失败的条目数(相似问/反例被移除)",
+ "type": "integer"
+ },
+ "processed": {
+ "description": "Entries processed so far",
+ "type": "integer"
+ },
+ "processing_time": {
+ "description": "处理耗时(毫秒)",
+ "type": "integer"
+ },
+ "progress": {
+ "description": "0-100 percentage",
+ "type": "integer"
+ },
+ "skipped_count": {
+ "description": "跳过的条目数(如重复等)",
+ "type": "integer"
+ },
+ "status": {
+ "description": "Task status",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQImportTaskStatus"
+ }
+ ]
+ },
+ "success_count": {
+ "description": "完全成功的条目数(不包含部分成功/部分失败)",
+ "type": "integer"
+ },
+ "success_entries": {
+ "description": "成功条目简单信息(少量时直接返回)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSuccessEntry"
+ }
+ },
+ "task_id": {
+ "description": "UUID for the import task",
+ "type": "string"
+ },
+ "total": {
+ "description": "Total entries to import",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "integer"
+ },
+ "valid_entry_indices": {
+ "description": "验证通过的条目索引(用于重试时跳过验证)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQImportTaskStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "processing",
+ "completed",
+ "failed"
],
"x-enum-varnames": [
- "MatchTypeEmbedding",
- "MatchTypeKeywords",
- "MatchTypeNearByChunk",
- "MatchTypeHistory",
- "MatchTypeParentChunk",
- "MatchTypeRelationChunk",
- "MatchTypeGraph",
- "MatchTypeWebSearch",
- "MatchTypeDirectLoad",
- "MatchTypeDataAnalysis"
+ "FAQImportStatusPending",
+ "FAQImportStatusProcessing",
+ "FAQImportStatusCompleted",
+ "FAQImportStatusFailed"
]
},
- "github_com_Tencent_WeKnora_internal_types.MatchedImage": {
+ "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": {
+ "type": "string",
+ "enum": [
+ "question_only",
+ "question_answer"
+ ],
+ "x-enum-varnames": [
+ "FAQIndexModeQuestionOnly",
+ "FAQIndexModeQuestionAnswer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQMergeDetail": {
"type": "object",
"properties": {
- "chunk_id": {
- "type": "string"
+ "answer_changed": {
+ "description": "答案是否变更",
+ "type": "boolean"
},
- "knowledge_base_id": {
- "type": "string"
+ "index": {
+ "description": "行号(在批次中的索引)",
+ "type": "integer"
},
- "url": {
+ "new_negative_count": {
+ "description": "新增反例数量",
+ "type": "integer"
+ },
+ "new_similar_count": {
+ "description": "新增相似问数量",
+ "type": "integer"
+ },
+ "standard_question": {
+ "description": "标准问",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Membership": {
+ "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": {
+ "type": "string",
+ "enum": [
+ "combined",
+ "separate"
+ ],
+ "x-enum-varnames": [
+ "FAQQuestionIndexModeCombined",
+ "FAQQuestionIndexModeSeparate"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": {
"type": "object",
+ "required": [
+ "query_text"
+ ],
"properties": {
- "role": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantRole"
+ "first_priority_tag_ids": {
+ "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
- "tenant_id": {
+ "match_count": {
"type": "integer"
},
- "tenant_name": {
+ "only_recommended": {
+ "description": "是否仅返回推荐的条目",
+ "type": "boolean"
+ },
+ "query_text": {
"type": "string"
+ },
+ "second_priority_tag_ids": {
+ "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MemoryConfig": {
+ "github_com_Tencent_WeKnora_internal_types.FAQSuccessEntry": {
"type": "object",
"properties": {
- "embedding_model_id": {
- "description": "EmbeddingModelID is the single model used to score memory against a\nquestion. It is pinned per workspace: knowledge bases each have their\nown embedding model, and grabbing whichever one happens to be listed\nfirst would mix incomparable vector spaces. Blank means semantic recall\nis off and matching stays lexical.",
- "type": "string"
- },
- "enabled": {
- "description": "Enabled defaults to false. Memory retains user statements across\nsessions, so a workspace admin has to turn it on deliberately.",
- "type": "boolean"
- },
- "extract_delay_seconds": {
- "description": "ExtractDelaySeconds is how long a finished turn waits before\ndistillation runs. Waiting lets one model call cover the several\nmessages a user usually sends in a row. 0 means the default.",
+ "index": {
+ "description": "条目在批次中的索引(从0开始)",
"type": "integer"
},
- "extract_instructions": {
- "description": "ExtractInstructions are workspace-specific rules appended to the\ndistillation prompt, for policies the product cannot guess (\"never record\ncustomer names\", \"always note the environment a question is about\").",
- "type": "string"
- },
- "extract_min_interval_seconds": {
- "description": "ExtractMinIntervalSeconds is the floor between two distillation runs for\nthe same person, and exists purely to bound cost. It never drops a turn:\na turn arriving inside the interval is queued and picked up by the next\nrun. 0 means the default.",
+ "seq_id": {
+ "description": "导入后的条目序列ID",
"type": "integer"
},
- "extract_model_id": {
- "description": "ExtractModelID is the model used by the background extraction task.\nEmpty means \"use the model the conversation itself used\", which is what\nthe settings UI promises, so the extraction task must never fail merely\nbecause this is blank.",
+ "standard_question": {
+ "description": "标准问题",
"type": "string"
},
- "interest_threshold": {
- "description": "InterestThreshold is how many separate conversations must touch a topic\nbefore it becomes a stored interest. 0 means the default. Setting it to 1\nrecords every topic on first sight, which is usually too noisy.",
- "type": "integer"
- },
- "max_items": {
- "description": "MaxItems caps active items per subject. 0 means DefaultMemoryMaxItems.",
+ "tag_id": {
+ "description": "分类ID(seq_id)",
"type": "integer"
},
- "retrieval_conditioning": {
- "description": "RetrievalConditioning lets memory shape retrieval — query rewriting and\nper-document ranking — rather than only being appended to the answer\nprompt. This is where memory earns its keep in a knowledge-base product.",
- "type": "boolean"
- },
- "vector_recall": {
- "description": "VectorRecall adds semantic similarity to memory recall. Nil means on\nwhen an embedding model is reachable.\n\nLexical matching alone cannot find a memory the user has re-worded, which\nis most of them: \"回答直接给结论\" and \"别铺垫那么多\" share no tokens. The\ncost is one embedding call per turn, bounded and degraded to lexical on\nfailure, so the feature never becomes a reason a chat is slow.",
- "type": "boolean"
- },
- "write_mode": {
- "description": "WriteMode is MemoryWriteExplicitOnly or MemoryWriteAuto.",
+ "tag_name": {
+ "description": "分类名称",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MentionedItem": {
+ "github_com_Tencent_WeKnora_internal_types.FallbackStrategy": {
+ "type": "string",
+ "enum": [
+ "fixed",
+ "model"
+ ],
+ "x-enum-comments": {
+ "FallbackStrategyFixed": "Fixed response",
+ "FallbackStrategyModel": "Model fallback response"
+ },
+ "x-enum-descriptions": [
+ "Fixed response",
+ "Model fallback response"
+ ],
+ "x-enum-varnames": [
+ "FallbackStrategyFixed",
+ "FallbackStrategyModel"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig": {
"type": "object",
"properties": {
- "id": {
+ "additional_instruction": {
"type": "string"
},
- "kb_id": {
- "description": "Parent knowledge base for file/tag mentions",
- "type": "string"
+ "allow_regenerate": {
+ "type": "boolean"
},
- "kb_name": {
- "description": "Display name for parent KB",
- "type": "string"
+ "categories": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
- "type": "string"
+ "count": {
+ "type": "integer"
},
- "name": {
- "type": "string"
+ "enabled": {
+ "type": "boolean"
},
- "service_id": {
- "description": "Parent MCP service for MCP tool mentions",
- "type": "string"
+ "knowledge_fallback": {
+ "type": "boolean"
},
- "skill_name": {
- "description": "Preloaded agent skill name",
+ "max_context_turns": {
+ "type": "integer"
+ },
+ "mode": {
"type": "string"
},
- "type": {
- "description": "\"kb\", \"file\", \"tag\", \"mcp\", \"skill\"",
+ "model_id": {
"type": "string"
+ },
+ "suppress_on_fallback": {
+ "type": "boolean"
+ },
+ "suppress_when_answer_asks_question": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Message": {
+ "github_com_Tencent_WeKnora_internal_types.GalleryUserPrefs": {
"type": "object",
"properties": {
- "agent_duration_ms": {
- "description": "Agent total execution duration in milliseconds (from query start to answer start)",
- "type": "integer"
- },
- "agent_id": {
- "description": "AgentID is the agent used for this individual assistant turn. Unlike the\nsession's last_request_state it remains stable when users switch agents.",
+ "mode": {
+ "description": "Mode is \"all\" (every search-eligible field active) or \"custom\"\n(per-field Status governs). Empty = \"all\".",
"type": "string"
},
- "agent_steps": {
- "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep"
+ "status": {
+ "description": "Status maps a namespaced attribute id (\"builtin:caption\") to\n\"on\"/\"off\". Only consulted in custom mode; an unrecorded field is\noff. Source-declared on/off does not exist — activation is always\nthe user's own record.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.GenerationMetrics": {
+ "type": "object",
+ "properties": {
+ "bleu1": {
+ "description": "BLEU-1 score",
+ "type": "number"
},
- "artifacts": {
- "description": "Skill-generated files produced during this assistant turn (assistant messages only).\nPopulated by ArtifactCollector after the sandbox finishes, referenced by the\nartifact download endpoint. Empty for user messages and turns without skills.\n\nStored in the message_artifacts table, not on the message row: the message\nrepository loads it with every message it returns and writes it whenever it\nis non-nil on create or update. A nil slice leaves the stored rows alone.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageArtifact"
- }
- },
- "attachments": {
- "description": "Attached files (documents, audio, etc., for user messages)",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageAttachment"
- }
- },
- "channel": {
- "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
- "type": "string"
- },
- "content": {
- "description": "Message text content",
- "type": "string"
- },
- "created_at": {
- "description": "Message creation timestamp",
- "type": "string"
- },
- "deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "id": {
- "description": "Unique identifier for the message",
- "type": "string"
- },
- "images": {
- "description": "Attached images with OCR/Caption text (for user messages)",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage"
- }
+ "bleu2": {
+ "description": "BLEU-2 score",
+ "type": "number"
},
- "is_completed": {
- "description": "Whether message generation is complete",
- "type": "boolean"
+ "bleu4": {
+ "description": "BLEU-4 score",
+ "type": "number"
},
- "is_fallback": {
- "description": "Whether this response is a fallback (no knowledge base match found)",
- "type": "boolean"
+ "rouge1": {
+ "description": "ROUGE-1 score",
+ "type": "number"
},
- "knowledge_id": {
- "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
- "type": "string"
+ "rouge2": {
+ "description": "ROUGE-2 score",
+ "type": "number"
},
- "knowledge_references": {
- "description": "References to knowledge chunks used in the response",
+ "rougel": {
+ "description": "ROUGE-L score",
+ "type": "number"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.GraphNode": {
+ "type": "object",
+ "properties": {
+ "attributes": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
+ "type": "string"
}
},
- "mentioned_items": {
- "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "chunks": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
+ "type": "string"
}
},
- "model_id": {
- "description": "ModelID is the requested/effective chat model binding captured for this\nturn. It is useful for reproducibility and suggestion generation.",
+ "name": {
"type": "string"
- },
- "request_id": {
- "description": "Request identifier for tracking API requests",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.GraphRelation": {
+ "type": "object",
+ "properties": {
+ "node1": {
"type": "string"
},
- "role": {
- "description": "Message role: \"user\", \"assistant\", \"system\"",
+ "node2": {
"type": "string"
},
- "sandbox_checkpoint": {
- "description": "SandboxCheckpoint is the git commit this assistant turn produced in the\nsession sandbox's /workspace. Nil for user messages, for turns that ran\nwithout a sandbox, and for turns whose commit failed (best-effort — a\nfailed checkpoint must never block the reply). A message without a\ncheckpoint cannot serve as a fork point with sandbox state.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SandboxCheckpoint"
- }
- ]
- },
- "session_id": {
- "description": "ID of the session this message belongs to",
+ "type": {
"type": "string"
- },
- "updated_at": {
- "description": "Last update timestamp",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.History": {
+ "type": "object",
+ "properties": {
+ "answer": {
+ "description": "System response text",
"type": "string"
},
- "usage": {
- "description": "LLM token usage aggregated across every round of the turn that produced this\nassistant message. Persisted so history reads can attribute cost after the\nlive stream is gone; NULL (nil) for user messages and pre-feature rows.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TokenUsage"
- }
- ]
+ "createAt": {
+ "description": "When this history entry was created",
+ "type": "string"
},
- "used_memories": {
- "description": "UsedMemories records which long-term memories were injected into this\nanswer, so the chat UI can show them and let the user delete one on the\nspot. Persisted rather than only streamed so reopening a conversation\nstill explains what the answer saw.",
+ "knowledgeReferences": {
+ "description": "Knowledge references used in the answer",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UsedMemory"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
}
+ },
+ "query": {
+ "description": "User query text",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MessageArtifact": {
+ "github_com_Tencent_WeKnora_internal_types.ImageActionsConfig": {
"type": "object",
"properties": {
- "content_hash": {
- "description": "SHA-256 of the persisted bytes",
- "type": "string"
+ "ocr": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageOCRAction"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ImageAsset": {
+ "type": "object",
+ "properties": {
+ "attrs": {
+ "description": "Attrs is the observed attribute map (e.g. contain.text, contain.data_visual)\nproduced by the attribute pipeline. Absent keys mean \"not observed\".",
+ "type": "object",
+ "additionalProperties": {}
},
- "created_at": {
- "description": "When WeKnora persisted the blob",
+ "caption": {
+ "description": "Caption is the model-generated image description.",
"type": "string"
},
- "deleted_at": {
- "description": "DeletedAt marks a file the user deleted. The entry stays in the list\nrather than being removed because its position IS the download address\n(msg.Artifacts[index]); dropping it would shift every later file's index\nand hand an old link the wrong blob. Keeping it also keeps the entry in\nArtifactCollector's de-duplication set, so the next collect does not\nre-attach the very file that was deleted — its sandbox mtime has not\nmoved. Clients filter these out; the bytes are already reclaimed.",
+ "chunk_id": {
+ "description": "ChunkID is the owning chunk (text chunk for embedded images, or the\nimage_ocr / image_caption chunk for dedicated image assets).",
"type": "string"
},
- "file_name": {
- "description": "Original filename inside the sandbox",
+ "chunk_type": {
+ "description": "ChunkType is the owning chunk's type; empty for images discovered on a\ntext (document) chunk. Helps the UI label the source.",
"type": "string"
},
- "file_size": {
- "description": "File size in bytes",
- "type": "integer"
- },
- "file_type": {
- "description": "File extension (e.g., \".pptx\", \".pdf\")",
+ "created_at": {
+ "description": "CreatedAt is the owning chunk's creation time.",
"type": "string"
},
- "mod_time": {
- "description": "Sandbox-side modification time (used for diff)",
+ "id": {
+ "description": "ID is stable and unique within a KB: \"\u003cchunkID\u003e#\u003cindex-in-array\u003e\".",
"type": "string"
},
- "source_path": {
- "description": "Absolute path inside the sandbox (used for diff)",
- "type": "string"
+ "is_enabled": {
+ "description": "IsEnabled mirrors the owning chunk's enabled flag.",
+ "type": "boolean"
},
- "url": {
- "description": "Storage URL (provider://path); persisted, not sent to client",
+ "knowledge_id": {
+ "description": "KnowledgeID is the document/knowledge item the image belongs to.",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MessageAttachment": {
- "type": "object",
- "properties": {
- "content": {
- "description": "Extracted text content (for small text files)",
+ },
+ "ocr_text": {
+ "description": "OCRText is the extracted text from the image, if any.",
"type": "string"
},
- "content_mode": {
- "description": "full or selected_chunks",
+ "original_url": {
+ "description": "OriginalURL is the pre-transform source reference, when different.",
"type": "string"
},
- "file_name": {
- "description": "Original filename",
+ "source_name": {
+ "description": "SourceName is the human-readable name of the source knowledge item\n(document), resolved from KnowledgeID. Empty when the item no longer\nexists (e.g. deleted), in which case KnowledgeID is still shown.",
"type": "string"
},
- "file_size": {
- "description": "File size in bytes",
+ "status": {
+ "description": "Status mirrors the owning chunk's index status.",
"type": "integer"
},
- "file_type": {
- "description": "File extension (e.g., \".pdf\", \".docx\")",
+ "updated_at": {
+ "description": "UpdatedAt is the owning chunk's last update time.",
"type": "string"
},
- "id": {
- "description": "Temporary document ID for session-scoped uploads",
+ "url": {
+ "description": "URL is the rendered image URL (COS / storage provider).",
"type": "string"
- },
- "is_truncated": {
- "description": "Whether content was truncated",
- "type": "boolean"
- },
- "line_count": {
- "description": "Total line count (for text files)",
- "type": "integer"
- },
- "selected_chunks": {
- "description": "Chunks included in this message prompt",
- "type": "integer"
- },
- "token_count": {
- "description": "Approximate tokens in the parsed document",
- "type": "integer"
- },
- "total_chunks": {
- "description": "Total parsed chunks",
- "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MessageImage": {
+ "github_com_Tencent_WeKnora_internal_types.ImageAttrCondition": {
"type": "object",
"properties": {
- "caption": {
+ "is": {
"type": "string"
},
- "url": {
+ "prop": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ImageOCRAction": {
"type": "object",
"properties": {
- "access_key_id": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
- },
- "endpoint": {
- "type": "string"
- },
- "mode": {
- "description": "\"docker\" or \"remote\"",
- "type": "string"
- },
- "path_prefix": {
- "type": "string"
- },
- "secret_access_key": {
- "type": "string"
+ "on": {
+ "description": "On is the list of attribute conditions that enable OCR. Matching any one\nturns OCR on.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAttrCondition"
+ }
},
- "use_ssl": {
+ "on_unobserved": {
+ "description": "OnUnobserved is the OCR decision used when the observation does not\nanswer for one of the attributes the policy reads — the attribute is\nabsent because the model skipped the line, or because the value it wrote\nwas not one of the allowed ones. The default is true: an incomplete\nobservation keeps extracting, so a missed block of text costs one extra\ncall instead of being lost. Turn it off only with a model reliable enough\nto answer every attribute line.",
"type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ModelParameters": {
+ "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": {
"type": "object",
"properties": {
- "api_key": {
- "type": "string"
+ "image_actions": {
+ "description": "ImageActions overrides the built-in attribute→work table (see\nDefaultImageActions). A nil value keeps the conservative default: run OCR\nfor block text, data visuals, and unobserved images.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ }
+ ]
},
- "app_id": {
- "description": "WeKnoraCloud 厂商专用凭证",
+ "image_attrs_enabled": {
+ "description": "ImageAttrsEnabled turns the attribute-observed image pipeline on for this\nknowledge base. It is off by default on purpose, so upgrading an\nexisting deployment never changes what happens to documents already\nbeing ingested: with it off every image is described and OCR'd exactly\nas before. When on, the describe round also observes image attributes and\nthe attribute policy decides whether OCR runs for it. A single upload can\noverride it per document through\nKnowledgeProcessOverrides.ImageAttrsEnabled.",
+ "type": "boolean"
+ },
+ "image_vector_enabled": {
+ "description": "ImageVectorEnabled lets a knowledge base whose embedding model takes\nimages index each image by its own vector and recall it with one. It\nis off by default on purpose: a model that takes images is also used\nfor plain text, and turning this on costs an embedding call per image\nand widens vector recall. Existing knowledge bases stay off after an\nupgrade because the stored JSON has no such key.",
+ "type": "boolean"
+ },
+ "model_id": {
+ "description": "Model ID",
"type": "string"
+ }
+ }
+ },
+ "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"
},
- "app_secret": {
- "description": "AES-256 加密存储,实际承载上游 API Key",
+ "collection_name": {
+ "description": "Milvus",
"type": "string"
},
- "base_url": {
+ "collection_prefix": {
+ "description": "Qdrant, Weaviate",
"type": "string"
},
- "context_window": {
- "description": "ContextWindow is the model's total context window in tokens and\nMaxOutputTokens the most it emits in one response. Both are provider\nfacts the agent cannot discover but has to act on: the context window is\nwhat decides when conversation history gets compacted, and assuming a\nwindow larger than the real one means compaction never fires and the\nprovider rejects the request mid-conversation instead. 0 means unknown,\nwhich falls back to DefaultMaxContextTokens.",
+ "desired_shard_count": {
+ "description": "Weaviate: number of shards per collection",
"type": "integer"
},
- "custom_headers": {
- "description": "CustomHeaders 允许在调用远程模型 API 时附加自定义 HTTP 请求头,\n用途类似 Python OpenAI SDK 的 extra_headers 参数,\n常见场景包括透传企业网关鉴权信息、追踪 ID、路由标识等。\n保留字段(Authorization、api-key、Content-Type、Accept 等)会在运行期被忽略以避免破坏签名/鉴权流程。",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "hnsw_ef_construction": {
+ "description": "OpenSearch: HNSW index-build candidate list size",
+ "type": "integer"
},
- "embedding_parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
+ "hnsw_ef_search": {
+ "description": "OpenSearch: HNSW search candidate list size (faiss; lucene reads at query time)",
+ "type": "integer"
},
- "extra_config": {
- "description": "Provider-specific configuration",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "hnsw_m": {
+ "description": "--- OpenSearch k-NN HNSW fields ---\nAll omitempty so other engines' serialized IndexConfig is unchanged.\nZero / empty values fall back to the driver defaults in buildInternalCfg.",
+ "type": "integer"
},
- "interface_type": {
+ "index_name": {
+ "description": "--- Existing fields ---",
"type": "string"
},
- "max_concurrency": {
- "description": "MaxConcurrency caps concurrent in-flight BACKGROUND (ingestion /\nenrichment) calls to THIS specific model, keyed by model ID and shared\nacross all replicas. 0 (the default) means \"fall back to the\nprocess-wide model.max_concurrency\". Interactive user-facing calls are\nnever gated. Only chat / vlm / embedding honour this (see limiter.Gate).",
+ "knn_engine": {
+ "description": "OpenSearch: k-NN backend (\"lucene\" | \"faiss\")",
+ "type": "string"
+ },
+ "number_of_replicas": {
+ "description": "ES, OpenSearch",
"type": "integer"
},
- "max_output_tokens": {
+ "number_of_shards": {
+ "description": "ES, OpenSearch",
"type": "integer"
},
- "parameter_size": {
- "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
- "type": "string"
+ "replica_number": {
+ "description": "Milvus LoadCollection / Tencent VectorDB CreateCollection replicas",
+ "type": "integer"
},
- "provider": {
- "description": "Provider identifier: openai, aliyun, zhipu, generic",
- "type": "string"
+ "replication_factor": {
+ "description": "Qdrant, Weaviate: number of replicas",
+ "type": "integer"
},
- "spec": {
- "description": "Spec overrides the catalog entry for this row: protocol, capability\nflags and the flat protocol compat object. Everything omitted is\ninherited from the vendor catalog (see internal/models/catalog).",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSpecOverride"
- }
- ]
+ "replication_num": {
+ "description": "Doris: replication_num PROPERTIES",
+ "type": "integer"
},
- "supports_vision": {
- "description": "Whether the model accepts image/multimodal input",
- "type": "boolean"
+ "shard_number": {
+ "description": "--- Scalability fields ---",
+ "type": "integer"
+ },
+ "shards_num": {
+ "description": "Milvus: number of shards per collection (CreateCollection)",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ModelSource": {
- "type": "string",
- "enum": [
- "local",
- "remote",
- "aliyun",
- "zhipu",
- "volcengine",
- "deepseek",
- "hunyuan",
- "minimax",
- "openai",
- "gemini",
- "mimo",
- "siliconflow",
- "jina",
- "openrouter",
- "litellm",
- "requesty",
- "nvidia",
- "novita",
- "azure_openai"
- ],
- "x-enum-comments": {
- "ModelSourceAliyun": "Aliyun DashScope model",
- "ModelSourceAzureOpenAI": "Azure OpenAI model",
- "ModelSourceDeepseek": "Deepseek model",
- "ModelSourceGemini": "Gemini model",
- "ModelSourceHunyuan": "Hunyuan model",
- "ModelSourceJina": "Jina AI model",
- "ModelSourceLiteLLM": "LiteLLM proxy model",
- "ModelSourceLocal": "Local model",
- "ModelSourceMimo": "Mimo model",
- "ModelSourceMinimax": "Minimax mode",
- "ModelSourceNovita": "Novita AI model",
- "ModelSourceNvidia": "NVIDIA model",
- "ModelSourceOpenAI": "OpenAI model",
- "ModelSourceOpenRouter": "OpenRouter model",
- "ModelSourceRemote": "Remote model",
- "ModelSourceRequesty": "Requesty model",
- "ModelSourceSiliconFlow": "SiliconFlow model",
- "ModelSourceVolcengine": "Volcengine model",
- "ModelSourceZhipu": "Zhipu model"
- },
- "x-enum-descriptions": [
- "Local model",
- "Remote model",
- "Aliyun DashScope model",
- "Zhipu model",
- "Volcengine model",
- "Deepseek model",
- "Hunyuan model",
- "Minimax mode",
- "OpenAI model",
- "Gemini model",
- "Mimo model",
- "SiliconFlow model",
- "Jina AI model",
- "OpenRouter model",
- "LiteLLM proxy model",
- "Requesty model",
- "NVIDIA model",
- "Novita AI model",
- "Azure OpenAI model"
- ],
- "x-enum-varnames": [
- "ModelSourceLocal",
- "ModelSourceRemote",
- "ModelSourceAliyun",
- "ModelSourceZhipu",
- "ModelSourceVolcengine",
- "ModelSourceDeepseek",
- "ModelSourceHunyuan",
- "ModelSourceMinimax",
- "ModelSourceOpenAI",
- "ModelSourceGemini",
- "ModelSourceMimo",
- "ModelSourceSiliconFlow",
- "ModelSourceJina",
- "ModelSourceOpenRouter",
- "ModelSourceLiteLLM",
- "ModelSourceRequesty",
- "ModelSourceNvidia",
- "ModelSourceNovita",
- "ModelSourceAzureOpenAI"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ModelSpecOverride": {
+ "github_com_Tencent_WeKnora_internal_types.IndexingStrategy": {
"type": "object",
"properties": {
- "api": {
- "type": "string"
+ "graph_enabled": {
+ "description": "GraphEnabled enables knowledge graph entity/relation extraction",
+ "type": "boolean"
},
- "compat": {
- "description": "Compat is a plain object so it round-trips through both JSON (API,\ndatabase column) and YAML (builtin_models.yaml).",
- "type": "object",
- "additionalProperties": {}
+ "keyword_enabled": {
+ "description": "KeywordEnabled enables keyword-based (BM25) search",
+ "type": "boolean"
},
- "context_window": {
- "type": "integer"
+ "vector_enabled": {
+ "description": "VectorEnabled enables semantic vector embedding and search",
+ "type": "boolean"
},
- "input": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "wiki_enabled": {
+ "description": "WikiEnabled enables automatic wiki page generation from documents",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "representative_user_id": {
+ "description": "RepresentativeUserID is accepted for compatibility and ignored: a\ndirect add attaches no user of the enrolled workspace, since the\ninviter must not choose whose details the roster shows.",
+ "type": "string"
},
- "max_output_tokens": {
- "type": "integer"
+ "role": {
+ "description": "Role to assign: admin/editor/viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
},
- "reasoning": {
- "type": "boolean"
+ "tenant_id": {
+ "description": "TenantID is the workspace to enrol as an org member. Preferred field.",
+ "type": "integer"
},
- "thinking_levels": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "user_id": {
+ "description": "UserID is retained for backward compatibility. When set without\nTenantID, the handler resolves the user's TenantID.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ModelType": {
- "type": "string",
- "enum": [
- "Embedding",
- "Rerank",
- "KnowledgeQA",
- "VLLM",
- "ASR"
- ],
- "x-enum-comments": {
- "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
- "ModelTypeEmbedding": "Embedding model",
- "ModelTypeKnowledgeQA": "KnowledgeQA model",
- "ModelTypeRerank": "Rerank model",
- "ModelTypeVLLM": "VLLM model"
- },
- "x-enum-descriptions": [
- "Embedding model",
- "Rerank model",
- "KnowledgeQA model",
- "VLLM model",
- "ASR (Automatic Speech Recognition) model"
- ],
- "x-enum-varnames": [
- "ModelTypeEmbedding",
- "ModelTypeRerank",
- "ModelTypeKnowledgeQA",
- "ModelTypeVLLM",
- "ModelTypeASR"
- ]
+ "github_com_Tencent_WeKnora_internal_types.JSONMap": {
+ "type": "object",
+ "additionalProperties": {}
},
- "github_com_Tencent_WeKnora_internal_types.NamedCount": {
+ "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
"type": "object",
+ "required": [
+ "organization_id"
+ ],
"properties": {
- "count": {
- "type": "integer"
+ "message": {
+ "description": "Optional message for join request",
+ "type": "string",
+ "maxLength": 500
},
- "name": {
+ "organization_id": {
"type": "string"
+ },
+ "role": {
+ "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OBSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
+ ],
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinRequestResponse": {
"type": "object",
"properties": {
- "access_key": {
+ "created_at": {
"type": "string"
},
- "bucket_name": {
+ "email": {
"type": "string"
},
- "endpoint": {
+ "id": {
"type": "string"
},
- "path_prefix": {
+ "message": {
"type": "string"
},
- "region": {
+ "prev_role": {
+ "description": "Previous role (only for upgrade requests)",
"type": "string"
},
- "secret_key": {
+ "request_type": {
+ "description": "'join' or 'upgrade'",
"type": "string"
},
- "use_ssl": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": {
- "type": "object",
- "properties": {
- "authorization_url": {
+ "requested_role": {
+ "description": "Role the applicant requested (admin/editor/viewer)",
"type": "string"
},
- "provider_display_name": {
+ "reviewed_at": {
"type": "string"
},
- "state": {
+ "status": {
"type": "string"
},
- "success": {
- "type": "boolean"
+ "user_id": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": {
+ "github_com_Tencent_WeKnora_internal_types.JoinRequestStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "approved",
+ "rejected"
+ ],
+ "x-enum-varnames": [
+ "JoinRequestStatusPending",
+ "JoinRequestStatusApproved",
+ "JoinRequestStatusRejected"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinRequestType": {
+ "type": "string",
+ "enum": [
+ "join",
+ "upgrade"
+ ],
+ "x-enum-varnames": [
+ "JoinRequestTypeJoin",
+ "JoinRequestTypeUpgrade"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.KBCapabilities": {
"type": "object",
"properties": {
- "enabled": {
+ "faq": {
+ "description": "FAQ means the KB is a FAQ-type KB (Q/A pairs).",
"type": "boolean"
},
- "provider_display_name": {
- "type": "string"
+ "graph": {
+ "description": "Graph means knowledge-graph extraction is enabled.",
+ "type": "boolean"
},
- "success": {
+ "keyword": {
+ "description": "Keyword means BM25 / sparse keyword search is indexed.",
+ "type": "boolean"
+ },
+ "vector": {
+ "description": "Vector means semantic (embedding) search is indexed.",
+ "type": "boolean"
+ },
+ "wiki": {
+ "description": "Wiki means the wiki feature is enabled and authored pages exist / will be generated.",
"type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OSSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KBCloneProgress": {
"type": "object",
"properties": {
- "access_key": {
- "type": "string"
+ "created_at": {
+ "description": "任务创建时间",
+ "type": "integer"
},
- "bucket_name": {
+ "error": {
+ "description": "错误信息",
"type": "string"
},
- "endpoint": {
+ "message": {
+ "description": "状态消息",
"type": "string"
},
- "path_prefix": {
- "type": "string"
+ "processed": {
+ "description": "已处理数",
+ "type": "integer"
},
- "region": {
- "type": "string"
+ "progress": {
+ "description": "0-100",
+ "type": "integer"
},
- "secret_key": {
+ "source_id": {
"type": "string"
},
- "temp_bucket_name": {
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus"
+ },
+ "target_id": {
"type": "string"
},
- "temp_region": {
+ "task_id": {
"type": "string"
},
- "use_temp_bucket": {
- "type": "boolean"
+ "total": {
+ "description": "总知识数",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "最后更新时间",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
+ "github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus": {
"type": "string",
"enum": [
- "admin",
- "editor",
- "viewer"
+ "pending",
+ "processing",
+ "completed",
+ "failed"
],
"x-enum-varnames": [
- "OrgRoleAdmin",
- "OrgRoleEditor",
- "OrgRoleViewer"
+ "KBCloneStatusPending",
+ "KBCloneStatusProcessing",
+ "KBCloneStatusCompleted",
+ "KBCloneStatusFailed"
]
},
- "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
+ "github_com_Tencent_WeKnora_internal_types.KS3EngineConfig": {
"type": "object",
"properties": {
- "avatar": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "id": {
- "type": "string"
- },
- "joined_at": {
+ "access_key": {
"type": "string"
},
- "representative_user_id": {
+ "bucket_name": {
"type": "string"
},
- "role": {
+ "endpoint": {
"type": "string"
},
- "tenant_id": {
- "type": "integer"
- },
- "tenant_name": {
+ "path_prefix": {
"type": "string"
},
- "user_id": {
+ "region": {
"type": "string"
},
- "username": {
+ "secret_key": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
+ "github_com_Tencent_WeKnora_internal_types.Knowledge": {
"type": "object",
"properties": {
- "agent_share_count": {
- "description": "共享到该组织的智能体数量",
- "type": "integer"
- },
- "avatar": {
+ "channel": {
+ "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
"type": "string"
},
"created_at": {
+ "description": "Creation time of the knowledge",
"type": "string"
},
+ "custom_metadata": {
+ "description": "CustomMetadata is user-authored descriptive metadata. It is deliberately\nseparate from Metadata, which contains internal ingestion state and IDs.",
+ "type": "object"
+ },
+ "deleted_at": {
+ "description": "Deletion time of the knowledge",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
"description": {
+ "description": "Description of the knowledge",
"type": "string"
},
- "has_pending_upgrade": {
- "description": "当前用户是否有待处理的权限升级申请",
- "type": "boolean"
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
+ "type": "string"
},
- "id": {
+ "enable_status": {
+ "description": "Enable status of the knowledge",
"type": "string"
},
- "invite_code": {
+ "error_message": {
+ "description": "Error message of the knowledge",
"type": "string"
},
- "invite_code_expires_at": {
+ "file_hash": {
+ "description": "File hash of the knowledge",
"type": "string"
},
- "invite_code_validity_days": {
- "type": "integer"
+ "file_name": {
+ "description": "File name of the knowledge",
+ "type": "string"
},
- "is_owner": {
- "type": "boolean"
+ "file_path": {
+ "description": "File path of the knowledge",
+ "type": "string"
},
- "member_count": {
+ "file_size": {
+ "description": "File size of the knowledge",
"type": "integer"
},
- "member_limit": {
- "description": "0 = unlimited",
- "type": "integer"
+ "file_type": {
+ "description": "File type of the knowledge",
+ "type": "string"
},
- "my_role": {
+ "folder_path": {
+ "description": "FolderPath is the canonical relative directory this entry belongs to\ninside the knowledge base, e.g. \"docs/spec\" for a folder upload of\n\"docs/spec/design.md\". Empty means the knowledge base root. It is a\ndisplay/navigation concern only: it never affects where the file is\nphysically stored (see FilePath).",
"type": "string"
},
- "name": {
+ "id": {
+ "description": "Unique identifier of the knowledge",
"type": "string"
},
- "owner_id": {
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base",
"type": "string"
},
- "owner_tenant_id": {
- "description": "OwnerTenantID is the persisted owner workspace of the organization\n(Plan 3, migration 000046). Frontend uses this to identify the\n\"owner row\" in the workspace-keyed members list — comparing\nmember.tenant_id against owner_tenant_id is the post-Plan-3\nequivalent of the old member.user_id == owner_id check.",
- "type": "integer"
+ "knowledge_base_name": {
+ "description": "Knowledge base name (not stored in database, populated on query)",
+ "type": "string"
},
- "pending_join_request_count": {
- "description": "待审批加入申请数(仅管理员可见)",
- "type": "integer"
+ "last_activity_at": {
+ "description": "Most recent processing progress (row or span write) for an in-flight\nrow, so clients can tell a slow stage from a stalled one. Not stored.",
+ "type": "string"
},
- "require_approval": {
- "type": "boolean"
+ "last_faq_import_result": {
+ "description": "Last FAQ import result (for FAQ type knowledge only)",
+ "type": "object"
},
- "searchable": {
- "type": "boolean"
- },
- "share_count": {
- "description": "共享到该组织的知识库数量",
- "type": "integer"
- },
- "updated_at": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": {
- "type": "object",
- "properties": {
- "chat_parser_engine_rules": {
- "description": "ChatParserEngineRules selects parser engines for session-scoped chat\ndocuments. Knowledge bases keep their own rules in ChunkingConfig.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
+ "metadata": {
+ "description": "Metadata of the knowledge",
+ "type": "object"
},
- "mineru_api_key": {
- "description": "MinerU 云 API Key",
+ "parse_status": {
+ "description": "Parse status of the knowledge",
"type": "string"
},
- "mineru_cloud_enable_formula": {
- "type": "boolean"
+ "pending_subtasks_count": {
+ "description": "PendingSubtasksCount is the outstanding enrichment subtask count\n(summary + question + graph chunks). Only meaningful while\nParseStatus == \"finalizing\"; defaults to 0 in any terminal state.",
+ "type": "integer"
},
- "mineru_cloud_enable_ocr": {
- "type": "boolean"
+ "processed_at": {
+ "description": "Processed time of the knowledge",
+ "type": "string"
},
- "mineru_cloud_enable_table": {
- "type": "boolean"
+ "profile": {
+ "description": "Profile is the structured companion of Description: a one-line gist,\ntopic keywords, a document type and one typical question. It is produced\nby the same model call as the summary and feeds the knowledge-base\nlevel description aggregation. nil when no summary has been generated.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProfile"
+ }
+ ]
},
- "mineru_cloud_language": {
+ "source": {
+ "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
"type": "string"
},
- "mineru_cloud_model": {
- "description": "MinerU 云 API 解析参数",
+ "stall_state": {
+ "description": "Verdict on an in-flight row gone quiet: StallStateQueued (its work is\nstill queued, i.e. backlogged) or StallStateStalled (nothing left to\nrun it). Empty while it is progressing or the probe failed. Not stored.",
"type": "string"
},
- "mineru_enable_formula": {
- "type": "boolean"
+ "storage_size": {
+ "description": "Storage size of the knowledge",
+ "type": "integer"
},
- "mineru_enable_ocr": {
- "description": "MinerUEnableOCR is retained for compatibility with configurations saved\nbefore parse_method supported auto/ocr/txt.",
- "type": "boolean"
+ "summary_status": {
+ "description": "Summary status for async summary generation",
+ "type": "string"
},
- "mineru_enable_table": {
- "type": "boolean"
+ "tags": {
+ "description": "Tags holds the tags associated with this knowledge (populated on query, not persisted directly).",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeTag"
+ }
},
- "mineru_endpoint": {
- "description": "MinerU 自建服务端点",
- "type": "string"
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
},
- "mineru_language": {
+ "title": {
+ "description": "Title of the knowledge",
"type": "string"
},
- "mineru_model": {
- "description": "以下 backend、vLLM、公式/表格、语言参数仅对 3.x 及更早版本生效。",
+ "type": {
+ "description": "Type of the knowledge",
"type": "string"
},
- "mineru_parse_method": {
+ "updated_at": {
+ "description": "Last updated time of the knowledge",
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": {
+ "type": "object",
+ "properties": {
+ "asr_config": {
+ "description": "ASR config (Automatic Speech Recognition)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
+ }
+ ]
},
- "mineru_server_api_key": {
- "description": "MinerU 自建解析参数。协议按服务端自动识别:4.0+ 走 V1 API,更早版本走 /file_parse。",
- "type": "string"
+ "auto_tag_config": {
+ "description": "AutoTagConfig controls asynchronous association of existing tags after parsing.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
+ }
+ ]
},
- "mineru_tier": {
- "description": "4.0+:flash/basic/standard/advanced,空为服务端默认",
- "type": "string"
+ "chunk_count": {
+ "description": "Chunk count (not stored in database, calculated on query)",
+ "type": "integer"
},
- "mineru_vlm_server_url": {
- "description": "vLLM 服务器地址 (vlm-http-client / hybrid-http-client)",
- "type": "string"
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
},
- "odl_hybrid": {
- "description": "OpenDataLoader PDF (docreader engine); hybrid requires opendataloader-pdf-hybrid service.",
+ "created_at": {
+ "description": "Creation time of the knowledge base",
"type": "string"
},
- "odl_hybrid_fallback": {
- "type": "boolean"
- },
- "odl_hybrid_mode": {
- "description": "auto, full",
+ "creator_id": {
+ "description": "CreatorID records the user ID of whoever originally created the KB.\nUsed by the workspace-level RBAC middleware to let Contributors edit\ntheir own KBs without granting them access to everyone else's.\nNullable for backward compatibility with rows created before the\nRBAC migration backfilled the column to the workspace Owner.",
"type": "string"
},
- "odl_hybrid_url": {
- "description": "e.g. http://odl-hybrid:5002",
+ "creator_name": {
+ "description": "CreatorName 是 CreatorID 对应用户的展示名(username / email 等),\n仅在列表场景由 handler 批量回填,不落库;为空表示创建者无法解析(用户已删除、\nCreatorID 为空的老数据等)。前端用它在卡片来源徽章上做 mine vs workspace 的二分。",
"type": "string"
},
- "odl_markdown_with_html": {
- "type": "boolean"
+ "deleted_at": {
+ "description": "Deletion time of the knowledge base",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
- "paddleocr_vl_cloud_model": {
- "description": "e.g. PaddleOCR-VL-1.6",
+ "description": {
+ "description": "Description of the knowledge base",
"type": "string"
},
- "paddleocr_vl_cloud_token": {
- "description": "PaddleOCR-VL AI Studio cloud API.",
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
"type": "string"
},
- "paddleocr_vl_cloud_use_chart_recognition": {
- "type": "boolean"
+ "extract_config": {
+ "description": "Extract config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
+ }
+ ]
},
- "paddleocr_vl_cloud_use_seal_recognition": {
- "type": "boolean"
+ "faq_config": {
+ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
},
- "paddleocr_vl_endpoint": {
- "description": "PaddleOCR-VL self-hosted pipeline service (full /layout-parsing API).",
+ "generated_profile": {
+ "description": "GeneratedProfile is the machine-generated description: a gist, merged\ntopics, typical questions and the aggregate snapshot they came from. It\nnever overwrites the user-authored Description; both are shown to agents.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the knowledge base",
"type": "string"
},
- "paddleocr_vl_use_chart_recognition": {
- "type": "boolean"
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
},
- "paddleocr_vl_use_seal_recognition": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": {
- "type": "object",
- "properties": {
- "engine": {
- "type": "string"
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active for this knowledge base.\nPipelines: vector search, keyword search, wiki generation, knowledge graph extraction.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
},
- "file_types": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "is_pinned": {
+ "description": "IsPinned and PinnedAt are computed per-caller from user_kb_pins\n(see migration 000050). They used to be stored on the row itself,\nwhich made pinning a workspace-wide ordering decision gated behind\nthe kb-edit RBAC guard. The columns are still present in legacy\nschemas for rollback safety but are no longer read or written by\nthe application — both fields are tagged ` + "`" + `gorm:\"-\"` + "`" + ` so GORM\nignores them on every CRUD call and the list handler stamps them\nafter enriching with the caller's pin set.",
+ "type": "boolean"
},
- "xlsx_first_row_as_header": {
- "description": "XLSXFirstRowAsHeader restores row-1 column context for flat XLSX tables.\nnil preserves the parser default; an explicit false disables the mode.",
+ "is_processing": {
+ "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
"type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.PromptCacheStatus": {
- "type": "string",
- "enum": [
- "unsupported",
- "unreported",
- "miss",
- "hit"
- ],
- "x-enum-varnames": [
- "PromptCacheStatusUnsupported",
- "PromptCacheStatusUnreported",
- "PromptCacheStatusMiss",
- "PromptCacheStatusHit"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ProviderMetadata": {
- "type": "object",
- "additionalProperties": {
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
- "type": "object",
- "properties": {
- "custom_instructions": {
- "description": "CustomInstructions describes the intended audience or question style.\nIt is appended to the stable system question-generation template.",
- "type": "string"
},
- "enabled": {
+ "is_temporary": {
+ "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
"type": "boolean"
},
- "question_count": {
- "description": "Number of questions to generate per chunk (default: 3, max: 10)",
+ "knowledge_count": {
+ "description": "Knowledge count (not stored in database, calculated on query)",
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.QuestionOrigin": {
- "type": "object",
- "properties": {
- "knowledge_base_id": {
- "type": "string"
},
- "knowledge_id": {
+ "name": {
+ "description": "Name of the knowledge base",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig": {
- "type": "object",
- "properties": {
- "follow_ups": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig"
- },
- "starters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.QueueStat": {
- "type": "object",
- "properties": {
- "active": {
- "type": "integer"
},
- "archived": {
- "type": "integer"
+ "pinned_at": {
+ "description": "PinnedAt records when the current caller pinned this knowledge\nbase; nil when they have not.",
+ "type": "string"
},
- "completed": {
+ "processing_count": {
+ "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
"type": "integer"
},
- "failed": {
- "type": "integer"
+ "profile_config": {
+ "description": "ProfileConfig controls automatic generation of the knowledge-base\ndescription from per-document profiles (document knowledge bases only).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
+ }
+ ]
},
- "latency_ms": {
- "description": "LatencyMs is the age of the oldest pending task, in milliseconds.",
- "type": "integer"
+ "question_generation_config": {
+ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
+ }
+ ]
},
- "memory_usage_bytes": {
- "description": "MemoryUsageBytes is the approximate Redis memory the queue occupies.",
+ "share_count": {
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
"type": "integer"
},
- "name": {
+ "storage_backend_id": {
+ "description": "StorageBackendID binds this KB to one concrete storage instance. The\nlegacy provider field remains readable during migration only.",
"type": "string"
},
- "paused": {
- "description": "Paused reports whether the queue is paused (tasks not consumed).",
- "type": "boolean"
+ "storage_config": {
+ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
+ }
+ ]
},
- "pending": {
- "type": "integer"
+ "storage_provider_config": {
+ "description": "Storage provider config (new): only stores provider selection; credentials from workspace StorageEngineConfig",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
+ }
+ ]
},
- "pool": {
- "description": "Pool is the independent worker pool that drains this queue.",
+ "summary_model_id": {
+ "description": "Summary model ID",
"type": "string"
},
- "processed": {
- "description": "Processed / Failed are today's counters (reset daily).",
- "type": "integer"
- },
- "retry": {
+ "tenant_id": {
+ "description": "Workspace ID",
"type": "integer"
},
- "scheduled": {
- "type": "integer"
+ "type": {
+ "description": "Type of the knowledge base (document, faq, etc.)",
+ "type": "string"
},
- "size": {
- "description": "Size is the total number of tasks in the queue (pending + active +\nscheduled + retry + aggregating + archived).",
- "type": "integer"
+ "updated_at": {
+ "description": "Last updated time of the knowledge base",
+ "type": "string"
},
- "weight": {
- "description": "Weight is the queue's scheduling weight inside its pool.",
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
- "type": "object",
- "required": [
- "email",
- "password",
- "username"
- ],
- "properties": {
- "email": {
+ "vector_store_id": {
+ "description": "VectorStoreID references the VectorStore this knowledge base is bound to.\nWhen nil, the KB falls back to the workspace's effective engines derived from\nthe RETRIEVE_DRIVER environment variable (env store flow).\nThis field is set once at creation time and must not be modified afterwards;\nenforcement lives at the GORM layer (` + "`" + `\u003c-:create` + "`" + `) plus the service-layer\nKB update path, which omits this field from its update DTO.",
"type": "string"
},
- "password": {
- "type": "string",
- "minLength": 6
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ ]
},
- "username": {
- "type": "string",
- "maxLength": 50,
- "minLength": 2
+ "wiki_config": {
+ "description": "WikiConfig stores wiki-specific configuration (only for wiki type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RegisterResponse": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
"type": "object",
"properties": {
- "message": {
- "type": "string"
- },
- "success": {
- "type": "boolean"
+ "auto_tag_config": {
+ "description": "AutoTagConfig controls optional automatic association of existing KB tags.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
+ }
+ ]
},
- "tenant": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
},
- "user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
- "type": "object",
- "required": [
- "requested_role"
- ],
- "properties": {
- "message": {
- "description": "Optional message explaining the reason",
- "type": "string",
- "maxLength": 500
+ "faq_config": {
+ "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
},
- "requested_role": {
- "description": "The role user wants to upgrade to",
+ "image_processing_config": {
+ "description": "Image processing configuration.\n\nnil means \"no change\" when updating, the same contract IndexingStrategy\nuses. A request that does not mention this field must leave the image\nsettings alone: the attribute-observation switch and the attribute policy\nare things a knowledge base accumulates, and a client that predates them\nwould otherwise reset the lot on any save. Sending an object — empty\nincluded — replaces the whole configuration.",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
}
]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RerankOptions": {
- "type": "object",
- "properties": {
- "enabled": {
- "description": "Enabled turns the rerank stage off when explicitly false. Nil means on.",
- "type": "boolean"
},
- "model_id": {
- "description": "ModelID selects the rerank model. Empty falls back to the tenant\nRetrievalConfig, then to the first rerank model of the tenant.",
- "type": "string"
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active.\nnil means \"no change\" when updating (preserves existing strategy).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
},
- "threshold": {
- "description": "Threshold is the minimum rerank model score. Nil uses the tenant\nRetrievalConfig. A pointer because 0 and negative scores are valid.",
- "type": "number"
+ "profile_config": {
+ "description": "ProfileConfig controls optional automatic knowledge-base description\ngeneration. nil means \"no change\" when updating.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
+ }
+ ]
},
- "top_k": {
- "description": "TopK caps the reranked results. Zero uses the endpoint's result count.",
- "type": "integer"
+ "wiki_config": {
+ "description": "Wiki configuration (only for wiki-enabled knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Resource": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile": {
"type": "object",
"properties": {
- "description": {
- "description": "Optional description",
- "type": "string"
- },
- "external_id": {
- "description": "Unique identifier in the external system",
+ "aggregate_hash": {
+ "description": "AggregateHash identifies the aggregate the gist was generated from. A\nmismatch with the live aggregate means the text is stale.",
"type": "string"
},
- "has_children": {
- "description": "Whether this resource has children that can be expanded",
- "type": "boolean"
- },
- "metadata": {
- "description": "Additional metadata",
- "type": "object",
- "additionalProperties": true
- },
- "modified_at": {
- "description": "Last modified time in external system",
+ "error": {
+ "description": "Error holds the last generation error when Status is failed.",
"type": "string"
},
- "name": {
- "description": "Display name",
+ "generated_at": {
+ "description": "GeneratedAt records when the text was produced.",
"type": "string"
},
- "parent_id": {
- "description": "For hierarchical resources (parent ID if applicable)",
+ "gist": {
+ "description": "Gist is a short statement of what the knowledge base covers.",
"type": "string"
},
- "type": {
- "description": "Resource type (document, folder, space, page, etc.)",
+ "model_id": {
+ "description": "ModelID records which chat model produced the text.",
"type": "string"
},
- "url": {
- "description": "URL to access in external system",
+ "stats": {
+ "description": "Stats is the aggregate snapshot the text was generated from.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileStats"
+ }
+ ]
+ },
+ "status": {
+ "description": "Status is one of the KnowledgeBaseProfileStatus* values.",
"type": "string"
+ },
+ "topics": {
+ "description": "Topics is the merged topic list (at most KnowledgeBaseProfileMaxTopics).",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "typical_questions": {
+ "description": "TypicalQuestions lists questions this knowledge base can answer.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig": {
"type": "object",
"properties": {
- "agents": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
+ "custom_instructions": {
+ "description": "CustomInstructions is appended to the stable system prompt, e.g. the\naudience the description should address or terms to keep.",
+ "type": "string"
},
- "knowledge_bases": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
+ "enabled": {
+ "type": "boolean"
+ },
+ "model_id": {
+ "description": "ModelID overrides the chat model; empty falls back to the KB summary model.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileStats": {
"type": "object",
"properties": {
- "embedding_top_k": {
- "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
- "type": "integer"
+ "doc_types": {
+ "description": "DocTypes counts documents per model-assigned document type.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ }
},
- "keyword_threshold": {
- "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
- "type": "number"
+ "document_count": {
+ "description": "DocumentCount is the number of eligible documents at generation time.",
+ "type": "integer"
},
- "rerank_model_id": {
- "description": "RerankModelID is the ID of the rerank model to use (required for search)",
+ "earliest_at": {
+ "description": "EarliestAt and LatestAt bound document creation times.",
"type": "string"
},
- "rerank_threshold": {
- "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
- "type": "number"
+ "file_types": {
+ "description": "FileTypes counts documents per file extension.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ }
},
- "rerank_top_k": {
- "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
- "type": "integer"
+ "folders": {
+ "description": "Folders lists the top-level folder names present.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "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"
+ "latest_at": {
+ "type": "string"
},
- "rrf_keyword_weight": {
- "description": "RRFKeywordWeight is the keyword counterpart. Default: 0.3.",
- "type": "number"
+ "profiled_count": {
+ "description": "ProfiledCount is how many of them carried a document profile.",
+ "type": "integer"
},
- "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"
+ "raw_topics": {
+ "description": "RawTopics counts documents per normalized topic keyword before merging.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ }
},
- "vector_threshold": {
- "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
- "type": "number"
+ "tags": {
+ "description": "Tags counts documents per knowledge-base tag.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare": {
"type": "object",
"properties": {
- "retriever_engine_type": {
- "description": "Retriever engine type",
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time (soft delete)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ "$ref": "#/definitions/gorm.DeletedAt"
}
]
},
- "retriever_type": {
- "description": "Retriever type",
+ "id": {
+ "description": "Unique identifier",
+ "type": "string"
+ },
+ "knowledge_base": {
+ "description": "Associations (not stored in database)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
}
]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": {
- "type": "string",
- "enum": [
- "postgres",
- "elasticsearch",
- "infinity",
- "elasticfaiss",
- "qdrant",
- "milvus",
- "weaviate",
- "doris",
- "sqlite",
- "tencent_vectordb",
- "opensearch"
- ],
- "x-enum-varnames": [
- "PostgresRetrieverEngineType",
- "ElasticsearchRetrieverEngineType",
- "InfinityRetrieverEngineType",
- "ElasticFaissRetrieverEngineType",
- "QdrantRetrieverEngineType",
- "MilvusRetrieverEngineType",
- "WeaviateRetrieverEngineType",
- "DorisRetrieverEngineType",
- "SQLiteRetrieverEngineType",
- "TencentVectorDBRetrieverEngineType",
- "OpenSearchRetrieverEngineType"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
- "type": "object",
- "properties": {
- "engines": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverType": {
- "type": "string",
- "enum": [
- "keywords",
- "vector",
- "websearch"
- ],
- "x-enum-comments": {
- "KeywordsRetrieverType": "Keywords retriever",
- "VectorRetrieverType": "Vector retriever",
- "WebSearchRetrieverType": "Web search retriever"
- },
- "x-enum-descriptions": [
- "Keywords retriever",
- "Vector retriever",
- "Web search retriever"
- ],
- "x-enum-varnames": [
- "KeywordsRetrieverType",
- "VectorRetrieverType",
- "WebSearchRetrieverType"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
- "type": "object",
- "properties": {
- "approved": {
- "type": "boolean"
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "knowledge_base_id": {
+ "description": "Knowledge base ID being shared",
+ "type": "string"
},
- "role": {
- "description": "Optional: role to assign when approving; overrides applicant's requested role",
+ "organization": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Organization"
+ },
+ "organization_id": {
+ "description": "Organization ID receiving the share",
+ "type": "string"
+ },
+ "permission": {
+ "description": "Permission level (admin/editor/viewer)",
"allOf": [
{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
]
+ },
+ "shared_by_user_id": {
+ "description": "User ID who shared the knowledge base",
+ "type": "string"
+ },
+ "source_tenant_id": {
+ "description": "Original tenant ID of the knowledge base (for cross-tenant embedding model access)",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RuntimeTaskAction": {
- "type": "string",
- "enum": [
- "cancel",
- "run_now",
- "delete"
- ],
- "x-enum-varnames": [
- "RuntimeTaskActionCancel",
- "RuntimeTaskActionRunNow",
- "RuntimeTaskActionDelete"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.RuntimeTaskInfo": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
"type": "object",
"properties": {
- "allowed_actions": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RuntimeTaskAction"
- }
- },
- "completed_at": {
- "type": "string"
+ "chunk_count": {
+ "type": "integer"
},
- "data_source_id": {
+ "created_at": {
"type": "string"
},
- "deadline": {
+ "id": {
"type": "string"
},
- "enqueued_at": {
+ "knowledge_base_id": {
"type": "string"
},
- "id": {
+ "knowledge_base_name": {
"type": "string"
},
- "is_orphaned": {
- "type": "boolean"
- },
- "knowledge_base_id": {
+ "knowledge_base_type": {
"type": "string"
},
"knowledge_count": {
"type": "integer"
},
- "knowledge_id": {
+ "my_permission": {
+ "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
"type": "string"
},
- "last_error": {
+ "my_role_in_org": {
+ "description": "Current user's role in this organization (admin/editor/viewer)",
"type": "string"
},
- "last_failed_at": {
+ "organization_id": {
"type": "string"
},
- "max_retry": {
- "type": "integer"
- },
- "next_process_at": {
+ "organization_name": {
"type": "string"
},
- "queue": {
+ "permission": {
+ "description": "Share permission (what the space was granted: viewer/editor)",
"type": "string"
},
- "retried": {
- "type": "integer"
- },
- "source_id": {
- "type": "string"
+ "require_approval": {
+ "type": "boolean"
},
- "source_kb_id": {
+ "shared_by_user_id": {
"type": "string"
},
- "started_at": {
+ "shared_by_username": {
"type": "string"
},
- "state": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RuntimeTaskState"
- },
- "sync_log_id": {
- "type": "string"
+ "source_tenant_id": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeFolderNode": {
+ "type": "object",
+ "properties": {
+ "children": {
+ "description": "Children are the direct sub-folders, sorted by name.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeFolderNode"
+ }
},
- "target_id": {
- "type": "string"
+ "document_count": {
+ "description": "DocumentCount counts entries whose folder_path equals Path.",
+ "type": "integer"
},
- "target_kb_id": {
+ "name": {
+ "description": "Name is the last segment of Path, used as the tree row label.",
"type": "string"
},
- "task_id": {
+ "path": {
+ "description": "Path is the canonical folder path, e.g. \"docs/spec\".",
"type": "string"
},
- "tenant_id": {
+ "total_count": {
+ "description": "TotalCount counts entries in Path and in all descendant folders.",
"type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeFolderTree": {
+ "type": "object",
+ "properties": {
+ "folders": {
+ "description": "Folders are the top-level folders, sorted by name.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeFolderNode"
+ }
},
- "type": {
- "type": "string"
+ "root_document_count": {
+ "description": "RootDocumentCount counts entries that live at the knowledge base root\n(folder_path = \"\"), i.e. documents that were not uploaded as part of a\nfolder.",
+ "type": "integer"
},
- "worker": {
- "type": "string"
+ "total_document_count": {
+ "description": "TotalDocumentCount counts every entry in the knowledge base, matching\nthe unfiltered document list total.",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RuntimeTaskState": {
- "type": "string",
- "enum": [
- "pending",
- "active",
- "scheduled",
- "retry",
- "archived",
- "completed"
- ],
- "x-enum-varnames": [
- "RuntimeTaskPending",
- "RuntimeTaskActive",
- "RuntimeTaskScheduled",
- "RuntimeTaskRetry",
- "RuntimeTaskArchived",
- "RuntimeTaskCompleted"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress": {
"type": "object",
"properties": {
- "access_key": {
- "type": "string"
+ "created_at": {
+ "description": "任务创建时间",
+ "type": "integer"
},
- "bucket_name": {
+ "error": {
+ "description": "错误信息",
"type": "string"
},
- "endpoint": {
+ "failed": {
+ "description": "失败数",
+ "type": "integer"
+ },
+ "message": {
+ "description": "状态消息",
"type": "string"
},
- "force_path_style": {
- "type": "boolean"
+ "processed": {
+ "description": "已处理数",
+ "type": "integer"
},
- "path_prefix": {
- "type": "string"
+ "progress": {
+ "description": "0-100",
+ "type": "integer"
},
- "region": {
+ "source_kb_id": {
"type": "string"
},
- "secret_key": {
- "type": "string"
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus"
},
- "use_ssl": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SandboxCheckpoint": {
- "type": "object",
- "properties": {
- "commit_sha": {
+ "target_kb_id": {
"type": "string"
},
- "committed_at": {
+ "task_id": {
"type": "string"
},
- "sandbox_id": {
- "type": "string"
+ "total": {
+ "description": "总知识数",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "最后更新时间",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SandboxNetworkPolicy": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides": {
"type": "object",
"properties": {
- "allow_out": {
- "description": "AllowOut accepts IPv4, IPv4 CIDR, a DNS name, or a single-label\nwildcard such as \"*.example.com\". Domain entries are only meaningful\ntogether with a deny-all; see ValidateSandboxNetworkPolicy.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "asr_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
},
- "allow_public_inbound": {
- "description": "AllowPublicInbound is accepted on the wire for old payloads and then\ncleared. Inbound is always credential-required; a true value has no\nruntime effect.",
+ "chunking_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ },
+ "enable_multimodel": {
"type": "boolean"
},
- "cube_rules": {
- "description": "CubeRules are validated whenever present and consumed only by the Cube\nprovider adapter.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeEgressRule"
- }
+ "extract_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
},
- "deny_egress_by_default": {
- "description": "DenyEgressByDefault installs a 0.0.0.0/0 deny-all, after which only\nAllowOut (and L7 rule targets) can reach the network. false allows\npublic egress, which is what skill installs need.",
+ "graph_enabled": {
"type": "boolean"
},
- "deny_out": {
- "description": "DenyOut accepts IPv4 and IPv4 CIDR only. Neither provider can deny a\ndomain: denial is a pure longest-prefix match on the destination IP.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "image_actions": {
+ "description": "ImageActions overrides rows of the attribute-\u003ework table for this document\n(merged per action key on top of the knowledge base's table).\nnil keeps the knowledge base's setting.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ }
+ ]
},
- "e2b_host_rules": {
- "description": "E2BHostRules are validated whenever present and consumed only by the E2B\nprovider adapter.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.E2BHostRule"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SearchParams": {
- "type": "object",
- "properties": {
- "disable_keywords_match": {
+ "image_attrs_enabled": {
+ "description": "ImageAttrsEnabled overrides the knowledge base's attribute-observed image\npipeline switch for this one document. nil keeps the knowledge base's\nsetting.",
"type": "boolean"
},
- "disable_vector_match": {
+ "image_vector_enabled": {
+ "description": "ImageVectorEnabled overrides image vector indexing for this document.\nIt does not change the KB-wide retrieval setting or embedding model.",
"type": "boolean"
},
- "keyword_threshold": {
- "type": "number"
- },
- "knowledge_base_ids": {
- "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
- "type": "array",
- "items": {
+ "parser_engine_overrides": {
+ "description": "ParserEngineOverrides passes key-value configuration to docreader parsers\n(e.g. pdf_force_scanned=true). Merged with workspace-level overrides in the\nparse pipeline; per-upload values take priority on conflict.",
+ "type": "object",
+ "additionalProperties": {
"type": "string"
}
},
- "knowledge_ids": {
+ "parser_engine_rules": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
}
},
- "match_count": {
- "type": "integer"
+ "question_generation_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
},
- "only_recommended": {
+ "summary_enabled": {
+ "description": "SummaryEnabled defaults to true when omitted for backward compatibility.",
"type": "boolean"
},
- "query_embedding": {
+ "vlm_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeProfile": {
+ "type": "object",
+ "properties": {
+ "doc_type": {
+ "description": "DocType is a coarse label such as \"user manual\", \"meeting notes\" or \"contract\".",
+ "type": "string"
+ },
+ "gist": {
+ "description": "Gist is a one-line statement of what the document is about.",
+ "type": "string"
+ },
+ "topics": {
+ "description": "Topics lists 3-5 short topic keywords.",
"type": "array",
"items": {
- "type": "number"
+ "type": "string"
}
},
- "query_text": {
- "description": "QueryText is required unless query_embedding is provided, keyword matching is disabled,\nand vector matching remains enabled.",
+ "typical_question": {
+ "description": "TypicalQuestion is one natural-language question this document answers.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeTag": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "description": "Optional display color",
"type": "string"
},
- "rerank": {
- "description": "Rerank, when present and enabled, reranks the fused candidates before\ntruncating to MatchCount. Only the hybrid-search API reads it; internal\ncallers rerank on their own.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankOptions"
- }
- ]
- },
- "scope_tag_ids": {
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier of the tag (UUID)",
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base ID that this tag belongs to",
+ "type": "string"
+ },
+ "name": {
+ "description": "Tag name, unique within the same knowledge base",
+ "type": "string"
+ },
+ "seq_id": {
+ "description": "SeqID is an auto-increment integer ID for external API usage",
+ "type": "integer"
+ },
+ "sort_order": {
+ "description": "Sort order within the same knowledge base",
+ "type": "integer"
+ },
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListJoinRequestsResponse": {
+ "type": "object",
+ "properties": {
+ "requests": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestResponse"
}
},
- "skip_context_enrichment": {
- "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
- "type": "boolean"
- },
- "tag_ids": {
- "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
+ "type": "object",
+ "properties": {
+ "members": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
}
},
- "vector_threshold": {
- "type": "number"
+ "total": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SearchResult": {
+ "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
"type": "object",
"properties": {
- "chunk_index": {
- "description": "Chunk index",
- "type": "integer"
+ "organizations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
},
- "chunk_metadata": {
- "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
+ "resource_counts": {
+ "description": "各空间内知识库/智能体数量,供列表侧栏展示",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
+ }
+ ]
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
+ "type": "object",
+ "properties": {
+ "shares": {
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
}
},
- "chunk_type": {
- "description": "Chunk 类型",
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": {
+ "type": "object",
+ "properties": {
+ "path_prefix": {
"type": "string"
- },
- "content": {
- "description": "Content",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LoginRequest": {
+ "type": "object",
+ "required": [
+ "email",
+ "password"
+ ],
+ "properties": {
+ "email": {
"type": "string"
},
- "end_at": {
- "description": "End at",
- "type": "integer"
+ "password": {
+ "type": "string",
+ "minLength": 6
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LoginResponse": {
+ "type": "object",
+ "properties": {
+ "active_tenant": {
+ "description": "ActiveTenant is the workspace whose ID is encoded in the issued JWT;\nfuture requests are scoped to it until the client calls /auth/switch-tenant.\nDefaults to the user's home workspace on a fresh login.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ }
+ ]
},
- "id": {
- "description": "ID",
- "type": "string"
+ "memberships": {
+ "description": "Memberships lists every workspace the user can authenticate into,\nalong with their role in each. Always populated (length 1 for users\nwho only belong to their home workspace) so frontends can render a\nworkspace switcher without a follow-up request. Serialised without\nomitempty so the field is always present as a JSON array (possibly\nempty) — the \"always populated\" contract relies on the server side\nguaranteeing a non-nil slice.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Membership"
+ }
},
- "image_info": {
- "description": "图片信息 (JSON 格式)",
+ "message": {
"type": "string"
},
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
+ "refresh_token": {
"type": "string"
},
- "knowledge_channel": {
- "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
- "type": "string"
+ "success": {
+ "type": "boolean"
},
- "knowledge_custom_metadata": {
- "description": "KnowledgeCustomMetadata is user-authored context safe to expose to models.",
+ "token": {
"type": "string"
},
- "knowledge_description": {
- "description": "KnowledgeDescription is the description of the knowledge document",
- "type": "string"
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig": {
+ "type": "object",
+ "properties": {
+ "retry_count": {
+ "description": "Number of retries, default: 3",
+ "type": "integer"
},
- "knowledge_filename": {
- "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
- "type": "string"
+ "retry_delay": {
+ "description": "Delay between retries in seconds, default: 1",
+ "type": "integer"
},
- "knowledge_id": {
- "description": "Knowledge ID",
+ "timeout": {
+ "description": "Timeout in seconds, default: 30",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": {
+ "type": "object",
+ "properties": {
+ "api_key": {
"type": "string"
},
- "knowledge_source": {
- "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
+ "api_key_header": {
+ "description": "APIKeyHeader is the header name that carries APIKey when AuthType is\napi_key. Empty defaults to \"X-API-Key\". This is non-secret structural\nconfig (the secret is APIKey), so it is not encrypted and is safe to echo\nback in responses. It lets services that expect the key in a different\nheader (e.g. the raw token directly in \"Authorization\") work without\nresorting to plaintext custom headers.",
"type": "string"
},
- "knowledge_title": {
- "description": "Knowledge title",
+ "auth_server_metadata_url": {
+ "description": "AuthServerMetadataURL optionally pins the OAuth authorization server\nmetadata URL. When empty, the server is discovered automatically from\nthe MCP URL (RFC 9728 / RFC 8414).",
"type": "string"
},
- "match_type": {
- "description": "Match type",
+ "auth_type": {
+ "description": "AuthType selects the authentication strategy. Empty (\"\") is treated as\nnone for backward compatibility with rows that pre-date this field.",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthType"
}
]
},
- "matched_content": {
- "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "client_id": {
+ "description": "ClientID optionally names an OAuth client registered with the\nauthorization server in advance. When set it is used instead of dynamic\nclient registration, for servers that offer no registration endpoint or\nallow grants only to clients an administrator registered. Non-secret.",
"type": "string"
},
- "matched_images": {
- "description": "MatchedImages survives merging, deduplication and stored reference replay.\nIt contains storage references, never image bytes.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchedImage"
- }
+ "client_secret": {
+ "description": "ClientSecret is the secret of ClientID for a confidential client.\nSecret: encrypted at rest like APIKey and Token, never returned, and\nchanged only through the credentials subresource after creation.",
+ "type": "string"
},
- "metadata": {
- "description": "Metadata",
+ "custom_headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
- "parent_chunk_id": {
- "description": "父 Chunk ID",
- "type": "string"
- },
- "score": {
- "description": "Score",
- "type": "number"
- },
- "seq": {
- "description": "Seq",
- "type": "integer"
- },
- "source_locators": {
- "description": "SourceLocators point back into the original file for citation\nnavigation. Merged results carry the union of their chunks' locators.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SourceLocator"
- }
- },
- "start_at": {
- "description": "Start at",
- "type": "integer"
- },
- "sub_chunk_id": {
- "description": "SubChunkIndex",
+ "scopes": {
+ "description": "Scopes are the OAuth scopes requested during authorization. Optional.",
"type": "array",
"items": {
"type": "string"
}
+ },
+ "token": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Session": {
+ "github_com_Tencent_WeKnora_internal_types.MCPAuthType": {
+ "type": "string",
+ "enum": [
+ "",
+ "api_key",
+ "bearer",
+ "oauth"
+ ],
+ "x-enum-varnames": [
+ "MCPAuthNone",
+ "MCPAuthAPIKey",
+ "MCPAuthBearer",
+ "MCPAuthOAuth"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPResource": {
"type": "object",
"properties": {
- "created_at": {
+ "description": {
"type": "string"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "description": {
- "description": "Description",
+ "mimeType": {
"type": "string"
},
- "forked_from_message_id": {
- "description": "ForkedFromMessageID is the user or assistant message, IN THE PARENT\nSESSION, that the fork branched at. For a user point, messages strictly\nbefore it were copied here. For an assistant point, that answer is\nincluded so the branch continues after it.",
+ "name": {
"type": "string"
},
- "host_workspace_dir": {
- "description": "HostWorkspaceDir is the user-selected project directory this session\noperates in, for the WeKnora Lite host sandbox only. Empty means the session\ngets an auto-allocated workspace instead.\n\nWritten once at creation and never updated: re-pointing a live session\nat a different directory would leave its transcript describing files\nthat are no longer there. Standard edition never writes it.",
+ "uri": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPService": {
+ "type": "object",
+ "properties": {
+ "advanced_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
},
- "id": {
- "description": "ID",
+ "auth_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig"
+ },
+ "created_at": {
"type": "string"
},
- "im_platform": {
- "description": "IMPlatform is the originating IM platform (e.g. \"feishu\", \"wecom\") when\nthis session is bound to an IM channel. It is not stored on the sessions\ntable (it lives in im_channel_sessions) and is populated on read so the\nWeb console can classify a session's origin folder without a list query.",
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
"type": "string"
},
- "is_pinned": {
- "description": "IsPinned indicates whether the session is pinned in the list.",
+ "enabled": {
"type": "boolean"
},
- "last_request_state": {
- "description": "LastRequestState records the input-bar state used the last time this\nsession sent a question (agent, model, KB scope, web search, MCPs).\nPersisted on every successful POST to /knowledge-chat or /agent-chat so\nthat reopening the session can restore the original request context to\nthe chat UI. Stored in the legacy sessions.agent_config JSONB column to\navoid a new migration; the shape used today is ` + "`" + `SessionLastRequestState` + "`" + `.",
+ "env_vars": {
+ "description": "Environment variables for stdio",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SessionLastRequestState"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
}
]
},
- "parent_session_id": {
- "description": "ParentSessionID names the session this one was forked from. Empty for\nordinary sessions. Deliberately not a foreign key: the parent may be\ndeleted while the branch lives on, and a branch must not cascade away\nwith it. A dangling value simply renders as an ordinary session.",
- "type": "string"
+ "headers": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
},
- "pinned_at": {
- "description": "PinnedAt records when the session was pinned; nil when not pinned.",
+ "id": {
"type": "string"
},
- "sandbox_config_id": {
- "description": "SandboxConfigID pins which sandbox config this session's CURRENT live\nsandbox was created on. Empty means no live sandbox;\nSandboxConfigIDGlobalDefault means the deployment-wide default config.\n\nThis is an ephemeral pin that dies with the sandbox, not a permanent\nowner: sessions outlive sandboxes by months, so treating it as\npermanent would make \"no session references this config\" never true.",
+ "is_builtin": {
+ "description": "Whether this is a builtin MCP service (visible to all workspaces)",
+ "type": "boolean"
+ },
+ "name": {
"type": "string"
},
+ "stdio_config": {
+ "description": "Required for stdio transport",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
+ }
+ ]
+ },
"tenant_id": {
- "description": "Workspace ID",
"type": "integer"
},
- "title": {
- "description": "Title",
- "type": "string"
+ "transport_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
},
"updated_at": {
"type": "string"
},
- "user_id": {
- "description": "UserID is the owner scope for this session. WeKnora user UUIDs, API\nexternal-user principals, and embed visitor principals all use this column.",
+ "url": {
+ "description": "Optional: required for SSE/HTTP Streamable",
+ "type": "string"
+ },
+ "usage_instructions": {
+ "description": "UsageInstructions is maintained locally and is not overwritten by directory refresh.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SessionLastRequestState": {
+ "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": {
"type": "object",
"properties": {
- "agent_enabled": {
- "type": "boolean"
- },
- "agent_id": {
- "type": "string"
- },
- "knowledge_base_ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "local_browser_enabled": {
- "type": "boolean"
- },
- "mcp_service_ids": {
+ "args": {
+ "description": "Command arguments array",
"type": "array",
"items": {
"type": "string"
}
},
- "mentioned_items": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
- }
- },
- "model_id": {
+ "command": {
+ "description": "Command: \"uvx\" or \"npx\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPTestResult": {
+ "type": "object",
+ "properties": {
+ "description": {
"type": "string"
},
- "reasoning_effort": {
+ "message": {
"type": "string"
},
- "skill_names": {
+ "oauth_required": {
+ "description": "OAuthRequired is true when the connection failed because the server\nrequires OAuth authorization (RFC 9728), even though the service was not\nconfigured for OAuth. The UI uses it to guide the user to switch the auth\nstrategy to OAuth.",
+ "type": "boolean"
+ },
+ "resources": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPResource"
}
},
- "tag_ids": {
+ "success": {
+ "type": "boolean"
+ },
+ "tools": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTool"
}
- },
- "web_search_enabled": {
- "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MCPTool": {
"type": "object",
- "required": [
- "organization_id",
- "permission"
- ],
"properties": {
- "organization_id": {
+ "description": {
"type": "string"
},
- "permission": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "inputSchema": {
+ "description": "JSON Schema for tool parameters",
+ "type": "object"
+ },
+ "name": {
+ "type": "string"
+ },
+ "require_approval": {
+ "description": "RequireApproval when true: agent execution pauses until the user approves in UI (issue #1173).",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SkillImageConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MCPTransportType": {
+ "type": "string",
+ "enum": [
+ "sse",
+ "http-streamable",
+ "stdio"
+ ],
+ "x-enum-comments": {
+ "MCPTransportHTTPStreamable": "HTTP Streamable",
+ "MCPTransportSSE": "Server-Sent Events",
+ "MCPTransportStdio": "Stdio (Standard Input/Output)"
+ },
+ "x-enum-descriptions": [
+ "Server-Sent Events",
+ "HTTP Streamable",
+ "Stdio (Standard Input/Output)"
+ ],
+ "x-enum-varnames": [
+ "MCPTransportSSE",
+ "MCPTransportHTTPStreamable",
+ "MCPTransportStdio"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": {
"type": "object",
"properties": {
- "base_template_id": {
- "description": "BaseTemplateID is the template this chain was originally built from;\nthe rebuild path starts over from it.",
+ "channel": {
"type": "string"
},
- "built_at": {
- "description": "BuiltAt records when this generation was produced.",
+ "content": {
"type": "string"
},
- "generation": {
- "description": "Generation increments on every successful install/remove, for naming\nand troubleshooting.",
- "type": "integer"
+ "process_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides"
},
- "owner_fingerprint": {
- "description": "OwnerFingerprint identifies the provider account that owns the snapshot.\nSnapshots are invisible across accounts, so a mismatch means \"fall back\nto the base template\" rather than \"fail\".",
+ "status": {
"type": "string"
},
- "snapshot_id": {
- "description": "SnapshotID is the currently effective snapshot; empty = base template.",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SourceLocator": {
- "type": "object",
- "properties": {
- "bbox": {
- "description": "BBox is [x0, y0, x1, y1] as fractions of the page width and height,\norigin at the top-left corner of the rendered page.",
+ "tag_ids": {
"type": "array",
"items": {
- "type": "number"
+ "type": "string"
}
},
- "block": {
- "description": "Block is the 1-based index among a Word file's body paragraphs and tables.",
- "type": "integer"
- },
- "end": {
- "type": "integer"
- },
- "end_ms": {
- "type": "integer"
- },
- "mapping": {
- "description": "Mapping records verified text-to-source alignment. Empty means legacy.",
- "type": "string"
- },
- "page": {
- "description": "Page is the 1-based PDF page.",
- "type": "integer"
- },
- "partial": {
- "description": "Partial means some of the chunk has no source mapping.",
- "type": "boolean"
- },
- "quote": {
- "description": "Quote is the complete cited overlap as parsed. Viewers match it\ninside the rendered original and against the\nanswer sentence that cites the chunk.",
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MatchType": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "x-enum-comments": {
+ "MatchTypeDataAnalysis": "数据分析匹配类型",
+ "MatchTypeDirectLoad": "Deprecated: reserved to preserve serialized enum values",
+ "MatchTypeParentChunk": "父Chunk匹配类型",
+ "MatchTypeRelationChunk": "关系Chunk匹配类型",
+ "MatchTypeWebSearch": "网络搜索匹配类型"
+ },
+ "x-enum-descriptions": [
+ "",
+ "",
+ "",
+ "",
+ "父Chunk匹配类型",
+ "关系Chunk匹配类型",
+ "",
+ "网络搜索匹配类型",
+ "Deprecated: reserved to preserve serialized enum values",
+ "数据分析匹配类型"
+ ],
+ "x-enum-varnames": [
+ "MatchTypeEmbedding",
+ "MatchTypeKeywords",
+ "MatchTypeNearByChunk",
+ "MatchTypeHistory",
+ "MatchTypeParentChunk",
+ "MatchTypeRelationChunk",
+ "MatchTypeGraph",
+ "MatchTypeWebSearch",
+ "MatchTypeDirectLoad",
+ "MatchTypeDataAnalysis"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.MatchedImage": {
+ "type": "object",
+ "properties": {
+ "chunk_id": {
"type": "string"
},
- "row_end": {
- "type": "integer"
+ "knowledge_base_id": {
+ "type": "string"
},
- "row_start": {
- "type": "integer"
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.Membership": {
+ "type": "object",
+ "properties": {
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantRole"
},
- "section": {
- "description": "Section is the 1-based EPUB spine index.",
+ "tenant_id": {
"type": "integer"
},
- "sheet": {
- "description": "Sheet is the spreadsheet sheet name; RowStart/RowEnd are its 1-based\nrow numbers as shown by spreadsheet applications.",
+ "tenant_name": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MemoryConfig": {
+ "type": "object",
+ "properties": {
+ "embedding_model_id": {
+ "description": "EmbeddingModelID is the single model used to score memory against a\nquestion. It is pinned per workspace: knowledge bases each have their\nown embedding model, and grabbing whichever one happens to be listed\nfirst would mix incomparable vector spaces. Blank means semantic recall\nis off and matching stays lexical.",
"type": "string"
},
- "slide": {
- "description": "Slide is the 1-based slide number in presentation order.",
+ "enabled": {
+ "description": "Enabled defaults to false. Memory retains user statements across\nsessions, so a workspace admin has to turn it on deliberately.",
+ "type": "boolean"
+ },
+ "extract_delay_seconds": {
+ "description": "ExtractDelaySeconds is how long a finished turn waits before\ndistillation runs. Waiting lets one model call cover the several\nmessages a user usually sends in a row. 0 means the default.",
"type": "integer"
},
- "source_hash": {
- "description": "SourceHash binds the locator to the knowledge record’s source revision hash.",
+ "extract_instructions": {
+ "description": "ExtractInstructions are workspace-specific rules appended to the\ndistillation prompt, for policies the product cannot guess (\"never record\ncustomer names\", \"always note the environment a question is about\").",
"type": "string"
},
- "source_id": {
- "description": "SourceID identifies a block within the parser result, not a rendered item.",
+ "extract_min_interval_seconds": {
+ "description": "ExtractMinIntervalSeconds is the floor between two distillation runs for\nthe same person, and exists purely to bound cost. It never drops a turn:\na turn arriving inside the interval is queued and picked up by the next\nrun. 0 means the default.",
+ "type": "integer"
+ },
+ "extract_model_id": {
+ "description": "ExtractModelID is the model used by the background extraction task.\nEmpty means \"use the model the conversation itself used\", which is what\nthe settings UI promises, so the extraction task must never fail merely\nbecause this is blank.",
"type": "string"
},
- "start": {
- "description": "Start/End are rune offsets into the original text file.",
+ "interest_threshold": {
+ "description": "InterestThreshold is how many separate conversations must touch a topic\nbefore it becomes a stored interest. 0 means the default. Setting it to 1\nrecords every topic on first sight, which is usually too noisy.",
"type": "integer"
},
- "start_ms": {
- "description": "StartMs/EndMs bound an audio segment.",
+ "max_items": {
+ "description": "MaxItems caps active items per subject. 0 means DefaultMemoryMaxItems.",
"type": "integer"
},
- "title": {
- "description": "Title names the section or slide when the source has one.",
- "type": "string"
+ "retrieval_conditioning": {
+ "description": "RetrievalConditioning lets memory shape retrieval — query rewriting and\nper-document ranking — rather than only being appended to the answer\nprompt. This is where memory earns its keep in a knowledge-base product.",
+ "type": "boolean"
},
- "type": {
+ "vector_recall": {
+ "description": "VectorRecall adds semantic similarity to memory recall. Nil means on\nwhen an embedding model is reachable.\n\nLexical matching alone cannot find a memory the user has re-worded, which\nis most of them: \"回答直接给结论\" and \"别铺垫那么多\" share no tokens. The\ncost is one embedding call per turn, bounded and degraded to lexical on\nfailure, so the feature never becomes a reason a chat is slow.",
+ "type": "boolean"
+ },
+ "write_mode": {
+ "description": "WriteMode is MemoryWriteExplicitOnly or MemoryWriteAuto.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MemoryConsolidationResult": {
"type": "object",
"properties": {
- "count": {
+ "candidates": {
+ "description": "Candidates is how many groups were put in front of the model.",
"type": "integer"
},
- "enabled": {
- "type": "boolean"
+ "demoted": {
+ "type": "integer"
},
- "items": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "expired": {
+ "type": "integer"
},
- "mode": {
+ "merged": {
+ "type": "integer"
+ },
+ "reviewed": {
+ "description": "Reviewed is how many active memories the pass looked at.",
+ "type": "integer"
+ },
+ "skipped": {
+ "description": "Skipped is why nothing was merged, empty when something was.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StorageBackendConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MemoryDocView": {
"type": "object",
"properties": {
- "access_key_id": {
+ "hits": {
+ "type": "integer"
+ },
+ "id": {
"type": "string"
},
- "app_id": {
+ "knowledge_base_id": {
"type": "string"
},
- "bucket_name": {
+ "knowledge_id": {
"type": "string"
},
- "endpoint": {
+ "last_used_at": {
"type": "string"
},
- "force_path_style": {
- "type": "boolean"
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MemoryItem": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
},
- "mode": {
+ "created_at": {
"type": "string"
},
- "path_prefix": {
+ "expires_at": {
+ "description": "ExpiresAt is when the statement stops being worth recalling, used for\nthings that are true only for a while (\"finish the migration this week\").\nWithout it an in-flight task stays in context forever and slowly turns\nthe memory into a list of things the user finished months ago.",
"type": "string"
},
- "region": {
+ "id": {
"type": "string"
},
- "secret_access_key": {
+ "importance": {
+ "type": "integer"
+ },
+ "invalid_at": {
"type": "string"
},
- "temp_bucket_name": {
+ "kind": {
"type": "string"
},
- "temp_region": {
+ "last_used_at": {
"type": "string"
},
- "use_ssl": {
- "type": "boolean"
+ "normalized_key": {
+ "description": "NormalizedKey identifies the topic this item is about. A new item with\nthe same key as an active one supersedes it, which is how contradictions\n(\"I use MySQL\" then \"I moved to Postgres\") resolve without an LLM in the\nread path.",
+ "type": "string"
},
- "use_temp_bucket": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.StorageConfig": {
- "type": "object",
- "properties": {
- "app_id": {
- "description": "App ID (COS specific)",
+ "origin": {
"type": "string"
},
- "bucket_name": {
- "description": "Bucket Name",
+ "replaces_id": {
"type": "string"
},
- "endpoint": {
- "description": "Endpoint (S3 specific) - e.g., s3.amazonaws.com, oss-cn-hangzhou.aliyuncs.com",
+ "source_message_id": {
"type": "string"
},
- "force_path_style": {
- "description": "ForcePathStyle (S3 specific) - whether to use path-style URLs",
- "type": "boolean"
+ "source_session_id": {
+ "type": "string"
},
- "path_prefix": {
- "description": "Path Prefix",
+ "status": {
"type": "string"
},
- "provider": {
- "description": "Provider: \"cos\", \"minio\", \"s3\"",
+ "subject_id": {
"type": "string"
},
- "region": {
- "description": "Region",
+ "superseded_by": {
"type": "string"
},
- "secret_id": {
- "description": "Secret ID (COS) / Access Key ID (S3, MinIO)",
+ "tenant_id": {
+ "type": "integer"
+ },
+ "topic": {
+ "description": "Topic is the readable subject the statement is about, as the extraction\nmodel named it (\"在用的数据库\"). It is kept verbatim next to the\nnormalized key because it is the best retrieval handle available: a\nquestion often names the topic while the statement itself only carries\nthe value (\"已经迁到 PostgreSQL\").",
"type": "string"
},
- "secret_key": {
- "description": "Secret Key (COS) / Secret Access Key (S3, MinIO)",
+ "updated_at": {
"type": "string"
},
- "use_ssl": {
- "description": "UseSSL (S3 specific) - whether to use HTTPS",
- "type": "boolean"
+ "use_count": {
+ "type": "integer"
+ },
+ "valid_from": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MemorySettings": {
"type": "object",
"properties": {
- "cos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
- },
- "default_provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\", \"obs\"",
- "type": "string"
- },
- "ks3": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig"
- },
- "local": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
+ "effective": {
+ "description": "Effective is what actually happens: WorkspaceEnabled \u0026\u0026 UserEnabled.",
+ "type": "boolean"
},
- "minio": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
+ "item_count": {
+ "description": "ItemCount is how many active memories the caller currently has.",
+ "type": "integer"
},
- "obs": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OBSEngineConfig"
+ "max_items": {
+ "description": "MaxItems is the capacity cap after which the lowest ranked are archived.",
+ "type": "integer"
},
- "oss": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
+ "user_enabled": {
+ "description": "UserEnabled is the caller's own opt out. Meaningless while the\nworkspace switch is off, but still reported so the toggle keeps its\nposition when an admin turns the workspace back on.",
+ "type": "boolean"
},
- "s3": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
+ "workspace_enabled": {
+ "description": "WorkspaceEnabled is the admin switch on the workspace.",
+ "type": "boolean"
},
- "tos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
+ "write_mode": {
+ "description": "WriteMode is the workspace write mode.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MemoryTopicView": {
"type": "object",
"properties": {
- "provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\", \"obs\"",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
- "type": "object",
- "required": [
- "invite_code"
- ],
- "properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
+ "aliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "hits": {
+ "type": "integer"
},
- "role": {
- "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SuggestionAttribution": {
- "type": "object",
- "properties": {
- "question_id": {
+ "id": {
"type": "string"
},
- "suggestion_set_id": {
+ "last_seen_at": {
+ "type": "string"
+ },
+ "threshold": {
+ "type": "integer"
+ },
+ "topic": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SyncLog": {
+ "github_com_Tencent_WeKnora_internal_types.MentionedItem": {
"type": "object",
"properties": {
- "created_at": {
- "description": "Creation timestamp (usually same as StartedAt)",
+ "id": {
"type": "string"
},
- "data_source_id": {
- "description": "Reference to the data source",
+ "kb_id": {
+ "description": "Parent knowledge base for file/tag mentions",
"type": "string"
},
- "error_message": {
- "description": "Error details if status is \"failed\"",
+ "kb_name": {
+ "description": "Display name for parent KB",
"type": "string"
},
- "finished_at": {
- "description": "Sync completion time",
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
"type": "string"
},
- "id": {
- "description": "Unique identifier",
+ "name": {
"type": "string"
},
- "items_created": {
- "description": "New items created in knowledge base",
- "type": "integer"
- },
- "items_deleted": {
- "description": "Items deleted from knowledge base",
- "type": "integer"
+ "service_id": {
+ "description": "Parent MCP service for MCP tool mentions",
+ "type": "string"
},
- "items_failed": {
- "description": "Items that failed to sync",
- "type": "integer"
+ "skill_name": {
+ "description": "Preloaded agent skill name",
+ "type": "string"
},
- "items_skipped": {
- "description": "Items skipped (no changes detected)",
+ "type": {
+ "description": "\"kb\", \"file\", \"tag\", \"mcp\", \"skill\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.Message": {
+ "type": "object",
+ "properties": {
+ "agent_duration_ms": {
+ "description": "Agent total execution duration in milliseconds (from query start to answer start)",
"type": "integer"
},
- "items_total": {
- "description": "Total items fetched from source",
- "type": "integer"
+ "agent_id": {
+ "description": "AgentID is the agent used for this individual assistant turn. Unlike the\nsession's last_request_state it remains stable when users switch agents.",
+ "type": "string"
},
- "items_updated": {
- "description": "Existing items updated",
- "type": "integer"
+ "agent_steps": {
+ "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep"
+ }
},
- "result": {
- "description": "Detailed sync result (JSON-encoded)",
+ "artifacts": {
+ "description": "Skill-generated files produced during this assistant turn (assistant messages only).\nPopulated by ArtifactCollector after the sandbox finishes, referenced by the\nartifact download endpoint. Empty for user messages and turns without skills.\n\nStored in the message_artifacts table, not on the message row: the message\nrepository loads it with every message it returns and writes it whenever it\nis non-nil on create or update. A nil slice leaves the stored rows alone.",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageArtifact"
}
},
- "started_at": {
- "description": "Sync start time",
- "type": "string"
+ "attachments": {
+ "description": "Attached files (documents, audio, etc., for user messages)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageAttachment"
+ }
},
- "status": {
- "description": "Sync status: running, success, partial, failed, canceled",
+ "channel": {
+ "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
"type": "string"
},
- "tenant_id": {
- "description": "Workspace ID",
- "type": "integer"
- },
- "updated_at": {
- "description": "Last update timestamp",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SystemSetting": {
- "type": "object",
- "properties": {
- "category": {
- "description": "Category groups settings in the management UI (\"limits\", \"agent\",\n\"auth\", ...). Free-form string so adding a new category is a\ndata-only change.",
+ "content": {
+ "description": "Message text content",
"type": "string"
},
"created_at": {
+ "description": "Message creation timestamp",
"type": "string"
},
- "description": {
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier for the message",
"type": "string"
},
- "enum": {
- "description": "Enum is populated by the service layer (NOT persisted) from the\nin-code registry. Empty/nil means \"free-form input\"; non-empty\nmeans the UI should render a select with these options. Tagged\n` + "`" + `gorm:\"-\"` + "`" + ` so GORM never tries to read/write the column.",
+ "images": {
+ "description": "Attached images with OCR/Caption text (for user messages)",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage"
}
},
- "id": {
- "type": "integer"
+ "is_completed": {
+ "description": "Whether message generation is complete",
+ "type": "boolean"
},
- "is_secret": {
- "description": "IsSecret reserves UI affordances for P3 (mask + reveal-with-confirm).\nIn P1 every row is is_secret=false; service Update accepts the\ncolumn but does not yet enforce special handling.",
+ "is_fallback": {
+ "description": "Whether this response is a fallback (no knowledge base match found)",
"type": "boolean"
},
- "key": {
+ "knowledge_id": {
+ "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
"type": "string"
},
- "last_modified_by": {
+ "knowledge_references": {
+ "description": "References to knowledge chunks used in the response",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
+ }
+ },
+ "mentioned_items": {
+ "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
+ }
+ },
+ "model_id": {
+ "description": "ModelID is the requested/effective chat model binding captured for this\nturn. It is useful for reproducibility and suggestion generation.",
"type": "string"
},
- "last_modified_by_name": {
- "description": "LastModifiedByName is a display label resolved from LastModifiedBy\n(the user's UUID) at handler time — username when available,\notherwise email. Empty for virtual rows that were never persisted\n(LastModifiedBy=\"\"). Not stored: derived per request so renaming\na user reflects on the next reload without a backfill job.",
+ "pending_prompt": {
+ "description": "PendingPrompt is the prompt an awaiting_input message waits on. The\nmessage list fills it in for the prompt's owner; it is never stored.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PendingPromptView"
+ }
+ ]
+ },
+ "request_id": {
+ "description": "Request identifier for tracking API requests",
"type": "string"
},
- "requires_restart": {
- "description": "RequiresRestart reserves UI affordances for P3 (banner \"this\nchange won't take effect until the next restart\"). In P1 the\nonly seeded key is per-request, so always false.",
- "type": "boolean"
+ "role": {
+ "description": "Message role: \"user\", \"assistant\", \"system\"",
+ "type": "string"
+ },
+ "run_state": {
+ "description": "RunState refines an incomplete message: MessageRunStateAwaitingInput\nmeans the run ended suspended on a prompt instead of still generating.\nEmpty means IsCompleted alone describes the message.",
+ "type": "string"
+ },
+ "sandbox_checkpoint": {
+ "description": "SandboxCheckpoint is the git commit this assistant turn produced in the\nsession sandbox's /workspace. Nil for user messages, for turns that ran\nwithout a sandbox, and for turns whose commit failed (best-effort — a\nfailed checkpoint must never block the reply). A message without a\ncheckpoint cannot serve as a fork point with sandbox state.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SandboxCheckpoint"
+ }
+ ]
+ },
+ "session_id": {
+ "description": "ID of the session this message belongs to",
+ "type": "string"
},
"updated_at": {
+ "description": "Last update timestamp",
"type": "string"
},
- "value": {
+ "usage": {
+ "description": "LLM token usage aggregated across every round of the turn that produced this\nassistant message. Persisted so history reads can attribute cost after the\nlive stream is gone; NULL (nil) for user messages and pre-feature rows.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TokenUsage"
+ }
+ ]
+ },
+ "used_memories": {
+ "description": "UsedMemories records which long-term memories were injected into this\nanswer, so the chat UI can show them and let the user delete one on the\nspot. Persisted rather than only streamed so reopening a conversation\nstill explains what the answer saw.",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UsedMemory"
}
- },
- "value_type": {
- "description": "ValueType is one of \"int\", \"string\", \"bool\". Service layer rejects\nupdates whose payload type does not match; UI uses it to pick\nInputNumber vs Input vs Switch.",
- "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MessageArtifact": {
"type": "object",
"properties": {
- "access_key": {
+ "content_hash": {
+ "description": "SHA-256 of the persisted bytes",
"type": "string"
},
- "bucket_name": {
+ "created_at": {
+ "description": "When WeKnora persisted the blob",
"type": "string"
},
- "endpoint": {
+ "deleted_at": {
+ "description": "DeletedAt marks a file the user deleted. The entry stays in the list\nrather than being removed because its position IS the download address\n(msg.Artifacts[index]); dropping it would shift every later file's index\nand hand an old link the wrong blob. Keeping it also keeps the entry in\nArtifactCollector's de-duplication set, so the next collect does not\nre-attach the very file that was deleted — its sandbox mtime has not\nmoved. Clients filter these out; the bytes are already reclaimed.",
"type": "string"
},
- "path_prefix": {
+ "file_name": {
+ "description": "Original filename inside the sandbox",
"type": "string"
},
- "region": {
- "type": "string"
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
},
- "secret_key": {
+ "file_type": {
+ "description": "File extension (e.g., \".pptx\", \".pdf\")",
"type": "string"
},
- "temp_bucket_name": {
+ "mod_time": {
+ "description": "Sandbox-side modification time (used for diff)",
"type": "string"
},
- "temp_region": {
+ "source_path": {
+ "description": "Absolute path inside the sandbox (used for diff)",
+ "type": "string"
+ },
+ "url": {
+ "description": "Storage URL (provider://path); persisted, not sent to client",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Tenant": {
+ "github_com_Tencent_WeKnora_internal_types.MessageAttachment": {
"type": "object",
"properties": {
- "business": {
- "description": "Business",
+ "content": {
+ "description": "Extracted text content (for small text files)",
"type": "string"
},
- "chat_history_config": {
- "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
- }
- ]
- },
- "context_config": {
- "description": "Global Context configuration for this workspace (default for all sessions)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
- }
- ]
- },
- "created_at": {
- "description": "Creation time",
+ "content_mode": {
+ "description": "full or selected_chunks",
"type": "string"
},
- "credentials": {
- "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig"
- }
- ]
- },
- "default_storage_backend_id": {
- "description": "DefaultStorageBackendID is the workspace default concrete storage instance.",
+ "file_name": {
+ "description": "Original filename",
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
},
- "description": {
- "description": "Description",
+ "file_type": {
+ "description": "File extension (e.g., \".pdf\", \".docx\")",
"type": "string"
},
"id": {
- "description": "ID",
- "type": "integer"
- },
- "memory_config": {
- "description": "Memory config: workspace switch for cross-session long-term memory",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConfig"
- }
- ]
- },
- "name": {
- "description": "Name",
+ "description": "Temporary document ID for session-scoped uploads",
"type": "string"
},
- "parser_engine_config": {
- "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
- }
- ]
- },
- "retrieval_config": {
- "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
- }
- ]
- },
- "retriever_engines": {
- "description": "Retriever engines",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
- }
- ]
- },
- "status": {
- "description": "Status",
- "type": "string"
+ "is_truncated": {
+ "description": "Whether content was truncated",
+ "type": "boolean"
},
- "storage_engine_config": {
- "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
- }
- ]
+ "line_count": {
+ "description": "Total line count (for text files)",
+ "type": "integer"
},
- "storage_quota": {
- "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
+ "selected_chunks": {
+ "description": "Chunks included in this message prompt",
"type": "integer"
},
- "storage_used": {
- "description": "Storage used (Bytes)",
+ "token_count": {
+ "description": "Approximate tokens in the parsed document",
"type": "integer"
},
- "updated_at": {
- "description": "Last updated time",
+ "total_chunks": {
+ "description": "Total parsed chunks",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MessageImage": {
+ "type": "object",
+ "properties": {
+ "caption": {
"type": "string"
},
- "web_search_config": {
- "description": "Global WebSearch configuration for this workspace",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
- }
- ]
+ "url": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.TenantRole": {
- "type": "string",
- "enum": [
- "owner",
- "admin",
- "contributor",
- "viewer"
- ],
- "x-enum-varnames": [
- "TenantRoleOwner",
- "TenantRoleAdmin",
- "TenantRoleContributor",
- "TenantRoleViewer"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.TenantSandboxConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem": {
"type": "object",
"properties": {
- "allow_private_endpoints": {
- "description": "AllowPrivateEndpoints permits this workspace config to reach RFC1918 or\nloopback cluster endpoints. Link-local/cloud-metadata addresses remain\nblocked. It is explicit in the UI instead of hidden in process env.",
- "type": "boolean"
- },
- "cube": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeSandboxConfig"
- },
- "default_timeout_sec": {
- "description": "DefaultTimeoutSec is the per-execution timeout in seconds. 0 uses the\nprogram's built-in default.",
- "type": "integer"
- },
- "desktop_enabled": {
- "description": "DesktopEnabled declares that this config's base template is a desktop\nimage (XFCE + x11vnc + websockify). It is NOT a second template: a\nconfig has exactly one boot target, and skill snapshots stack on top of\nthis base generation after generation. Flipping it changes the base, so\nany installed skills must be rebuilt from the new one.",
- "type": "boolean"
- },
- "docker": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DockerSandboxConfig"
+ "answer_content": {
+ "description": "Assistant answer content (role=assistant), may be empty if only Q matched",
+ "type": "string"
},
- "e2b": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.E2BSandboxConfig"
+ "created_at": {
+ "description": "Timestamp of the earliest message in the group",
+ "type": "string"
},
- "env_vars": {
- "description": "EnvVars are additional environment variables injected into every\nsandbox created for this tenant. 🔒 Values are encrypted at rest.\nThese become visible to all scripts running in the tenant's\nsandboxes — do not place secrets here that scripts must not access.",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "match_type": {
+ "description": "How this result was matched: \"keyword\", \"vector\", or \"hybrid\"",
+ "type": "string"
},
- "network": {
- "description": "Network is the outbound/inbound network policy applied to every sandbox\ncreated from this config — chat sessions, skill installs and deep\nconnectivity probes alike. nil and the zero value mean the same thing:\noutbound egress allowed, inbound public access closed.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SandboxNetworkPolicy"
- }
- ]
+ "query_content": {
+ "description": "User query content (role=user)",
+ "type": "string"
},
- "sandbox_type": {
- "description": "SandboxType is cube, e2b, or docker; disabled is the hidden policy row.",
+ "request_id": {
+ "description": "The request_id that groups Q\u0026A together",
"type": "string"
},
- "skill_image": {
- "description": "SkillImage points at the snapshot that carries this config's installed\nskills. Empty means \"use the base template\". Written only by the skill\ninstall/remove path: MergeSandboxConfigForUpdate ignores client values\nso a settings-form save cannot wipe or plant the pointer.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SkillImageConfig"
- }
- ]
+ "score": {
+ "description": "Best score among the matched messages in this group",
+ "type": "number"
},
- "skill_rollout": {
- "description": "SkillRollout decides whether sessions that already hold a sandbox of\nthis config rebuild after a skill install or removal. Empty and\nSkillRolloutNextTurn rebuild on the next chat turn. SkillRolloutNewSession\nleaves those sandboxes on the previous image; only sessions that start\nafterwards boot the new snapshot.",
+ "session_id": {
+ "description": "Session info",
"type": "string"
},
- "terminal_idle_disconnect_sec": {
- "description": "TerminalIdleDisconnectSec is how long an interactive terminal or\ndesktop may go without user activity before WeKnora closes the\nconnection so the sandbox can pause on its provider TTL. Terminal\ncounts keystrokes and PTY output; desktop counts mouse and keyboard.\n0 uses the built-in default (15 minutes). Not an identity field.",
- "type": "integer"
- },
- "volume_mount": {
- "description": "VolumeMount configures an optional shared volume mounted into every\nsandbox created for this tenant. Currently used for tenant-installed\nskills, but the configuration itself is skill-agnostic and can serve\nany volume-mount use case (shared datasets, pre-installed toolchains,\netc.).",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VolumeMountConfig"
- }
- ]
+ "session_title": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.TokenUsage": {
+ "github_com_Tencent_WeKnora_internal_types.MessageSearchResult": {
"type": "object",
"properties": {
- "cache_miss_tokens": {
- "type": "integer"
+ "items": {
+ "description": "List of merged Q\u0026A pairs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem"
+ }
},
- "cache_read_tokens": {
+ "total": {
+ "description": "Total number of results",
"type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet": {
+ "type": "object",
+ "properties": {
+ "agent_id": {
+ "type": "string"
},
- "cache_reported": {
+ "allow_regenerate": {
"type": "boolean"
},
- "cache_status": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptCacheStatus"
- },
- "cache_write_tokens": {
- "type": "integer"
- },
- "cached_tokens": {
- "description": "CachedTokens is the legacy alias for CacheReadTokens. It remains on the\nwire for compatibility with existing API consumers.",
- "type": "integer"
+ "assistant_message_id": {
+ "type": "string"
},
"completion_tokens": {
"type": "integer"
},
- "context_token_scale": {
- "description": "ContextTokenScale is provider prompt tokens per cl100k-estimated token,\nmeasured over the turn's rounds. Persisted with the turn so the next\nturn's history loading and first compaction check are calibrated before\nany provider count of their own. Zero when the turn measured none.",
- "type": "number"
- },
- "prompt_tokens": {
- "type": "integer"
- },
- "total_tokens": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ToolCall": {
- "type": "object",
- "properties": {
- "args": {
- "description": "Tool arguments",
- "type": "object",
- "additionalProperties": true
- },
- "duration": {
- "description": "Execution time in milliseconds",
- "type": "integer"
- },
- "id": {
- "description": "Function call ID from LLM",
+ "config_hash": {
"type": "string"
},
- "name": {
- "description": "Tool name",
+ "created_at": {
"type": "string"
},
- "provider_metadata": {
- "description": "Provider-specific tool-call state for replay",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCallMetadata"
- }
- ]
+ "error_code": {
+ "type": "string"
},
- "reflection": {
- "description": "Agent's reflection on this tool call result (if enabled)",
+ "generated_at": {
"type": "string"
},
- "result": {
- "description": "Execution result (contains Output)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult"
- }
- ]
+ "id": {
+ "type": "string"
},
- "target": {
- "description": "Target identifies the actual proxy target; Name/Args retain the model call for replay.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCallTarget"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ToolCallMetadata": {
- "type": "object",
- "additionalProperties": {
- "type": "array",
- "items": {
+ "latency_ms": {
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ToolCallTarget": {
- "type": "object",
- "properties": {
- "args": {
- "type": "object",
- "additionalProperties": true
},
- "name": {
+ "locale": {
"type": "string"
},
- "service_name": {
+ "model_id": {
"type": "string"
},
- "tool_name": {
+ "placement": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ToolResult": {
- "type": "object",
- "properties": {
- "data": {
- "description": "Structured data for programmatic use",
- "type": "object",
- "additionalProperties": true
},
- "error": {
- "description": "Error message if execution failed",
- "type": "string"
+ "prompt_tokens": {
+ "type": "integer"
},
- "images": {
- "description": "Base64 data URIs from tool (e.g. MCP image content)",
+ "questions": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestionItem"
}
},
- "output": {
- "description": "Human-readable output",
+ "session_id": {
"type": "string"
},
- "success": {
- "description": "Whether the tool executed successfully",
- "type": "boolean"
+ "status": {
+ "type": "string"
+ },
+ "suppression_reason": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MetricResult": {
"type": "object",
- "required": [
- "role"
- ],
"properties": {
- "role": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "generation_metrics": {
+ "description": "Text generation quality metrics",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GenerationMetrics"
+ }
+ ]
+ },
+ "retrieval_metrics": {
+ "description": "Retrieval performance metrics",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalMetrics"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": {
"type": "object",
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
+ "access_key_id": {
+ "type": "string"
},
- "description": {
- "type": "string",
- "maxLength": 1000
+ "bucket_name": {
+ "type": "string"
},
- "invite_code_validity_days": {
- "description": "0=never, 1, 7, 30",
- "type": "integer"
+ "endpoint": {
+ "type": "string"
},
- "member_limit": {
- "description": "max members; 0=unlimited",
- "type": "integer"
+ "mode": {
+ "description": "\"docker\" or \"remote\"",
+ "type": "string"
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
+ "path_prefix": {
+ "type": "string"
},
- "require_approval": {
- "type": "boolean"
+ "secret_access_key": {
+ "type": "string"
},
- "searchable": {
- "description": "open for search so others can discover and join",
+ "use_ssl": {
"type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
- "type": "object",
- "required": [
- "permission"
- ],
- "properties": {
- "permission": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.UsedMemory": {
+ "github_com_Tencent_WeKnora_internal_types.ModelParameters": {
"type": "object",
"properties": {
- "content": {
+ "api_key": {
"type": "string"
},
- "id": {
+ "app_id": {
+ "description": "WeKnoraCloud 厂商专用凭证",
"type": "string"
},
- "kind": {
+ "app_secret": {
+ "description": "AES-256 加密存储,实际承载上游 API Key",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.User": {
- "type": "object",
- "properties": {
- "avatar": {
- "description": "Avatar URL of the user",
+ },
+ "base_url": {
"type": "string"
},
- "can_access_all_tenants": {
- "description": "Whether the user can access all workspaces (cross-workspace access)",
- "type": "boolean"
+ "context_window": {
+ "description": "ContextWindow is the model's total context window in tokens and\nMaxOutputTokens the most it emits in one response. Both are provider\nfacts the agent cannot discover but has to act on: the context window is\nwhat decides when conversation history gets compacted, and assuming a\nwindow larger than the real one means compaction never fires and the\nprovider rejects the request mid-conversation instead. 0 means unknown,\nwhich falls back to DefaultMaxContextTokens.",
+ "type": "integer"
},
- "created_at": {
- "description": "Creation time of the user",
- "type": "string"
+ "custom_headers": {
+ "description": "CustomHeaders 允许在调用远程模型 API 时附加自定义 HTTP 请求头,\n用途类似 Python OpenAI SDK 的 extra_headers 参数,\n常见场景包括透传企业网关鉴权信息、追踪 ID、路由标识等。\n保留字段(Authorization、api-key、Content-Type、Accept 等)会在运行期被忽略以避免破坏签名/鉴权流程。",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "deleted_at": {
- "description": "Deletion time of the user",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "embedding_parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
},
- "email": {
- "description": "Email address of the user",
- "type": "string"
+ "extra_config": {
+ "description": "Provider-specific configuration",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "id": {
- "description": "Unique identifier of the user",
+ "interface_type": {
"type": "string"
},
- "is_active": {
- "description": "Whether the user is active",
- "type": "boolean"
+ "max_concurrency": {
+ "description": "MaxConcurrency caps concurrent in-flight BACKGROUND (ingestion /\nenrichment) calls to THIS specific model, keyed by model ID and shared\nacross all replicas. 0 (the default) means \"fall back to the\nprocess-wide model.max_concurrency\". Interactive user-facing calls are\nnever gated. Only chat / vlm / embedding honour this (see limiter.Gate).",
+ "type": "integer"
},
- "is_system_admin": {
- "description": "Whether the user is a system administrator (independent of workspace roles)",
- "type": "boolean"
+ "max_output_tokens": {
+ "type": "integer"
},
- "preferences": {
- "description": "Per-user UI/feature preferences.\nStored as JSON (jsonb on Postgres, TEXT on SQLite) via the\ndriver.Valuer / sql.Scanner methods on UserPreferences.",
+ "parameter_size": {
+ "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
+ "type": "string"
+ },
+ "provider": {
+ "description": "Provider identifier: openai, aliyun, zhipu, generic",
+ "type": "string"
+ },
+ "spec": {
+ "description": "Spec overrides the catalog entry for this row: protocol, capability\nflags and the flat protocol compat object. Everything omitted is\ninherited from the vendor catalog (see internal/models/catalog).",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSpecOverride"
}
]
},
- "tenant": {
- "description": "Association relationship, not stored in the database",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
- }
- ]
- },
- "tenant_id": {
- "description": "Workspace ID that the user belongs to",
- "type": "integer"
- },
- "updated_at": {
- "description": "Last updated time of the user",
- "type": "string"
- },
- "username": {
- "description": "Username of the user",
- "type": "string"
+ "supports_vision": {
+ "description": "Whether the model accepts image/multimodal input",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UserInfo": {
+ "github_com_Tencent_WeKnora_internal_types.ModelSource": {
+ "type": "string",
+ "enum": [
+ "local",
+ "remote",
+ "aliyun",
+ "zhipu",
+ "volcengine",
+ "deepseek",
+ "hunyuan",
+ "minimax",
+ "openai",
+ "gemini",
+ "mimo",
+ "siliconflow",
+ "jina",
+ "openrouter",
+ "litellm",
+ "requesty",
+ "nvidia",
+ "novita",
+ "azure_openai"
+ ],
+ "x-enum-comments": {
+ "ModelSourceAliyun": "Aliyun DashScope model",
+ "ModelSourceAzureOpenAI": "Azure OpenAI model",
+ "ModelSourceDeepseek": "Deepseek model",
+ "ModelSourceGemini": "Gemini model",
+ "ModelSourceHunyuan": "Hunyuan model",
+ "ModelSourceJina": "Jina AI model",
+ "ModelSourceLiteLLM": "LiteLLM proxy model",
+ "ModelSourceLocal": "Local model",
+ "ModelSourceMimo": "Mimo model",
+ "ModelSourceMinimax": "Minimax mode",
+ "ModelSourceNovita": "Novita AI model",
+ "ModelSourceNvidia": "NVIDIA model",
+ "ModelSourceOpenAI": "OpenAI model",
+ "ModelSourceOpenRouter": "OpenRouter model",
+ "ModelSourceRemote": "Remote model",
+ "ModelSourceRequesty": "Requesty model",
+ "ModelSourceSiliconFlow": "SiliconFlow model",
+ "ModelSourceVolcengine": "Volcengine model",
+ "ModelSourceZhipu": "Zhipu model"
+ },
+ "x-enum-descriptions": [
+ "Local model",
+ "Remote model",
+ "Aliyun DashScope model",
+ "Zhipu model",
+ "Volcengine model",
+ "Deepseek model",
+ "Hunyuan model",
+ "Minimax mode",
+ "OpenAI model",
+ "Gemini model",
+ "Mimo model",
+ "SiliconFlow model",
+ "Jina AI model",
+ "OpenRouter model",
+ "LiteLLM proxy model",
+ "Requesty model",
+ "NVIDIA model",
+ "Novita AI model",
+ "Azure OpenAI model"
+ ],
+ "x-enum-varnames": [
+ "ModelSourceLocal",
+ "ModelSourceRemote",
+ "ModelSourceAliyun",
+ "ModelSourceZhipu",
+ "ModelSourceVolcengine",
+ "ModelSourceDeepseek",
+ "ModelSourceHunyuan",
+ "ModelSourceMinimax",
+ "ModelSourceOpenAI",
+ "ModelSourceGemini",
+ "ModelSourceMimo",
+ "ModelSourceSiliconFlow",
+ "ModelSourceJina",
+ "ModelSourceOpenRouter",
+ "ModelSourceLiteLLM",
+ "ModelSourceRequesty",
+ "ModelSourceNvidia",
+ "ModelSourceNovita",
+ "ModelSourceAzureOpenAI"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ModelSpecOverride": {
"type": "object",
"properties": {
- "avatar": {
- "type": "string"
- },
- "can_access_all_tenants": {
- "type": "boolean"
- },
- "created_at": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "id": {
+ "api": {
"type": "string"
},
- "is_active": {
- "type": "boolean"
+ "compat": {
+ "description": "Compat is a plain object so it round-trips through both JSON (API,\ndatabase column) and YAML (builtin_models.yaml).",
+ "type": "object",
+ "additionalProperties": {}
},
- "is_system_admin": {
- "type": "boolean"
+ "context_window": {
+ "type": "integer"
},
- "preferences": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ "input": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "tenant_id": {
+ "max_output_tokens": {
"type": "integer"
},
- "updated_at": {
- "type": "string"
+ "reasoning": {
+ "type": "boolean"
},
- "username": {
- "type": "string"
+ "thinking_levels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UserPreferences": {
+ "github_com_Tencent_WeKnora_internal_types.ModelStatus": {
+ "type": "string",
+ "enum": [
+ "active",
+ "downloading",
+ "download_failed"
+ ],
+ "x-enum-comments": {
+ "ModelStatusActive": "Model is active",
+ "ModelStatusDownloadFailed": "Model download failed",
+ "ModelStatusDownloading": "Model is downloading"
+ },
+ "x-enum-descriptions": [
+ "Model is active",
+ "Model is downloading",
+ "Model download failed"
+ ],
+ "x-enum-varnames": [
+ "ModelStatusActive",
+ "ModelStatusDownloading",
+ "ModelStatusDownloadFailed"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ModelType": {
+ "type": "string",
+ "enum": [
+ "Embedding",
+ "Rerank",
+ "KnowledgeQA",
+ "VLLM",
+ "ASR"
+ ],
+ "x-enum-comments": {
+ "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
+ "ModelTypeEmbedding": "Embedding model",
+ "ModelTypeKnowledgeQA": "KnowledgeQA model",
+ "ModelTypeRerank": "Rerank model",
+ "ModelTypeVLLM": "VLLM model"
+ },
+ "x-enum-descriptions": [
+ "Embedding model",
+ "Rerank model",
+ "KnowledgeQA model",
+ "VLLM model",
+ "ASR (Automatic Speech Recognition) model"
+ ],
+ "x-enum-varnames": [
+ "ModelTypeEmbedding",
+ "ModelTypeRerank",
+ "ModelTypeKnowledgeQA",
+ "ModelTypeVLLM",
+ "ModelTypeASR"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.NamedCount": {
"type": "object",
"properties": {
- "browser_search_instructions": {
- "description": "BrowserSearchInstructions customizes browser search for this user. Nil/empty uses the platform default.",
- "type": "string"
- },
- "gallery": {
- "description": "Gallery holds the user's image-gallery UI state: the search\nactivation mode and the per-attribute search-field toggles. Written\nby the gallery's mode / checkbox interactions via the preferences\nPUT; read back by GET /knowledge-bases/:id/gallery-config so the\ngallery renders the same activation state on every device. Nil = the\nuser never touched the gallery controls (mode defaults to \"all\").",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GalleryUserPrefs"
- }
- ]
- },
- "last_active_tenant_id": {
- "description": "LastActiveTenantID remembers the last workspace the user actively\nswitched into, so a fresh login (new device, cleared browser, new\nrefresh token) lands them back in that workspace instead of always\nbouncing to their home workspace. Written by the SPA's preferences\nPUT and by service-level SwitchTenant (including when switching\nhome, which stores the home ID). Login / RefreshToken validate that\nthe workspace still exists and the user still has an active membership\n(or CanAccessAllTenants) before honouring this preference; an\ninvalid pointer is best-effort cleared and the user falls back to\nhome. Refresh JWT claims have no tenant_id, so RefreshToken\nre-resolves from this field.\n\nnil = no preference (use user.TenantID, i.e. home)\n*0 = \"clear preference\" sentinel for the partial-update endpoint\n (UpdateUserPreferences turns this into nil). Otherwise treat\n a stored *0 the same as nil.\n*N = preferred workspace id.",
+ "count": {
"type": "integer"
},
- "oidc_only_login": {
- "description": "OidcOnlyLogin is set server-side when an account is auto-provisioned\nvia OIDC with a random password the user never received. The profile\nUI hides self-service password rotation until the user sets a known\npassword via ChangePassword (which clears this flag).",
- "type": "boolean"
+ "name": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.VLMConfig": {
+ "github_com_Tencent_WeKnora_internal_types.OBSEngineConfig": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API Key",
+ "access_key": {
"type": "string"
},
- "base_url": {
- "description": "Base URL",
+ "bucket_name": {
"type": "string"
},
- "custom_instructions": {
- "description": "CustomInstructions adds KB-specific image interpretation guidance without\nreplacing the system-owned OCR and Markdown output contract.",
+ "endpoint": {
"type": "string"
},
- "description_language": {
- "description": "DescriptionLanguage controls the language used for generated image\ncaptions. Empty means follow the document/request language.",
+ "path_prefix": {
"type": "string"
},
- "enabled": {
- "type": "boolean"
- },
- "interface_type": {
- "description": "Interface Type: \"ollama\" or \"openai\"",
+ "region": {
"type": "string"
},
- "model_id": {
+ "secret_key": {
"type": "string"
},
- "model_name": {
- "description": "兼容老版本\nModel Name",
- "type": "string"
+ "use_ssl": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.VolumeMountConfig": {
+ "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": {
"type": "object",
"properties": {
- "enabled": {
- "description": "Enabled toggles the volume mount for this tenant.",
- "type": "boolean"
+ "authorization_url": {
+ "type": "string"
},
- "mount_path": {
- "description": "MountPath is the sandbox-internal path where the volume is mounted.\nDefault: /weknora/tenant/skills (customizable per use case).",
+ "provider_display_name": {
"type": "string"
},
- "provider": {
- "description": "Provider identifies the volume backend. Currently \"e2b\" or \"cube\".",
+ "state": {
"type": "string"
},
- "volume_id": {
- "description": "VolumeID is the provider-specific volume identifier, populated after\nEnsureVolume / CreateVolume succeeds.",
- "type": "string"
- },
- "volume_name": {
- "description": "VolumeName is the human-readable volume name, e.g.\n\"weknora-tenant-\u003cid\u003e-skills\".",
- "type": "string"
- },
- "volume_owner_fingerprint": {
- "description": "VolumeOwnerFingerprint = sha256(provider + APIKey + APIURL).\nUsed to detect when the tenant switched to a different backend or\nAPI key, at which point the volume is no longer reachable and must\nbe recreated.",
- "type": "string"
+ "success": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials": {
+ "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
+ "enabled": {
+ "type": "boolean"
},
- "app_secret": {
+ "provider_display_name": {
"type": "string"
+ },
+ "success": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": {
+ "github_com_Tencent_WeKnora_internal_types.OSSEngineConfig": {
"type": "object",
"properties": {
- "api_key": {
- "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "access_key": {
"type": "string"
},
- "blacklist": {
- "description": "黑名单规则列表",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "compression_method": {
- "description": "压缩方法:none, summary, extract, rag",
+ "bucket_name": {
"type": "string"
},
- "document_fragments": {
- "description": "文档片段数量(用于RAG压缩)",
- "type": "integer"
- },
- "embedding_dimension": {
- "description": "嵌入维度(用于RAG压缩)",
- "type": "integer"
- },
- "embedding_model_id": {
- "description": "RAG压缩相关配置",
+ "endpoint": {
"type": "string"
},
- "include_date": {
- "description": "是否包含日期",
- "type": "boolean"
+ "path_prefix": {
+ "type": "string"
},
- "max_results": {
- "description": "最大搜索结果数",
- "type": "integer"
+ "region": {
+ "type": "string"
},
- "provider": {
- "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "secret_key": {
"type": "string"
},
- "proxy_url": {
- "description": "Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url. Merged at call time when set.",
+ "temp_bucket_name": {
"type": "string"
},
- "rerank_model_id": {
- "description": "重排模型ID(用于RAG压缩)",
+ "temp_region": {
"type": "string"
+ },
+ "use_temp_bucket": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity": {
+ "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "OrgRoleAdmin",
+ "OrgRoleEditor",
+ "OrgRoleViewer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.Organization": {
"type": "object",
"properties": {
+ "avatar": {
+ "description": "Avatar URL for display in list and settings",
+ "type": "string"
+ },
"created_at": {
- "description": "Timestamps",
+ "description": "Creation time",
"type": "string"
},
"deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
+ "description": "Deletion time (soft delete)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
"description": {
- "description": "Description",
+ "description": "Description of the organization",
"type": "string"
},
"id": {
- "description": "Unique identifier (UUID, auto-generated)",
+ "description": "Unique identifier of the organization",
"type": "string"
},
- "is_default": {
- "description": "Whether this is the default provider for the workspace",
- "type": "boolean"
+ "invite_code": {
+ "description": "Unique invitation code for joining the organization",
+ "type": "string"
+ },
+ "invite_code_expires_at": {
+ "description": "When the current invite code expires; nil means no expiry",
+ "type": "string"
+ },
+ "invite_code_validity_days": {
+ "description": "Invite link validity in days: 0=never, 1/7/30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "Max members allowed; 0 means no limit",
+ "type": "integer"
+ },
+ "members": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationTenantMember"
+ }
},
"name": {
- "description": "User-friendly name, e.g., \"Production Bing Search\"",
+ "description": "Name of the organization",
"type": "string"
},
- "parameters": {
- "description": "Provider-specific parameters (API key, engine ID, etc.) stored as encrypted JSON",
+ "owner": {
+ "description": "Associations (not stored in database)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
}
]
},
- "provider": {
- "description": "Provider type: bing, google, duckduckgo, tavily",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderType"
- }
- ]
+ "owner_id": {
+ "description": "User ID of the organization owner",
+ "type": "string"
},
- "tenant_id": {
- "description": "Workspace ID for scoping",
+ "owner_tenant_id": {
+ "description": "OwnerTenantID is the tenant the owner belonged to when the\norganization was created. Plan 3 (#1303) treats this tenant as\nthe org's \"owning tenant\": its membership row in\norganization_tenant_members is undeletable / unchangeable so\nthe org can never be orphaned even if the owner user later\nswitches tenants or is soft-deleted. See migration 000046.",
"type": "integer"
},
+ "require_approval": {
+ "description": "Whether joining requires admin approval",
+ "type": "boolean"
+ },
+ "searchable": {
+ "description": "Whether the space is open for search (discoverable; non-members can search and join by org ID)",
+ "type": "boolean"
+ },
+ "shares": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare"
+ }
+ },
"updated_at": {
+ "description": "Last updated time",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationJoinRequest": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API key for the search provider (encrypted in DB)",
+ "created_at": {
+ "description": "Creation time",
"type": "string"
},
- "base_url": {
- "description": "Base URL for self-hosted search engines (e.g. SearXNG instance URL).\nValidated with utils.ValidateURLForSSRF; private hosts must be added to SSRF_WHITELIST.",
+ "id": {
+ "description": "Unique identifier",
"type": "string"
},
- "engine_id": {
- "description": "Google Custom Search Engine ID (only for Google provider)",
+ "message": {
+ "description": "Optional message from the requester",
"type": "string"
},
- "extra_config": {
- "description": "Provider-specific extra configuration for future extensibility",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "organization": {
+ "description": "Associations (not stored in database)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Organization"
+ }
+ ]
},
- "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": [
- "brave",
- "bing",
- "google",
- "duckduckgo",
- "tavily",
- "ollama",
- "baidu",
- "searxng",
- "keenable",
- "zhipu",
- "exa",
- "metaso",
- "bocha",
- "serply"
- ],
- "x-enum-varnames": [
- "WebSearchProviderTypeBrave",
- "WebSearchProviderTypeBing",
- "WebSearchProviderTypeGoogle",
- "WebSearchProviderTypeDuckDuckGo",
- "WebSearchProviderTypeTavily",
- "WebSearchProviderTypeOllama",
- "WebSearchProviderTypeBaidu",
- "WebSearchProviderTypeSearxng",
- "WebSearchProviderTypeKeenable",
- "WebSearchProviderTypeZhipu",
- "WebSearchProviderTypeExa",
- "WebSearchProviderTypeMetaso",
- "WebSearchProviderTypeBocha",
- "WebSearchProviderTypeSerply"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.WikiConfig": {
- "type": "object",
- "properties": {
- "content_instructions": {
- "description": "ContentInstructions controls tone, structure and emphasis for generated\nsummary/entity/index prose. Citation and merge rules remain system-owned.",
+ "organization_id": {
+ "description": "Organization ID",
"type": "string"
},
- "extraction_granularity": {
- "description": "ExtractionGranularity controls how many candidate slugs Pass 0 extracts\nper document. Empty / unknown value is treated as WikiExtractionStandard.",
+ "prev_role": {
+ "description": "Previous role before upgrade (only for upgrade requests)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
]
},
- "extraction_instructions": {
- "description": "ExtractionInstructions tells candidate extraction which domain concepts\nto emphasize without replacing the stable JSON/citation protocol.",
+ "request_type": {
+ "description": "Type of request: 'join' for new member, 'upgrade' for role upgrade",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestType"
+ }
+ ]
+ },
+ "requested_role": {
+ "description": "Role requested by the applicant (admin/editor/viewer)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ },
+ "review_message": {
+ "description": "Optional message from the reviewer",
"type": "string"
},
- "ingest_batch_size": {
- "description": "IngestBatchSize controls how many pending ops a single batch claims and\nprocesses before scheduling a follow-up. 0 falls back to the hard-coded\ndefault (5). Larger batches amortize per-batch setup and let more docs\nshare the batch-internal Map/Reduce fan-out; smaller batches spread a\nKB's backlog across more concurrent batches (finer scheduling grain).",
- "type": "integer"
+ "reviewed_at": {
+ "description": "Time when the request was reviewed",
+ "type": "string"
},
- "ingest_map_parallel": {
- "description": "IngestMapParallel sets the errgroup limit for the Map phase\n(per-document extraction + summary + chunk citation) WITHIN one batch.\n0 falls back to 10. Bound by the LLM provider's concurrency limit and\nthe worker's outbound HTTP pool. Remember it multiplies with the number\nof concurrent batches (IngestMaxInflight).",
- "type": "integer"
+ "reviewed_by": {
+ "description": "User ID of the admin who reviewed the request",
+ "type": "string"
},
- "ingest_max_inflight": {
- "description": "IngestMaxInflight caps how many ingest batches for THIS KB may run\nconcurrently in the shared wiki worker pool (standard/Redis mode\nonly). 0 falls back to the hard-coded default (4). Since Phase 3\nremoved the exclusive per-KB lock, one KB's backlog could otherwise\nmonopolize the whole pool during a bulk import and starve other KBs;\nthis knob trades a single KB's peak throughput for cross-KB fairness.\nSet it \u003e= the wiki pool size to effectively disable the cap.",
- "type": "integer"
+ "reviewer": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
},
- "ingest_reduce_parallel": {
- "description": "IngestReduceParallel sets the errgroup limit for the Reduce phase\n(per-slug page write) WITHIN one batch. 0 falls back to 10. Bound by the\nsame LLM concurrency / HTTP pool considerations as the Map phase, plus\nDB connection pool size. Same multiplier caveat as IngestMapParallel.",
- "type": "integer"
+ "status": {
+ "description": "Status of the request",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestStatus"
+ }
+ ]
},
- "max_pages_per_ingest": {
- "description": "MaxPagesPerIngest limits pages created/updated per ingest operation (0 = no limit)",
+ "tenant_id": {
+ "description": "Tenant ID of the requester",
"type": "integer"
},
- "synthesis_model_id": {
- "description": "SynthesisModelID is the LLM model ID used for wiki page generation and updates",
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
+ },
+ "user_id": {
+ "description": "User ID of the requester",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity": {
- "type": "string",
- "enum": [
- "focused",
- "standard",
- "exhaustive"
- ],
- "x-enum-varnames": [
- "WikiExtractionFocused",
- "WikiExtractionStandard",
- "WikiExtractionExhaustive"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.WikiFolder": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
"type": "object",
"properties": {
- "created_at": {
+ "avatar": {
"type": "string"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "depth": {
- "type": "integer"
- },
- "id": {
+ "email": {
"type": "string"
},
- "knowledge_base_id": {
+ "id": {
"type": "string"
},
- "name": {
+ "joined_at": {
"type": "string"
},
- "parent_id": {
+ "representative_user_id": {
"type": "string"
},
- "path": {
+ "role": {
"type": "string"
},
- "sort_order": {
- "type": "integer"
- },
"tenant_id": {
"type": "integer"
},
- "updated_at": {
+ "tenant_name": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiFolderCreateRequest": {
- "type": "object",
- "properties": {
- "name": {
+ },
+ "user_id": {
"type": "string"
},
- "parent_id": {
+ "username": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiFolderListResponse": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
"type": "object",
"properties": {
- "folders": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiFolderNode"
- }
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
+ "type": "integer"
},
- "parent_id": {
+ "avatar": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiFolderNode": {
- "type": "object",
- "properties": {
+ },
"created_at": {
"type": "string"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "depth": {
- "type": "integer"
+ "description": {
+ "type": "string"
},
- "has_children": {
+ "has_pending_upgrade": {
+ "description": "当前用户是否有待处理的权限升级申请",
"type": "boolean"
},
"id": {
"type": "string"
},
- "knowledge_base_id": {
+ "invite_code": {
"type": "string"
},
- "name": {
+ "invite_code_expires_at": {
"type": "string"
},
- "page_count": {
+ "invite_code_validity_days": {
"type": "integer"
},
- "parent_id": {
+ "is_owner": {
+ "type": "boolean"
+ },
+ "member_count": {
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "0 = unlimited",
+ "type": "integer"
+ },
+ "my_role": {
"type": "string"
},
- "path": {
+ "name": {
"type": "string"
},
- "sort_order": {
+ "owner_id": {
+ "type": "string"
+ },
+ "owner_tenant_id": {
+ "description": "OwnerTenantID is the persisted owner workspace of the organization\n(Plan 3, migration 000046). Frontend uses this to identify the\n\"owner row\" in the workspace-keyed members list — comparing\nmember.tenant_id against owner_tenant_id is the post-Plan-3\nequivalent of the old member.user_id == owner_id check.",
"type": "integer"
},
- "tenant_id": {
+ "pending_join_request_count": {
+ "description": "待审批加入申请数(仅管理员可见)",
+ "type": "integer"
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "type": "boolean"
+ },
+ "share_count": {
+ "description": "共享到该组织的知识库数量",
"type": "integer"
},
"updated_at": {
@@ -25545,1381 +27941,5791 @@ const docTemplate = `{
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiFolderUpdateRequest": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationSharedAgentItem": {
"type": "object",
"properties": {
- "move_parent": {
+ "agent": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ },
+ "disabled_by_me": {
+ "description": "DisabledByMe: current tenant has hidden this shared agent from their conversation dropdown (per-user preference)",
"type": "boolean"
},
- "name": {
+ "is_mine": {
+ "type": "boolean"
+ },
+ "org_name": {
"type": "string"
},
- "parent_id": {
+ "organization_id": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiGraphData": {
- "type": "object",
- "properties": {
- "edges": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge"
- }
},
- "meta": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphMeta"
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
},
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphNode"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiGraphEdge": {
- "type": "object",
- "properties": {
- "source": {
- "description": "source slug",
+ "share_id": {
"type": "string"
},
- "target": {
- "description": "target slug",
+ "shared_at": {
+ "type": "string"
+ },
+ "shared_by_user_id": {
"type": "string"
+ },
+ "shared_by_username": {
+ "type": "string"
+ },
+ "source_tenant_id": {
+ "type": "integer"
+ },
+ "web_search_ready": {
+ "description": "WebSearchReady is resolved against the source workspace without exposing\nits provider list or credentials. Receivers must not compare the agent's\nprovider ID with their own workspace resources.",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiGraphMeta": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationTenantMember": {
"type": "object",
"properties": {
- "center": {
- "description": "populated in ego mode",
+ "created_at": {
"type": "string"
},
- "depth": {
- "description": "populated in ego mode",
- "type": "integer"
+ "id": {
+ "type": "string"
},
- "familiar_count": {
- "description": "FamiliarCount is how many returned nodes are lit up for this person.",
- "type": "integer"
+ "joined_at": {
+ "type": "string"
},
- "mode": {
+ "organization": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Organization"
+ },
+ "organization_id": {
"type": "string"
},
- "returned": {
- "description": "number of nodes actually returned",
- "type": "integer"
+ "representative_user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
},
- "total": {
- "description": "total node count in the KB before filtering/limit",
+ "representative_user_id": {
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ },
+ "tenant_id": {
"type": "integer"
},
- "truncated": {
- "description": "true when Returned \u003c Total (after filters)",
- "type": "boolean"
+ "updated_at": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiGraphNode": {
+ "github_com_Tencent_WeKnora_internal_types.PageResult": {
"type": "object",
"properties": {
- "familiar": {
- "description": "Familiar is true when this page was built from a document this person\nkeeps citing in answers. It is a personal overlay, not a property of\nthe page: two people looking at the same wiki see different highlights.",
- "type": "boolean"
+ "data": {
+ "description": "Data"
},
- "link_count": {
- "description": "Number of inbound + outbound links",
+ "page": {
+ "description": "Current page number",
"type": "integer"
},
- "page_type": {
- "type": "string"
- },
- "slug": {
- "type": "string"
+ "page_size": {
+ "description": "Page size",
+ "type": "integer"
},
- "title": {
- "type": "string"
+ "total": {
+ "description": "Total number of records",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiIndexEntry": {
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": {
"type": "object",
"properties": {
- "category_path": {
+ "chat_parser_engine_rules": {
+ "description": "ChatParserEngineRules selects parser engines for session-scoped chat\ndocuments. Knowledge bases keep their own rules in ChunkingConfig.",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
}
},
- "depth": {
- "type": "integer"
- },
- "parent_slug": {
+ "mineru_api_key": {
+ "description": "MinerU 云 API Key",
"type": "string"
},
- "slug": {
- "type": "string"
+ "mineru_cloud_enable_formula": {
+ "type": "boolean"
},
- "sort_order": {
- "type": "integer"
+ "mineru_cloud_enable_ocr": {
+ "type": "boolean"
},
- "summary": {
- "type": "string"
+ "mineru_cloud_enable_table": {
+ "type": "boolean"
},
- "title": {
+ "mineru_cloud_language": {
"type": "string"
},
- "wiki_path": {
+ "mineru_cloud_model": {
+ "description": "MinerU 云 API 解析参数",
"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"
+ "mineru_enable_formula": {
+ "type": "boolean"
},
- "total": {
- "type": "integer"
+ "mineru_enable_ocr": {
+ "description": "MinerUEnableOCR is retained for compatibility with configurations saved\nbefore parse_method supported auto/ocr/txt.",
+ "type": "boolean"
},
- "type": {
+ "mineru_enable_table": {
+ "type": "boolean"
+ },
+ "mineru_endpoint": {
+ "description": "MinerU 自建服务端点",
"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": {
+ "mineru_language": {
"type": "string"
},
- "version": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiPage": {
- "type": "object",
- "properties": {
- "aliases": {
- "description": "Alternate names, abbreviations, acronyms or translated names",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "mineru_model": {
+ "description": "以下 backend、vLLM、公式/表格、语言参数仅对 3.x 及更早版本生效。",
+ "type": "string"
},
- "category_path": {
- "description": "CategoryPath is the directory breadcrumb that groups this page in the\nwiki browser, e.g. [\"AI\", \"LLM 应用\", \"RAG\"]. Derived cache of the\nfolder chain identified by FolderID.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "mineru_parse_method": {
+ "type": "string"
},
- "chunk_refs": {
- "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "mineru_server_api_key": {
+ "description": "MinerU 自建解析参数。协议按服务端自动识别:4.0+ 走 V1 API,更早版本走 /file_parse。",
+ "type": "string"
},
- "content": {
- "description": "Full markdown content",
+ "mineru_tier": {
+ "description": "4.0+:flash/basic/standard/advanced,空为服务端默认",
"type": "string"
},
- "created_at": {
- "description": "Creation time",
+ "mineru_vlm_server_url": {
+ "description": "vLLM 服务器地址 (vlm-http-client / hybrid-http-client)",
"type": "string"
},
- "deleted_at": {
- "description": "Soft delete",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "odl_hybrid": {
+ "description": "OpenDataLoader PDF (docreader engine); hybrid requires opendataloader-pdf-hybrid service.",
+ "type": "string"
},
- "depth": {
- "description": "Depth is len(CategoryPath), cached for filtering / display.",
- "type": "integer"
+ "odl_hybrid_fallback": {
+ "type": "boolean"
},
- "folder_id": {
- "description": "FolderID is the single source of truth for where this page sits in the\ndirectory tree — a reference to wiki_folders.id (\"\" = wiki root). The\nCategoryPath / WikiPath / Depth fields below are denormalized caches\nrecomputed from this folder's chain on every write so list/index/search\nqueries don't have to join wiki_folders.",
+ "odl_hybrid_mode": {
+ "description": "auto, full",
"type": "string"
},
- "id": {
- "description": "Unique identifier (UUID)",
+ "odl_hybrid_url": {
+ "description": "e.g. http://odl-hybrid:5002",
"type": "string"
},
- "in_links": {
- "description": "Slugs of pages that link TO this page (backlinks)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "odl_markdown_with_html": {
+ "type": "boolean"
},
- "knowledge_base_id": {
- "description": "Knowledge base this page belongs to",
+ "paddleocr_vl_cloud_model": {
+ "description": "e.g. PaddleOCR-VL-1.6",
"type": "string"
},
- "last_edit_source": {
- "description": "LastEditSource records who authored the CURRENT version: pipeline |\nagent | user | revert. Empty for legacy rows (treated as pipeline).\nWhen the version is superseded this value travels into the revision\nsnapshot, so each historical version keeps its own author kind.",
+ "paddleocr_vl_cloud_token": {
+ "description": "PaddleOCR-VL AI Studio cloud API.",
"type": "string"
},
- "last_editor_id": {
- "description": "LastEditorID is the user id of the caller that produced the current\nversion (empty for background pipeline writes).",
+ "paddleocr_vl_cloud_use_chart_recognition": {
+ "type": "boolean"
+ },
+ "paddleocr_vl_cloud_use_seal_recognition": {
+ "type": "boolean"
+ },
+ "paddleocr_vl_endpoint": {
+ "description": "PaddleOCR-VL self-hosted pipeline service (full /layout-parsing API).",
"type": "string"
},
- "out_links": {
- "description": "Slugs of pages this page links to (outbound links)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "paddleocr_vl_use_chart_recognition": {
+ "type": "boolean"
},
- "page_metadata": {
- "description": "Arbitrary metadata (tags, categories, dates, etc.)",
+ "paddleocr_vl_use_seal_recognition": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineInfo": {
+ "type": "object",
+ "properties": {
+ "available": {
+ "type": "boolean"
+ },
+ "description": {
+ "type": "string"
+ },
+ "fileTypes": {
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
},
- "page_type": {
- "description": "Page type: summary, entity, concept, index, synthesis, comparison",
+ "name": {
"type": "string"
},
- "parent_slug": {
- "description": "ParentSlug optionally points at the wiki page that should act as this\npage's semantic parent in the directory tree. The parent may be empty\nwhen the page is grouped only by FolderID.",
+ "unavailableReason": {
"type": "string"
- },
- "slug": {
- "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": {
+ "type": "object",
+ "properties": {
+ "engine": {
"type": "string"
},
- "sort_order": {
- "description": "SortOrder allows generated or manually edited pages to control sibling\nordering before falling back to title.",
- "type": "integer"
- },
- "source_refs": {
- "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on ` + "`" + `|` + "`" + `\nto recover the title. Document-level granularity.",
+ "file_types": {
"type": "array",
"items": {
"type": "string"
}
},
- "status": {
- "description": "Page status: draft, published, archived",
+ "xlsx_first_row_as_header": {
+ "description": "XLSXFirstRowAsHeader restores row-1 column context for flat XLSX tables.\nnil preserves the parser default; an explicit false disables the mode.",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.PendingPromptView": {
+ "type": "object",
+ "properties": {
+ "created_at": {
"type": "string"
},
- "summary": {
- "description": "One-line summary for index listing",
+ "expires_at": {
"type": "string"
},
- "tenant_id": {
- "description": "Workspace ID for multi-workspace isolation",
- "type": "integer"
- },
- "title": {
- "description": "Human-readable title",
+ "id": {
"type": "string"
},
- "updated_at": {
- "description": "Last update time",
+ "kind": {
"type": "string"
},
- "version": {
- "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
- "type": "integer"
+ "request": {
+ "type": "object"
},
- "wiki_path": {
- "description": "WikiPath is a normalized, sortable path derived from page_type,\ncategory_path, and title. It keeps large directory listings cheap to sort.",
+ "tool_call_id": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageDetail": {
+ "github_com_Tencent_WeKnora_internal_types.PromptCacheStatus": {
+ "type": "string",
+ "enum": [
+ "unsupported",
+ "unreported",
+ "miss",
+ "hit"
+ ],
+ "x-enum-varnames": [
+ "PromptCacheStatusUnsupported",
+ "PromptCacheStatusUnreported",
+ "PromptCacheStatusMiss",
+ "PromptCacheStatusHit"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.PromptPlaceholder": {
"type": "object",
"properties": {
- "aliases": {
- "description": "Alternate names, abbreviations, acronyms or translated names",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "category_path": {
- "description": "CategoryPath is the directory breadcrumb that groups this page in the\nwiki browser, e.g. [\"AI\", \"LLM 应用\", \"RAG\"]. Derived cache of the\nfolder chain identified by FolderID.",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "chunk_refs": {
- "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "content": {
- "description": "Full markdown content",
+ "description": {
+ "description": "Description explains what this placeholder represents",
"type": "string"
},
- "created_at": {
- "description": "Creation time",
+ "label": {
+ "description": "Label is a short label for the placeholder",
"type": "string"
},
- "deleted_at": {
- "description": "Soft delete",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "depth": {
- "description": "Depth is len(CategoryPath), cached for filtering / display.",
- "type": "integer"
- },
- "folder_id": {
- "description": "FolderID is the single source of truth for where this page sits in the\ndirectory tree — a reference to wiki_folders.id (\"\" = wiki root). The\nCategoryPath / WikiPath / Depth fields below are denormalized caches\nrecomputed from this folder's chain on every write so list/index/search\nqueries don't have to join wiki_folders.",
- "type": "string"
- },
- "id": {
- "description": "Unique identifier (UUID)",
- "type": "string"
- },
- "in_link_titles": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "in_links": {
- "description": "Slugs of pages that link TO this page (backlinks)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_base_id": {
- "description": "Knowledge base this page belongs to",
- "type": "string"
- },
- "last_edit_source": {
- "description": "LastEditSource records who authored the CURRENT version: pipeline |\nagent | user | revert. Empty for legacy rows (treated as pipeline).\nWhen the version is superseded this value travels into the revision\nsnapshot, so each historical version keeps its own author kind.",
- "type": "string"
- },
- "last_editor_id": {
- "description": "LastEditorID is the user id of the caller that produced the current\nversion (empty for background pipeline writes).",
- "type": "string"
- },
- "out_links": {
- "description": "Slugs of pages this page links to (outbound links)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "page_metadata": {
- "description": "Arbitrary metadata (tags, categories, dates, etc.)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "page_type": {
- "description": "Page type: summary, entity, concept, index, synthesis, comparison",
- "type": "string"
- },
- "parent_slug": {
- "description": "ParentSlug optionally points at the wiki page that should act as this\npage's semantic parent in the directory tree. The parent may be empty\nwhen the page is grouped only by FolderID.",
- "type": "string"
- },
- "slug": {
- "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ "name": {
+ "description": "Name is the placeholder name (without braces), e.g., \"query\"",
"type": "string"
- },
- "sort_order": {
- "description": "SortOrder allows generated or manually edited pages to control sibling\nordering before falling back to title.",
- "type": "integer"
- },
- "source_refs": {
- "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on ` + "`" + `|` + "`" + `\nto recover the title. Document-level granularity.",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "status": {
- "description": "Page status: draft, published, archived",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ProviderMetadata": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.QueryIntent": {
+ "type": "string",
+ "enum": [
+ "kb_search",
+ "web_search",
+ "greeting",
+ "chitchat",
+ "follow_up",
+ "image_only",
+ "doc_only",
+ "summarize",
+ "clarification"
+ ],
+ "x-enum-varnames": [
+ "IntentKBSearch",
+ "IntentWebSearch",
+ "IntentGreeting",
+ "IntentChitchat",
+ "IntentFollowUp",
+ "IntentImageOnly",
+ "IntentDocOnly",
+ "IntentSummarize",
+ "IntentClarification"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
+ "type": "object",
+ "properties": {
+ "custom_instructions": {
+ "description": "CustomInstructions describes the intended audience or question style.\nIt is appended to the stable system question-generation template.",
"type": "string"
},
- "summary": {
- "description": "One-line summary for index listing",
- "type": "string"
+ "enabled": {
+ "type": "boolean"
},
- "tenant_id": {
- "description": "Workspace ID for multi-workspace isolation",
+ "question_count": {
+ "description": "Number of questions to generate per chunk (default: 3, max: 10)",
"type": "integer"
- },
- "title": {
- "description": "Human-readable title",
- "type": "string"
- },
- "updated_at": {
- "description": "Last update time",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.QuestionOrigin": {
+ "type": "object",
+ "properties": {
+ "knowledge_base_id": {
"type": "string"
},
- "version": {
- "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
- "type": "integer"
- },
- "wiki_path": {
- "description": "WikiPath is a normalized, sortable path derived from page_type,\ncategory_path, and title. It keeps large directory listings cheap to sort.",
+ "knowledge_id": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageIssue": {
+ "github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig": {
"type": "object",
"properties": {
- "created_at": {
- "type": "string"
- },
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
+ "follow_ups": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig"
},
- "description": {
- "type": "string"
+ "starters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.QueueStat": {
+ "type": "object",
+ "properties": {
+ "active": {
+ "type": "integer"
},
- "id": {
- "type": "string"
+ "archived": {
+ "type": "integer"
},
- "issue_type": {
- "type": "string"
+ "completed": {
+ "type": "integer"
},
- "knowledge_base_id": {
- "type": "string"
+ "failed": {
+ "type": "integer"
},
- "reported_by": {
- "type": "string"
+ "latency_ms": {
+ "description": "LatencyMs is the age of the oldest pending task, in milliseconds.",
+ "type": "integer"
},
- "slug": {
- "type": "string"
+ "memory_usage_bytes": {
+ "description": "MemoryUsageBytes is the approximate Redis memory the queue occupies.",
+ "type": "integer"
},
- "status": {
+ "name": {
"type": "string"
},
- "suspected_knowledge_ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "paused": {
+ "description": "Paused reports whether the queue is paused (tasks not consumed).",
+ "type": "boolean"
},
- "tenant_id": {
+ "pending": {
"type": "integer"
},
- "updated_at": {
+ "pool": {
+ "description": "Pool is the independent worker pool that drains this queue.",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiPageListResponse": {
- "type": "object",
- "properties": {
- "page": {
+ },
+ "processed": {
+ "description": "Processed / Failed are today's counters (reset daily).",
"type": "integer"
},
- "page_size": {
+ "retry": {
"type": "integer"
},
- "pages": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
- }
+ "scheduled": {
+ "type": "integer"
},
- "total": {
+ "size": {
+ "description": "Size is the total number of tasks in the queue (pending + active +\nscheduled + retry + aggregating + archived).",
"type": "integer"
},
- "total_pages": {
+ "weight": {
+ "description": "Weight is the queue's scheduling weight inside its pool.",
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageMoveRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
"type": "object",
"required": [
- "slug"
+ "email",
+ "password",
+ "username"
],
"properties": {
- "folder_id": {
+ "email": {
"type": "string"
},
- "slug": {
- "type": "string"
+ "password": {
+ "type": "string",
+ "minLength": 6
+ },
+ "username": {
+ "type": "string",
+ "maxLength": 50,
+ "minLength": 2
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageRevertRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RegisterResponse": {
"type": "object",
- "required": [
- "slug",
- "version"
- ],
"properties": {
- "slug": {
+ "message": {
"type": "string"
},
- "version": {
- "type": "integer"
+ "success": {
+ "type": "boolean"
+ },
+ "tenant": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageRevision": {
+ "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
"type": "object",
+ "required": [
+ "requested_role"
+ ],
"properties": {
- "aliases": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "content": {
- "type": "string"
- },
- "created_at": {
- "type": "string"
- },
- "edit_source": {
- "description": "Author of THIS version (same semantics as WikiPage.LastEditSource).",
- "type": "string"
+ "message": {
+ "description": "Optional message explaining the reason",
+ "type": "string",
+ "maxLength": 500
},
- "edited_at": {
- "description": "When this version was authored (the page's updated_at while current).",
- "type": "string"
+ "requested_role": {
+ "description": "The role user wants to upgrade to",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.RerankDiagnostics": {
+ "type": "object",
+ "properties": {
+ "applied": {
+ "description": "Applied is true when rerank scores decided the returned order.",
+ "type": "boolean"
},
- "editor_id": {
- "type": "string"
+ "candidate_count": {
+ "type": "integer"
},
- "id": {
- "type": "string"
+ "effective_threshold": {
+ "type": "number"
},
- "knowledge_base_id": {
+ "error": {
+ "description": "Error carries the reason for model_error / model_unavailable.",
"type": "string"
},
- "page_id": {
- "type": "string"
+ "images_kept": {
+ "type": "integer"
},
- "page_type": {
- "type": "string"
+ "images_scored": {
+ "description": "ImagesScored counts image hits a multimodal reranker scored by their\nimage; ImagesKept the pictorial image hits kept over a text reranker's\nrejection on their vector's evidence.",
+ "type": "integer"
},
- "slug": {
+ "model_id": {
+ "description": "ModelID and ModelSource (request / tenant / auto) identify the model.",
"type": "string"
},
- "status": {
+ "model_source": {
"type": "string"
},
- "summary": {
- "type": "string"
+ "outcome": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankOutcome"
},
- "tenant_id": {
+ "result_count": {
"type": "integer"
},
- "title": {
- "type": "string"
+ "threshold": {
+ "description": "Threshold is the requested minimum score; EffectiveThreshold is the one\napplied after degradation.",
+ "type": "number"
},
- "version": {
- "type": "integer"
+ "top_score": {
+ "description": "TopScore is the best rerank model score among the candidates.",
+ "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageRevisionListResponse": {
+ "github_com_Tencent_WeKnora_internal_types.RerankOptions": {
"type": "object",
"properties": {
- "current_version": {
- "type": "integer"
+ "enabled": {
+ "description": "Enabled turns the rerank stage off when explicitly false. Nil means on.",
+ "type": "boolean"
},
- "revisions": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageRevision"
- }
+ "model_id": {
+ "description": "ModelID selects the rerank model. Empty falls back to the tenant\nRetrievalConfig, then to the first rerank model of the tenant.",
+ "type": "string"
},
- "total": {
+ "threshold": {
+ "description": "Threshold is the minimum rerank model score. Nil uses the tenant\nRetrievalConfig. A pointer because 0 and negative scores are valid.",
+ "type": "number"
+ },
+ "top_k": {
+ "description": "TopK caps the reranked results. Zero uses the endpoint's result count.",
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageUpdateRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RerankOutcome": {
+ "type": "string",
+ "enum": [
+ "ok",
+ "threshold_degraded",
+ "fallback_top1",
+ "all_below_threshold",
+ "model_error",
+ "model_unavailable",
+ "no_model",
+ "disabled",
+ "no_candidates"
+ ],
+ "x-enum-varnames": [
+ "RerankOutcomeOK",
+ "RerankOutcomeThresholdDegraded",
+ "RerankOutcomeFallbackTop1",
+ "RerankOutcomeAllBelowThreshold",
+ "RerankOutcomeModelError",
+ "RerankOutcomeModelUnavailable",
+ "RerankOutcomeNoModel",
+ "RerankOutcomeDisabled",
+ "RerankOutcomeNoCandidates"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.Resource": {
"type": "object",
"properties": {
- "aliases": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "description": {
+ "description": "Optional description",
+ "type": "string"
},
- "content": {
+ "external_id": {
+ "description": "Unique identifier in the external system",
"type": "string"
},
- "page_type": {
+ "has_children": {
+ "description": "Whether this resource has children that can be expanded",
+ "type": "boolean"
+ },
+ "metadata": {
+ "description": "Additional metadata",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "modified_at": {
+ "description": "Last modified time in external system",
"type": "string"
},
- "status": {
+ "name": {
+ "description": "Display name",
"type": "string"
},
- "summary": {
+ "parent_id": {
+ "description": "For hierarchical resources (parent ID if applicable)",
"type": "string"
},
- "title": {
+ "type": {
+ "description": "Resource type (document, folder, space, page, etc.)",
"type": "string"
},
- "version": {
- "description": "Version is the optimistic-lock guard: when \u003e 0 the update is rejected\nwith a conflict if the stored version differs (someone else edited the\npage since the client loaded it). 0 skips the check (legacy clients).",
- "type": "integer"
+ "url": {
+ "description": "URL to access in external system",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiStats": {
+ "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
"type": "object",
"properties": {
- "is_active": {
- "description": "whether wiki ingestion is currently running",
- "type": "boolean"
- },
- "orphan_count": {
- "description": "pages with no inbound links",
- "type": "integer"
- },
- "pages_by_type": {
+ "agents": {
"type": "object",
- "additionalProperties": {
- "type": "integer",
- "format": "int64"
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
}
},
- "pending_issues": {
- "description": "number of pending wiki issues",
- "type": "integer"
- },
- "pending_tasks": {
- "description": "number of documents waiting to be ingested",
- "type": "integer"
- },
- "recent_updates": {
- "description": "last N updated pages",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ "knowledge_bases": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
}
- },
- "total_links": {
- "type": "integer"
- },
- "total_pages": {
- "type": "integer"
}
}
},
- "gorm.DeletedAt": {
+ "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": {
"type": "object",
"properties": {
- "time": {
+ "embedding_top_k": {
+ "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
+ "type": "integer"
+ },
+ "keyword_threshold": {
+ "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
+ "type": "number"
+ },
+ "rerank_model_id": {
+ "description": "RerankModelID is the ID of the rerank model to use (required for search)",
"type": "string"
},
- "valid": {
- "description": "Valid is true if Time is not NULL",
- "type": "boolean"
+ "rerank_threshold": {
+ "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
+ "type": "number"
+ },
+ "rerank_top_k": {
+ "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
+ "type": "integer"
+ },
+ "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"
}
}
},
- "internal_handler.AddFavoriteRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RetrievalMeta": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
- },
- "type": {
- "type": "string"
+ "rerank": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankDiagnostics"
}
}
},
- "internal_handler.BatchDeleteKnowledgeRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RetrievalMetrics": {
"type": "object",
- "required": [
- "ids",
- "kb_id"
- ],
"properties": {
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "map": {
+ "description": "Mean Average Precision",
+ "type": "number"
},
- "kb_id": {
- "type": "string"
+ "mrr": {
+ "description": "Mean Reciprocal Rank",
+ "type": "number"
+ },
+ "ndcg10": {
+ "description": "Normalized Discounted Cumulative Gain at 10",
+ "type": "number"
+ },
+ "ndcg3": {
+ "description": "Normalized Discounted Cumulative Gain at 3",
+ "type": "number"
+ },
+ "precision": {
+ "description": "Precision score",
+ "type": "number"
+ },
+ "recall": {
+ "description": "Recall score",
+ "type": "number"
}
}
},
- "internal_handler.BatchDownloadKnowledgeRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
"type": "object",
- "required": [
- "ids"
- ],
"properties": {
- "ids": {
- "type": "array",
- "maxItems": 200,
- "minItems": 1,
+ "retriever_engine_type": {
+ "description": "Retriever engine type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ }
+ ]
+ },
+ "retriever_type": {
+ "description": "Retriever type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": {
+ "type": "string",
+ "enum": [
+ "postgres",
+ "elasticsearch",
+ "infinity",
+ "elasticfaiss",
+ "qdrant",
+ "milvus",
+ "weaviate",
+ "doris",
+ "sqlite",
+ "tencent_vectordb",
+ "opensearch"
+ ],
+ "x-enum-varnames": [
+ "PostgresRetrieverEngineType",
+ "ElasticsearchRetrieverEngineType",
+ "InfinityRetrieverEngineType",
+ "ElasticFaissRetrieverEngineType",
+ "QdrantRetrieverEngineType",
+ "MilvusRetrieverEngineType",
+ "WeaviateRetrieverEngineType",
+ "DorisRetrieverEngineType",
+ "SQLiteRetrieverEngineType",
+ "TencentVectorDBRetrieverEngineType",
+ "OpenSearchRetrieverEngineType"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
+ "type": "object",
+ "properties": {
+ "engines": {
+ "type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams"
}
}
}
},
- "internal_handler.CopyKnowledgeBaseRequest": {
- "type": "object",
- "required": [
- "source_id"
+ "github_com_Tencent_WeKnora_internal_types.RetrieverType": {
+ "type": "string",
+ "enum": [
+ "keywords",
+ "vector",
+ "websearch"
+ ],
+ "x-enum-comments": {
+ "KeywordsRetrieverType": "Keywords retriever",
+ "VectorRetrieverType": "Vector retriever",
+ "WebSearchRetrieverType": "Web search retriever"
+ },
+ "x-enum-descriptions": [
+ "Keywords retriever",
+ "Vector retriever",
+ "Web search retriever"
],
+ "x-enum-varnames": [
+ "KeywordsRetrieverType",
+ "VectorRetrieverType",
+ "WebSearchRetrieverType"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
+ "type": "object",
"properties": {
- "source_id": {
- "type": "string"
+ "approved": {
+ "type": "boolean"
},
- "target_id": {
- "type": "string"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "task_id": {
- "type": "string"
+ "role": {
+ "description": "Optional: role to assign when approving; overrides applicant's requested role",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "internal_handler.CopyModelRequest": {
- "type": "object",
- "required": [
- "display_name"
+ "github_com_Tencent_WeKnora_internal_types.RuntimeTaskAction": {
+ "type": "string",
+ "enum": [
+ "cancel",
+ "run_now",
+ "delete"
],
- "properties": {
- "display_name": {
- "type": "string"
- }
- }
+ "x-enum-varnames": [
+ "RuntimeTaskActionCancel",
+ "RuntimeTaskActionRunNow",
+ "RuntimeTaskActionDelete"
+ ]
},
- "internal_handler.CreateAgentRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RuntimeTaskInfo": {
"type": "object",
- "required": [
- "name"
- ],
"properties": {
- "avatar": {
- "type": "string"
+ "allowed_actions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RuntimeTaskAction"
+ }
},
- "config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ "completed_at": {
+ "type": "string"
},
- "description": {
+ "data_source_id": {
"type": "string"
},
- "name": {
+ "deadline": {
"type": "string"
- }
- }
- },
- "internal_handler.CreateModelRequest": {
- "type": "object",
- "required": [
- "name",
- "parameters",
- "source",
- "type"
- ],
- "properties": {
- "description": {
+ },
+ "enqueued_at": {
"type": "string"
},
- "display_name": {
+ "id": {
"type": "string"
},
- "name": {
+ "is_orphaned": {
+ "type": "boolean"
+ },
+ "knowledge_base_id": {
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
+ "knowledge_count": {
+ "type": "integer"
},
- "source": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ "knowledge_id": {
+ "type": "string"
},
- "type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
- }
- }
- },
- "internal_handler.CreateStoreRequest": {
- "type": "object",
- "required": [
- "connection_config",
- "engine_type",
- "name"
- ],
- "properties": {
- "connection_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
+ "last_error": {
+ "type": "string"
},
- "engine_type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ "last_failed_at": {
+ "type": "string"
},
- "index_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig"
+ "max_retry": {
+ "type": "integer"
},
- "name": {
+ "next_process_at": {
"type": "string"
- }
- }
- },
- "internal_handler.CreateSystemUserResponse": {
- "type": "object",
- "properties": {
- "generated_password": {
- "description": "GeneratedPassword is the plaintext password when the server\nauto-generated one. Absent when the caller supplied the password.",
+ },
+ "queue": {
"type": "string"
},
- "user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
- }
- }
- },
- "internal_handler.DeleteTagRequest": {
- "type": "object",
- "properties": {
- "exclude_ids": {
- "description": "Chunk seq_ids to exclude from deletion",
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- }
- },
- "internal_handler.EnsureMessageSuggestionsRequest": {
- "type": "object",
- "properties": {
- "regenerate": {
- "type": "boolean"
- }
- }
- },
- "internal_handler.EvaluationRequest": {
- "type": "object",
- "properties": {
- "chat_id": {
- "description": "ID of chat model to use",
+ "retried": {
+ "type": "integer"
+ },
+ "source_id": {
"type": "string"
},
- "dataset_id": {
- "description": "ID of dataset to evaluate",
+ "source_kb_id": {
"type": "string"
},
- "knowledge_base_id": {
- "description": "ID of knowledge base to use",
+ "started_at": {
"type": "string"
},
- "rerank_id": {
- "description": "ID of rerank model to use",
+ "state": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RuntimeTaskState"
+ },
+ "sync_log_id": {
"type": "string"
- }
- }
+ },
+ "target_id": {
+ "type": "string"
+ },
+ "target_kb_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ },
+ "worker": {
+ "type": "string"
+ }
+ }
},
- "internal_handler.FabriTextRequest": {
- "type": "object",
- "required": [
- "model_id"
+ "github_com_Tencent_WeKnora_internal_types.RuntimeTaskState": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "active",
+ "scheduled",
+ "retry",
+ "archived",
+ "completed"
],
+ "x-enum-varnames": [
+ "RuntimeTaskPending",
+ "RuntimeTaskActive",
+ "RuntimeTaskScheduled",
+ "RuntimeTaskRetry",
+ "RuntimeTaskArchived",
+ "RuntimeTaskCompleted"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": {
+ "type": "object",
"properties": {
- "model_id": {
+ "access_key": {
"type": "string"
},
- "tags": {
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "force_path_style": {
+ "type": "boolean"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
+ "type": "string"
+ },
+ "use_ssl": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SandboxCheckpoint": {
+ "type": "object",
+ "properties": {
+ "commit_sha": {
+ "type": "string"
+ },
+ "committed_at": {
+ "type": "string"
+ },
+ "sandbox_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SandboxNetworkPolicy": {
+ "type": "object",
+ "properties": {
+ "allow_out": {
+ "description": "AllowOut accepts IPv4, IPv4 CIDR, a DNS name, or a single-label\nwildcard such as \"*.example.com\". Domain entries are only meaningful\ntogether with a deny-all; see ValidateSandboxNetworkPolicy.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "allow_public_inbound": {
+ "description": "AllowPublicInbound is accepted on the wire for old payloads and then\ncleared. Inbound is always credential-required; a true value has no\nruntime effect.",
+ "type": "boolean"
+ },
+ "cube_rules": {
+ "description": "CubeRules are validated whenever present and consumed only by the Cube\nprovider adapter.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeEgressRule"
+ }
+ },
+ "deny_egress_by_default": {
+ "description": "DenyEgressByDefault installs a 0.0.0.0/0 deny-all, after which only\nAllowOut (and L7 rule targets) can reach the network. false allows\npublic egress, which is what skill installs need.",
+ "type": "boolean"
+ },
+ "deny_out": {
+ "description": "DenyOut accepts IPv4 and IPv4 CIDR only. Neither provider can deny a\ndomain: denial is a pure longest-prefix match on the destination IP.",
"type": "array",
"items": {
"type": "string"
}
+ },
+ "e2b_host_rules": {
+ "description": "E2BHostRules are validated whenever present and consumed only by the E2B\nprovider adapter.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.E2BHostRule"
+ }
}
}
},
- "internal_handler.GetStorageEngineStatusResponse": {
+ "github_com_Tencent_WeKnora_internal_types.SearchParams": {
"type": "object",
"properties": {
- "allowed_providers": {
+ "disable_keywords_match": {
+ "type": "boolean"
+ },
+ "disable_vector_match": {
+ "type": "boolean"
+ },
+ "keyword_threshold": {
+ "type": "number"
+ },
+ "knowledge_base_ids": {
+ "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
"type": "array",
"items": {
"type": "string"
}
},
- "engines": {
+ "knowledge_ids": {
"type": "array",
"items": {
- "$ref": "#/definitions/internal_handler.StorageEngineStatusItem"
+ "type": "string"
}
},
- "minio_env_available": {
+ "match_count": {
+ "type": "integer"
+ },
+ "only_recommended": {
+ "type": "boolean"
+ },
+ "query_embedding": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ },
+ "query_text": {
+ "description": "QueryText is required unless query_embedding is provided, keyword matching is disabled,\nand vector matching remains enabled.",
+ "type": "string"
+ },
+ "rerank": {
+ "description": "Rerank, when present and enabled, reranks the fused candidates before\ntruncating to MatchCount. Only the hybrid-search API reads it; internal\ncallers rerank on their own.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankOptions"
+ }
+ ]
+ },
+ "scope_tag_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skip_context_enrichment": {
+ "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
"type": "boolean"
+ },
+ "tag_ids": {
+ "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "internal_handler.GetSystemInfoResponse": {
+ "github_com_Tencent_WeKnora_internal_types.SearchResult": {
"type": "object",
"properties": {
- "build_time": {
+ "chunk_index": {
+ "description": "Chunk index",
+ "type": "integer"
+ },
+ "chunk_metadata": {
+ "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
+ "type": "object"
+ },
+ "chunk_type": {
+ "description": "Chunk 类型",
"type": "string"
},
- "commit_id": {
+ "content": {
+ "description": "Content",
"type": "string"
},
- "db_migration_error": {
- "description": "DBMigrationError carries the human-readable error message recorded when\nthe most recent startup migration attempt failed. Empty when migrations\nsucceeded; non-empty values let the frontend surface a troubleshooting\nbanner instead of silently hiding the DB version row (see issue #1319).",
+ "end_at": {
+ "description": "End at",
+ "type": "integer"
+ },
+ "id": {
+ "description": "ID",
"type": "string"
},
- "db_version": {
+ "image_info": {
+ "description": "图片信息 (JSON 格式)",
"type": "string"
},
- "edition": {
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
"type": "string"
},
- "go_version": {
+ "knowledge_channel": {
+ "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
"type": "string"
},
- "graph_database_engine": {
+ "knowledge_custom_metadata": {
+ "description": "KnowledgeCustomMetadata is user-authored context safe to expose to models.",
"type": "string"
},
- "keyword_index_engine": {
+ "knowledge_description": {
+ "description": "KnowledgeDescription is the description of the knowledge document",
"type": "string"
},
- "minio_enabled": {
- "type": "boolean"
+ "knowledge_filename": {
+ "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
+ "type": "string"
},
- "started_at": {
- "description": "StartedAt is the server process boot time (RFC3339, UTC).",
+ "knowledge_id": {
+ "description": "Knowledge ID",
"type": "string"
},
- "uptime_seconds": {
- "description": "UptimeSeconds is seconds elapsed since process start.",
- "type": "integer"
+ "knowledge_source": {
+ "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
+ "type": "string"
},
- "vector_store_engine": {
+ "knowledge_title": {
+ "description": "Knowledge title",
"type": "string"
},
- "version": {
+ "match_type": {
+ "description": "Match type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
+ }
+ ]
+ },
+ "matched_content": {
+ "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
"type": "string"
- }
- }
- },
- "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"
- }
- }
+ },
+ "matched_images": {
+ "description": "MatchedImages survives merging, deduplication and stored reference replay.\nIt contains storage references, never image bytes.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchedImage"
}
},
- "embedding": {
+ "metadata": {
+ "description": "Metadata",
"type": "object",
- "required": [
- "modelName",
- "source"
- ],
- "properties": {
- "apiKey": {
- "type": "string"
- },
- "baseUrl": {
- "type": "string"
- },
- "dimension": {
- "description": "添加embedding维度字段",
- "type": "integer"
- },
- "modelName": {
- "type": "string"
- },
- "source": {
- "type": "string"
- }
+ "additionalProperties": {
+ "type": "string"
}
},
- "llm": {
- "type": "object",
- "required": [
- "modelName",
- "source"
- ],
- "properties": {
- "apiKey": {
- "type": "string"
- },
- "baseUrl": {
- "type": "string"
- },
- "modelName": {
- "type": "string"
- },
- "source": {
- "type": "string"
- }
+ "parent_chunk_id": {
+ "description": "父 Chunk ID",
+ "type": "string"
+ },
+ "score": {
+ "description": "Score",
+ "type": "number"
+ },
+ "seq": {
+ "description": "Seq",
+ "type": "integer"
+ },
+ "source_locators": {
+ "description": "SourceLocators point back into the original file for citation\nnavigation. Merged results carry the union of their chunks' locators.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SourceLocator"
}
},
- "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"
- }
- }
+ "start_at": {
+ "description": "Start at",
+ "type": "integer"
+ },
+ "sub_chunk_id": {
+ "description": "SubChunkIndex",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SearchableOrganizationItem": {
+ "type": "object",
+ "properties": {
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
+ "type": "integer"
+ },
+ "avatar": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_already_member": {
+ "type": "boolean"
+ },
+ "member_count": {
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "0 = unlimited",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "share_count": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.Session": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description",
+ "type": "string"
+ },
+ "forked_from_message_id": {
+ "description": "ForkedFromMessageID is the user or assistant message, IN THE PARENT\nSESSION, that the fork branched at. For a user point, messages strictly\nbefore it were copied here. For an assistant point, that answer is\nincluded so the branch continues after it.",
+ "type": "string"
+ },
+ "host_workspace_dir": {
+ "description": "HostWorkspaceDir is the user-selected project directory this session\noperates in, for the WeKnora Lite host sandbox only. Empty means the session\ngets an auto-allocated workspace instead.\n\nWritten once at creation and never updated: re-pointing a live session\nat a different directory would leave its transcript describing files\nthat are no longer there. Standard edition never writes it.",
+ "type": "string"
+ },
+ "id": {
+ "description": "ID",
+ "type": "string"
+ },
+ "im_platform": {
+ "description": "IMPlatform is the originating IM platform (e.g. \"feishu\", \"wecom\") when\nthis session is bound to an IM channel. It is not stored on the sessions\ntable (it lives in im_channel_sessions) and is populated on read so the\nWeb console can classify a session's origin folder without a list query.",
+ "type": "string"
+ },
+ "is_pinned": {
+ "description": "IsPinned indicates whether the session is pinned in the list.",
+ "type": "boolean"
+ },
+ "last_request_state": {
+ "description": "LastRequestState records the input-bar state used the last time this\nsession sent a question (agent, model, KB scope, web search, MCPs).\nPersisted on every successful POST to /knowledge-chat or /agent-chat so\nthat reopening the session can restore the original request context to\nthe chat UI. Stored in the legacy sessions.agent_config JSONB column to\navoid a new migration; the shape used today is ` + "`" + `SessionLastRequestState` + "`" + `.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SessionLastRequestState"
}
+ ]
+ },
+ "parent_session_id": {
+ "description": "ParentSessionID names the session this one was forked from. Empty for\nordinary sessions. Deliberately not a foreign key: the parent may be\ndeleted while the branch lives on, and a branch must not cascade away\nwith it. A dangling value simply renders as an ordinary session.",
+ "type": "string"
+ },
+ "pinned_at": {
+ "description": "PinnedAt records when the session was pinned; nil when not pinned.",
+ "type": "string"
+ },
+ "sandbox_config_id": {
+ "description": "SandboxConfigID pins which sandbox config this session's CURRENT live\nsandbox was created on. Empty means no live sandbox;\nSandboxConfigIDGlobalDefault means the deployment-wide default config.\n\nThis is an ephemeral pin that dies with the sandbox, not a permanent\nowner: sessions outlive sandboxes by months, so treating it as\npermanent would make \"no session references this config\" never true.",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Title",
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "user_id": {
+ "description": "UserID is the owner scope for this session. WeKnora user UUIDs, API\nexternal-user principals, and embed visitor principals all use this column.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SessionLastRequestState": {
+ "type": "object",
+ "properties": {
+ "agent_enabled": {
+ "type": "boolean"
+ },
+ "agent_id": {
+ "type": "string"
+ },
+ "knowledge_base_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "local_browser_enabled": {
+ "type": "boolean"
+ },
+ "mcp_service_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "mentioned_items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
+ }
+ },
+ "model_id": {
+ "type": "string"
+ },
+ "reasoning_effort": {
+ "type": "string"
+ },
+ "skill_names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tag_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "web_search_enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "organization_id",
+ "permission"
+ ],
+ "properties": {
+ "organization_id": {
+ "type": "string"
+ },
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SharedAgentInfo": {
+ "type": "object",
+ "properties": {
+ "agent": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ },
+ "disabled_by_me": {
+ "description": "DisabledByMe: current tenant has hidden this shared agent from their conversation dropdown (per-user preference)",
+ "type": "boolean"
+ },
+ "org_name": {
+ "type": "string"
+ },
+ "organization_id": {
+ "type": "string"
+ },
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ },
+ "share_id": {
+ "type": "string"
+ },
+ "shared_at": {
+ "type": "string"
+ },
+ "shared_by_user_id": {
+ "type": "string"
+ },
+ "shared_by_username": {
+ "type": "string"
+ },
+ "source_tenant_id": {
+ "type": "integer"
+ },
+ "web_search_ready": {
+ "description": "WebSearchReady is resolved against the source workspace without exposing\nits provider list or credentials. Receivers must not compare the agent's\nprovider ID with their own workspace resources.",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SkillImageConfig": {
+ "type": "object",
+ "properties": {
+ "base_template_id": {
+ "description": "BaseTemplateID is the template this chain was originally built from;\nthe rebuild path starts over from it.",
+ "type": "string"
+ },
+ "built_at": {
+ "description": "BuiltAt records when this generation was produced.",
+ "type": "string"
+ },
+ "generation": {
+ "description": "Generation increments on every successful install/remove, for naming\nand troubleshooting.",
+ "type": "integer"
+ },
+ "owner_fingerprint": {
+ "description": "OwnerFingerprint identifies the provider account that owns the snapshot.\nSnapshots are invisible across accounts, so a mismatch means \"fall back\nto the base template\" rather than \"fail\".",
+ "type": "string"
+ },
+ "snapshot_id": {
+ "description": "SnapshotID is the currently effective snapshot; empty = base template.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SourceLocator": {
+ "type": "object",
+ "properties": {
+ "bbox": {
+ "description": "BBox is [x0, y0, x1, y1] as fractions of the page width and height,\norigin at the top-left corner of the rendered page.",
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ },
+ "block": {
+ "description": "Block is the 1-based index among a Word file's body paragraphs and tables.",
+ "type": "integer"
+ },
+ "end": {
+ "type": "integer"
+ },
+ "end_ms": {
+ "type": "integer"
+ },
+ "mapping": {
+ "description": "Mapping records verified text-to-source alignment. Empty means legacy.",
+ "type": "string"
+ },
+ "page": {
+ "description": "Page is the 1-based PDF page.",
+ "type": "integer"
+ },
+ "partial": {
+ "description": "Partial means some of the chunk has no source mapping.",
+ "type": "boolean"
+ },
+ "quote": {
+ "description": "Quote is the complete cited overlap as parsed. Viewers match it\ninside the rendered original and against the\nanswer sentence that cites the chunk.",
+ "type": "string"
+ },
+ "row_end": {
+ "type": "integer"
+ },
+ "row_start": {
+ "type": "integer"
+ },
+ "section": {
+ "description": "Section is the 1-based EPUB spine index.",
+ "type": "integer"
+ },
+ "sheet": {
+ "description": "Sheet is the spreadsheet sheet name; RowStart/RowEnd are its 1-based\nrow numbers as shown by spreadsheet applications.",
+ "type": "string"
+ },
+ "slide": {
+ "description": "Slide is the 1-based slide number in presentation order.",
+ "type": "integer"
+ },
+ "source_hash": {
+ "description": "SourceHash binds the locator to the knowledge record’s source revision hash.",
+ "type": "string"
+ },
+ "source_id": {
+ "description": "SourceID identifies a block within the parser result, not a rendered item.",
+ "type": "string"
+ },
+ "start": {
+ "description": "Start/End are rune offsets into the original text file.",
+ "type": "integer"
+ },
+ "start_ms": {
+ "description": "StartMs/EndMs bound an audio segment.",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Title names the section or slide when the source has one.",
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SpanTreeNode": {
+ "type": "object",
+ "properties": {
+ "attempt": {
+ "type": "integer"
+ },
+ "children": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SpanTreeNode"
+ }
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "duration_ms": {
+ "type": "integer"
+ },
+ "error_code": {
+ "type": "string"
+ },
+ "error_message": {
+ "type": "string"
+ },
+ "finished_at": {
+ "type": "string"
+ },
+ "input": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JSONMap"
+ },
+ "kind": {
+ "type": "string"
+ },
+ "knowledge_id": {
+ "type": "string"
+ },
+ "metadata": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JSONMap"
+ },
+ "name": {
+ "type": "string"
+ },
+ "output": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JSONMap"
+ },
+ "parent_span_id": {
+ "type": "string"
+ },
+ "span_id": {
+ "type": "string"
+ },
+ "started_at": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "mode": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageBackend": {
+ "type": "object",
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackendConfig"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "id": {
+ "type": "string"
+ },
+ "legacy_alias": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "source": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageBackendConfig": {
+ "type": "object",
+ "properties": {
+ "access_key_id": {
+ "type": "string"
+ },
+ "app_id": {
+ "type": "string"
+ },
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "force_path_style": {
+ "type": "boolean"
+ },
+ "mode": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_access_key": {
+ "type": "string"
+ },
+ "temp_bucket_name": {
+ "type": "string"
+ },
+ "temp_region": {
+ "type": "string"
+ },
+ "use_ssl": {
+ "type": "boolean"
+ },
+ "use_temp_bucket": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageConfig": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "description": "App ID (COS specific)",
+ "type": "string"
+ },
+ "bucket_name": {
+ "description": "Bucket Name",
+ "type": "string"
+ },
+ "endpoint": {
+ "description": "Endpoint (S3 specific) - e.g., s3.amazonaws.com, oss-cn-hangzhou.aliyuncs.com",
+ "type": "string"
+ },
+ "force_path_style": {
+ "description": "ForcePathStyle (S3 specific) - whether to use path-style URLs",
+ "type": "boolean"
+ },
+ "path_prefix": {
+ "description": "Path Prefix",
+ "type": "string"
+ },
+ "provider": {
+ "description": "Provider: \"cos\", \"minio\", \"s3\"",
+ "type": "string"
+ },
+ "region": {
+ "description": "Region",
+ "type": "string"
+ },
+ "secret_id": {
+ "description": "Secret ID (COS) / Access Key ID (S3, MinIO)",
+ "type": "string"
+ },
+ "secret_key": {
+ "description": "Secret Key (COS) / Secret Access Key (S3, MinIO)",
+ "type": "string"
+ },
+ "use_ssl": {
+ "description": "UseSSL (S3 specific) - whether to use HTTPS",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
+ },
+ "default_provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\", \"obs\"",
+ "type": "string"
+ },
+ "ks3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig"
+ },
+ "local": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
+ },
+ "minio": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
+ },
+ "obs": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OBSEngineConfig"
+ },
+ "oss": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
+ },
+ "s3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
+ },
+ "tos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": {
+ "type": "object",
+ "properties": {
+ "provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\", \"obs\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
+ ],
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ },
+ "message": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "role": {
+ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SuggestedQuestion": {
+ "type": "object",
+ "properties": {
+ "knowledge_base_id": {
+ "description": "来源知识库ID(仅 faq/document/wiki 来源时有值)",
+ "type": "string"
+ },
+ "knowledge_id": {
+ "description": "来源文档ID(仅 faq/document 来源时有值)",
+ "type": "string"
+ },
+ "question": {
+ "description": "问题文本",
+ "type": "string"
+ },
+ "source": {
+ "description": "来源类型: \"agent_config\", \"faq\", \"document\", \"wiki\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SuggestionAttribution": {
+ "type": "object",
+ "properties": {
+ "question_id": {
+ "type": "string"
+ },
+ "suggestion_set_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SuggestionItem": {
+ "type": "object",
+ "properties": {
+ "category": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "source": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SummaryConfig": {
+ "type": "object",
+ "properties": {
+ "context_template": {
+ "description": "Context template",
+ "type": "string"
+ },
+ "frequency_penalty": {
+ "description": "Frequency penalty",
+ "type": "number"
+ },
+ "max_completion_tokens": {
+ "description": "Max completion tokens",
+ "type": "integer"
+ },
+ "max_tokens": {
+ "description": "Max tokens",
+ "type": "integer"
+ },
+ "no_match_prefix": {
+ "description": "No match prefix",
+ "type": "string"
+ },
+ "presence_penalty": {
+ "description": "Presence penalty",
+ "type": "number"
+ },
+ "prompt": {
+ "description": "Prompt",
+ "type": "string"
+ },
+ "reasoning_effort": {
+ "description": "ReasoningEffort is the graded thinking level; empty falls back to Thinking.",
+ "type": "string"
+ },
+ "repeat_penalty": {
+ "description": "Repeat penalty",
+ "type": "number"
+ },
+ "seed": {
+ "description": "Seed",
+ "type": "integer"
+ },
+ "temperature": {
+ "description": "Temperature",
+ "type": "number"
+ },
+ "thinking": {
+ "description": "Thinking - whether to enable thinking mode",
+ "type": "boolean"
+ },
+ "top_k": {
+ "description": "TopK",
+ "type": "integer"
+ },
+ "top_p": {
+ "description": "TopP",
+ "type": "number"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SyncLog": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "description": "Creation timestamp (usually same as StartedAt)",
+ "type": "string"
+ },
+ "data_source_id": {
+ "description": "Reference to the data source",
+ "type": "string"
+ },
+ "error_message": {
+ "description": "Error details if status is \"failed\"",
+ "type": "string"
+ },
+ "finished_at": {
+ "description": "Sync completion time",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier",
+ "type": "string"
+ },
+ "items_created": {
+ "description": "New items created in knowledge base",
+ "type": "integer"
+ },
+ "items_deleted": {
+ "description": "Items deleted from knowledge base",
+ "type": "integer"
+ },
+ "items_failed": {
+ "description": "Items that failed to sync",
+ "type": "integer"
+ },
+ "items_skipped": {
+ "description": "Items skipped (no changes detected)",
+ "type": "integer"
+ },
+ "items_total": {
+ "description": "Total items fetched from source",
+ "type": "integer"
+ },
+ "items_updated": {
+ "description": "Existing items updated",
+ "type": "integer"
+ },
+ "result": {
+ "description": "Detailed sync result (JSON-encoded)",
+ "type": "object"
+ },
+ "started_at": {
+ "description": "Sync start time",
+ "type": "string"
+ },
+ "status": {
+ "description": "Sync status: running, success, partial, failed, canceled",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SystemSetting": {
+ "type": "object",
+ "properties": {
+ "category": {
+ "description": "Category groups settings in the management UI (\"limits\", \"agent\",\n\"auth\", ...). Free-form string so adding a new category is a\ndata-only change.",
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "enum": {
+ "description": "Enum is populated by the service layer (NOT persisted) from the\nin-code registry. Empty/nil means \"free-form input\"; non-empty\nmeans the UI should render a select with these options. Tagged\n` + "`" + `gorm:\"-\"` + "`" + ` so GORM never tries to read/write the column.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "id": {
+ "type": "integer"
+ },
+ "is_secret": {
+ "description": "IsSecret reserves UI affordances for P3 (mask + reveal-with-confirm).\nIn P1 every row is is_secret=false; service Update accepts the\ncolumn but does not yet enforce special handling.",
+ "type": "boolean"
+ },
+ "key": {
+ "type": "string"
+ },
+ "last_modified_by": {
+ "type": "string"
+ },
+ "last_modified_by_name": {
+ "description": "LastModifiedByName is a display label resolved from LastModifiedBy\n(the user's UUID) at handler time — username when available,\notherwise email. Empty for virtual rows that were never persisted\n(LastModifiedBy=\"\"). Not stored: derived per request so renaming\na user reflects on the next reload without a backfill job.",
+ "type": "string"
+ },
+ "requires_restart": {
+ "description": "RequiresRestart reserves UI affordances for P3 (banner \"this\nchange won't take effect until the next restart\"). In P1 the\nonly seeded key is per-request, so always false.",
+ "type": "boolean"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "value": {
+ "type": "object"
+ },
+ "value_type": {
+ "description": "ValueType is one of \"int\", \"string\", \"bool\". Service layer rejects\nupdates whose payload type does not match; UI uses it to pick\nInputNumber vs Input vs Switch.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": {
+ "type": "object",
+ "properties": {
+ "access_key": {
+ "type": "string"
+ },
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
+ "type": "string"
+ },
+ "temp_bucket_name": {
+ "type": "string"
+ },
+ "temp_region": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.Tenant": {
+ "type": "object",
+ "properties": {
+ "business": {
+ "description": "Business",
+ "type": "string"
+ },
+ "chat_history_config": {
+ "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
+ }
+ ]
+ },
+ "context_config": {
+ "description": "Global Context configuration for this workspace (default for all sessions)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
+ }
+ ]
+ },
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "credentials": {
+ "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig"
+ }
+ ]
+ },
+ "default_storage_backend_id": {
+ "description": "DefaultStorageBackendID is the workspace default concrete storage instance.",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "description": {
+ "description": "Description",
+ "type": "string"
+ },
+ "id": {
+ "description": "ID",
+ "type": "integer"
+ },
+ "memory_config": {
+ "description": "Memory config: workspace switch for cross-session long-term memory",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConfig"
+ }
+ ]
+ },
+ "name": {
+ "description": "Name",
+ "type": "string"
+ },
+ "parser_engine_config": {
+ "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
+ }
+ ]
+ },
+ "retrieval_config": {
+ "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
+ }
+ ]
+ },
+ "retriever_engines": {
+ "description": "Retriever engines",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
+ }
+ ]
+ },
+ "status": {
+ "description": "Status",
+ "type": "string"
+ },
+ "storage_engine_config": {
+ "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
+ }
+ ]
+ },
+ "storage_quota": {
+ "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
+ "type": "integer"
+ },
+ "storage_used": {
+ "description": "Storage used (Bytes)",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
+ },
+ "web_search_config": {
+ "description": "Global WebSearch configuration for this workspace",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantInvitationResponse": {
+ "type": "object",
+ "properties": {
+ "accepted_count": {
+ "description": "AcceptedCount mirrors TenantInvitation.AcceptedCount. Surfaced\nfor share-link rows so the management UI can show \"N 人已通过此\n链接加入\"; informational only for per-user invitations.",
+ "type": "integer"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "expires_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "integer"
+ },
+ "invite_url": {
+ "description": "InviteURL is set on share-link rows that are still pending.\nComposed by the handler from FrontendBaseURL + the row's plaintext\ntoken, so the management UI can render a \"copy link\" button per\nrow without ever exposing the raw token through the JSON wire.",
+ "type": "string"
+ },
+ "invited_by": {
+ "type": "string"
+ },
+ "invitee_email": {
+ "type": "string"
+ },
+ "invitee_name": {
+ "type": "string"
+ },
+ "invitee_user_id": {
+ "type": "string"
+ },
+ "inviter_email": {
+ "type": "string"
+ },
+ "inviter_name": {
+ "type": "string"
+ },
+ "is_share_link": {
+ "description": "IsShareLink is a convenience flag so the SPA doesn't have to\nspecial-case \"invitee_user_id == ''\" everywhere when distinguishing\nshare-link rows from per-user invitations.",
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string"
+ },
+ "responded_at": {
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantRole"
+ },
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInvitationStatus"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "tenant_name": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantInvitationStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "accepted",
+ "declined",
+ "revoked",
+ "expired"
+ ],
+ "x-enum-varnames": [
+ "TenantInvitationStatusPending",
+ "TenantInvitationStatusAccepted",
+ "TenantInvitationStatusDeclined",
+ "TenantInvitationStatusRevoked",
+ "TenantInvitationStatusExpired"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantInviteCandidate": {
+ "type": "object",
+ "properties": {
+ "representative_avatar": {
+ "type": "string"
+ },
+ "representative_email": {
+ "type": "string"
+ },
+ "representative_user_id": {
+ "type": "string"
+ },
+ "representative_username": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "tenant_name": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantRole": {
+ "type": "string",
+ "enum": [
+ "owner",
+ "admin",
+ "contributor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "TenantRoleOwner",
+ "TenantRoleAdmin",
+ "TenantRoleContributor",
+ "TenantRoleViewer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantSandboxConfig": {
+ "type": "object",
+ "properties": {
+ "allow_private_endpoints": {
+ "description": "AllowPrivateEndpoints permits this workspace config to reach RFC1918 or\nloopback cluster endpoints. Link-local/cloud-metadata addresses remain\nblocked. It is explicit in the UI instead of hidden in process env.",
+ "type": "boolean"
+ },
+ "cube": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeSandboxConfig"
+ },
+ "default_timeout_sec": {
+ "description": "DefaultTimeoutSec is the per-execution timeout in seconds. 0 uses the\nprogram's built-in default.",
+ "type": "integer"
+ },
+ "desktop_enabled": {
+ "description": "DesktopEnabled declares that this config's base template is a desktop\nimage (XFCE + x11vnc + websockify). It is NOT a second template: a\nconfig has exactly one boot target, and skill snapshots stack on top of\nthis base generation after generation. Flipping it changes the base, so\nany installed skills must be rebuilt from the new one.",
+ "type": "boolean"
+ },
+ "docker": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DockerSandboxConfig"
+ },
+ "e2b": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.E2BSandboxConfig"
+ },
+ "env_vars": {
+ "description": "EnvVars are additional environment variables injected into every\nsandbox created for this tenant. 🔒 Values are encrypted at rest.\nThese become visible to all scripts running in the tenant's\nsandboxes — do not place secrets here that scripts must not access.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "network": {
+ "description": "Network is the outbound/inbound network policy applied to every sandbox\ncreated from this config — chat sessions, skill installs and deep\nconnectivity probes alike. nil and the zero value mean the same thing:\noutbound egress allowed, inbound public access closed.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SandboxNetworkPolicy"
+ }
+ ]
+ },
+ "sandbox_type": {
+ "description": "SandboxType is cube, e2b, or docker; disabled is the hidden policy row.",
+ "type": "string"
+ },
+ "skill_image": {
+ "description": "SkillImage points at the snapshot that carries this config's installed\nskills. Empty means \"use the base template\". Written only by the skill\ninstall/remove path: MergeSandboxConfigForUpdate ignores client values\nso a settings-form save cannot wipe or plant the pointer.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SkillImageConfig"
+ }
+ ]
+ },
+ "skill_rollout": {
+ "description": "SkillRollout decides whether sessions that already hold a sandbox of\nthis config rebuild after a skill install or removal. Empty and\nSkillRolloutNextTurn rebuild on the next chat turn. SkillRolloutNewSession\nleaves those sandboxes on the previous image; only sessions that start\nafterwards boot the new snapshot.",
+ "type": "string"
+ },
+ "terminal_idle_disconnect_sec": {
+ "description": "TerminalIdleDisconnectSec is how long an interactive terminal or\ndesktop may go without user activity before WeKnora closes the\nconnection so the sandbox can pause on its provider TTL. Terminal\ncounts keystrokes and PTY output; desktop counts mouse and keyboard.\n0 uses the built-in default (15 minutes). Not an identity field.",
+ "type": "integer"
+ },
+ "volume_mount": {
+ "description": "VolumeMount configures an optional shared volume mounted into every\nsandbox created for this tenant. Currently used for tenant-installed\nskills, but the configuration itself is skill-agnostic and can serve\nany volume-mount use case (shared datasets, pre-installed toolchains,\netc.).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VolumeMountConfig"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TokenUsage": {
+ "type": "object",
+ "properties": {
+ "cache_miss_tokens": {
+ "type": "integer"
+ },
+ "cache_read_tokens": {
+ "type": "integer"
+ },
+ "cache_reported": {
+ "type": "boolean"
+ },
+ "cache_status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptCacheStatus"
+ },
+ "cache_write_tokens": {
+ "type": "integer"
+ },
+ "cached_tokens": {
+ "description": "CachedTokens is the legacy alias for CacheReadTokens. It remains on the\nwire for compatibility with existing API consumers.",
+ "type": "integer"
+ },
+ "completion_tokens": {
+ "type": "integer"
+ },
+ "context_token_scale": {
+ "description": "ContextTokenScale is provider prompt tokens per cl100k-estimated token,\nmeasured over the turn's rounds. Persisted with the turn so the next\nturn's history loading and first compaction check are calibrated before\nany provider count of their own. Zero when the turn measured none.",
+ "type": "number"
+ },
+ "prompt_tokens": {
+ "type": "integer"
+ },
+ "total_tokens": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ToolCall": {
+ "type": "object",
+ "properties": {
+ "args": {
+ "description": "Tool arguments",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "duration": {
+ "description": "Execution time in milliseconds",
+ "type": "integer"
+ },
+ "id": {
+ "description": "Function call ID from LLM",
+ "type": "string"
+ },
+ "name": {
+ "description": "Tool name",
+ "type": "string"
+ },
+ "provider_metadata": {
+ "description": "Provider-specific tool-call state for replay",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCallMetadata"
+ }
+ ]
+ },
+ "reflection": {
+ "description": "Agent's reflection on this tool call result (if enabled)",
+ "type": "string"
+ },
+ "result": {
+ "description": "Execution result (contains Output)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult"
+ }
+ ]
+ },
+ "target": {
+ "description": "Target identifies the actual proxy target; Name/Args retain the model call for replay.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCallTarget"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ToolCallMetadata": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ToolCallTarget": {
+ "type": "object",
+ "properties": {
+ "args": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "service_name": {
+ "type": "string"
+ },
+ "tool_name": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ToolResult": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "description": "Structured data for programmatic use",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "error": {
+ "description": "Error message if execution failed",
+ "type": "string"
+ },
+ "images": {
+ "description": "Base64 data URIs from tool (e.g. MCP image content)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "output": {
+ "description": "Human-readable output",
+ "type": "string"
+ },
+ "success": {
+ "description": "Whether the tool executed successfully",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 1000
+ },
+ "invite_code_validity_days": {
+ "description": "0=never, 1, 7, 30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "max members; 0=unlimited",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "description": "open for search so others can discover and join",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
+ "type": "object",
+ "required": [
+ "permission"
+ ],
+ "properties": {
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UsedMemory": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kind": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.User": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "description": "Avatar URL of the user",
+ "type": "string"
+ },
+ "can_access_all_tenants": {
+ "description": "Whether the user can access all workspaces (cross-workspace access)",
+ "type": "boolean"
+ },
+ "created_at": {
+ "description": "Creation time of the user",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time of the user",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "email": {
+ "description": "Email address of the user",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier of the user",
+ "type": "string"
+ },
+ "is_active": {
+ "description": "Whether the user is active",
+ "type": "boolean"
+ },
+ "is_system_admin": {
+ "description": "Whether the user is a system administrator (independent of workspace roles)",
+ "type": "boolean"
+ },
+ "preferences": {
+ "description": "Per-user UI/feature preferences.\nStored as JSON (jsonb on Postgres, TEXT on SQLite) via the\ndriver.Valuer / sql.Scanner methods on UserPreferences.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ }
+ ]
+ },
+ "tenant": {
+ "description": "Association relationship, not stored in the database",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ }
+ ]
+ },
+ "tenant_id": {
+ "description": "Workspace ID that the user belongs to",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time of the user",
+ "type": "string"
+ },
+ "username": {
+ "description": "Username of the user",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UserInfo": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "can_access_all_tenants": {
+ "type": "boolean"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_active": {
+ "type": "boolean"
+ },
+ "is_system_admin": {
+ "type": "boolean"
+ },
+ "preferences": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UserPreferences": {
+ "type": "object",
+ "properties": {
+ "browser_search_instructions": {
+ "description": "BrowserSearchInstructions customizes browser search for this user. Nil/empty uses the platform default.",
+ "type": "string"
+ },
+ "gallery": {
+ "description": "Gallery holds the user's image-gallery UI state: the search\nactivation mode and the per-attribute search-field toggles. Written\nby the gallery's mode / checkbox interactions via the preferences\nPUT; read back by GET /knowledge-bases/:id/gallery-config so the\ngallery renders the same activation state on every device. Nil = the\nuser never touched the gallery controls (mode defaults to \"all\").",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GalleryUserPrefs"
+ }
+ ]
+ },
+ "last_active_tenant_id": {
+ "description": "LastActiveTenantID remembers the last workspace the user actively\nswitched into, so a fresh login (new device, cleared browser, new\nrefresh token) lands them back in that workspace instead of always\nbouncing to their home workspace. Written by the SPA's preferences\nPUT and by service-level SwitchTenant (including when switching\nhome, which stores the home ID). Login / RefreshToken validate that\nthe workspace still exists and the user still has an active membership\n(or CanAccessAllTenants) before honouring this preference; an\ninvalid pointer is best-effort cleared and the user falls back to\nhome. Refresh JWT claims have no tenant_id, so RefreshToken\nre-resolves from this field.\n\nnil = no preference (use user.TenantID, i.e. home)\n*0 = \"clear preference\" sentinel for the partial-update endpoint\n (UpdateUserPreferences turns this into nil). Otherwise treat\n a stored *0 the same as nil.\n*N = preferred workspace id.",
+ "type": "integer"
+ },
+ "oidc_only_login": {
+ "description": "OidcOnlyLogin is set server-side when an account is auto-provisioned\nvia OIDC with a random password the user never received. The profile\nUI hides self-service password rotation until the user sets a known\npassword via ChangePassword (which clears this flag).",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UserResourceFavorite": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "resource_id": {
+ "type": "string"
+ },
+ "resource_type": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VLMConfig": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "description": "API Key",
+ "type": "string"
+ },
+ "base_url": {
+ "description": "Base URL",
+ "type": "string"
+ },
+ "custom_instructions": {
+ "description": "CustomInstructions adds KB-specific image interpretation guidance without\nreplacing the system-owned OCR and Markdown output contract.",
+ "type": "string"
+ },
+ "description_language": {
+ "description": "DescriptionLanguage controls the language used for generated image\ncaptions. Empty means follow the document/request language.",
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "interface_type": {
+ "description": "Interface Type: \"ollama\" or \"openai\"",
+ "type": "string"
+ },
+ "model_id": {
+ "type": "string"
+ },
+ "model_name": {
+ "description": "兼容老版本\nModel Name",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VectorStoreFieldInfo": {
+ "type": "object",
+ "properties": {
+ "default": {},
+ "description": {
+ "type": "string"
+ },
+ "enum": {
+ "description": "Enum constrains the allowed string values. Empty means no\nconstraint. Used by fields whose value space is closed (e.g.\nOpenSearch's knn_engine ∈ {\"lucene\", \"faiss\"}).",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "immutable": {
+ "description": "Immutable marks a field whose value cannot be changed after the\nVectorStore is first created. The UI shows the input as read-only\nin edit mode; the backend rejects modification attempts. Used by\nengines whose underlying index structure is fixed at create time\n(e.g. OpenSearch's HNSW engine / M / ef_construction).",
+ "type": "boolean"
+ },
+ "max": {
+ "type": "number"
+ },
+ "min": {
+ "description": "Min / Max set inclusive bounds for \"number\"-typed fields. nil\nmeans no bound on that side. Frontend uses these to constrain\ninputs; backend re-validates as defense-in-depth.",
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "required": {
+ "type": "boolean"
+ },
+ "sensitive": {
+ "type": "boolean"
+ },
+ "type": {
+ "description": "\"string\", \"number\", \"boolean\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VectorStoreResponse": {
+ "type": "object",
+ "properties": {
+ "connection_config": {
+ "description": "Driver-specific connection parameters (sensitive fields encrypted with AES-GCM)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
+ }
+ ]
+ },
+ "created_at": {
+ "description": "Timestamps",
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "engine_type": {
+ "description": "Engine type: postgres, elasticsearch, qdrant, milvus, weaviate, sqlite",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier (UUID, auto-generated)",
+ "type": "string"
+ },
+ "index_config": {
+ "description": "Optional index/collection configuration (engine-specific defaults if empty)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig"
+ }
+ ]
+ },
+ "name": {
+ "description": "User-friendly name, e.g., \"elasticsearch-hot\"",
+ "type": "string"
+ },
+ "readonly": {
+ "description": "env stores are read-only",
+ "type": "boolean"
+ },
+ "source": {
+ "description": "\"env\" or \"user\"",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID for scoping",
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VectorStoreTypeInfo": {
+ "type": "object",
+ "properties": {
+ "connection_fields": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreFieldInfo"
+ }
+ },
+ "display_name": {
+ "type": "string"
+ },
+ "index_fields": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreFieldInfo"
+ }
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VolumeMountConfig": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "description": "Enabled toggles the volume mount for this tenant.",
+ "type": "boolean"
+ },
+ "mount_path": {
+ "description": "MountPath is the sandbox-internal path where the volume is mounted.\nDefault: /weknora/tenant/skills (customizable per use case).",
+ "type": "string"
+ },
+ "provider": {
+ "description": "Provider identifies the volume backend. Currently \"e2b\" or \"cube\".",
+ "type": "string"
+ },
+ "volume_id": {
+ "description": "VolumeID is the provider-specific volume identifier, populated after\nEnsureVolume / CreateVolume succeeds.",
+ "type": "string"
+ },
+ "volume_name": {
+ "description": "VolumeName is the human-readable volume name, e.g.\n\"weknora-tenant-\u003cid\u003e-skills\".",
+ "type": "string"
+ },
+ "volume_owner_fingerprint": {
+ "description": "VolumeOwnerFingerprint = sha256(provider + APIKey + APIURL).\nUsed to detect when the tenant switched to a different backend or\nAPI key, at which point the volume is no longer reachable and must\nbe recreated.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WeKnoraCloudStatusResult": {
+ "type": "object",
+ "properties": {
+ "has_models": {
+ "description": "是否已配置 WeKnoraCloud 凭证",
+ "type": "boolean"
+ },
+ "needs_reinit": {
+ "description": "是否需要重新初始化(凭证损坏)",
+ "type": "boolean"
+ },
+ "reason": {
+ "description": "需要重新初始化的原因",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "blacklist": {
+ "description": "黑名单规则列表",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "compression_method": {
+ "description": "压缩方法:none, summary, extract, rag",
+ "type": "string"
+ },
+ "document_fragments": {
+ "description": "文档片段数量(用于RAG压缩)",
+ "type": "integer"
+ },
+ "embedding_dimension": {
+ "description": "嵌入维度(用于RAG压缩)",
+ "type": "integer"
+ },
+ "embedding_model_id": {
+ "description": "RAG压缩相关配置",
+ "type": "string"
+ },
+ "include_date": {
+ "description": "是否包含日期",
+ "type": "boolean"
+ },
+ "max_results": {
+ "description": "最大搜索结果数",
+ "type": "integer"
+ },
+ "provider": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "proxy_url": {
+ "description": "Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url. Merged at call time when set.",
+ "type": "string"
+ },
+ "rerank_model_id": {
+ "description": "重排模型ID(用于RAG压缩)",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigField": {
+ "type": "object",
+ "properties": {
+ "default": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "description_key": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "label_key": {
+ "type": "string"
+ },
+ "options": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigFieldOption"
+ }
+ },
+ "required": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigFieldOption": {
+ "type": "object",
+ "properties": {
+ "label": {
+ "type": "string"
+ },
+ "label_key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ "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 workspace",
+ "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": "Workspace 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"
+ },
+ "base_url": {
+ "description": "Base URL for self-hosted search engines (e.g. SearXNG instance URL).\nValidated with utils.ValidateURLForSSRF; private hosts must be added to SSRF_WHITELIST.",
+ "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": [
+ "brave",
+ "bing",
+ "google",
+ "duckduckgo",
+ "tavily",
+ "ollama",
+ "baidu",
+ "searxng",
+ "keenable",
+ "zhipu",
+ "exa",
+ "metaso",
+ "bocha",
+ "serply"
+ ],
+ "x-enum-varnames": [
+ "WebSearchProviderTypeBrave",
+ "WebSearchProviderTypeBing",
+ "WebSearchProviderTypeGoogle",
+ "WebSearchProviderTypeDuckDuckGo",
+ "WebSearchProviderTypeTavily",
+ "WebSearchProviderTypeOllama",
+ "WebSearchProviderTypeBaidu",
+ "WebSearchProviderTypeSearxng",
+ "WebSearchProviderTypeKeenable",
+ "WebSearchProviderTypeZhipu",
+ "WebSearchProviderTypeExa",
+ "WebSearchProviderTypeMetaso",
+ "WebSearchProviderTypeBocha",
+ "WebSearchProviderTypeSerply"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderTypeInfo": {
+ "type": "object",
+ "properties": {
+ "config_fields": {
+ "description": "Provider-specific non-secret configuration rendered dynamically by the frontend.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigField"
+ }
+ },
+ "description": {
+ "description": "Description",
+ "type": "string"
+ },
+ "docs_url": {
+ "description": "URL to the provider's official website or documentation for obtaining credentials",
+ "type": "string"
+ },
+ "id": {
+ "description": "Provider type identifier",
+ "type": "string"
+ },
+ "name": {
+ "description": "Human-readable name",
+ "type": "string"
+ },
+ "requires_api_key": {
+ "description": "Whether the provider requires an API key",
+ "type": "boolean"
+ },
+ "requires_base_url": {
+ "description": "Whether the provider requires a user-supplied base URL (e.g., self-hosted SearXNG instance)",
+ "type": "boolean"
+ },
+ "requires_engine_id": {
+ "description": "Whether the provider requires an engine ID (e.g., Google CSE)",
+ "type": "boolean"
+ },
+ "supports_optional_api_key": {
+ "description": "Whether the provider accepts an optional API key (keyless by default, but a\nkey unlocks higher limits — e.g. Keenable). Mutually exclusive with RequiresAPIKey.",
+ "type": "boolean"
+ },
+ "supports_proxy": {
+ "description": "Whether optional proxy_url in parameters is honored for outbound requests",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiConfig": {
+ "type": "object",
+ "properties": {
+ "content_instructions": {
+ "description": "ContentInstructions controls tone, structure and emphasis for generated\nsummary/entity/index prose. Citation and merge rules remain system-owned.",
+ "type": "string"
+ },
+ "extraction_granularity": {
+ "description": "ExtractionGranularity controls how many candidate slugs Pass 0 extracts\nper document. Empty / unknown value is treated as WikiExtractionStandard.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity"
+ }
+ ]
+ },
+ "extraction_instructions": {
+ "description": "ExtractionInstructions tells candidate extraction which domain concepts\nto emphasize without replacing the stable JSON/citation protocol.",
+ "type": "string"
+ },
+ "ingest_batch_size": {
+ "description": "IngestBatchSize controls how many pending ops a single batch claims and\nprocesses before scheduling a follow-up. 0 falls back to the hard-coded\ndefault (5). Larger batches amortize per-batch setup and let more docs\nshare the batch-internal Map/Reduce fan-out; smaller batches spread a\nKB's backlog across more concurrent batches (finer scheduling grain).",
+ "type": "integer"
+ },
+ "ingest_map_parallel": {
+ "description": "IngestMapParallel sets the errgroup limit for the Map phase\n(per-document extraction + summary + chunk citation) WITHIN one batch.\n0 falls back to 10. Bound by the LLM provider's concurrency limit and\nthe worker's outbound HTTP pool. Remember it multiplies with the number\nof concurrent batches (IngestMaxInflight).",
+ "type": "integer"
+ },
+ "ingest_max_inflight": {
+ "description": "IngestMaxInflight caps how many ingest batches for THIS KB may run\nconcurrently in the shared wiki worker pool (standard/Redis mode\nonly). 0 falls back to the hard-coded default (4). Since Phase 3\nremoved the exclusive per-KB lock, one KB's backlog could otherwise\nmonopolize the whole pool during a bulk import and starve other KBs;\nthis knob trades a single KB's peak throughput for cross-KB fairness.\nSet it \u003e= the wiki pool size to effectively disable the cap.",
+ "type": "integer"
+ },
+ "ingest_reduce_parallel": {
+ "description": "IngestReduceParallel sets the errgroup limit for the Reduce phase\n(per-slug page write) WITHIN one batch. 0 falls back to 10. Bound by the\nsame LLM concurrency / HTTP pool considerations as the Map phase, plus\nDB connection pool size. Same multiplier caveat as IngestMapParallel.",
+ "type": "integer"
+ },
+ "max_pages_per_ingest": {
+ "description": "MaxPagesPerIngest limits pages created/updated per ingest operation (0 = no limit)",
+ "type": "integer"
+ },
+ "synthesis_model_id": {
+ "description": "SynthesisModelID is the LLM model ID used for wiki page generation and updates",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity": {
+ "type": "string",
+ "enum": [
+ "focused",
+ "standard",
+ "exhaustive"
+ ],
+ "x-enum-varnames": [
+ "WikiExtractionFocused",
+ "WikiExtractionStandard",
+ "WikiExtractionExhaustive"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolder": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "depth": {
+ "type": "integer"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolderCreateRequest": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolderListResponse": {
+ "type": "object",
+ "properties": {
+ "folders": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiFolderNode"
+ }
+ },
+ "parent_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolderNode": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "depth": {
+ "type": "integer"
+ },
+ "has_children": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "page_count": {
+ "type": "integer"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolderUpdateRequest": {
+ "type": "object",
+ "properties": {
+ "move_parent": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphData": {
+ "type": "object",
+ "properties": {
+ "edges": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge"
+ }
+ },
+ "meta": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphMeta"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphNode"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphEdge": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "description": "source slug",
+ "type": "string"
+ },
+ "target": {
+ "description": "target slug",
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ },
+ "familiar_count": {
+ "description": "FamiliarCount is how many returned nodes are lit up for this person.",
+ "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": {
+ "familiar": {
+ "description": "Familiar is true when this page was built from a document this person\nkeeps citing in answers. It is a personal overlay, not a property of\nthe page: two people looking at the same wiki see different highlights.",
+ "type": "boolean"
+ },
+ "link_count": {
+ "description": "Number of inbound + outbound links",
+ "type": "integer"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiIndexEntry": {
+ "type": "object",
+ "properties": {
+ "category_path": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "depth": {
+ "type": "integer"
+ },
+ "parent_slug": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "wiki_path": {
+ "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.WikiPage": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "description": "Alternate names, abbreviations, acronyms or translated names",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "category_path": {
+ "description": "CategoryPath is the directory breadcrumb that groups this page in the\nwiki browser, e.g. [\"AI\", \"LLM 应用\", \"RAG\"]. Derived cache of the\nfolder chain identified by FolderID.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "chunk_refs": {
+ "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "description": "Full markdown content",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "depth": {
+ "description": "Depth is len(CategoryPath), cached for filtering / display.",
+ "type": "integer"
+ },
+ "folder_id": {
+ "description": "FolderID is the single source of truth for where this page sits in the\ndirectory tree — a reference to wiki_folders.id (\"\" = wiki root). The\nCategoryPath / WikiPath / Depth fields below are denormalized caches\nrecomputed from this folder's chain on every write so list/index/search\nqueries don't have to join wiki_folders.",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier (UUID)",
+ "type": "string"
+ },
+ "in_links": {
+ "description": "Slugs of pages that link TO this page (backlinks)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base this page belongs to",
+ "type": "string"
+ },
+ "last_edit_source": {
+ "description": "LastEditSource records who authored the CURRENT version: pipeline |\nagent | user | revert. Empty for legacy rows (treated as pipeline).\nWhen the version is superseded this value travels into the revision\nsnapshot, so each historical version keeps its own author kind.",
+ "type": "string"
+ },
+ "last_editor_id": {
+ "description": "LastEditorID is the user id of the caller that produced the current\nversion (empty for background pipeline writes).",
+ "type": "string"
+ },
+ "out_links": {
+ "description": "Slugs of pages this page links to (outbound links)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "page_metadata": {
+ "description": "Arbitrary metadata (tags, categories, dates, etc.)",
+ "type": "object"
+ },
+ "page_type": {
+ "description": "Page type: summary, entity, concept, index, synthesis, comparison",
+ "type": "string"
+ },
+ "parent_slug": {
+ "description": "ParentSlug optionally points at the wiki page that should act as this\npage's semantic parent in the directory tree. The parent may be empty\nwhen the page is grouped only by FolderID.",
+ "type": "string"
+ },
+ "slug": {
+ "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ "type": "string"
+ },
+ "sort_order": {
+ "description": "SortOrder allows generated or manually edited pages to control sibling\nordering before falling back to title.",
+ "type": "integer"
+ },
+ "source_refs": {
+ "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on ` + "`" + `|` + "`" + `\nto recover the title. Document-level granularity.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "description": "Page status: draft, published, archived",
+ "type": "string"
+ },
+ "summary": {
+ "description": "One-line summary for index listing",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID for multi-workspace isolation",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Human-readable title",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update time",
+ "type": "string"
+ },
+ "version": {
+ "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
+ "type": "integer"
+ },
+ "wiki_path": {
+ "description": "WikiPath is a normalized, sortable path derived from page_type,\ncategory_path, and title. It keeps large directory listings cheap to sort.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageDetail": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "description": "Alternate names, abbreviations, acronyms or translated names",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "category_path": {
+ "description": "CategoryPath is the directory breadcrumb that groups this page in the\nwiki browser, e.g. [\"AI\", \"LLM 应用\", \"RAG\"]. Derived cache of the\nfolder chain identified by FolderID.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "chunk_refs": {
+ "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "description": "Full markdown content",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "depth": {
+ "description": "Depth is len(CategoryPath), cached for filtering / display.",
+ "type": "integer"
+ },
+ "folder_id": {
+ "description": "FolderID is the single source of truth for where this page sits in the\ndirectory tree — a reference to wiki_folders.id (\"\" = wiki root). The\nCategoryPath / WikiPath / Depth fields below are denormalized caches\nrecomputed from this folder's chain on every write so list/index/search\nqueries don't have to join wiki_folders.",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier (UUID)",
+ "type": "string"
+ },
+ "in_link_titles": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "in_links": {
+ "description": "Slugs of pages that link TO this page (backlinks)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base this page belongs to",
+ "type": "string"
+ },
+ "last_edit_source": {
+ "description": "LastEditSource records who authored the CURRENT version: pipeline |\nagent | user | revert. Empty for legacy rows (treated as pipeline).\nWhen the version is superseded this value travels into the revision\nsnapshot, so each historical version keeps its own author kind.",
+ "type": "string"
+ },
+ "last_editor_id": {
+ "description": "LastEditorID is the user id of the caller that produced the current\nversion (empty for background pipeline writes).",
+ "type": "string"
+ },
+ "out_links": {
+ "description": "Slugs of pages this page links to (outbound links)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "page_metadata": {
+ "description": "Arbitrary metadata (tags, categories, dates, etc.)",
+ "type": "object"
+ },
+ "page_type": {
+ "description": "Page type: summary, entity, concept, index, synthesis, comparison",
+ "type": "string"
+ },
+ "parent_slug": {
+ "description": "ParentSlug optionally points at the wiki page that should act as this\npage's semantic parent in the directory tree. The parent may be empty\nwhen the page is grouped only by FolderID.",
+ "type": "string"
+ },
+ "slug": {
+ "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ "type": "string"
+ },
+ "sort_order": {
+ "description": "SortOrder allows generated or manually edited pages to control sibling\nordering before falling back to title.",
+ "type": "integer"
+ },
+ "source_refs": {
+ "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on ` + "`" + `|` + "`" + `\nto recover the title. Document-level granularity.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "description": "Page status: draft, published, archived",
+ "type": "string"
+ },
+ "summary": {
+ "description": "One-line summary for index listing",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID for multi-workspace isolation",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Human-readable title",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update time",
+ "type": "string"
+ },
+ "version": {
+ "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
+ "type": "integer"
+ },
+ "wiki_path": {
+ "description": "WikiPath is a normalized, sortable path derived from page_type,\ncategory_path, and title. It keeps large directory listings cheap to sort.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageIssue": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue_type": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "reported_by": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "suspected_knowledge_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageListResponse": {
+ "type": "object",
+ "properties": {
+ "page": {
+ "type": "integer"
+ },
+ "page_size": {
+ "type": "integer"
+ },
+ "pages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
+ },
+ "total": {
+ "type": "integer"
+ },
+ "total_pages": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageMoveRequest": {
+ "type": "object",
+ "required": [
+ "slug"
+ ],
+ "properties": {
+ "folder_id": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageRevertRequest": {
+ "type": "object",
+ "required": [
+ "slug",
+ "version"
+ ],
+ "properties": {
+ "slug": {
+ "type": "string"
+ },
+ "version": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageRevision": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "edit_source": {
+ "description": "Author of THIS version (same semantics as WikiPage.LastEditSource).",
+ "type": "string"
+ },
+ "edited_at": {
+ "description": "When this version was authored (the page's updated_at while current).",
+ "type": "string"
+ },
+ "editor_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "page_id": {
+ "type": "string"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "title": {
+ "type": "string"
+ },
+ "version": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageRevisionListResponse": {
+ "type": "object",
+ "properties": {
+ "current_version": {
+ "type": "integer"
+ },
+ "revisions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageRevision"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageUpdateRequest": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "type": "string"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "version": {
+ "description": "Version is the optimistic-lock guard: when \u003e 0 the update is rejected\nwith a conflict if the stored version differs (someone else edited the\npage since the client loaded it). 0 skips the check (legacy clients).",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiStats": {
+ "type": "object",
+ "properties": {
+ "is_active": {
+ "description": "whether wiki ingestion is currently running",
+ "type": "boolean"
+ },
+ "orphan_count": {
+ "description": "pages with no inbound links",
+ "type": "integer"
+ },
+ "pages_by_type": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "pending_issues": {
+ "description": "number of pending wiki issues",
+ "type": "integer"
+ },
+ "pending_tasks": {
+ "description": "number of documents waiting to be ingested",
+ "type": "integer"
+ },
+ "recent_updates": {
+ "description": "last N updated pages",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
+ },
+ "total_links": {
+ "type": "integer"
+ },
+ "total_pages": {
+ "type": "integer"
+ }
+ }
+ },
+ "gorm.DeletedAt": {
+ "type": "object",
+ "properties": {
+ "time": {
+ "type": "string"
+ },
+ "valid": {
+ "description": "Valid is true if Time is not NULL",
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.AddFavoriteRequest": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.AgentWriteResponse": {
+ "type": "object",
+ "properties": {
+ "allowed_tools_warnings": {
+ "$ref": "#/definitions/internal_handler.AllowedToolsWarningsDoc"
+ },
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.AllowedToolsWarningsDoc": {
+ "type": "object",
+ "properties": {
+ "dropped": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kept_unknown": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.ApplyDefaultStorageQuotaToAllTenantsResponse": {
+ "type": "object",
+ "properties": {
+ "affected": {
+ "type": "integer"
+ },
+ "quota_bytes": {
+ "type": "integer"
+ },
+ "quota_gb": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.AutoFixResponse": {
+ "type": "object",
+ "properties": {
+ "fixed": {
+ "type": "integer"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.BatchDeleteKnowledgeRequest": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.BatchDownloadKnowledgeRequest": {
+ "type": "object",
+ "required": [
+ "ids"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "maxItems": 200,
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.ClearResponse": {
+ "type": "object",
+ "properties": {
+ "removed": {
+ "type": "integer"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.CopyKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "source_id"
+ ],
+ "properties": {
+ "source_id": {
+ "type": "string"
+ },
+ "target_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CopyKnowledgeBaseResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "source_id": {
+ "type": "string"
+ },
+ "target_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CopyModelRequest": {
+ "type": "object",
+ "required": [
+ "display_name"
+ ],
+ "properties": {
+ "display_name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ },
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CreateModelRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "parameters",
+ "source",
+ "type"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "display_name": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
+ },
+ "source": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ },
+ "type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ }
+ }
+ },
+ "internal_handler.CreateStoreRequest": {
+ "type": "object",
+ "required": [
+ "connection_config",
+ "engine_type",
+ "name"
+ ],
+ "properties": {
+ "connection_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
+ },
+ "engine_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ },
+ "index_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CreateSystemUserResponse": {
+ "type": "object",
+ "properties": {
+ "generated_password": {
+ "description": "GeneratedPassword is the plaintext password when the server\nauto-generated one. Absent when the caller supplied the password.",
+ "type": "string"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ },
+ "internal_handler.CurrentUserCapabilities": {
+ "type": "object",
+ "properties": {
+ "auto_accept_invitation": {
+ "type": "boolean"
+ },
+ "can_create_tenant": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.CurrentUserData": {
+ "type": "object",
+ "properties": {
+ "capabilities": {
+ "$ref": "#/definitions/internal_handler.CurrentUserCapabilities"
+ },
+ "memberships": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Membership"
+ }
+ },
+ "preference_defaults": {
+ "$ref": "#/definitions/internal_handler.PreferenceDefaults"
+ },
+ "tenant": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ },
+ "tenant_required": {
+ "type": "boolean"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ },
+ "internal_handler.DataMessageResponse": {
+ "type": "object",
+ "properties": {
+ "data": {},
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.DataResponse": {
+ "type": "object",
+ "properties": {
+ "data": {},
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.DeleteTagRequest": {
+ "type": "object",
+ "properties": {
+ "exclude_ids": {
+ "description": "Chunk seq_ids to exclude from deletion",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "internal_handler.DeploymentCapabilitiesData": {
+ "type": "object",
+ "properties": {
+ "capabilities": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/internal_handler.DeploymentCapability"
+ }
+ },
+ "edition": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.DeploymentCapability": {
+ "type": "object",
+ "properties": {
+ "reason": {
+ "type": "string"
+ },
+ "supported": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.DownloadTask": {
+ "type": "object",
+ "properties": {
+ "endTime": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "modelName": {
+ "type": "string"
+ },
+ "progress": {
+ "type": "number"
+ },
+ "startTime": {
+ "type": "string"
+ },
+ "status": {
+ "description": "pending, downloading, completed, failed",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.DuplicateKnowledgeBaseData": {
+ "type": "object",
+ "properties": {
+ "knowledge_base": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ },
+ "message": {
+ "type": "string"
+ },
+ "source_id": {
+ "type": "string"
+ },
+ "target_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.EnsureMessageSuggestionsRequest": {
+ "type": "object",
+ "properties": {
+ "regenerate": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.EvaluationRequest": {
+ "type": "object",
+ "properties": {
+ "chat_id": {
+ "description": "ID of chat model to use",
+ "type": "string"
+ },
+ "dataset_id": {
+ "description": "ID of dataset to evaluate",
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "description": "ID of knowledge base to use",
+ "type": "string"
+ },
+ "rerank_id": {
+ "description": "ID of rerank model to use",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.ExportResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ },
+ "truncated": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.FabriTagResponse": {
+ "type": "object",
+ "properties": {
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.FabriTextRequest": {
+ "type": "object",
+ "required": [
+ "model_id"
+ ],
+ "properties": {
+ "model_id": {
+ "type": "string"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.FabriTextResponse": {
+ "type": "object",
+ "properties": {
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.FolderMoveData": {
+ "type": "object",
+ "properties": {
+ "folder_path": {
+ "type": "string"
+ },
+ "moved_count": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.GetAuthConfigResponse": {
+ "type": "object",
+ "properties": {
+ "complex_password_enabled": {
+ "type": "boolean"
+ },
+ "registration_mode": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.GetDeploymentCapabilitiesResponse": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer"
+ },
+ "data": {
+ "$ref": "#/definitions/internal_handler.DeploymentCapabilitiesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.GetStorageEngineStatusResponse": {
+ "type": "object",
+ "properties": {
+ "allowed_providers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "engines": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.StorageEngineStatusItem"
+ }
+ },
+ "minio_env_available": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.GetSystemInfoResponse": {
+ "type": "object",
+ "properties": {
+ "build_time": {
+ "type": "string"
+ },
+ "commit_id": {
+ "type": "string"
+ },
+ "db_migration_error": {
+ "description": "DBMigrationError carries the human-readable error message recorded when\nthe most recent startup migration attempt failed. Empty when migrations\nsucceeded; non-empty values let the frontend surface a troubleshooting\nbanner instead of silently hiding the DB version row (see issue #1319).",
+ "type": "string"
+ },
+ "db_version": {
+ "type": "string"
+ },
+ "edition": {
+ "type": "string"
+ },
+ "go_version": {
+ "type": "string"
+ },
+ "graph_database_engine": {
+ "type": "string"
+ },
+ "keyword_index_engine": {
+ "type": "string"
+ },
+ "minio_enabled": {
+ "type": "boolean"
+ },
+ "started_at": {
+ "description": "StartedAt is the server process boot time (RFC3339, UTC).",
+ "type": "string"
+ },
+ "uptime_seconds": {
+ "description": "UptimeSeconds is seconds elapsed since process start.",
+ "type": "integer"
+ },
+ "vector_store_engine": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.HybridSearchResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
+ }
+ },
+ "meta": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalMeta"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.ImageAttrSchemaData": {
+ "type": "object",
+ "properties": {
+ "attributes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AttrSpec"
+ }
+ },
+ "default_actions": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ },
+ "prompt": {
+ "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"
+ }
+ }
+ },
+ "rerank": {
+ "type": "object",
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "modelName": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "internal_handler.KBModelConfigRequest": {
+ "type": "object",
+ "required": [
+ "llmModelId"
+ ],
+ "properties": {
+ "asr_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
+ },
+ "documentSplitting": {
+ "description": "文档分块配置",
+ "type": "object",
+ "properties": {
+ "childChunkSize": {
+ "type": "integer"
+ },
+ "chunkOverlap": {
+ "type": "integer"
+ },
+ "chunkSize": {
+ "type": "integer"
+ },
+ "enableParentChild": {
+ "type": "boolean"
+ },
+ "languages": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "parentChunkSize": {
+ "type": "integer"
+ },
+ "parserEngineRules": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "type": "array",
+ "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"
+ },
+ "tableMetadataInstructions": {
+ "type": "string"
+ },
+ "tokenLimit": {
+ "type": "integer"
+ }
+ }
+ },
+ "embeddingModelId": {
+ "description": "optional when RAG indexing is disabled",
+ "type": "string"
+ },
+ "llmModelId": {
+ "type": "string"
+ },
+ "multimodal": {
+ "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "nodeExtract": {
+ "description": "知识图谱配置",
+ "type": "object",
+ "properties": {
+ "customInstructions": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "questionGeneration": {
+ "description": "问题生成配置",
+ "type": "object",
+ "properties": {
+ "customInstructions": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "questionCount": {
+ "type": "integer"
+ }
+ }
+ },
+ "storageBackendId": {
+ "type": "string"
+ },
+ "storageProvider": {
+ "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
+ "type": "string"
+ },
+ "vlm_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ }
+ },
+ "internal_handler.KnowledgeBaseView": {
+ "type": "object",
+ "properties": {
+ "asr_config": {
+ "description": "ASR config (Automatic Speech Recognition)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
+ }
+ ]
+ },
+ "auto_tag_config": {
+ "description": "AutoTagConfig controls asynchronous association of existing tags after parsing.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
+ }
+ ]
+ },
+ "capabilities": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCapabilities"
+ },
+ "chunk_count": {
+ "description": "Chunk count (not stored in database, calculated on query)",
+ "type": "integer"
+ },
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
+ },
+ "created_at": {
+ "description": "Creation time of the knowledge base",
+ "type": "string"
+ },
+ "creator_id": {
+ "description": "CreatorID records the user ID of whoever originally created the KB.\nUsed by the workspace-level RBAC middleware to let Contributors edit\ntheir own KBs without granting them access to everyone else's.\nNullable for backward compatibility with rows created before the\nRBAC migration backfilled the column to the workspace Owner.",
+ "type": "string"
+ },
+ "creator_name": {
+ "description": "CreatorName 是 CreatorID 对应用户的展示名(username / email 等),\n仅在列表场景由 handler 批量回填,不落库;为空表示创建者无法解析(用户已删除、\nCreatorID 为空的老数据等)。前端用它在卡片来源徽章上做 mine vs workspace 的二分。",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time of the knowledge base",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "description": {
+ "description": "Description of the knowledge base",
+ "type": "string"
+ },
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
+ "type": "string"
+ },
+ "extract_config": {
+ "description": "Extract config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
+ }
+ ]
+ },
+ "faq_config": {
+ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
+ },
+ "generated_profile": {
+ "description": "GeneratedProfile is the machine-generated description: a gist, merged\ntopics, typical questions and the aggregate snapshot they came from. It\nnever overwrites the user-authored Description; both are shown to agents.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the knowledge base",
+ "type": "string"
+ },
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
+ },
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active for this knowledge base.\nPipelines: vector search, keyword search, wiki generation, knowledge graph extraction.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
+ },
+ "is_pinned": {
+ "description": "IsPinned and PinnedAt are computed per-caller from user_kb_pins\n(see migration 000050). They used to be stored on the row itself,\nwhich made pinning a workspace-wide ordering decision gated behind\nthe kb-edit RBAC guard. The columns are still present in legacy\nschemas for rollback safety but are no longer read or written by\nthe application — both fields are tagged ` + "`" + `gorm:\"-\"` + "`" + ` so GORM\nignores them on every CRUD call and the list handler stamps them\nafter enriching with the caller's pin set.",
+ "type": "boolean"
+ },
+ "is_processing": {
+ "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
+ "type": "boolean"
+ },
+ "is_temporary": {
+ "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
+ "type": "boolean"
+ },
+ "knowledge_count": {
+ "description": "Knowledge count (not stored in database, calculated on query)",
+ "type": "integer"
+ },
+ "my_permission": {
+ "description": "MyPermission is the caller's role on a knowledge base shared from\nanother workspace; GET /knowledge-bases/{id} sets it.",
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ]
+ },
+ "name": {
+ "description": "Name of the knowledge base",
+ "type": "string"
+ },
+ "pinned_at": {
+ "description": "PinnedAt records when the current caller pinned this knowledge\nbase; nil when they have not.",
+ "type": "string"
+ },
+ "processing_count": {
+ "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
+ "type": "integer"
+ },
+ "profile_config": {
+ "description": "ProfileConfig controls automatic generation of the knowledge-base\ndescription from per-document profiles (document knowledge bases only).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
+ }
+ ]
+ },
+ "question_generation_config": {
+ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
+ }
+ ]
+ },
+ "share_count": {
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "type": "integer"
+ },
+ "storage_backend_id": {
+ "description": "StorageBackendID binds this KB to one concrete storage instance. The\nlegacy provider field remains readable during migration only.",
+ "type": "string"
+ },
+ "storage_config": {
+ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
+ }
+ ]
+ },
+ "storage_provider_config": {
+ "description": "Storage provider config (new): only stores provider selection; credentials from workspace StorageEngineConfig",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
+ }
+ ]
+ },
+ "summary_model_id": {
+ "description": "Summary model ID",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
+ },
+ "type": {
+ "description": "Type of the knowledge base (document, faq, etc.)",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last updated time of the knowledge base",
+ "type": "string"
+ },
+ "vector_store_engine_type": {
+ "type": "string"
+ },
+ "vector_store_id": {
+ "description": "VectorStoreID references the VectorStore this knowledge base is bound to.\nWhen nil, the KB falls back to the workspace's effective engines derived from\nthe RETRIEVE_DRIVER environment variable (env store flow).\nThis field is set once at creation time and must not be modified afterwards;\nenforcement lives at the GORM layer (` + "`" + `\u003c-:create` + "`" + `) plus the service-layer\nKB update path, which omits this field from its update DTO.",
+ "type": "string"
+ },
+ "vector_store_name": {
+ "type": "string"
+ },
+ "vector_store_source": {
+ "type": "string"
+ },
+ "vector_store_status": {
+ "type": "string"
+ },
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ ]
+ },
+ "wiki_config": {
+ "description": "WikiConfig stores wiki-specific configuration (only for wiki type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
+ }
+ }
+ },
+ "internal_handler.KnowledgeSearchKnowledgeResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ },
+ "has_more": {
+ "type": "boolean"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.KnowledgeSpanError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string"
+ },
+ "error_code": {
+ "type": "string"
+ },
+ "error_message": {
+ "type": "string"
+ },
+ "finished_at": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "stage": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.KnowledgeSpansData": {
+ "type": "object",
+ "properties": {
+ "attempt": {
+ "description": "Attempt is the attempt the trace describes; equals CurrentAttempt.",
+ "type": "integer"
+ },
+ "current_attempt": {
+ "type": "integer"
+ },
+ "current_stage": {
+ "description": "CurrentStage is the stage running now, or the last one that ran.",
+ "type": "string"
+ },
+ "knowledge_id": {
+ "type": "string"
+ },
+ "last_activity_at": {
+ "description": "LastActivityAt is set while the parse is in flight.",
+ "type": "string"
+ },
+ "last_error": {
+ "$ref": "#/definitions/internal_handler.KnowledgeSpanError"
+ },
+ "latest_attempt": {
+ "type": "integer"
+ },
+ "parse_status": {
+ "type": "string"
+ },
+ "stall_state": {
+ "description": "StallState is types.StallStateQueued or types.StallStateStalled when an\nin-flight parse has gone quiet.",
+ "type": "string"
+ },
+ "trace": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SpanTreeNode"
+ }
+ }
+ },
+ "internal_handler.ListAgentsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ }
+ },
+ "disabled_own_agent_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.ListAllUsersResponse": {
+ "type": "object",
+ "properties": {
+ "has_more": {
+ "type": "boolean"
+ },
+ "limit": {
+ "type": "integer"
+ },
+ "offset": {
+ "type": "integer"
+ },
+ "users": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ }
+ },
+ "internal_handler.ListDocumentsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryDocView"
}
},
- "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"
- }
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListItemsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
}
},
- "questionGeneration": {
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "questionCount": {
- "type": "integer"
- }
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListOrganizationSharedAgentsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationSharedAgentItem"
}
},
- "rerank": {
- "type": "object",
- "properties": {
- "apiKey": {
- "type": "string"
- },
- "baseUrl": {
- "type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "modelName": {
- "type": "string"
- }
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListOrganizationSharedKnowledgeBasesResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
}
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
}
}
},
- "internal_handler.KBModelConfigRequest": {
+ "internal_handler.ListParserEnginesResponse": {
"type": "object",
- "required": [
- "llmModelId"
- ],
"properties": {
- "asr_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
+ "code": {
+ "type": "integer"
},
- "documentSplitting": {
- "description": "文档分块配置",
- "type": "object",
- "properties": {
- "childChunkSize": {
- "type": "integer"
- },
- "chunkOverlap": {
- "type": "integer"
- },
- "chunkSize": {
- "type": "integer"
- },
- "enableParentChild": {
- "type": "boolean"
- },
- "languages": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "parentChunkSize": {
- "type": "integer"
- },
- "parserEngineRules": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
- },
- "separators": {
- "type": "array",
- "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"
- },
- "tableMetadataInstructions": {
- "type": "string"
- },
- "tokenLimit": {
- "type": "integer"
- }
+ "connected": {
+ "type": "boolean"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineInfo"
}
},
- "embeddingModelId": {
- "description": "optional when RAG indexing is disabled",
+ "docreader_addr": {
"type": "string"
},
- "llmModelId": {
+ "docreader_transport": {
"type": "string"
},
- "multimodal": {
- "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- }
+ "msg": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.ListResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend"
}
},
- "nodeExtract": {
- "description": "知识图谱配置",
- "type": "object",
- "properties": {
- "customInstructions": {
- "type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
- }
- },
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
- }
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "text": {
- "type": "string"
- }
+ "default_storage_backend_id": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.ListSharedAgentsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SharedAgentInfo"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListSharedKnowledgeBasesResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
}
},
- "questionGeneration": {
- "description": "问题生成配置",
- "type": "object",
- "properties": {
- "customInstructions": {
- "type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "questionCount": {
- "type": "integer"
- }
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListSkillsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.SkillInfoResponse"
}
},
- "storageBackendId": {
- "type": "string"
+ "skills_available": {
+ "type": "boolean"
},
- "storageProvider": {
- "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.ListSystemAdminsResponse": {
+ "type": "object",
+ "properties": {
+ "admins": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListTopicsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryTopicView"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.MessageResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
"type": "string"
},
- "vlm_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ "success": {
+ "type": "boolean",
+ "example": true
}
}
},
- "internal_handler.ListAllUsersResponse": {
+ "internal_handler.ModelCatalogEntryDTO": {
"type": "object",
"properties": {
- "has_more": {
- "type": "boolean"
+ "api": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
},
- "limit": {
+ "context_window": {
"type": "integer"
},
- "offset": {
+ "cost": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models.ModelCost"
+ },
+ "dimension": {
"type": "integer"
},
- "users": {
+ "id": {
+ "type": "string"
+ },
+ "input": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ "type": "string"
+ }
+ },
+ "max_output_tokens": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "reasoning": {
+ "type": "boolean"
+ },
+ "source": {
+ "description": "Source is the vendor page these facts were read from, so the editor can\nsend an operator to the documentation for this exact model.",
+ "type": "string"
+ },
+ "thinking_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort"
}
+ },
+ "type": {
+ "type": "string"
}
}
},
- "internal_handler.ListSystemAdminsResponse": {
+ "internal_handler.ModelProviderDTO": {
"type": "object",
"properties": {
- "admins": {
+ "api": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
+ },
+ "auth": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.AuthStyle"
+ },
+ "credentialLabels": {
+ "description": "CredentialLabels rename the primary credential input for the model\ntypes that do not take a plain API key (signed rerank APIs).",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.CredentialLabel"
}
},
- "total": {
+ "defaultUrls": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "description": {
+ "type": "string"
+ },
+ "descriptions": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "extraFields": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.ExtraField"
+ }
+ },
+ "icon": {
+ "description": "Icon is a data: URI (image/svg+xml;base64) ready for \u003cimg src\u003e.",
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "modelTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "models": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.ModelCatalogEntryDTO"
+ }
+ },
+ "order": {
"type": "integer"
+ },
+ "requiresAuth": {
+ "type": "boolean"
+ },
+ "thinking": {
+ "$ref": "#/definitions/internal_handler.ProviderThinkingDTO"
+ },
+ "value": {
+ "type": "string"
+ },
+ "website": {
+ "type": "string"
}
}
},
@@ -27052,6 +33858,80 @@ const docTemplate = `{
}
}
},
+ "internal_handler.PageResponse": {
+ "type": "object",
+ "properties": {
+ "data": {},
+ "page": {
+ "type": "integer"
+ },
+ "page_size": {
+ "type": "integer"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.PlaceholderGroups": {
+ "type": "object",
+ "properties": {
+ "agent_system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "all": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "context_template": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "fallback_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "rewrite_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "rewrite_system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ }
+ }
+ },
+ "internal_handler.PreferenceDefaults": {
+ "type": "object",
+ "properties": {
+ "browser_search_instructions": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.PreviewChunkResult": {
"type": "object",
"properties": {
@@ -27177,20 +34057,64 @@ const docTemplate = `{
"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"
+ "truncated_to": {
+ "description": "TruncatedTo, when set, is the original chunk count before the\nresponse was truncated to previewMaxChunks for transport.",
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.PromoteUserToSystemAdminRequest": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string"
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.ProviderThinkingDTO": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "type": "string"
+ },
+ "levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort"
+ }
+ }
+ }
+ },
+ "internal_handler.PurgeArchivedRuntimeTasksResponse": {
+ "type": "object",
+ "properties": {
+ "deleted": {
+ "type": "integer"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
}
}
},
- "internal_handler.PromoteUserToSystemAdminRequest": {
+ "internal_handler.RefreshTokenResponse": {
"type": "object",
"properties": {
- "email": {
+ "access_token": {
"type": "string"
},
- "user_id": {
+ "message": {
+ "type": "string"
+ },
+ "refresh_token": {
"type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
}
}
},
@@ -27265,6 +34189,19 @@ const docTemplate = `{
}
}
},
+ "internal_handler.ReparseKnowledgeRequest": {
+ "type": "object",
+ "properties": {
+ "process_config": {
+ "description": "ProcessConfig overrides the processing options stored at upload time.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides"
+ }
+ ]
+ }
+ }
+ },
"internal_handler.ResetUserPasswordRequest": {
"type": "object",
"required": [
@@ -27280,6 +34217,14 @@ const docTemplate = `{
}
}
},
+ "internal_handler.ResetUserPasswordResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.RevokeSystemAdminRequest": {
"type": "object",
"required": [
@@ -27477,6 +34422,24 @@ const docTemplate = `{
}
}
},
+ "internal_handler.SearchOrganizationsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchableOrganizationItem"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
"internal_handler.SearchWikiRequest": {
"type": "object",
"required": [
@@ -27515,6 +34478,31 @@ const docTemplate = `{
}
}
},
+ "internal_handler.SetUserStatusResponse": {
+ "type": "object",
+ "properties": {
+ "is_active": {
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ },
+ "internal_handler.SkillInfoResponse": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.StorageCheckRequest": {
"type": "object",
"properties": {
@@ -27579,6 +34567,67 @@ const docTemplate = `{
}
}
},
+ "internal_handler.SubmittedTaskData": {
+ "type": "object",
+ "properties": {
+ "deleted_count": {
+ "type": "integer"
+ },
+ "reparse_count": {
+ "type": "integer"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.SubmittedTaskResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.SubmittedTaskData"
+ },
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.SuccessErrorResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.SuccessResponse": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.SuggestedQuestionsData": {
+ "type": "object",
+ "properties": {
+ "questions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestedQuestion"
+ }
+ }
+ }
+ },
"internal_handler.SuggestionEventRequest": {
"type": "object",
"required": [
@@ -27597,6 +34646,45 @@ const docTemplate = `{
}
}
},
+ "internal_handler.TaskIDData": {
+ "type": "object",
+ "properties": {
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.TenantListData": {
+ "type": "object",
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ }
+ }
+ }
+ },
+ "internal_handler.TenantSearchData": {
+ "type": "object",
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ }
+ },
+ "page": {
+ "type": "integer"
+ },
+ "page_size": {
+ "type": "integer"
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
"internal_handler.TestProviderRequest": {
"type": "object",
"required": [
@@ -27611,6 +34699,36 @@ const docTemplate = `{
}
}
},
+ "internal_handler.TestStoreByIDResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.TestStoreRawResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.TestStoreRequest": {
"type": "object",
"required": [
@@ -27648,6 +34766,23 @@ const docTemplate = `{
}
}
},
+ "internal_handler.TextRelationExtractionResponse": {
+ "type": "object",
+ "properties": {
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
+ }
+ }
+ }
+ },
"internal_handler.UpdateAgentRequest": {
"type": "object",
"properties": {
@@ -27680,6 +34815,32 @@ const docTemplate = `{
}
}
},
+ "internal_handler.UpdateChunkResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Chunk"
+ },
+ "description": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "summary_status": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.UpdateIMChannelResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_im.IMChannel"
+ }
+ }
+ },
"internal_handler.UpdateKnowledgeBaseRequest": {
"type": "object",
"required": [
@@ -27709,10 +34870,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"custom_metadata": {
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "type": "object"
},
"description": {
"type": "string"
@@ -27722,6 +34880,21 @@ const docTemplate = `{
}
}
},
+ "internal_handler.UpdateKnowledgeResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ },
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
"internal_handler.UpdateModelRequest": {
"type": "object",
"properties": {
@@ -27745,39 +34918,102 @@ const docTemplate = `{
}
}
},
- "internal_handler.UpdateProviderRequest": {
+ "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": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.UpdateSystemSettingRequest": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "description": "Value is intentionally ` + "`" + `any` + "`" + ` (decoded as float64 / string / bool /\netc. by the JSON unmarshaller). Service.encodeForType normalises\nthese against the registry's declared type and rejects mismatches."
+ }
+ }
+ },
+ "internal_handler.ValidateTokenResponse": {
"type": "object",
"properties": {
- "description": {
+ "message": {
"type": "string"
},
- "is_default": {
- "type": "boolean"
+ "success": {
+ "type": "boolean",
+ "example": true
},
- "name": {
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ },
+ "internal_handler.WikiErrorResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
"type": "string"
- },
- "parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
}
}
},
- "internal_handler.UpdateStoreRequest": {
+ "internal_handler.WikiMessageResponse": {
"type": "object",
- "required": [
- "name"
- ],
"properties": {
- "name": {
+ "message": {
"type": "string"
}
}
},
- "internal_handler.UpdateSystemSettingRequest": {
+ "internal_handler.WikiSearchHit": {
"type": "object",
"properties": {
- "value": {
- "description": "Value is intentionally ` + "`" + `any` + "`" + ` (decoded as float64 / string / bool /\netc. by the JSON unmarshaller). Service.encodeForType normalises\nthese against the registry's declared type and rejects mismatches."
+ "aliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "match_snippet": {
+ "type": "string"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
}
}
},
@@ -27842,6 +35078,27 @@ const docTemplate = `{
}
}
},
+ "internal_handler.apiPrincipalConfigResponse": {
+ "type": "object",
+ "properties": {
+ "direct_header_name": {
+ "type": "string"
+ },
+ "has_hmac_secret": {
+ "description": "HasHMACSecret reports whether a signing secret is configured. The\nplaintext secret is NEVER returned — clients only learn presence.",
+ "type": "boolean"
+ },
+ "mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.APIPrincipalMode"
+ },
+ "require_direct_header": {
+ "type": "boolean"
+ },
+ "signed_token_header_name": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.apiPrincipalTestTokenRequest": {
"type": "object",
"properties": {
@@ -27853,6 +35110,26 @@ const docTemplate = `{
}
}
},
+ "internal_handler.apiPrincipalTestTokenResponse": {
+ "type": "object",
+ "properties": {
+ "expires_at_unix": {
+ "type": "integer"
+ },
+ "expires_in_seconds": {
+ "type": "integer"
+ },
+ "external_user_id": {
+ "type": "string"
+ },
+ "header_name": {
+ "type": "string"
+ },
+ "token": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.auditLogListResponse": {
"type": "object",
"properties": {
@@ -27863,6 +35140,7 @@ const docTemplate = `{
}
},
"next_cursor": {
+ "description": "NextCursor is the id of the last entry on this page, 0 when it is empty.",
"type": "integer"
},
"success": {
@@ -28113,6 +35391,49 @@ const docTemplate = `{
}
}
},
+ "internal_handler.sandboxConfigResponse": {
+ "type": "object",
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantSandboxConfig"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "sandbox_type": {
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.skillEnvResponse": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "is_set": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "required": {
+ "type": "boolean"
+ }
+ }
+ },
"internal_handler.skillPatchRequest": {
"type": "object",
"properties": {
@@ -28129,6 +35450,64 @@ const docTemplate = `{
}
}
},
+ "internal_handler.skillResponse": {
+ "type": "object",
+ "properties": {
+ "bundle_sha256": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "envs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.skillEnvResponse"
+ }
+ },
+ "error": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "install_message_id": {
+ "type": "string"
+ },
+ "install_session_id": {
+ "type": "string"
+ },
+ "installed_snapshot_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "served": {
+ "description": "Served is the previous version that keeps running while this install\nis in flight or after it failed.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillServedInfo"
+ }
+ ]
+ },
+ "status": {
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.skillSourceRequest": {
"type": "object",
"properties": {
@@ -28159,6 +35538,91 @@ const docTemplate = `{
}
}
},
+ "internal_handler.tenantAPIKeyCreateResponse": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "type": "string"
+ },
+ "capabilities": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "expires_at": {
+ "type": "string"
+ },
+ "full_access": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "integer"
+ },
+ "knowledge_base_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "last_used_at": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "scope_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.APIKeyScopeType"
+ },
+ "token": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.tenantAPIKeyResponse": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "type": "string"
+ },
+ "capabilities": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "expires_at": {
+ "type": "string"
+ },
+ "full_access": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "integer"
+ },
+ "knowledge_base_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "last_used_at": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "scope_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.APIKeyScopeType"
+ }
+ }
+ },
"internal_handler.updateLastFAQImportResultDisplayStatusRequest": {
"type": "object",
"required": [
diff --git a/docs/swag.overrides b/docs/swag.overrides
new file mode 100644
index 000000000..6975fc016
--- /dev/null
+++ b/docs/swag.overrides
@@ -0,0 +1,4 @@
+// JSON wrappers are byte slices in Go; document them as JSON objects. Fields
+// holding arrays override this with a swaggertype tag.
+replace github.com/Tencent/WeKnora/internal/types.JSON object
+replace encoding/json.RawMessage object
diff --git a/docs/swagger.json b/docs/swagger.json
index 44208badb..cc06001aa 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -64,10 +64,9 @@
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "SSE 事件流",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "string"
}
},
"400": {
@@ -120,8 +119,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -166,13 +164,75 @@
"responses": {
"200": {
"description": "OK",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/agent/prompts/{prompt_id}": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "回答 Agent 运行中发起的交互(ask_user 提问或工具审批)。\nkind 须与交互一致,response 为该类型的回答 JSON(不接受未知字段):\nask_user 为 {selected?, values?, text?, declined?};\ntool_approval 为 {approved: bool, modified_args?: object, reason?: string}。\n返回 resumed=true 表示运行已挂起并在本次回答后恢复,客户端需重新接入该消息的事件流",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Agent"
+ ],
+ "summary": "回答 Agent 的交互请求",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "交互 ID(事件中的 pending_id)",
+ "name": "prompt_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "{kind: \\",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{success: true, resumed: bool}",
"schema": {
"type": "object",
"additionalProperties": true
}
},
+ "400": {
+ "description": "回答不合法或交互已结束",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
"404": {
- "description": "Not Found",
+ "description": "交互不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -264,12 +324,23 @@
"智能体"
],
"summary": "获取智能体列表",
+ "parameters": [
+ {
+ "enum": [
+ "mine",
+ "others"
+ ],
+ "type": "string",
+ "description": "创建者过滤,仅 mine 与 others 生效",
+ "name": "creator",
+ "in": "query"
+ }
+ ],
"responses": {
"200": {
"description": "智能体列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListAgentsResponse"
}
},
"500": {
@@ -315,8 +386,7 @@
"201": {
"description": "创建的智能体",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.AgentWriteResponse"
}
},
"400": {
@@ -353,8 +423,19 @@
"200": {
"description": "占位符定义",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.PlaceholderGroups"
+ }
+ }
+ }
+ ]
}
}
}
@@ -385,8 +466,19 @@
"200": {
"description": "工具目录",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.AgentToolCatalog"
+ }
+ }
+ }
+ ]
}
}
}
@@ -417,8 +509,22 @@
"200": {
"description": "预设列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetEntry"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -458,8 +564,19 @@
"200": {
"description": "智能体详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -518,8 +635,7 @@
"200": {
"description": "更新后的智能体",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.AgentWriteResponse"
}
},
"400": {
@@ -569,8 +685,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -628,8 +743,19 @@
"201": {
"description": "复制成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -685,8 +811,7 @@
"200": {
"description": "success: true",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -756,8 +881,19 @@
"200": {
"description": "推荐问题列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.SuggestedQuestionsData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -959,8 +1095,7 @@
"200": {
"description": "修改成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -989,8 +1124,7 @@
"200": {
"description": "认证配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.GetAuthConfigResponse"
}
}
}
@@ -1098,8 +1232,7 @@
"200": {
"description": "登出成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -1133,8 +1266,19 @@
"200": {
"description": "用户信息",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.CurrentUserData"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -1179,8 +1323,19 @@
"200": {
"description": "更新后的偏好",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -1352,8 +1507,7 @@
"200": {
"description": "新令牌",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.RefreshTokenResponse"
}
},
"401": {
@@ -1550,8 +1704,7 @@
"200": {
"description": "令牌有效",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ValidateTokenResponse"
}
},
"401": {
@@ -1660,8 +1813,19 @@
"200": {
"description": "分块详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Chunk"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -1727,8 +1891,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -1756,7 +1919,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取指定知识下的所有分块列表,支持分页",
+ "description": "获取指定知识下的所有分块列表,支持分页。chunk_type 可重复,缺省 text\n取值 text, parent_text, image_ocr, image_caption, image_vector, summary, entity,\nrelationship, faq, web_search, table_summary, table_column, wiki_page",
"consumes": [
"application/json"
],
@@ -1776,6 +1939,7 @@
"required": true
},
{
+ "minimum": 1,
"type": "integer",
"default": 1,
"description": "页码",
@@ -1783,19 +1947,45 @@
"in": "query"
},
{
+ "maximum": 100,
+ "minimum": 1,
"type": "integer",
"default": 10,
"description": "每页数量",
"name": "page_size",
"in": "query"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "multi",
+ "description": "分块类型,可重复,缺省 text",
+ "name": "chunk_type",
+ "in": "query"
}
],
"responses": {
"200": {
"description": "分块列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.PageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Chunk"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -1839,8 +2029,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -1902,8 +2091,7 @@
"200": {
"description": "更新后的分块",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.UpdateChunkResponse"
}
},
"400": {
@@ -1960,8 +2148,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -2623,8 +2810,19 @@
"200": {
"description": "评估结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationDetail"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -2670,8 +2868,19 @@
"200": {
"description": "评估任务",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationDetail"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -2717,8 +2926,19 @@
"200": {
"description": "导入进度",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQImportProgress"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -2774,8 +2994,7 @@
"200": {
"description": "更新后的渠道",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.UpdateIMChannelResponse"
}
},
"400": {
@@ -2824,8 +3043,7 @@
"200": {
"description": "success: true",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -2876,8 +3094,7 @@
"200": {
"description": "更新后的渠道",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.UpdateIMChannelResponse"
}
},
"400": {
@@ -2989,6 +3206,46 @@
}
}
},
+ "/image-attrs/schema": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回当前版本的图片属性注册表、提示词版本和默认动作。全局只读,不绑定知识库。",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "获取图片属性字典",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.ImageAttrSchemaData"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/initialization/asr/check": {
"post": {
"security": [
@@ -3126,8 +3383,7 @@
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -3211,8 +3467,19 @@
"200": {
"description": "生成的标签",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.FabriTagResponse"
+ }
+ }
+ }
+ ]
}
}
}
@@ -3254,8 +3521,19 @@
"200": {
"description": "生成的文本",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.FabriTextResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -3303,8 +3581,19 @@
"200": {
"description": "提取结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TextRelationExtractionResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -3486,8 +3775,19 @@
"200": {
"description": "下载进度",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.DownloadTask"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -3524,8 +3824,22 @@
"200": {
"description": "任务列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.DownloadTask"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -3829,14 +4143,44 @@
"description": "共享智能体 ID(传入时返回该智能体可用的知识库)",
"name": "agent_id",
"in": "query"
+ },
+ {
+ "enum": [
+ "mine",
+ "others"
+ ],
+ "type": "string",
+ "description": "按创建者过滤,仅 mine 与 others 生效",
+ "name": "creator",
+ "in": "query"
}
],
"responses": {
"200": {
"description": "知识库列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ }
+ ]
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"500": {
@@ -3882,8 +4226,19 @@
"201": {
"description": "创建的知识库",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -3891,6 +4246,12 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -3931,8 +4292,19 @@
"200": {
"description": "任务ID",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -3940,6 +4312,18 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "401": {
+ "description": "未认证",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -3978,8 +4362,25 @@
"200": {
"description": "进度信息",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneProgress"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
@@ -4031,8 +4432,19 @@
"200": {
"description": "知识库详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4041,6 +4453,12 @@
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
+ "403": {
+ "description": "无权访问知识库",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
"404": {
"description": "知识库不存在",
"schema": {
@@ -4091,8 +4509,19 @@
"200": {
"description": "更新后的知识库",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4100,6 +4529,18 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
},
@@ -4136,8 +4577,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -4145,6 +4585,18 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "仅所有者可删除",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -4156,7 +4608,7 @@
"Bearer": []
}
],
- "description": "返回知识库的重要变更与后台任务入口。仅知识库创建者或所属空间管理员可读,共享空间不可读。",
+ "description": "返回知识库的重要变更与后台任务入口。仅知识库创建者或所属空间管理员可读,共享空间不可读。\n按 id 倒序;把 next_cursor 作为 after_id 取下一页,返回空列表表示没有更多。",
"produces": [
"application/json"
],
@@ -4179,20 +4631,31 @@
"in": "query"
},
{
+ "maximum": 100,
+ "minimum": 1,
"type": "integer",
- "description": "页大小,1-100,默认 50",
+ "default": 50,
+ "description": "页大小",
"name": "limit",
"in": "query"
},
{
"type": "string",
- "description": "按 action 精确过滤",
+ "description": "按 action 精确过滤,如 knowledge.deleted",
"name": "action",
"in": "query"
},
{
+ "enum": [
+ "success",
+ "accepted",
+ "partial",
+ "failed",
+ "denied",
+ "canceled"
+ ],
"type": "string",
- "description": "按 outcome 精确过滤",
+ "description": "结果过滤",
"name": "outcome",
"in": "query"
},
@@ -4211,7 +4674,13 @@
}
},
"403": {
- "description": "Forbidden",
+ "description": "非创建者或管理员,或知识库来自其他空间",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4250,8 +4719,19 @@
"201": {
"description": "创建后的知识库副本",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.DuplicateKnowledgeBaseData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4259,6 +4739,18 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -4345,8 +4837,19 @@
"200": {
"description": "FAQ列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PageResult"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4399,8 +4902,19 @@
"200": {
"description": "任务ID",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TaskIDData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4461,8 +4975,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -4570,8 +5083,7 @@
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -4626,8 +5138,7 @@
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -4680,8 +5191,19 @@
"200": {
"description": "FAQ条目详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4747,8 +5269,19 @@
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4810,8 +5343,19 @@
"200": {
"description": "更新后的FAQ条目",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4872,8 +5416,19 @@
"200": {
"description": "创建的FAQ条目",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -4928,8 +5483,7 @@
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -4990,8 +5544,22 @@
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5057,8 +5625,7 @@
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.HybridSearchResponse"
}
},
"400": {
@@ -5066,6 +5633,12 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
},
@@ -5122,8 +5695,7 @@
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.HybridSearchResponse"
}
},
"400": {
@@ -5131,6 +5703,12 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -5229,8 +5807,22 @@
"200": {
"description": "图片资产分页列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.PageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAsset"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5282,8 +5874,22 @@
"200": {
"description": "图片资产分页列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.PageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAsset"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5305,7 +5911,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的知识列表,支持分页和筛选",
+ "description": "获取知识库下的知识列表,支持分页和筛选\n不传 parse_status 时不返回删除中(deleting)的文档。",
"consumes": [
"application/json"
],
@@ -5325,13 +5931,18 @@
"required": true
},
{
+ "minimum": 1,
"type": "integer",
+ "default": 1,
"description": "页码",
"name": "page",
"in": "query"
},
{
+ "maximum": 1000,
+ "minimum": 1,
"type": "integer",
+ "default": 20,
"description": "每页数量",
"name": "page_size",
"in": "query"
@@ -5355,8 +5966,17 @@
"in": "query"
},
{
+ "enum": [
+ "pending",
+ "processing",
+ "finalizing",
+ "completed",
+ "failed",
+ "cancelled",
+ "deleting"
+ ],
"type": "string",
- "description": "解析状态筛选 (pending/processing/completed/failed)",
+ "description": "状态",
"name": "parse_status",
"in": "query"
},
@@ -5391,14 +6011,25 @@
"in": "query"
},
{
+ "enum": [
+ "created_at",
+ "updated_at",
+ "file_name"
+ ],
"type": "string",
- "description": "排序字段: updated_at/created_at/file_name,默认 created_at",
+ "default": "created_at",
+ "description": "排序字段",
"name": "sort_by",
"in": "query"
},
{
+ "enum": [
+ "asc",
+ "desc"
+ ],
"type": "string",
- "description": "排序方向: asc/desc,默认 desc",
+ "default": "desc",
+ "description": "排序方向",
"name": "sort_order",
"in": "query"
}
@@ -5407,8 +6038,22 @@
"200": {
"description": "知识列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.PageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5416,6 +6061,12 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "无权访问知识库",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
},
@@ -5452,8 +6103,7 @@
"200": {
"description": "清空任务已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SubmittedTaskResponse"
}
},
"400": {
@@ -5627,8 +6277,19 @@
"200": {
"description": "创建的知识",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5681,8 +6342,19 @@
"200": {
"description": "目录树",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeFolderTree"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5735,8 +6407,19 @@
"200": {
"description": "重命名成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.FolderMoveData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5797,8 +6480,19 @@
"200": {
"description": "创建的知识",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5876,8 +6570,19 @@
"201": {
"description": "创建的知识",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5927,8 +6632,22 @@
"200": {
"description": "可移动目标列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -5937,6 +6656,18 @@
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
+ "401": {
+ "description": "未认证",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
"404": {
"description": "知识库不存在",
"schema": {
@@ -5980,8 +6711,25 @@
"200": {
"description": "更新后的知识库",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
@@ -5989,6 +6737,12 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -6024,8 +6778,19 @@
"200": {
"description": "生成的知识库画像",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6033,6 +6798,18 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "403": {
+ "description": "无权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -6109,8 +6886,19 @@
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -6169,8 +6957,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -6212,8 +6999,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -6277,8 +7063,19 @@
"200": {
"description": "标签列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PageResult"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6342,8 +7139,19 @@
"200": {
"description": "创建的标签",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeTag"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6405,8 +7213,19 @@
"200": {
"description": "更新后的标签",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeTag"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6477,8 +7296,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -6542,10 +7360,9 @@
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "SSE 事件流",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "string"
}
},
"400": {
@@ -6667,8 +7484,22 @@
"200": {
"description": "知识列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6716,8 +7547,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SubmittedTaskResponse"
}
},
"400": {
@@ -6771,8 +7601,7 @@
"200": {
"description": "任务已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SubmittedTaskResponse"
}
},
"400": {
@@ -6826,8 +7655,19 @@
"200": {
"description": "移动成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.FolderMoveData"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -6900,8 +7740,7 @@
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -6956,8 +7795,19 @@
"200": {
"description": "更新后的知识",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -7126,8 +7976,7 @@
"200": {
"description": "Search results",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.KnowledgeSearchKnowledgeResponse"
}
},
"400": {
@@ -7175,8 +8024,7 @@
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -7222,8 +8070,19 @@
"200": {
"description": "知识详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -7232,6 +8091,12 @@
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
+ "403": {
+ "description": "无权访问所属知识库",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
"404": {
"description": "知识不存在",
"schema": {
@@ -7282,8 +8147,7 @@
"200": {
"description": "更新成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.UpdateKnowledgeResponse"
}
},
"400": {
@@ -7325,14 +8189,37 @@
],
"responses": {
"200": {
- "description": "任务已提交,返回 task_id",
+ "description": "任务已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataMessageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TaskIDData"
+ }
+ }
+ }
+ ]
}
},
"400": {
- "description": "请求参数错误",
+ "description": "请求参数错误或知识正在移动",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "需要编辑权限",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -7374,8 +8261,19 @@
"200": {
"description": "取消已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataMessageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -7524,11 +8422,11 @@
"required": true
},
{
- "description": "可选的处理配置覆盖:{\\",
+ "description": "可选;不传则沿用上传时的处理配置",
"name": "body",
"in": "body",
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.ReparseKnowledgeRequest"
}
}
],
@@ -7536,8 +8434,19 @@
"200": {
"description": "重新解析任务已提交",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataMessageResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -7551,6 +8460,12 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "知识不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
@@ -7585,8 +8500,9 @@
"required": true
},
{
+ "minimum": 1,
"type": "integer",
- "description": "指定尝试号;省略=最新",
+ "description": "指定尝试号;省略或非正数=最新",
"name": "attempt",
"in": "query"
}
@@ -7595,8 +8511,31 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.KnowledgeSpansData"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "403": {
+ "description": "无权访问所属知识库",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -7630,8 +8569,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.AutoFixResponse"
}
}
}
@@ -8001,8 +8939,13 @@
"in": "query"
},
{
+ "enum": [
+ "pending",
+ "ignored",
+ "resolved"
+ ],
"type": "string",
- "description": "Filter by status (pending, ignored, resolved)",
+ "description": "Filter by status",
"name": "status",
"in": "query"
}
@@ -8016,6 +8959,18 @@
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageIssue"
}
}
+ },
+ "400": {
+ "description": "Not a Wiki knowledge base, or no access",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
+ },
+ "500": {
+ "description": "Internal Server Error",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
}
}
}
@@ -8112,6 +9067,18 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintReport"
}
+ },
+ "400": {
+ "description": "Not a Wiki knowledge base, or no access",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
+ },
+ "500": {
+ "description": "Internal Server Error",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
}
}
}
@@ -8463,6 +9430,9 @@
}
],
"description": "Re-parse all pages and rebuild bidirectional link references",
+ "produces": [
+ "application/json"
+ ],
"tags": [
"Wiki"
],
@@ -8480,10 +9450,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "$ref": "#/definitions/internal_handler.WikiMessageResponse"
+ }
+ },
+ "400": {
+ "description": "Not a Wiki knowledge base, or no access",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
+ },
+ "500": {
+ "description": "Internal Server Error",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
}
}
}
@@ -8698,6 +9677,18 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiStats"
}
+ },
+ "400": {
+ "description": "Not a Wiki knowledge base, or no access",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
+ },
+ "500": {
+ "description": "Internal Server Error",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.WikiErrorResponse"
+ }
}
}
}
@@ -8940,8 +9931,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"404": {
@@ -9038,8 +10028,22 @@
"200": {
"description": "MCP服务列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9091,8 +10095,19 @@
"200": {
"description": "创建的MCP服务",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9172,8 +10187,19 @@
"200": {
"description": "MCP服务详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -9226,10 +10252,21 @@
"200": {
"description": "更新后的MCP服务",
"schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse"
+ }
+ }
+ }
+ ]
+ }
+ },
"400": {
"description": "请求参数错误",
"schema": {
@@ -9271,8 +10308,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"500": {
@@ -9328,8 +10364,19 @@
"200": {
"description": "写入后的凭据状态",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialsResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9577,8 +10624,19 @@
"200": {
"description": "与 oauth/status 相同",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_mcp.OAuthAuthorizationStatus"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9756,8 +10814,22 @@
"200": {
"description": "资源列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPResource"
+ }
+ }
+ }
+ }
+ ]
}
},
"500": {
@@ -9803,8 +10875,19 @@
"200": {
"description": "测试结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTestResult"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -9867,8 +10950,7 @@
"200": {
"description": "更新结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -9920,8 +11002,22 @@
"200": {
"description": "工具列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTool"
+ }
+ }
+ }
+ }
+ ]
}
},
"500": {
@@ -9952,8 +11048,22 @@
"200": {
"description": "One group per sandbox config",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.ConfigEnvGroup"
+ }
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -9999,8 +11109,7 @@
"200": {
"description": "Stored",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -10043,8 +11152,7 @@
"200": {
"description": "Deleted",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"404": {
@@ -10089,8 +11197,7 @@
"200": {
"description": "Stored",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -10133,8 +11240,7 @@
"200": {
"description": "Deleted",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"404": {
@@ -10315,8 +11421,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10341,8 +11446,19 @@
"200": {
"description": "整理结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConsolidationResult"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10382,8 +11498,7 @@
"200": {
"description": "文档列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListDocumentsResponse"
}
}
}
@@ -10417,8 +11532,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10443,8 +11557,7 @@
"200": {
"description": "记忆导出",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ExportResponse"
}
}
}
@@ -10496,8 +11609,7 @@
"200": {
"description": "记忆列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListItemsResponse"
}
}
}
@@ -10534,8 +11646,19 @@
"200": {
"description": "新增的记忆",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10558,8 +11681,7 @@
"200": {
"description": "清空成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ClearResponse"
}
}
}
@@ -10605,8 +11727,19 @@
"200": {
"description": "更新后的记忆",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10638,8 +11771,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10673,8 +11805,19 @@
"200": {
"description": "确认成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10708,8 +11851,7 @@
"200": {
"description": "否决成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10734,8 +11876,19 @@
"200": {
"description": "记忆设置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemorySettings"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10772,8 +11925,19 @@
"200": {
"description": "更新后的设置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemorySettings"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10813,8 +11977,7 @@
"200": {
"description": "主题列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListTopicsResponse"
}
}
}
@@ -10848,8 +12011,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -10883,8 +12045,19 @@
"200": {
"description": "新增的记忆",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10915,8 +12088,19 @@
"200": {
"description": "统计信息",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryKBStats"
+ }
+ }
+ }
+ ]
}
}
}
@@ -10958,8 +12142,19 @@
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSearchResult"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11029,8 +12224,22 @@
"200": {
"description": "消息列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Message"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11083,8 +12292,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"500": {
@@ -11121,8 +12329,22 @@
"200": {
"description": "模型列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11168,8 +12390,19 @@
"201": {
"description": "创建的模型",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11273,8 +12506,22 @@
"200": {
"description": "厂商列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.ModelProviderDTO"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -11302,8 +12549,7 @@
"200": {
"description": "凭证状态",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudStatusResult"
}
},
"500": {
@@ -11350,8 +12596,19 @@
"200": {
"description": "模型详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -11404,8 +12661,19 @@
"200": {
"description": "更新后的模型",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -11449,8 +12717,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -11511,8 +12778,19 @@
"201": {
"description": "复制的模型",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11586,8 +12864,19 @@
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11632,8 +12921,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -11678,8 +12978,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -11724,8 +13035,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationJoinRequest"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -11812,8 +13134,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SearchOrganizationsResponse"
}
}
}
@@ -11847,8 +13168,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"404": {
@@ -11898,8 +13230,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -11934,8 +13277,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12031,8 +13373,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -12119,8 +13460,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListJoinRequestsResponse"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -12179,8 +13531,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12217,8 +13568,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12311,8 +13661,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12354,8 +13703,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"403": {
@@ -12407,8 +13755,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationJoinRequest"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -12454,8 +13813,22 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInviteCandidate"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -12495,8 +13868,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListOrganizationSharedAgentsResponse"
}
}
}
@@ -12530,8 +13902,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListOrganizationSharedKnowledgeBasesResponse"
}
}
}
@@ -12641,8 +14012,19 @@
"201": {
"description": "Created sandbox config",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.sandboxConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -12692,8 +14074,19 @@
"200": {
"description": "Sandbox config",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.sandboxConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -12753,8 +14146,19 @@
"200": {
"description": "Updated sandbox config",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.sandboxConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -12828,8 +14232,7 @@
"200": {
"description": "Deletion success",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"401": {
@@ -12880,8 +14283,19 @@
"200": {
"description": "Sandbox inventory",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SandboxInventory"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -12925,8 +14339,22 @@
"200": {
"description": "Installed skills",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.skillResponse"
+ }
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -13056,8 +14484,19 @@
"200": {
"description": "Installed skill",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.skillResponse"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -13180,8 +14619,19 @@
"200": {
"description": "Updated skill",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.skillResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -13244,8 +14694,22 @@
"200": {
"description": "Skill files",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileEntry"
+ }
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -13309,8 +14773,19 @@
"200": {
"description": "Skill file",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileContent"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -13494,8 +14969,19 @@
"200": {
"description": "Stopped skill",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.skillResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -13799,10 +15285,9 @@
],
"responses": {
"200": {
- "description": "流式响应",
+ "description": "SSE 事件流",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "string"
}
},
"404": {
@@ -14381,8 +15866,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet"
+ }
+ }
+ }
+ ]
}
}
}
@@ -14435,15 +15931,37 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet"
+ }
+ }
+ }
+ ]
}
},
"202": {
"description": "Accepted",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet"
+ }
+ }
+ }
+ ]
}
}
}
@@ -14875,8 +16393,7 @@
"200": {
"description": "智能体列表 + total",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListSharedAgentsResponse"
}
},
"500": {
@@ -14907,8 +16424,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListSharedKnowledgeBasesResponse"
}
}
}
@@ -14959,8 +16475,7 @@
"200": {
"description": "Skills列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListSkillsResponse"
}
},
"403": {
@@ -15044,8 +16559,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -15074,8 +16588,22 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileEntry"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -15110,8 +16638,19 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileContent"
+ }
+ }
+ }
+ ]
}
}
}
@@ -15172,8 +16711,7 @@
"200": {
"description": "List of storage backends and default_storage_backend_id",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListResponse"
}
},
"401": {
@@ -15220,8 +16758,19 @@
"201": {
"description": "Created storage backend",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -15282,8 +16831,7 @@
"200": {
"description": "Connectivity test result (success, error)",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessErrorResponse"
}
},
"400": {
@@ -15324,8 +16872,22 @@
"200": {
"description": "List of allowed storage provider types",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -15362,8 +16924,19 @@
"200": {
"description": "Storage backend details",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -15423,8 +16996,19 @@
"200": {
"description": "Updated storage backend",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -15478,8 +17062,7 @@
"200": {
"description": "Deletion success",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -15535,8 +17118,7 @@
"200": {
"description": "Default set successfully",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -15592,8 +17174,7 @@
"200": {
"description": "Connectivity test result (success, error)",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessErrorResponse"
}
},
"401": {
@@ -15631,8 +17212,22 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.tenantAPIKeyResponse"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -15669,8 +17264,19 @@
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.tenantAPIKeyCreateResponse"
+ }
+ }
+ }
+ ]
}
}
}
@@ -15704,8 +17310,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -16164,8 +17769,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.PurgeArchivedRuntimeTasksResponse"
}
}
}
@@ -16391,8 +17995,7 @@
"200": {
"description": "Reset acknowledged",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -16426,8 +18029,7 @@
"200": {
"description": "{ affected: int64, quota_bytes: int64 }",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ApplyDefaultStorageQuotaToAllTenantsResponse"
}
},
"500": {
@@ -16579,8 +18181,7 @@
"200": {
"description": "Password reset successfully",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ResetUserPasswordResponse"
}
},
"400": {
@@ -16635,8 +18236,7 @@
"200": {
"description": "Status updated",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SetUserStatusResponse"
}
},
"400": {
@@ -16668,10 +18268,9 @@
"summary": "获取部署能力清单",
"responses": {
"200": {
- "description": "标准 code/msg/data 包装,data 为 DeploymentCapabilitiesData",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.GetDeploymentCapabilitiesResponse"
}
}
}
@@ -16743,8 +18342,7 @@
"200": {
"description": "解析引擎列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.ListParserEnginesResponse"
}
}
}
@@ -16890,8 +18488,19 @@
"200": {
"description": "空间列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TenantListData"
+ }
+ }
+ }
+ ]
}
},
"500": {
@@ -16969,8 +18578,19 @@
"200": {
"description": "所有空间列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TenantListData"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -17007,8 +18627,19 @@
"200": {
"description": "提示词模板配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplatesConfig"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17045,8 +18676,19 @@
"200": {
"description": "网络搜索配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17201,6 +18843,8 @@
"in": "query"
},
{
+ "maximum": 100,
+ "minimum": 1,
"type": "integer",
"default": 20,
"description": "每页数量",
@@ -17212,8 +18856,19 @@
"200": {
"description": "搜索结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.TenantSearchData"
+ }
+ }
+ }
+ ]
}
},
"403": {
@@ -17259,8 +18914,19 @@
"200": {
"description": "空间详情",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17316,8 +18982,19 @@
"200": {
"description": "更新后的空间",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17358,8 +19035,7 @@
"200": {
"description": "删除成功",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -17402,8 +19078,19 @@
"200": {
"description": "API principal 配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.apiPrincipalConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17459,8 +19146,19 @@
"200": {
"description": "更新后的配置",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.apiPrincipalConfigResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17518,8 +19216,19 @@
"200": {
"description": "短期 JWT",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.apiPrincipalTestTokenResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -17703,8 +19412,19 @@
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInvitationResponse"
+ }
+ }
+ }
+ ]
}
}
}
@@ -17745,8 +19465,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -17792,8 +19511,19 @@
"201": {
"description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInvitationResponse"
+ }
+ }
+ }
+ ]
}
}
}
@@ -17827,8 +19557,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -17980,8 +19709,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -18020,8 +19748,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -18047,8 +19774,22 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserResourceFavorite"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -18073,8 +19814,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -18106,8 +19846,7 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
}
}
@@ -18135,10 +19874,24 @@
"200": {
"description": "List of vector stores (env + DB)",
"schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreResponse"
+ }
+ }
+ }
+ }
+ ]
+ }
+ },
"401": {
"description": "Unauthorized",
"schema": {
@@ -18183,8 +19936,19 @@
"201": {
"description": "Created vector store",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreResponse"
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -18245,8 +20009,7 @@
"200": {
"description": "Connection test result (success, version)",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.TestStoreRawResponse"
}
},
"400": {
@@ -18277,10 +20040,24 @@
"summary": "List vector store types",
"responses": {
"200": {
- "description": "List of engine types with config schemas",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreTypeInfo"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -18317,8 +20094,19 @@
"200": {
"description": "Vector store details",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreResponse"
+ }
+ }
+ }
+ ]
}
},
"401": {
@@ -18436,8 +20224,7 @@
"200": {
"description": "Deletion success",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"400": {
@@ -18495,8 +20282,7 @@
"200": {
"description": "Connection test result (success, version)",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.TestStoreByIDResponse"
}
},
"401": {
@@ -18552,8 +20338,7 @@
"200": {
"description": "测试结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessErrorResponse"
}
},
"400": {
@@ -18588,8 +20373,22 @@
"200": {
"description": "provider 类型列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderTypeInfo"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -18729,8 +20528,7 @@
"200": {
"description": "success: true",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessResponse"
}
},
"404": {
@@ -18774,8 +20572,7 @@
"200": {
"description": "测试结果",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.SuccessErrorResponse"
}
},
"404": {
@@ -18810,8 +20607,22 @@
"200": {
"description": "provider 列表",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderTypeInfo"
+ }
+ }
+ }
+ }
+ ]
}
}
}
@@ -18948,8 +20759,7 @@
"200": {
"description": "success: true",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.MessageResponse"
}
},
"400": {
@@ -18998,8 +20808,22 @@
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "allOf": [
+ {
+ "$ref": "#/definitions/internal_handler.DataResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.WikiSearchHit"
+ }
+ }
+ }
+ }
+ ]
}
},
"400": {
@@ -19013,6 +20837,90 @@
}
},
"definitions": {
+ "github_com_Tencent_WeKnora_internal_agent_tools.AgentToolCatalog": {
+ "type": "object",
+ "properties": {
+ "default_tools": {
+ "description": "DefaultTools apply when an agent's allowed_tools was never set (null).",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "switch_managed_tools": {
+ "description": "SwitchManagedTools follow other agent settings; naming them in the list\ndoes not register them.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tools": {
+ "description": "Tools are the selectable tools, in display order.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.AgentToolInfo"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_agent_tools.AgentToolInfo": {
+ "type": "object",
+ "properties": {
+ "danger": {
+ "description": "Danger marks tools that modify content, which the editor highlights.",
+ "type": "boolean"
+ },
+ "description": {
+ "type": "string"
+ },
+ "group": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "requirement": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.AgentToolRequirement"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_agent_tools.AgentToolRequirement": {
+ "type": "object",
+ "properties": {
+ "all_of": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.KBCapability"
+ }
+ },
+ "any_of": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.KBCapability"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_agent_tools.KBCapability": {
+ "type": "string",
+ "enum": [
+ "vector",
+ "keyword",
+ "wiki",
+ "graph",
+ "faq"
+ ],
+ "x-enum-varnames": [
+ "CapVector",
+ "CapKeyword",
+ "CapWiki",
+ "CapGraph",
+ "CapFAQ"
+ ]
+ },
"github_com_Tencent_WeKnora_internal_application_service.CatalogProviderView": {
"type": "object",
"properties": {
@@ -19138,6 +21046,142 @@
}
}
},
+ "github_com_Tencent_WeKnora_internal_application_service.ConfigEnvGroup": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "sandbox_config_id": {
+ "type": "string"
+ },
+ "sandbox_config_name": {
+ "type": "string"
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillEnvGroup"
+ }
+ },
+ "vars": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.EnvVarView"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.EnvVarView": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "required": {
+ "type": "boolean"
+ },
+ "source": {
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "UpdatedAt is set only for the caller's own value; a workspace value has\nno per-variable timestamp to report.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SandboxInventory": {
+ "type": "object",
+ "properties": {
+ "agent_names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "sandbox_count": {
+ "type": "integer"
+ },
+ "session_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "unverifiable": {
+ "description": "Unverifiable reports that SandboxCount is unknown rather than zero\nbecause the provider could not be reached. The management page must say\nso instead of rendering a reassuring \"0 sandboxes\".",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SkillEnvGroup": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "skill_id": {
+ "type": "string"
+ },
+ "skill_name": {
+ "type": "string"
+ },
+ "vars": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.EnvVarView"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SkillFileContent": {
+ "type": "object",
+ "properties": {
+ "binary": {
+ "type": "boolean"
+ },
+ "content": {
+ "type": "string"
+ },
+ "encoding": {
+ "type": "string"
+ },
+ "media_type": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "size": {
+ "type": "integer"
+ },
+ "truncated": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SkillFileEntry": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string"
+ },
+ "size": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.SkillServedInfo": {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue": {
"type": "object",
"properties": {
@@ -19218,43 +21262,156 @@
}
}
},
- "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": {
+ "github_com_Tencent_WeKnora_internal_config.PromptTemplate": {
"type": "object",
"properties": {
- "auth_type": {
- "description": "\"oauth2\", \"api_key\", \"token\", etc.",
+ "content": {
"type": "string"
},
- "capabilities": {
- "description": "\"incremental\", \"webhook\", \"deletion_sync\", etc.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "default": {
+ "type": "boolean"
},
"description": {
"type": "string"
},
- "icon": {
+ "has_knowledge_base": {
+ "type": "boolean"
+ },
+ "has_web_search": {
+ "type": "boolean"
+ },
+ "id": {
"type": "string"
},
- "name": {
+ "mode": {
"type": "string"
},
- "priority": {
- "description": "Priority order for UI display (lower = higher priority)",
- "type": "integer"
+ "name": {
+ "type": "string"
},
- "type": {
+ "user": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "github_com_Tencent_WeKnora_internal_config.PromptTemplatesConfig": {
"type": "object",
"properties": {
- "code": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode"
+ "agent_system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "context_template": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "fallback": {
+ "description": "Fallback 合并了固定回复模板和模型兜底 prompt(通过 mode:\"model\" 区分)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "generate_kb_description": {
+ "description": "GenerateKBDescription writes the knowledge-base gist from the document profile aggregate.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "generate_questions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "generate_session_title": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "generate_summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "graph_extraction": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "intent_prompts": {
+ "description": "IntentPrompts holds per-intent system prompt overrides (template ID = intent value).",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "keywords_extraction": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "rewrite": {
+ "description": "Rewrite 合并了前端可选模板和运行时默认模板,每个模板同时包含 content + user",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ },
+ "system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": {
+ "type": "object",
+ "properties": {
+ "auth_type": {
+ "description": "\"oauth2\", \"api_key\", \"token\", etc.",
+ "type": "string"
+ },
+ "capabilities": {
+ "description": "\"incremental\", \"webhook\", \"deletion_sync\", etc.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": {
+ "type": "string"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "priority": {
+ "description": "Priority order for UI display (lower = higher priority)",
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode"
},
"details": {},
"message": {
@@ -19317,6220 +21474,6459 @@
"ErrModelInUse"
]
},
- "github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile": {
+ "github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata": {
"type": "object",
"properties": {
- "all_caps_short_line_count": {
- "type": "integer"
+ "configured": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.CredentialsResponse": {
+ "type": "object",
+ "properties": {
+ "fields": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.MCPAuthConfigResponse": {
+ "type": "object",
+ "properties": {
+ "api_key_header": {
+ "type": "string"
},
- "avg_line_len": {
- "type": "number"
+ "auth_server_metadata_url": {
+ "type": "string"
},
- "blank_paragraph_breaks": {
- "type": "integer"
+ "auth_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthType"
},
- "chinese_chapter_count": {
- "type": "integer"
+ "client_id": {
+ "type": "string"
},
- "code_ratio": {
- "type": "number"
+ "custom_headers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "detected_langs": {
- "description": "Detected language hints (best-effort)",
+ "scopes": {
"type": "array",
"items": {
"type": "string"
}
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.MCPCatalogSummary": {
+ "type": "object",
+ "properties": {
+ "stale": {
+ "type": "boolean"
},
- "english_chapter_count": {
- "type": "integer"
+ "synced_at": {
+ "type": "string"
},
- "form_feed_count": {
+ "tool_count": {
"type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse": {
+ "type": "object",
+ "properties": {
+ "advanced_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
},
- "german_chapter_count": {
- "type": "integer"
+ "auth_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPAuthConfigResponse"
},
- "has_code": {
- "type": "boolean"
+ "catalog": {
+ "description": "Catalog is the persisted tool-directory summary for list cards.\nOmitted when this principal has never synchronized the service.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPCatalogSummary"
+ }
+ ]
},
- "has_tables": {
- "description": "Content characteristics",
- "type": "boolean"
+ "created_at": {
+ "type": "string"
},
- "md_heading_counts": {
- "description": "Markdown structure",
+ "credentials": {
+ "description": "Credentials is the per-field \"configured?\" map. Embedded on the main\nresponse so the credential UI doesn't need a follow-up GET. The\nfrontend never sees the actual secret value — only whether one is\nstored. Omitted entirely for builtin services (they can't have\nper-tenant credentials).",
"type": "object",
"additionalProperties": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata"
}
},
- "md_heading_total": {
- "type": "integer"
+ "description": {
+ "type": "string"
},
- "numbered_section_count": {
- "description": "Heuristic indicators",
- "type": "integer"
+ "enabled": {
+ "type": "boolean"
},
- "repeated_footer_count": {
- "type": "integer"
+ "env_vars": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
},
- "std_line_len": {
- "type": "number"
+ "headers": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
},
- "total_chars": {
- "type": "integer"
+ "id": {
+ "type": "string"
},
- "total_lines": {
- "type": "integer"
+ "is_builtin": {
+ "type": "boolean"
},
- "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": {
+ "name": {
"type": "string"
},
- "tier": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_models.ModelCost": {
- "type": "object",
- "properties": {
- "cache_read": {
- "type": "number"
+ "stdio_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
},
- "cache_write": {
- "type": "number"
+ "tenant_id": {
+ "type": "integer"
},
- "currency": {
+ "transport_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
+ },
+ "updated_at": {
"type": "string"
},
- "input": {
- "type": "number"
+ "url": {
+ "type": "string"
},
- "output": {
- "type": "number"
+ "usage_instructions": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_models.ModelSpec": {
+ "github_com_Tencent_WeKnora_internal_handler_dto.ModelParametersDTO": {
"type": "object",
"properties": {
- "aliases": {
- "description": "Aliases are additional ids that resolve to this entry (dated\nsnapshots, vendor-prefixed names on gateways).",
- "type": "array",
- "items": {
+ "app_id": {
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "context_window": {
+ "type": "integer"
+ },
+ "custom_headers": {
+ "type": "object",
+ "additionalProperties": {
"type": "string"
}
},
- "api": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
+ "embedding_parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
},
- "compat": {
- "description": "Compat is the protocol-specific overlay for this model (flat object,\nfields depend on API). Decoded lazily by Resolve.",
- "type": "array",
- "items": {
- "type": "integer"
+ "extra_config": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
},
- "context_window": {
+ "interface_type": {
+ "type": "string"
+ },
+ "max_concurrency": {
"type": "integer"
},
- "cost": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models.ModelCost"
+ "max_output_tokens": {
+ "type": "integer"
},
- "deprecated": {
- "description": "Deprecated hides the entry from pickers but keeps resolution working.",
- "type": "boolean"
+ "parameter_size": {
+ "type": "string"
},
- "dimension": {
- "description": "Dimension is the embedding vector width (embedding entries only).",
- "type": "integer"
+ "provider": {
+ "type": "string"
},
- "id": {
+ "spec": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSpecOverride"
+ },
+ "supports_vision": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse": {
+ "type": "object",
+ "properties": {
+ "capabilities": {
+ "description": "Capabilities is the catalog view of the model. Chat models get the\nprotocol, thinking levels and context window; embedding and rerank\nmodels get input modalities, including support for image input.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_runtime.Capabilities"
+ }
+ ]
+ },
+ "created_at": {
"type": "string"
},
- "input": {
- "description": "Input lists accepted modalities: text, image, audio, video.",
- "type": "array",
- "items": {
- "type": "string"
+ "credentials": {
+ "description": "Per-field \"configured?\" map. Omitted for builtin models unless the\ncaller is a system administrator. See MCPServiceResponse.Credentials.",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata"
}
},
- "match": {
- "description": "Match is a case-insensitive glob (\"gpt-5*\", \"*deepseek-r1*\") that lets\none entry describe a family. Exact ids and aliases win over patterns;\namong patterns the longest literal prefix wins.",
+ "description": {
"type": "string"
},
- "max_output_tokens": {
- "type": "integer"
+ "display_name": {
+ "type": "string"
},
- "name": {
+ "id": {
"type": "string"
},
- "reasoning": {
- "description": "Reasoning reports whether the model can emit thinking at all.",
+ "is_builtin": {
"type": "boolean"
},
- "source": {
- "description": "Source is the documentation URL the facts were taken from.",
+ "is_default": {
+ "type": "boolean"
+ },
+ "name": {
"type": "string"
},
- "thinking_levels": {
- "description": "ThinkingLevels maps protocol-neutral levels to vendor values; missing\nkeys inherit the vendor map. See api.ThinkingLevelMap.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap"
- }
- ]
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelParametersDTO"
+ },
+ "source": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ },
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelStatus"
+ },
+ "tenant_id": {
+ "type": "integer"
},
"type": {
- "description": "Type is the WeKnora model type this entry describes. Chat models with\nimage input are still KnowledgeQA; the UI derives VLM eligibility from\nInput. Embedding / Rerank / ASR entries exist for the model picker.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
- }
- ]
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ },
+ "updated_at": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_models_api.API": {
- "type": "string",
- "enum": [
- "openai-completions",
- "openai-responses",
- "anthropic-messages",
- "google-generative-ai",
- "ollama"
- ],
- "x-enum-varnames": [
- "APIOpenAICompletions",
- "APIOpenAIResponses",
- "APIAnthropicMessages",
- "APIGoogleGenerativeAI",
- "APIOllama"
- ]
- },
- "github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort": {
- "type": "string",
- "enum": [
- "off",
- "auto",
- "minimal",
- "low",
- "medium",
- "high",
- "xhigh",
- "max"
- ],
- "x-enum-varnames": [
- "ReasoningOff",
- "ReasoningAuto",
- "ReasoningMinimal",
- "ReasoningLow",
- "ReasoningMedium",
- "ReasoningHigh",
- "ReasoningXHigh",
- "ReasoningMax"
- ]
- },
- "github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat": {
+ "github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse": {
"type": "object",
"properties": {
- "active": {
- "type": "integer"
+ "business": {
+ "type": "string"
},
- "limit": {
- "type": "integer"
+ "chat_history_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
},
- "model_id": {
+ "context_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
+ },
+ "created_at": {
"type": "string"
},
- "name": {
+ "credentials": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
"type": "string"
},
- "waiting": {
+ "id": {
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.APIPrincipalMode": {
- "type": "string",
- "enum": [
- "tenant",
- "direct_header",
- "signed_token"
- ],
- "x-enum-varnames": [
- "APIPrincipalModeTenant",
- "APIPrincipalModeDirect",
- "APIPrincipalModeSignedToken"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ASRConfig": {
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
},
- "language": {
- "description": "optional: language hint for transcription",
- "type": "string"
+ "memory_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConfig"
},
- "model_id": {
+ "name": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.AdminCreateUserRequest": {
- "type": "object",
- "required": [
- "email",
- "username"
- ],
- "properties": {
- "email": {
+ },
+ "parser_engine_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
+ },
+ "retrieval_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
+ },
+ "retriever_engines": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
+ },
+ "status": {
"type": "string"
},
- "password": {
+ "storage_engine_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
+ },
+ "storage_quota": {
+ "type": "integer"
+ },
+ "storage_used": {
+ "type": "integer"
+ },
+ "updated_at": {
"type": "string"
},
- "username": {
- "type": "string",
- "maxLength": 50,
- "minLength": 2
+ "web_search_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AgentStep": {
+ "github_com_Tencent_WeKnora_internal_im.IMChannel": {
"type": "object",
"properties": {
- "intermediate_answer": {
- "description": "IntermediateAnswer preserves a plain answer followed by a loop-end steer.\nThe canonical final answer is still stored in Message.Content.",
- "type": "boolean"
+ "agent_id": {
+ "type": "string"
},
- "iteration": {
- "description": "Iteration number (0-indexed)",
- "type": "integer"
+ "bot_identity": {
+ "type": "string"
},
- "reasoning_content": {
- "description": "ReasoningContent stores the OpenAI-protocol reasoning_content emitted by the\nmodel in this round. Persisted on AgentStep so cross-turn replay can put it\nback on the assistant message — required by MiMo / DeepSeek V3.2+ thinking\nmode, ignored by providers that don't recognize the field.",
+ "created_at": {
"type": "string"
},
- "reasoning_metadata": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ProviderMetadata"
+ "credentials": {
+ "type": "object"
},
- "reasoning_signature": {
- "description": "ReasoningSignature / ReasoningMetadata are the provider artifacts that\nmust accompany ReasoningContent on replay (Anthropic signatures,\nOpenAI Responses encrypted reasoning items).",
- "type": "string"
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
},
- "thought": {
- "description": "LLM's reasoning/thinking (Think phase)",
+ "enabled": {
+ "type": "boolean"
+ },
+ "id": {
"type": "string"
},
- "timestamp": {
- "description": "When this step occurred",
+ "knowledge_base_id": {
"type": "string"
},
- "tool_calls": {
- "description": "Tools called in this step (Act phase)",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall"
- }
+ "locale": {
+ "type": "string"
},
- "truncated": {
- "description": "Truncated marks the round the completion-token cap cut off. It rides in\nthe agent_steps JSON so a reloaded, shared or re-opened conversation can\nstill show that the answer stops mid-sentence by design, rather than\nlooking finished. Live streaming carries the same fact on the answer\nevent; this is what survives the round trip.",
- "type": "boolean"
+ "mode": {
+ "type": "string"
},
- "user_messages_before": {
- "description": "UserMessagesBefore records consumed steer rows in delivery order, before\nthis model response. Unlike timestamps, this remains unambiguous on replay.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "name": {
+ "type": "string"
+ },
+ "output_mode": {
+ "type": "string"
+ },
+ "platform": {
+ "type": "string"
+ },
+ "session_mode": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": {
- "type": "string",
- "enum": [
- "all",
- "random"
- ],
- "x-enum-varnames": [
- "AnswerStrategyAll",
- "AnswerStrategyRandom"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.AuditAction": {
- "type": "string",
- "enum": [
- "rbac.member_added",
- "rbac.member_removed",
- "rbac.member_role_changed",
- "rbac.member_left",
- "rbac.access_denied",
- "rbac.invitation_sent",
- "rbac.invitation_accepted",
- "rbac.invitation_declined",
- "rbac.invitation_revoked",
- "rbac.invitation_expired",
- "vector_store.created",
- "vector_store.updated",
- "vector_store.deleted",
- "opensearch.index_created",
- "opensearch.index_deleted",
- "opensearch.reindex_executed",
- "system.setting_changed",
- "system.admin_promoted",
- "system.admin_revoked",
- "system.user_password_reset",
- "system.user_created",
- "system.api_key_created",
- "system.api_key_revoked",
- "system.queue_task_retried",
- "system.queue_task_deleted",
- "system.queue_task_run_now",
- "system.queue_task_cancelled",
- "system.queue_archived_purged",
- "kb.created",
- "kb.updated",
- "kb.deleted",
- "kb.duplicated",
- "kb.clone_started",
- "kb.clone_completed",
- "kb.clone_failed",
- "knowledge.created",
- "knowledge.updated",
- "knowledge.deleted",
- "knowledge.batch_deleted",
- "knowledge.reparse_started",
- "knowledge.parse_canceled",
- "knowledge.move_started",
- "knowledge.move_completed",
- "knowledge.move_failed",
- "tag.created",
- "tag.updated",
- "tag.deleted",
- "datasource.created",
- "datasource.updated",
- "datasource.deleted",
- "datasource.sync_started",
- "datasource.sync_completed",
- "datasource.sync_failed",
- "datasource.paused",
- "datasource.resumed",
- "kb.share_added",
- "kb.share_permission_changed",
- "kb.share_removed",
- "wiki.content_changed",
- "faq.import_started",
- "faq.import_completed",
- "faq.import_failed"
- ],
- "x-enum-varnames": [
- "AuditActionMemberAdded",
- "AuditActionMemberRemoved",
- "AuditActionMemberRoleChanged",
- "AuditActionMemberLeft",
- "AuditActionAccessDenied",
- "AuditActionInvitationSent",
- "AuditActionInvitationAccepted",
- "AuditActionInvitationDeclined",
- "AuditActionInvitationRevoked",
- "AuditActionInvitationExpired",
- "AuditActionVectorStoreCreated",
- "AuditActionVectorStoreUpdated",
- "AuditActionVectorStoreDeleted",
- "AuditActionOpenSearchIndexCreated",
- "AuditActionOpenSearchIndexDeleted",
- "AuditActionOpenSearchReindexExecuted",
- "AuditActionSystemSettingChanged",
- "AuditActionSystemAdminPromoted",
- "AuditActionSystemAdminRevoked",
- "AuditActionSystemUserPasswordReset",
- "AuditActionSystemUserCreated",
- "AuditActionSystemAPIKeyCreated",
- "AuditActionSystemAPIKeyRevoked",
- "AuditActionSystemQueueTaskRetried",
- "AuditActionSystemQueueTaskDeleted",
- "AuditActionSystemQueueTaskRunNow",
- "AuditActionSystemQueueTaskCancelled",
- "AuditActionSystemQueueArchivedPurged",
- "AuditActionKBCreated",
- "AuditActionKBUpdated",
- "AuditActionKBDeleted",
- "AuditActionKBDuplicated",
- "AuditActionKBCloneStarted",
- "AuditActionKBCloneCompleted",
- "AuditActionKBCloneFailed",
- "AuditActionKnowledgeCreated",
- "AuditActionKnowledgeUpdated",
- "AuditActionKnowledgeDeleted",
- "AuditActionKnowledgeBatchDeleted",
- "AuditActionKnowledgeReparseStarted",
- "AuditActionKnowledgeParseCanceled",
- "AuditActionKnowledgeMoveStarted",
- "AuditActionKnowledgeMoveCompleted",
- "AuditActionKnowledgeMoveFailed",
- "AuditActionTagCreated",
- "AuditActionTagUpdated",
- "AuditActionTagDeleted",
- "AuditActionDataSourceCreated",
- "AuditActionDataSourceUpdated",
- "AuditActionDataSourceDeleted",
- "AuditActionDataSourceSyncStarted",
- "AuditActionDataSourceSyncCompleted",
- "AuditActionDataSourceSyncFailed",
- "AuditActionDataSourcePaused",
- "AuditActionDataSourceResumed",
- "AuditActionKBShareAdded",
- "AuditActionKBSharePermissionChanged",
- "AuditActionKBShareRemoved",
- "AuditActionWikiContentChanged",
- "AuditActionFAQImportStarted",
- "AuditActionFAQImportCompleted",
- "AuditActionFAQImportFailed"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.AuditLog": {
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile": {
"type": "object",
"properties": {
- "action": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AuditAction"
+ "all_caps_short_line_count": {
+ "type": "integer"
},
- "actor_role": {
- "type": "string"
+ "avg_line_len": {
+ "type": "number"
},
- "actor_user_id": {
- "type": "string"
+ "blank_paragraph_breaks": {
+ "type": "integer"
},
- "created_at": {
- "type": "string"
+ "chinese_chapter_count": {
+ "type": "integer"
},
- "details": {
+ "code_ratio": {
+ "type": "number"
+ },
+ "detected_langs": {
+ "description": "Detected language hints (best-effort)",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
},
- "id": {
+ "english_chapter_count": {
"type": "integer"
},
- "outcome": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AuditOutcome"
+ "form_feed_count": {
+ "type": "integer"
},
- "request_method": {
- "type": "string"
+ "german_chapter_count": {
+ "type": "integer"
},
- "request_path": {
- "type": "string"
+ "has_code": {
+ "type": "boolean"
},
- "scope_id": {
- "type": "string"
+ "has_tables": {
+ "description": "Content characteristics",
+ "type": "boolean"
},
- "scope_type": {
- "type": "string"
+ "md_heading_counts": {
+ "description": "Markdown structure",
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
},
- "target_id": {
- "type": "string"
+ "md_heading_total": {
+ "type": "integer"
},
- "target_type": {
- "type": "string"
+ "numbered_section_count": {
+ "description": "Heuristic indicators",
+ "type": "integer"
},
- "target_user_id": {
- "type": "string"
+ "repeated_footer_count": {
+ "type": "integer"
},
- "tenant_id": {
+ "std_line_len": {
+ "type": "number"
+ },
+ "total_chars": {
+ "type": "integer"
+ },
+ "total_lines": {
+ "type": "integer"
+ },
+ "visual_sep_count": {
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.AuditOutcome": {
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier": {
"type": "string",
"enum": [
- "success",
- "accepted",
- "denied",
- "failed",
- "partial",
- "canceled"
+ "heading",
+ "heuristic",
+ "legacy"
],
"x-enum-varnames": [
- "AuditOutcomeSuccess",
- "AuditOutcomeAccepted",
- "AuditOutcomeDenied",
- "AuditOutcomeFailed",
- "AuditOutcomePartial",
- "AuditOutcomeCanceled"
+ "TierHeading",
+ "TierHeuristic",
+ "TierLegacy"
]
},
- "github_com_Tencent_WeKnora_internal_types.AutoTagConfig": {
+ "github_com_Tencent_WeKnora_internal_infrastructure_chunker.TierRejection": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "max_tags": {
- "type": "integer"
- },
- "model_id": {
+ "reason": {
"type": "string"
},
- "skip_if_tagged": {
- "description": "SkipIfTagged leaves documents that already carry tags untouched, so a\ndeliberate manual classification is not diluted by model guesses. It is\na pointer because the default is true: rows written before this field\nexisted decode to nil and must not silently flip to \"always append\".",
- "type": "boolean"
+ "tier": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_mcp.OAuthAuthorizationStatus": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
- },
- "path_prefix": {
- "type": "string"
- },
- "region": {
- "type": "string"
- },
- "secret_id": {
- "type": "string"
+ "authorized": {
+ "type": "boolean"
},
- "secret_key": {
+ "expires_at": {
"type": "string"
},
- "temp_bucket_name": {
- "type": "string"
+ "refresh_available": {
+ "type": "boolean"
},
- "temp_region": {
+ "state": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": {
+ "github_com_Tencent_WeKnora_internal_models.ModelCost": {
"type": "object",
"properties": {
- "embedding_model_id": {
- "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
- "type": "string"
+ "cache_read": {
+ "type": "number"
},
- "enabled": {
- "description": "Enabled controls whether chat history indexing is active",
- "type": "boolean"
+ "cache_write": {
+ "type": "number"
},
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
+ "currency": {
"type": "string"
+ },
+ "input": {
+ "type": "number"
+ },
+ "output": {
+ "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": {
+ "github_com_Tencent_WeKnora_internal_models.ModelSpec": {
"type": "object",
"properties": {
- "child_chunk_size": {
- "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
- "type": "integer"
- },
- "chunk_overlap": {
- "description": "Chunk overlap",
- "type": "integer"
- },
- "chunk_size": {
- "description": "Chunk size",
- "type": "integer"
- },
- "enable_parent_child": {
- "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
- "type": "boolean"
- },
- "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"
- },
- "parser_engine_rules": {
- "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, DefaultParserEngine is used (builtin/simple routing, except\ntypes that only a specific engine can parse: ppt/pptx fall back to\nmarkitdown). A linked anydoc binding is preferred for every type it\nconverts.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
- },
- "separators": {
- "description": "Separators",
+ "aliases": {
+ "description": "Aliases are additional ids that resolve to this entry (dated\nsnapshots, vendor-prefixed names on gateways).",
"type": "array",
"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"
+ "api": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
},
- "table_metadata_instructions": {
- "description": "TableMetadataInstructions contains optional business guidance used when\ngenerating searchable summaries for CSV/Excel tables. The system-owned\noutput contract remains fixed; these instructions only add domain context.",
- "type": "string"
+ "compat": {
+ "description": "Compat is the protocol-specific overlay for this model (flat object,\nfields depend on API). Decoded lazily by Resolve.",
+ "type": "object"
},
- "token_limit": {
- "description": "TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize\nas a character count.",
+ "context_window": {
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ConnectionConfig": {
- "type": "object",
- "properties": {
- "addr": {
- "description": "Common",
- "type": "string"
},
- "api_key": {
- "description": "AES-GCM encrypted",
- "type": "string"
+ "cost": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models.ModelCost"
},
- "database": {
- "description": "Database name used by engines that support database-level namespaces\n(currently Milvus, Tencent VectorDB, and Doris).",
- "type": "string"
+ "deprecated": {
+ "description": "Deprecated hides the entry from pickers but keeps resolution working.",
+ "type": "boolean"
},
- "grpc_address": {
- "description": "Weaviate",
- "type": "string"
+ "dimension": {
+ "description": "Dimension is the embedding vector width (embedding entries only).",
+ "type": "integer"
},
- "host": {
- "description": "Qdrant",
+ "id": {
"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"
- },
- "insecure_skip_verify": {
- "description": "InsecureSkipVerify disables TLS certificate verification when\ntalking to the backing store over HTTPS. Defaults to false\n(secure). Set to true ONLY for self-signed development clusters;\nproduction deployments should provide trusted certificates via\nthe system CA pool. Cross-driver applicable but currently only\nthe OpenSearch driver (Phase 3) reads this field. Note: this\ndiffers from the Qdrant-specific UseTLS below, which *enables*\nTLS on gRPC connections — InsecureSkipVerify only controls\n*verification* of an already-TLS connection.",
- "type": "boolean"
+ "input": {
+ "description": "Input lists accepted modalities: text, image, audio, video.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "password": {
- "description": "AES-GCM encrypted",
+ "match": {
+ "description": "Match is a case-insensitive glob (\"gpt-5*\", \"*deepseek-r1*\") that lets\none entry describe a family. Exact ids and aliases win over patterns;\namong patterns the longest literal prefix wins.",
"type": "string"
},
- "port": {
+ "max_output_tokens": {
"type": "integer"
},
- "scheme": {
+ "name": {
"type": "string"
},
- "use_default_connection": {
- "description": "Postgres",
- "type": "boolean"
- },
- "use_tls": {
+ "reasoning": {
+ "description": "Reasoning reports whether the model can emit thinking at all.",
"type": "boolean"
},
- "username": {
+ "source": {
+ "description": "Source is the documentation URL the facts were taken from.",
"type": "string"
},
- "version": {
- "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
- "type": "string"
+ "thinking_levels": {
+ "description": "ThinkingLevels maps protocol-neutral levels to vendor values; missing\nkeys inherit the vendor map. See api.ThinkingLevelMap.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap"
+ }
+ ]
+ },
+ "type": {
+ "description": "Type is the WeKnora model type this entry describes. Chat models with\nimage input are still KnowledgeQA; the UI derives VLM eligibility from\nInput. Embedding / Rerank / ASR entries exist for the model picker.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": {
+ "github_com_Tencent_WeKnora_internal_models_api.API": {
"type": "string",
"enum": [
- "sliding_window",
- "smart"
+ "openai-completions",
+ "openai-responses",
+ "anthropic-messages",
+ "google-generative-ai",
+ "ollama"
],
"x-enum-varnames": [
- "ContextCompressionSlidingWindow",
- "ContextCompressionSmart"
+ "APIOpenAICompletions",
+ "APIOpenAIResponses",
+ "APIAnthropicMessages",
+ "APIGoogleGenerativeAI",
+ "APIOllama"
]
},
- "github_com_Tencent_WeKnora_internal_types.ContextConfig": {
+ "github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort": {
+ "type": "string",
+ "enum": [
+ "off",
+ "auto",
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
+ "x-enum-varnames": [
+ "ReasoningOff",
+ "ReasoningAuto",
+ "ReasoningMinimal",
+ "ReasoningLow",
+ "ReasoningMedium",
+ "ReasoningHigh",
+ "ReasoningXHigh",
+ "ReasoningMax"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat": {
"type": "object",
"properties": {
- "compression_strategy": {
- "description": "Compression strategy: \"sliding_window\" or \"smart\"",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
- }
- ]
- },
- "max_tokens": {
- "description": "Maximum tokens allowed in LLM context",
+ "active": {
"type": "integer"
},
- "recent_message_count": {
- "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "limit": {
"type": "integer"
},
- "summarize_threshold": {
- "description": "Summarize threshold: number of messages before summarization",
+ "model_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "waiting": {
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
- "type": "object",
- "required": [
- "name"
+ "github_com_Tencent_WeKnora_internal_models_providers.AuthStyle": {
+ "type": "string",
+ "enum": [
+ "bearer",
+ "api-key",
+ "x-api-key",
+ "x-goog-api-key",
+ "none",
+ "signed"
],
+ "x-enum-varnames": [
+ "AuthBearer",
+ "AuthAPIKeyHeader",
+ "AuthXAPIKey",
+ "AuthGoogleAPIKey",
+ "AuthNone",
+ "AuthSigned"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_models_providers.CredentialLabel": {
+ "type": "object",
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
+ "hint": {
+ "description": "Hint is rendered under the input, for a warning the label cannot carry.",
+ "type": "string"
},
- "description": {
- "type": "string",
- "maxLength": 1000
+ "hints": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "invite_code_validity_days": {
- "description": "optional: 0=never, 1, 7, 30; default 7",
- "type": "integer"
+ "label": {
+ "type": "string"
},
- "member_limit": {
- "description": "optional: max members; 0=unlimited; default 50",
- "type": "integer"
+ "labels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.CredentialsConfig": {
- "type": "object",
- "properties": {
- "weknoracloud": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials"
+ "model_types": {
+ "description": "ModelTypes restricts the override; empty means every type.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ }
+ },
+ "placeholder": {
+ "type": "string"
+ },
+ "placeholders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "required": {
+ "description": "Required marks the credential mandatory even where the generic label\ncalls it optional.",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CubeEgressRule": {
+ "github_com_Tencent_WeKnora_internal_models_providers.ExtraField": {
"type": "object",
"properties": {
- "audit": {
- "description": "Audit is none | metadata | full. Empty uses the server default.",
+ "default": {
"type": "string"
},
- "deny": {
- "description": "Deny inverts the action, which defaults to allow. A deny rule still\nneeds Host or SNI: the target has to reach CubeEgress for it to answer\nwith a request-level 403 instead of the network layer dropping it.",
- "type": "boolean"
+ "key": {
+ "type": "string"
},
- "host": {
+ "label": {
"type": "string"
},
- "inject": {
- "description": "Inject adds credential headers on allowed HTTPS requests.",
+ "labels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "model_types": {
+ "description": "ModelTypes restricts the field to some model types; empty means all.",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeHeaderInject"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
}
},
- "methods": {
+ "options": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption"
}
},
- "name": {
+ "placeholder": {
"type": "string"
},
- "path": {
- "type": "string"
+ "placeholders": {
+ "description": "Placeholders carries localized variants of Placeholder.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "scheme": {
- "type": "string"
+ "required": {
+ "type": "boolean"
},
- "sni": {
+ "secret": {
+ "description": "Secret marks values that must never be echoed back to the UI.",
+ "type": "boolean"
+ },
+ "type": {
+ "description": "\"string\", \"number\", \"boolean\", \"select\", \"password\"",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CubeHeaderInject": {
+ "github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption": {
"type": "object",
"properties": {
- "format": {
+ "label": {
"type": "string"
},
- "header": {
- "type": "string"
+ "labels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "secret": {
+ "value": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CubeSandboxConfig": {
+ "github_com_Tencent_WeKnora_internal_models_runtime.Capabilities": {
"type": "object",
"properties": {
- "api_key": {
- "description": "加密",
- "type": "string"
+ "api": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
},
- "api_url": {
- "type": "string"
+ "cataloged": {
+ "type": "boolean"
},
- "cube_sandbox_ttl_seconds": {
+ "context_window": {
"type": "integer"
},
- "dns_servers": {
- "description": "DNSServers are Cube template nameserver IPs. Empty uses Cubelet's default.",
+ "input": {
"type": "array",
"items": {
"type": "string"
}
},
- "http_timeout_sec": {
- "description": "HTTPTimeoutSec bounds each HTTP call to the sandbox control plane.\n0 means use the built-in default (30s), never the deployment's value.",
+ "max_output_tokens": {
"type": "integer"
},
- "proxy_url": {
+ "max_tokens_field": {
"type": "string"
},
- "sandbox_domain": {
+ "provider": {
"type": "string"
},
- "template_id": {
+ "reasoning": {
+ "type": "boolean"
+ },
+ "thinking_format": {
"type": "string"
+ },
+ "thinking_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
+ "github_com_Tencent_WeKnora_internal_types.APIKeyScopeType": {
+ "type": "string",
+ "enum": [
+ "tenant",
+ "platform"
+ ],
+ "x-enum-varnames": [
+ "APIKeyScopeTenant",
+ "APIKeyScopePlatform"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.APIPrincipalMode": {
+ "type": "string",
+ "enum": [
+ "tenant",
+ "direct_header",
+ "signed_token"
+ ],
+ "x-enum-varnames": [
+ "APIPrincipalModeTenant",
+ "APIPrincipalModeDirect",
+ "APIPrincipalModeSignedToken"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ASRConfig": {
"type": "object",
"properties": {
- "agent_mode": {
- "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
- "type": "string"
+ "enabled": {
+ "type": "boolean"
},
- "agent_type": {
- "description": "AgentType is a preset category under smart-reasoning mode that pre-fills\nsystem prompt, allowed tools and recommended KB compatibility.\nValid values: \"rag-qa\", \"wiki-qa\", \"hybrid-rag-wiki\", \"custom\".\nEmpty / unknown values are treated as \"custom\" (no preset applied).\nIgnored for quick-answer mode.",
+ "language": {
+ "description": "optional: language hint for transcription",
"type": "string"
},
- "allowed_tools": {
- "description": "Allowed tools (only for agent type)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "model_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AdminCreateUserRequest": {
+ "type": "object",
+ "required": [
+ "email",
+ "username"
+ ],
+ "properties": {
+ "email": {
+ "type": "string"
},
- "asr_model_id": {
- "description": "ASR model ID for audio transcription (optional)",
+ "password": {
"type": "string"
},
- "attachment_image_understanding": {
- "description": "AttachmentImageUnderstanding enables VLM OCR fallback for image-only /\nscanned documents (PDF/PPT whose pages are images). Disabled by default\nbecause it materially increases parse latency; only triggers when the\nextracted text is below a threshold and a VLM model is configured.",
+ "username": {
+ "type": "string",
+ "maxLength": 50,
+ "minLength": 2
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentStep": {
+ "type": "object",
+ "properties": {
+ "intermediate_answer": {
+ "description": "IntermediateAnswer preserves a plain answer followed by a loop-end steer.\nThe canonical final answer is still stored in Message.Content.",
"type": "boolean"
},
- "attachment_ocr_max_pages": {
- "description": "AttachmentOCRMaxPages caps how many pages of a scanned / image-only\ndocument this agent sends to the VLM for OCR. 0 falls back to the global\ndefault (WEKNORA_CHAT_ATTACHMENT_OCR_MAX_PAGES). More pages means higher\ncoverage but slower parsing and more VLM cost.",
- "type": "integer"
- },
- "attachment_parse_wait_timeout_sec": {
- "description": "AttachmentParseWaitTimeoutSec bounds, in seconds, how long a chat turn\nwaits for this agent's still-parsing attachments before proceeding with\nonly the finished ones. 0 falls back to the global default\n(WEKNORA_CHAT_ATTACHMENT_WAIT_TIMEOUT_SEC).",
+ "iteration": {
+ "description": "Iteration number (0-indexed)",
"type": "integer"
},
- "audio_upload_enabled": {
- "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
- "type": "boolean"
+ "reasoning_content": {
+ "description": "ReasoningContent stores the OpenAI-protocol reasoning_content emitted by the\nmodel in this round. Persisted on AgentStep so cross-turn replay can put it\nback on the assistant message — required by MiMo / DeepSeek V3.2+ thinking\nmode, ignored by providers that don't recognize the field.",
+ "type": "string"
},
- "chat_parser_engine_rules": {
- "description": "===== Chat Attachment Parsing Settings =====\nChatParserEngineRules selects parser engines for session-scoped chat\nattachments by file type. Takes precedence over the tenant-level\nParserEngineConfig.ChatParserEngineRules; an explicit per-request\nparser_engine still overrides both.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
+ "reasoning_metadata": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ProviderMetadata"
},
- "citation_enabled": {
- "description": "Whether final answers include knowledge/web source citations. Nil defaults to true\nso agents saved before this option was introduced keep their existing behavior.",
- "type": "boolean"
+ "reasoning_signature": {
+ "description": "ReasoningSignature / ReasoningMetadata are the provider artifacts that\nmust accompany ReasoningContent on replay (Anthropic signatures,\nOpenAI Responses encrypted reasoning items).",
+ "type": "string"
},
- "context_template": {
- "description": "Context template for normal mode (how to format retrieved chunks)",
- "type": "string"
- },
- "context_template_id": {
- "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content is resolved at request time for saved agents.",
- "type": "string"
- },
- "data_analysis_enabled": {
- "description": "===== Data Analysis Settings =====\nWhether to run the legacy in-pipeline DuckDB SQL data-analysis stage when\nthe retrieved chunks include CSV/Excel files. This issues an extra LLM\ncall to generate a SQL query and is disabled by default because most\nquick-answer / RAG-style agents do not want the added latency.",
- "type": "boolean"
- },
- "embedding_top_k": {
- "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
- "type": "integer"
- },
- "enable_query_expansion": {
- "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
- "type": "boolean"
- },
- "enable_rewrite": {
- "description": "Whether to enable query rewrite for multi-turn conversations",
- "type": "boolean"
- },
- "fallback_prompt": {
- "description": "Fallback prompt (when FallbackStrategy is \"model\")",
- "type": "string"
- },
- "fallback_response": {
- "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
+ "thought": {
+ "description": "LLM's reasoning/thinking (Think phase)",
"type": "string"
},
- "fallback_strategy": {
- "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
+ "timestamp": {
+ "description": "When this step occurred",
"type": "string"
},
- "faq_direct_answer_threshold": {
- "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
- "type": "number"
- },
- "faq_priority_enabled": {
- "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
- "type": "boolean"
- },
- "faq_score_boost": {
- "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
- "type": "number"
- },
- "history_turns": {
- "description": "Number of history turns to keep in context. Quick-answer only; smart-reasoning sizes history by context window",
- "type": "integer"
- },
- "image_storage_provider": {
- "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\".\nEmpty means use the global/workspace default provider.",
- "type": "string"
+ "tool_calls": {
+ "description": "Tools called in this step (Act phase)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall"
+ }
},
- "image_upload_enabled": {
- "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "truncated": {
+ "description": "Truncated marks the round the completion-token cap cut off. It rides in\nthe agent_steps JSON so a reloaded, shared or re-opened conversation can\nstill show that the answer stops mid-sentence by design, rather than\nlooking finished. Live streaming carries the same fact on the answer\nevent; this is what survives the round trip.",
"type": "boolean"
},
- "intent_prompts": {
- "description": "IntentPrompts holds per-intent system prompt overrides for non-retrieval\nintents (greeting, chitchat, etc.). Empty values fall back to templates\nunder config/prompt_templates/intent_prompts.yaml.",
- "type": "object",
- "additionalProperties": {
+ "user_messages_before": {
+ "description": "UserMessagesBefore records consumed steer rows in delivery order, before\nthis model response. Unlike timestamps, this remains unambiguous on replay.",
+ "type": "array",
+ "items": {
"type": "string"
}
- },
- "kb_selection_mode": {
- "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
- "type": "string"
- },
- "keyword_threshold": {
- "description": "Keyword retrieval threshold",
- "type": "number"
- },
- "knowledge_bases": {
- "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentTypeKBFilter": {
+ "type": "object",
+ "properties": {
+ "all_of": {
+ "description": "AllOf: KB must expose ALL of these capability flags.",
"type": "array",
"items": {
"type": "string"
}
},
- "llm_call_timeout": {
- "description": "Timeout for a single LLM call in seconds (0 = use global default)",
- "type": "integer"
- },
- "max_completion_tokens": {
- "description": "Maximum completion tokens. Quick-answer uses this for the RAG answer.\nSmart-reasoning ReAct rounds send this value as-is (zero becomes\nDefaultMaxCompletionTokens at call time: 4096, or 24576 with a sandbox).",
- "type": "integer"
- },
- "max_iterations": {
- "description": "===== Agent Mode Settings =====\nMaximum iterations for the ReAct loop. Zero is unset (filled with a\ndefault). A negative value is unlimited: the loop runs until the model\nstops, the user cancels, or another guard fires.",
- "type": "integer"
- },
- "mcp_auth_wait_timeout": {
- "description": "MCPAuthWaitTimeout is how many seconds to wait for in-conversation OAuth\nauthorization before skipping. \u003c=0 uses the gate's configured timeout.",
- "type": "integer"
- },
- "mcp_selection_mode": {
- "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
- "type": "string"
- },
- "mcp_services": {
- "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "any_of": {
+ "description": "AnyOf: KB must expose at least ONE of these capability flags.",
"type": "array",
"items": {
"type": "string"
}
},
- "memory_enabled": {
- "description": "Whether this agent may read the user's long-term memory. Nil inherits\nthe workspace setting; false opts a single agent out of memory even when\nthe workspace has it on. There is no \"on\" that overrides the workspace.",
- "type": "boolean"
- },
- "model_id": {
- "description": "===== Model Settings =====\nModel ID to use for conversations",
- "type": "string"
+ "none_of": {
+ "description": "NoneOf: KB must expose NONE of these capability flags.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentTypePresetConfig": {
+ "type": "object",
+ "properties": {
+ "allowed_tools": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "multi_turn_enabled": {
- "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
+ "faq_priority_enabled": {
"type": "boolean"
},
- "query_understand_model_id": {
- "description": "Dedicated chat model ID for the query-understanding (rewrite + intent) step.\nWhen empty, the main conversation ModelID is used as a fallback.",
- "type": "string"
- },
- "question_suggestions": {
- "description": "===== Conversation Question Suggestions =====\nQuestionSuggestions owns both the static/knowledge-backed prompts shown\nbefore the first user turn and the contextual follow-up questions shown\nafter a completed assistant answer.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig"
- }
- ]
- },
- "reasoning_effort": {
- "description": "ReasoningEffort selects the thinking intensity (off | auto | minimal |\nlow | medium | high | xhigh | max). Empty keeps the boolean Thinking\nsemantics: true means \"auto\". See internal/models/api.ReasoningEffort.",
- "type": "string"
- },
- "rerank_model_id": {
- "description": "ReRank model ID for retrieval",
+ "kb_selection_mode": {
+ "description": "KBSelectionMode presets the KB picker mode: \"all\" | \"selected\" | \"none\".\nWhen empty, the user's current value stays untouched.",
"type": "string"
},
- "rerank_threshold": {
- "description": "Rerank threshold",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "Rerank top K",
+ "max_iterations": {
"type": "integer"
},
"retain_retrieval_history": {
- "description": "Whether to retain retrieval history across turns",
- "type": "boolean"
- },
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
"type": "boolean"
},
- "rewrite_prompt_system": {
- "description": "Rewrite prompt system message",
- "type": "string"
- },
- "rewrite_prompt_user": {
- "description": "Rewrite prompt user message template",
- "type": "string"
- },
- "sandbox_config_id": {
- "description": "===== Sandbox Settings =====\nSandboxConfigID selects which workspace sandbox config this agent's\nskill scripts run on. Empty means sandbox execution is disabled.\n\nThis references the LOGICAL config, never a specific revision: keeping\nthe indirection here is what would let credential rotation happen\nwithout re-pointing every agent (see the spec's §4.8).",
- "type": "string"
- },
- "selected_skills": {
- "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "skills_selection_mode": {
- "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all installed skills, \"selected\" = specific skills, \"none\" = no skills",
- "type": "string"
- },
"supported_file_types": {
- "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
"type": "array",
"items": {
"type": "string"
}
},
- "system_prompt": {
- "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
- "type": "string"
- },
"system_prompt_id": {
- "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content is resolved at request time for saved agents.",
"type": "string"
},
"temperature": {
- "description": "Temperature for LLM (0-1)",
"type": "number"
},
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "web_search_enabled": {
"type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentTypePresetEntry": {
+ "type": "object",
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetConfig"
},
- "vector_threshold": {
- "description": "Vector retrieval threshold",
- "type": "number"
+ "i18n": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n"
+ }
},
- "vlm_model_id": {
- "description": "VLM model ID for image analysis (optional, falls back to workspace-level VLM)",
+ "id": {
"type": "string"
},
- "web_fetch_enabled": {
- "description": "Whether to auto-fetch full page content for reranked web search results",
- "type": "boolean"
- },
- "web_fetch_top_n": {
- "description": "Max number of pages to fetch after rerank (default: 3)",
- "type": "integer"
- },
- "web_search_enabled": {
- "description": "===== Web Search Settings =====\nWhether web search is enabled",
- "type": "boolean"
- },
- "web_search_max_results": {
- "description": "Maximum web search results",
- "type": "integer"
+ "kb_filter": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypeKBFilter"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
},
- "web_search_provider_id": {
- "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the workspace's default provider (is_default=true) is used.",
+ "label": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.DataSource": {
+ "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": {
+ "type": "string",
+ "enum": [
+ "all",
+ "random"
+ ],
+ "x-enum-varnames": [
+ "AnswerStrategyAll",
+ "AnswerStrategyRandom"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.AttrSpec": {
"type": "object",
"properties": {
- "config": {
- "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "consumers": {
+ "description": "downstream steps that read this attribute",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
},
- "conflict_strategy": {
- "description": "Conflict resolution strategy: overwrite or skip",
+ "description": {
+ "description": "one line explaining what the attribute measures",
"type": "string"
},
- "created_at": {
- "description": "Creation timestamp",
+ "label": {
+ "description": "human-readable name for the settings panel",
"type": "string"
},
- "deleted_at": {
- "description": "Soft delete timestamp",
+ "name": {
+ "description": "stable key, e.g. \"contain.text\"",
+ "type": "string"
+ },
+ "question": {
+ "description": "sentence shown to the model in the describe round",
+ "type": "string"
+ },
+ "type": {
+ "description": "extent | presence",
"allOf": [
{
- "$ref": "#/definitions/gorm.DeletedAt"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AttrType"
}
]
},
- "error_message": {
- "description": "Error message if status is \"error\"",
+ "values": {
+ "description": "ordered low-\u003ehigh for extent attrs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AttrValue"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AttrType": {
+ "type": "string",
+ "enum": [
+ "extent",
+ "presence"
+ ],
+ "x-enum-varnames": [
+ "AttrTypeExtent",
+ "AttrTypePresence"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.AttrValue": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "description": "sentence explaining the value",
"type": "string"
},
- "id": {
- "description": "Unique identifier",
+ "label": {
+ "description": "short on-screen name",
"type": "string"
},
- "knowledge_base_id": {
- "description": "Target knowledge base ID",
+ "value": {
+ "description": "raw machine value, never localized",
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AuditAction": {
+ "type": "string",
+ "enum": [
+ "rbac.member_added",
+ "rbac.member_removed",
+ "rbac.member_role_changed",
+ "rbac.member_left",
+ "rbac.access_denied",
+ "rbac.invitation_sent",
+ "rbac.invitation_accepted",
+ "rbac.invitation_declined",
+ "rbac.invitation_revoked",
+ "rbac.invitation_expired",
+ "vector_store.created",
+ "vector_store.updated",
+ "vector_store.deleted",
+ "opensearch.index_created",
+ "opensearch.index_deleted",
+ "opensearch.reindex_executed",
+ "system.setting_changed",
+ "system.admin_promoted",
+ "system.admin_revoked",
+ "system.user_password_reset",
+ "system.user_created",
+ "system.api_key_created",
+ "system.api_key_revoked",
+ "system.queue_task_retried",
+ "system.queue_task_deleted",
+ "system.queue_task_run_now",
+ "system.queue_task_cancelled",
+ "system.queue_archived_purged",
+ "kb.created",
+ "kb.updated",
+ "kb.deleted",
+ "kb.duplicated",
+ "kb.clone_started",
+ "kb.clone_completed",
+ "kb.clone_failed",
+ "knowledge.created",
+ "knowledge.updated",
+ "knowledge.deleted",
+ "knowledge.batch_deleted",
+ "knowledge.reparse_started",
+ "knowledge.parse_canceled",
+ "knowledge.move_started",
+ "knowledge.move_completed",
+ "knowledge.move_failed",
+ "tag.created",
+ "tag.updated",
+ "tag.deleted",
+ "datasource.created",
+ "datasource.updated",
+ "datasource.deleted",
+ "datasource.sync_started",
+ "datasource.sync_completed",
+ "datasource.sync_failed",
+ "datasource.paused",
+ "datasource.resumed",
+ "kb.share_added",
+ "kb.share_permission_changed",
+ "kb.share_removed",
+ "wiki.content_changed",
+ "faq.import_started",
+ "faq.import_completed",
+ "faq.import_failed"
+ ],
+ "x-enum-varnames": [
+ "AuditActionMemberAdded",
+ "AuditActionMemberRemoved",
+ "AuditActionMemberRoleChanged",
+ "AuditActionMemberLeft",
+ "AuditActionAccessDenied",
+ "AuditActionInvitationSent",
+ "AuditActionInvitationAccepted",
+ "AuditActionInvitationDeclined",
+ "AuditActionInvitationRevoked",
+ "AuditActionInvitationExpired",
+ "AuditActionVectorStoreCreated",
+ "AuditActionVectorStoreUpdated",
+ "AuditActionVectorStoreDeleted",
+ "AuditActionOpenSearchIndexCreated",
+ "AuditActionOpenSearchIndexDeleted",
+ "AuditActionOpenSearchReindexExecuted",
+ "AuditActionSystemSettingChanged",
+ "AuditActionSystemAdminPromoted",
+ "AuditActionSystemAdminRevoked",
+ "AuditActionSystemUserPasswordReset",
+ "AuditActionSystemUserCreated",
+ "AuditActionSystemAPIKeyCreated",
+ "AuditActionSystemAPIKeyRevoked",
+ "AuditActionSystemQueueTaskRetried",
+ "AuditActionSystemQueueTaskDeleted",
+ "AuditActionSystemQueueTaskRunNow",
+ "AuditActionSystemQueueTaskCancelled",
+ "AuditActionSystemQueueArchivedPurged",
+ "AuditActionKBCreated",
+ "AuditActionKBUpdated",
+ "AuditActionKBDeleted",
+ "AuditActionKBDuplicated",
+ "AuditActionKBCloneStarted",
+ "AuditActionKBCloneCompleted",
+ "AuditActionKBCloneFailed",
+ "AuditActionKnowledgeCreated",
+ "AuditActionKnowledgeUpdated",
+ "AuditActionKnowledgeDeleted",
+ "AuditActionKnowledgeBatchDeleted",
+ "AuditActionKnowledgeReparseStarted",
+ "AuditActionKnowledgeParseCanceled",
+ "AuditActionKnowledgeMoveStarted",
+ "AuditActionKnowledgeMoveCompleted",
+ "AuditActionKnowledgeMoveFailed",
+ "AuditActionTagCreated",
+ "AuditActionTagUpdated",
+ "AuditActionTagDeleted",
+ "AuditActionDataSourceCreated",
+ "AuditActionDataSourceUpdated",
+ "AuditActionDataSourceDeleted",
+ "AuditActionDataSourceSyncStarted",
+ "AuditActionDataSourceSyncCompleted",
+ "AuditActionDataSourceSyncFailed",
+ "AuditActionDataSourcePaused",
+ "AuditActionDataSourceResumed",
+ "AuditActionKBShareAdded",
+ "AuditActionKBSharePermissionChanged",
+ "AuditActionKBShareRemoved",
+ "AuditActionWikiContentChanged",
+ "AuditActionFAQImportStarted",
+ "AuditActionFAQImportCompleted",
+ "AuditActionFAQImportFailed"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.AuditLog": {
+ "type": "object",
+ "properties": {
+ "action": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AuditAction"
},
- "last_sync_at": {
- "description": "Last successful sync timestamp",
+ "actor_role": {
"type": "string"
},
- "last_sync_cursor": {
- "description": "Cursor or state for incremental sync (connector-specific)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "last_sync_result": {
- "description": "Summary of last sync result",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "latest_sync_log": {
- "description": "Latest sync log (not stored in DB, populated on query)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
- }
- ]
- },
- "name": {
- "description": "User-friendly name",
+ "actor_user_id": {
"type": "string"
},
- "status": {
- "description": "Current status: active, paused, error",
+ "created_at": {
"type": "string"
},
- "sync_deletions": {
- "description": "Whether to sync deletions from source",
- "type": "boolean"
+ "details": {
+ "type": "object"
},
- "sync_log_retention_days": {
- "description": "Number of days to keep sync logs (default: 30)",
+ "id": {
"type": "integer"
},
- "sync_mode": {
- "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
- "type": "string"
+ "outcome": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AuditOutcome"
},
- "sync_schedule": {
- "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
+ "request_method": {
"type": "string"
},
- "tenant_id": {
- "description": "Workspace ID for multi-workspace isolation",
- "type": "integer"
+ "request_path": {
+ "type": "string"
},
- "total_items_synced": {
- "description": "Total items synced (not stored in DB, calculated on query)",
- "type": "integer"
+ "scope_id": {
+ "type": "string"
},
- "type": {
- "description": "Connector type (feishu, notion, confluence, etc.)",
+ "scope_type": {
"type": "string"
},
- "updated_at": {
- "description": "Last update timestamp",
+ "target_id": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.DockerSandboxConfig": {
- "type": "object",
- "properties": {
- "cpu_limit": {
- "description": "CPULimit is the number of CPU cores one sandbox may use. 0 uses the\nbuilt-in default.",
- "type": "number"
},
- "host": {
- "description": "Host is the daemon endpoint in DOCKER_HOST form. Empty means the local\nunix socket.",
+ "target_type": {
"type": "string"
},
- "http_timeout_sec": {
- "description": "HTTPTimeoutSec bounds each Engine API call. 0 uses the built-in default.",
- "type": "integer"
+ "target_user_id": {
+ "type": "string"
},
- "idle_ttl_seconds": {
- "description": "IdleTTLSeconds is how long a session container may go unused before it\nis reclaimed. The daemon has no idle timeout of its own, so this is what\nstops an abandoned session from pinning host memory indefinitely.",
+ "tenant_id": {
"type": "integer"
- },
- "image": {
- "type": "string"
- },
- "memory_limit_mb": {
- "description": "MemoryLimitMB caps one sandbox's memory. 0 uses the built-in default.",
- "type": "integer"
- },
- "network_mode": {
- "description": "NetworkMode is the Docker network sandboxes join: \"bridge\" (default) or\n\"none\" for no egress. Nothing else is accepted — host and container:\nmodes share another namespace outright, and a named network is usually\nthe deployment's own compose network, which would put the sandbox next\nto Postgres and Redis.",
- "type": "string"
- },
- "pids_limit": {
- "description": "PidsLimit caps how many processes one sandbox may run. 0 uses the\nbuilt-in default.",
- "type": "integer"
- },
- "runtime": {
- "description": "Runtime selects an alternative OCI runtime such as \"runsc\" (gVisor).\nEmpty uses the daemon default.",
- "type": "string"
- },
- "tls_cert_path": {
- "description": "TLSCertPath is a directory on the WeKnora host containing ca.pem,\ncert.pem and key.pem. Required when Host is a TCP endpoint.",
- "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.E2BHostRule": {
+ "github_com_Tencent_WeKnora_internal_types.AuditOutcome": {
+ "type": "string",
+ "enum": [
+ "success",
+ "accepted",
+ "denied",
+ "failed",
+ "partial",
+ "canceled"
+ ],
+ "x-enum-varnames": [
+ "AuditOutcomeSuccess",
+ "AuditOutcomeAccepted",
+ "AuditOutcomeDenied",
+ "AuditOutcomeFailed",
+ "AuditOutcomePartial",
+ "AuditOutcomeCanceled"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.AutoTagConfig": {
"type": "object",
"properties": {
- "headers": {
- "description": "Headers values are credentials and are encrypted at rest; names stay\nreadable so operators can see which headers are injected.",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "enabled": {
+ "type": "boolean"
},
- "host": {
+ "max_tags": {
+ "type": "integer"
+ },
+ "model_id": {
"type": "string"
+ },
+ "skip_if_tagged": {
+ "description": "SkipIfTagged leaves documents that already carry tags untouched, so a\ndeliberate manual classification is not diluted by model guesses. It is\na pointer because the default is true: rows written before this field\nexisted decode to nil and must not silently flip to \"always append\".",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.E2BSandboxConfig": {
+ "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": {
"type": "object",
"properties": {
- "api_key": {
- "description": "加密",
+ "app_id": {
"type": "string"
},
- "api_url": {
+ "bucket_name": {
"type": "string"
},
- "e2b_sandbox_ttl_seconds": {
- "type": "integer"
+ "path_prefix": {
+ "type": "string"
},
- "http_timeout_sec": {
- "description": "HTTPTimeoutSec bounds each HTTP call to the sandbox control plane.\n0 means use the built-in default (30s), never the deployment's value.",
- "type": "integer"
+ "region": {
+ "type": "string"
},
- "proxy_url": {
- "description": "ProxyURL is the data-plane gateway that fronts envd. E2B Cloud resolves\n\"\u003cport\u003e-\u003csandboxID\u003e.\u003csandbox_domain\u003e\" through public DNS and TLS, so it\nneeds no value here. Self-hosted E2B-compatible control planes usually\nserve every sandbox from one gateway address and expect the sandbox\nauthority in the Host header; setting this makes WeKnora dial the\ngateway directly instead of requiring wildcard DNS and a certificate\nfor the sandbox domain. An \"http://\" gateway also downgrades the\ndata-plane scheme, which the E2B SDK otherwise pins to https.",
+ "secret_id": {
"type": "string"
},
- "sandbox_domain": {
+ "secret_key": {
"type": "string"
},
- "template_id": {
+ "temp_bucket_name": {
+ "type": "string"
+ },
+ "temp_region": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": {
+ "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": {
"type": "object",
"properties": {
- "dimension": {
- "type": "integer"
+ "embedding_model_id": {
+ "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
+ "type": "string"
},
- "supports_dimension_override": {
+ "enabled": {
+ "description": "Enabled controls whether chat history indexing is active",
"type": "boolean"
},
- "truncate_prompt_tokens": {
- "type": "integer"
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ChatHistoryKBStats": {
"type": "object",
"properties": {
- "custom_instructions": {
- "description": "CustomInstructions adds domain-specific extraction guidance while the\nsystem keeps ownership of the structured graph output protocol.",
+ "embedding_model_id": {
+ "description": "ID of the embedding model used",
"type": "string"
},
"enabled": {
+ "description": "Whether the chat history KB is configured and enabled",
"type": "boolean"
},
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
- }
+ "has_indexed_messages": {
+ "description": "Whether there are any indexed messages (used by frontend to lock embedding model)",
+ "type": "boolean"
},
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
- }
+ "indexed_message_count": {
+ "description": "Number of indexed message entries (Knowledge count)",
+ "type": "integer"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base used for chat history",
+ "type": "string"
},
- "text": {
+ "knowledge_base_name": {
+ "description": "Name of the knowledge base",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": {
+ "github_com_Tencent_WeKnora_internal_types.ChatManage": {
"type": "object",
- "required": [
- "entries"
- ],
"properties": {
- "dry_run": {
- "description": "仅验证,不实际导入",
- "type": "boolean"
- },
- "entries": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
- }
- },
- "knowledge_id": {
+ "chat_model_id": {
+ "description": "Chat model parameters",
"type": "string"
},
- "mode": {
- "type": "string",
- "enum": [
- "append",
- "replace"
- ]
+ "citation_enabled": {
+ "description": "CitationEnabled controls only final knowledge/web source citations. Nil\ndefaults to true for requests and agents created before this option existed.",
+ "type": "boolean"
},
- "task_id": {
- "description": "可选,如果不传则自动生成UUID",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQConfig": {
- "type": "object",
- "properties": {
- "index_mode": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
+ "disable_keywords_match": {
+ "type": "boolean"
},
- "question_index_mode": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": {
- "type": "object",
- "properties": {
- "by_id": {
- "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
- }
+ "disable_vector_match": {
+ "description": "DisableVectorMatch / DisableKeywordsMatch turn off one recall path for\nevery search target. Set by the knowledge-search API.",
+ "type": "boolean"
},
- "by_tag": {
- "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
- }
+ "embedding_top_k": {
+ "type": "integer"
},
- "exclude_ids": {
- "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": {
- "type": "object",
- "properties": {
- "is_enabled": {
+ "enable_query_expansion": {
"type": "boolean"
},
- "is_recommended": {
+ "enable_rewrite": {
+ "description": "Rewrite parameters",
"type": "boolean"
},
- "tag_id": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": {
- "type": "object",
- "required": [
- "standard_question"
- ],
- "properties": {
- "answer_strategy": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
+ "fallback_prompt": {
+ "type": "string"
},
- "answers": {
+ "fallback_response": {
+ "type": "string"
+ },
+ "fallback_strategy": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy"
+ },
+ "history": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.History"
}
},
- "id": {
- "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
- "type": "integer"
- },
- "is_enabled": {
- "type": "boolean"
+ "intent": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QueryIntent"
},
- "is_recommended": {
- "type": "boolean"
+ "keyword_threshold": {
+ "type": "number"
},
- "negative_questions": {
+ "knowledge_base_ids": {
+ "description": "Knowledge base retrieval parameters",
"type": "array",
"items": {
"type": "string"
}
},
- "similar_questions": {
+ "knowledge_ids": {
"type": "array",
"items": {
"type": "string"
}
},
- "standard_question": {
+ "max_rounds": {
+ "type": "integer"
+ },
+ "query": {
"type": "string"
},
- "tag_id": {
- "type": "integer"
+ "query_understand_model_id": {
+ "description": "QueryUnderstandModelID, when set, overrides the chat model used for\nthe query-understanding (rewrite + intent classification) stage only.\nEmpty means fall back to ChatModelID.",
+ "type": "string"
},
- "tag_name": {
+ "rerank_model_id": {
+ "description": "Rerank parameters",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": {
- "type": "string",
- "enum": [
- "question_only",
- "question_answer"
- ],
- "x-enum-varnames": [
- "FAQIndexModeQuestionOnly",
- "FAQIndexModeQuestionAnswer"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": {
- "type": "string",
- "enum": [
- "combined",
- "separate"
- ],
- "x-enum-varnames": [
- "FAQQuestionIndexModeCombined",
- "FAQQuestionIndexModeSeparate"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": {
- "type": "object",
- "required": [
- "query_text"
- ],
- "properties": {
- "first_priority_tag_ids": {
- "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
- "type": "array",
- "items": {
- "type": "integer"
- }
},
- "match_count": {
+ "rerank_threshold": {
+ "type": "number"
+ },
+ "rerank_top_k": {
"type": "integer"
},
- "only_recommended": {
- "description": "是否仅返回推荐的条目",
- "type": "boolean"
+ "rewrite_prompt_system": {
+ "type": "string"
},
- "query_text": {
+ "rewrite_prompt_user": {
"type": "string"
},
- "second_priority_tag_ids": {
- "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "rewrite_query": {
+ "type": "string"
+ },
+ "session_id": {
+ "type": "string"
+ },
+ "summary_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig"
+ },
+ "user_id": {
+ "type": "string"
+ },
+ "vector_database": {
+ "type": "string"
},
"vector_threshold": {
"type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig": {
+ "github_com_Tencent_WeKnora_internal_types.Chunk": {
"type": "object",
"properties": {
- "additional_instruction": {
+ "chunk_index": {
+ "description": "Index position of the chunk in the original document",
+ "type": "integer"
+ },
+ "chunk_type": {
+ "description": "Chunk 类型,用于区分不同类型的 Chunk",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkType"
+ }
+ ]
+ },
+ "content": {
+ "description": "Actual text content of the chunk",
"type": "string"
},
- "allow_regenerate": {
- "type": "boolean"
+ "content_hash": {
+ "description": "ContentHash 存储内容的 hash 值,用于快速匹配(主要用于 FAQ)",
+ "type": "string"
},
- "categories": {
+ "content_revision": {
+ "description": "ContentRevision is incremented for every user edit or rollback.",
+ "type": "integer"
+ },
+ "created_at": {
+ "description": "Chunk creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete marker, supports data recovery",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "end_at": {
+ "description": "Ending character position in the original text",
+ "type": "integer"
+ },
+ "flags": {
+ "description": "Flags 存储多个布尔状态的位标志(如推荐状态等)\n默认值为 ChunkFlagRecommended (1),表示默认可推荐",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkFlags"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the chunk, using UUID format",
+ "type": "string"
+ },
+ "image_info": {
+ "description": "图片信息,存储为 JSON",
+ "type": "string"
+ },
+ "index_status": {
+ "description": "IndexStatus reports whether the current content is reflected in the\nretrieval stores: ready | processing | failed.",
+ "type": "string"
+ },
+ "indirect_relation_chunks": {
+ "description": "间接关系 Chunk ID,用于关联间接关系 Chunk 和原始文本 Chunk",
"type": "array",
"items": {
"type": "string"
}
},
- "count": {
- "type": "integer"
- },
- "enabled": {
+ "is_enabled": {
+ "description": "Whether the chunk is enabled, can be used to temporarily disable certain chunks",
"type": "boolean"
},
- "knowledge_fallback": {
- "type": "boolean"
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base, for quick location",
+ "type": "string"
},
- "max_context_turns": {
- "type": "integer"
+ "knowledge_id": {
+ "description": "ID of the parent knowledge, associated with the Knowledge model",
+ "type": "string"
},
- "mode": {
+ "last_editor_id": {
+ "description": "LastEditorID records the actor that produced the current revision.",
"type": "string"
},
- "model_id": {
+ "metadata": {
+ "description": "Metadata 存储 chunk 级别的扩展信息,例如 FAQ 元数据",
+ "type": "object"
+ },
+ "next_chunk_id": {
+ "description": "Next chunk ID",
"type": "string"
},
- "suppress_on_fallback": {
- "type": "boolean"
+ "parent_chunk_id": {
+ "description": "父 Chunk ID,用于关联图片 Chunk 和原始文本 Chunk",
+ "type": "string"
},
- "suppress_when_answer_asks_question": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.GalleryUserPrefs": {
- "type": "object",
- "properties": {
- "mode": {
- "description": "Mode is \"all\" (every search-eligible field active) or \"custom\"\n(per-field Status governs). Empty = \"all\".",
+ "pre_chunk_id": {
+ "description": "Previous chunk ID",
"type": "string"
},
- "status": {
- "description": "Status maps a namespaced attribute id (\"builtin:caption\") to\n\"on\"/\"off\". Only consulted in custom mode; an unrecorded field is\noff. Source-declared on/off does not exist — activation is always\nthe user's own record.",
- "type": "object",
- "additionalProperties": {
+ "relation_chunks": {
+ "description": "关系 Chunk ID,用于关联关系 Chunk 和原始文本 Chunk",
+ "type": "array",
+ "items": {
"type": "string"
}
+ },
+ "seq_id": {
+ "description": "SeqID is an auto-increment integer ID for external API usage (FAQ entries)",
+ "type": "integer"
+ },
+ "source_locators": {
+ "description": "SourceLocators point back into the original file (page and region,\nslide, sheet rows, ...) so citations can open the file at this chunk.\nEmpty when the parser reported no positions.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SourceLocator"
+ }
+ },
+ "start_at": {
+ "description": "Starting character position in the original text",
+ "type": "integer"
+ },
+ "status": {
+ "description": "Status of the chunk",
+ "type": "integer"
+ },
+ "tag_id": {
+ "description": "Optional tag ID for categorization within a knowledge base (used for FAQ)",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant ID, used for multi-tenant isolation",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Chunk last update time",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.GraphNode": {
+ "github_com_Tencent_WeKnora_internal_types.ChunkFlags": {
+ "type": "integer",
+ "enum": [
+ 1
+ ],
+ "x-enum-varnames": [
+ "ChunkFlagRecommended"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ChunkType": {
+ "type": "string",
+ "enum": [
+ "text",
+ "parent_text",
+ "image_ocr",
+ "image_caption",
+ "image_vector",
+ "entity",
+ "relationship",
+ "faq",
+ "web_search",
+ "table_summary",
+ "table_column",
+ "wiki_page"
+ ],
+ "x-enum-varnames": [
+ "ChunkTypeText",
+ "ChunkTypeParentText",
+ "ChunkTypeImageOCR",
+ "ChunkTypeImageCaption",
+ "ChunkTypeImageVector",
+ "ChunkTypeEntity",
+ "ChunkTypeRelationship",
+ "ChunkTypeFAQ",
+ "ChunkTypeWebSearch",
+ "ChunkTypeTableSummary",
+ "ChunkTypeTableColumn",
+ "ChunkTypeWikiPage"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": {
"type": "object",
"properties": {
- "attributes": {
+ "child_chunk_size": {
+ "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
+ },
+ "chunk_overlap": {
+ "description": "Chunk overlap",
+ "type": "integer"
+ },
+ "chunk_size": {
+ "description": "Chunk size",
+ "type": "integer"
+ },
+ "enable_parent_child": {
+ "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
+ "type": "boolean"
+ },
+ "languages": {
+ "description": "Languages hints the heuristic patterns. Empty = auto-detect from content.\nExamples: [\"de\"], [\"en\", \"zh\"].",
"type": "array",
"items": {
"type": "string"
}
},
- "chunks": {
+ "parent_chunk_size": {
+ "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
+ },
+ "parser_engine_rules": {
+ "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, DefaultParserEngine is used (builtin/simple routing, except\ntypes that only a specific engine can parse: ppt/pptx fall back to\nmarkitdown). A linked anydoc binding is preferred for every type it\nconverts.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "description": "Separators",
"type": "array",
"items": {
"type": "string"
}
},
- "name": {
+ "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"
+ },
+ "table_metadata_instructions": {
+ "description": "TableMetadataInstructions contains optional business guidance used when\ngenerating searchable summaries for CSV/Excel tables. The system-owned\noutput contract remains fixed; these instructions only add domain context.",
+ "type": "string"
+ },
+ "token_limit": {
+ "description": "TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize\nas a character count.",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.GraphRelation": {
+ "github_com_Tencent_WeKnora_internal_types.ConnectionConfig": {
"type": "object",
"properties": {
- "node1": {
+ "addr": {
+ "description": "Common",
"type": "string"
},
- "node2": {
+ "api_key": {
+ "description": "AES-GCM encrypted",
"type": "string"
},
- "type": {
+ "database": {
+ "description": "Database name used by engines that support database-level namespaces\n(currently Milvus, Tencent VectorDB, and Doris).",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ImageActionsConfig": {
- "type": "object",
- "properties": {
- "ocr": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageOCRAction"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ImageAttrCondition": {
- "type": "object",
- "properties": {
- "is": {
+ },
+ "grpc_address": {
+ "description": "Weaviate",
"type": "string"
},
- "prop": {
+ "host": {
+ "description": "Qdrant",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ImageOCRAction": {
- "type": "object",
- "properties": {
- "on": {
- "description": "On is the list of attribute conditions that enable OCR. Matching any one\nturns OCR on.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAttrCondition"
- }
},
- "on_unobserved": {
- "description": "OnUnobserved is the OCR decision used when the observation does not\nanswer for one of the attributes the policy reads — the attribute is\nabsent because the model skipped the line, or because the value it wrote\nwas not one of the allowed ones. The default is true: an incomplete\nobservation keeps extracting, so a missed block of text costs one extra\ncall instead of being lost. Turn it off only with a model reliable enough\nto answer every attribute line.",
+ "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"
+ },
+ "insecure_skip_verify": {
+ "description": "InsecureSkipVerify disables TLS certificate verification when\ntalking to the backing store over HTTPS. Defaults to false\n(secure). Set to true ONLY for self-signed development clusters;\nproduction deployments should provide trusted certificates via\nthe system CA pool. Cross-driver applicable but currently only\nthe OpenSearch driver (Phase 3) reads this field. Note: this\ndiffers from the Qdrant-specific UseTLS below, which *enables*\nTLS on gRPC connections — InsecureSkipVerify only controls\n*verification* of an already-TLS connection.",
+ "type": "boolean"
+ },
+ "password": {
+ "description": "AES-GCM encrypted",
+ "type": "string"
+ },
+ "port": {
+ "type": "integer"
+ },
+ "scheme": {
+ "type": "string"
+ },
+ "use_default_connection": {
+ "description": "Postgres",
+ "type": "boolean"
+ },
+ "use_tls": {
"type": "boolean"
+ },
+ "username": {
+ "type": "string"
+ },
+ "version": {
+ "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": {
+ "type": "string",
+ "enum": [
+ "sliding_window",
+ "smart"
+ ],
+ "x-enum-varnames": [
+ "ContextCompressionSlidingWindow",
+ "ContextCompressionSmart"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ContextConfig": {
"type": "object",
"properties": {
- "image_actions": {
- "description": "ImageActions overrides the built-in attribute→work table (see\nDefaultImageActions). A nil value keeps the conservative default: run OCR\nfor block text, data visuals, and unobserved images.",
+ "compression_strategy": {
+ "description": "Compression strategy: \"sliding_window\" or \"smart\"",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
}
]
},
- "image_attrs_enabled": {
- "description": "ImageAttrsEnabled turns the attribute-observed image pipeline on for this\nknowledge base. It is off by default on purpose, so upgrading an\nexisting deployment never changes what happens to documents already\nbeing ingested: with it off every image is described and OCR'd exactly\nas before. When on, the describe round also observes image attributes and\nthe attribute policy decides whether OCR runs for it. A single upload can\noverride it per document through\nKnowledgeProcessOverrides.ImageAttrsEnabled.",
- "type": "boolean"
+ "max_tokens": {
+ "description": "Maximum tokens allowed in LLM context",
+ "type": "integer"
},
- "image_vector_enabled": {
- "description": "ImageVectorEnabled lets a knowledge base whose embedding model takes\nimages index each image by its own vector and recall it with one. It\nis off by default on purpose: a model that takes images is also used\nfor plain text, and turning this on costs an embedding call per image\nand widens vector recall. Existing knowledge bases stay off after an\nupgrade because the stored JSON has no such key.",
- "type": "boolean"
+ "recent_message_count": {
+ "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "type": "integer"
},
- "model_id": {
- "description": "Model ID",
- "type": "string"
+ "summarize_threshold": {
+ "description": "Summarize threshold: number of messages before summarization",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.IndexConfig": {
+ "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
"type": "object",
+ "required": [
+ "name"
+ ],
"properties": {
- "buckets_num": {
- "description": "Doris: number of buckets per table (DISTRIBUTED BY HASH ... BUCKETS N)",
- "type": "integer"
- },
- "collection_name": {
- "description": "Milvus",
- "type": "string"
- },
- "collection_prefix": {
- "description": "Qdrant, Weaviate",
- "type": "string"
- },
- "desired_shard_count": {
- "description": "Weaviate: number of shards per collection",
- "type": "integer"
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "hnsw_ef_construction": {
- "description": "OpenSearch: HNSW index-build candidate list size",
- "type": "integer"
+ "description": {
+ "type": "string",
+ "maxLength": 1000
},
- "hnsw_ef_search": {
- "description": "OpenSearch: HNSW search candidate list size (faiss; lucene reads at query time)",
+ "invite_code_validity_days": {
+ "description": "optional: 0=never, 1, 7, 30; default 7",
"type": "integer"
},
- "hnsw_m": {
- "description": "--- OpenSearch k-NN HNSW fields ---\nAll omitempty so other engines' serialized IndexConfig is unchanged.\nZero / empty values fall back to the driver defaults in buildInternalCfg.",
+ "member_limit": {
+ "description": "optional: max members; 0=unlimited; default 50",
"type": "integer"
},
- "index_name": {
- "description": "--- Existing fields ---",
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.CredentialsConfig": {
+ "type": "object",
+ "properties": {
+ "weknoracloud": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.CubeEgressRule": {
+ "type": "object",
+ "properties": {
+ "audit": {
+ "description": "Audit is none | metadata | full. Empty uses the server default.",
"type": "string"
},
- "knn_engine": {
- "description": "OpenSearch: k-NN backend (\"lucene\" | \"faiss\")",
- "type": "string"
+ "deny": {
+ "description": "Deny inverts the action, which defaults to allow. A deny rule still\nneeds Host or SNI: the target has to reach CubeEgress for it to answer\nwith a request-level 403 instead of the network layer dropping it.",
+ "type": "boolean"
},
- "number_of_replicas": {
- "description": "ES, OpenSearch",
- "type": "integer"
+ "host": {
+ "type": "string"
},
- "number_of_shards": {
- "description": "ES, OpenSearch",
- "type": "integer"
+ "inject": {
+ "description": "Inject adds credential headers on allowed HTTPS requests.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeHeaderInject"
+ }
},
- "replica_number": {
- "description": "Milvus LoadCollection / Tencent VectorDB CreateCollection replicas",
- "type": "integer"
+ "methods": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "replication_factor": {
- "description": "Qdrant, Weaviate: number of replicas",
- "type": "integer"
+ "name": {
+ "type": "string"
},
- "replication_num": {
- "description": "Doris: replication_num PROPERTIES",
- "type": "integer"
+ "path": {
+ "type": "string"
},
- "shard_number": {
- "description": "--- Scalability fields ---",
- "type": "integer"
+ "scheme": {
+ "type": "string"
},
- "shards_num": {
- "description": "Milvus: number of shards per collection (CreateCollection)",
- "type": "integer"
+ "sni": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.IndexingStrategy": {
+ "github_com_Tencent_WeKnora_internal_types.CubeHeaderInject": {
"type": "object",
"properties": {
- "graph_enabled": {
- "description": "GraphEnabled enables knowledge graph entity/relation extraction",
- "type": "boolean"
- },
- "keyword_enabled": {
- "description": "KeywordEnabled enables keyword-based (BM25) search",
- "type": "boolean"
+ "format": {
+ "type": "string"
},
- "vector_enabled": {
- "description": "VectorEnabled enables semantic vector embedding and search",
- "type": "boolean"
+ "header": {
+ "type": "string"
},
- "wiki_enabled": {
- "description": "WikiEnabled enables automatic wiki page generation from documents",
- "type": "boolean"
+ "secret": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CubeSandboxConfig": {
"type": "object",
- "required": [
- "role"
- ],
"properties": {
- "representative_user_id": {
- "description": "RepresentativeUserID is accepted for compatibility and ignored: a\ndirect add attaches no user of the enrolled workspace, since the\ninviter must not choose whose details the roster shows.",
+ "api_key": {
+ "description": "加密",
"type": "string"
},
- "role": {
- "description": "Role to assign: admin/editor/viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
+ "api_url": {
+ "type": "string"
},
- "tenant_id": {
- "description": "TenantID is the workspace to enrol as an org member. Preferred field.",
+ "cube_sandbox_ttl_seconds": {
"type": "integer"
},
- "user_id": {
- "description": "UserID is retained for backward compatibility. When set without\nTenantID, the handler resolves the user's TenantID.",
+ "dns_servers": {
+ "description": "DNSServers are Cube template nameserver IPs. Empty uses Cubelet's default.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "http_timeout_sec": {
+ "description": "HTTPTimeoutSec bounds each HTTP call to the sandbox control plane.\n0 means use the built-in default (30s), never the deployment's value.",
+ "type": "integer"
+ },
+ "proxy_url": {
+ "type": "string"
+ },
+ "sandbox_domain": {
+ "type": "string"
+ },
+ "template_id": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CustomAgent": {
"type": "object",
- "required": [
- "organization_id"
- ],
"properties": {
- "message": {
- "description": "Optional message for join request",
- "type": "string",
- "maxLength": 500
- },
- "organization_id": {
+ "avatar": {
+ "description": "Avatar/Icon of the agent (emoji or icon name)",
"type": "string"
},
- "role": {
- "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "config": {
+ "description": "Agent configuration",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
}
]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
- "type": "object",
- "required": [
- "invite_code"
- ],
- "properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
- }
- }
- },
- "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": {
+ },
+ "created_at": {
+ "description": "Timestamps",
"type": "string"
},
- "bucket_name": {
+ "created_by": {
+ "description": "Created by user ID",
"type": "string"
},
- "endpoint": {
+ "creator_name": {
+ "description": "CreatorName 由 list handler 在返回前批量回填,作用同 KnowledgeBase.CreatorName:\n让前端列表卡片区分「我创建」与「同空间其他成员创建」。不落库,内建 agent / 老数据\n仍可能为空。",
"type": "string"
},
- "path_prefix": {
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description of the agent",
"type": "string"
},
- "region": {
+ "id": {
+ "description": "Unique identifier of the agent (composite primary key with TenantID)\nFor built-in agents, this is 'builtin-quick-answer' or 'builtin-smart-reasoning'\nFor custom agents, this is a UUID",
"type": "string"
},
- "secret_key": {
+ "is_builtin": {
+ "description": "Whether this is a built-in agent (normal mode / agent mode)",
+ "type": "boolean"
+ },
+ "name": {
+ "description": "Name of the agent",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant ID (composite primary key with ID)",
+ "type": "integer"
+ },
+ "updated_at": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": {
+ "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
"type": "object",
"properties": {
- "asr_config": {
- "description": "ASR config (Automatic Speech Recognition)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
- }
- ]
- },
- "auto_tag_config": {
- "description": "AutoTagConfig controls asynchronous association of existing tags after parsing.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
- }
- ]
- },
- "chunk_count": {
- "description": "Chunk count (not stored in database, calculated on query)",
- "type": "integer"
- },
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
- },
- "created_at": {
- "description": "Creation time of the knowledge base",
+ "agent_mode": {
+ "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
"type": "string"
},
- "creator_id": {
- "description": "CreatorID records the user ID of whoever originally created the KB.\nUsed by the workspace-level RBAC middleware to let Contributors edit\ntheir own KBs without granting them access to everyone else's.\nNullable for backward compatibility with rows created before the\nRBAC migration backfilled the column to the workspace Owner.",
+ "agent_type": {
+ "description": "AgentType is a preset category under smart-reasoning mode that pre-fills\nsystem prompt, allowed tools and recommended KB compatibility.\nValid values: \"rag-qa\", \"wiki-qa\", \"hybrid-rag-wiki\", \"custom\".\nEmpty / unknown values are treated as \"custom\" (no preset applied).\nIgnored for quick-answer mode.",
"type": "string"
},
- "creator_name": {
- "description": "CreatorName 是 CreatorID 对应用户的展示名(username / email 等),\n仅在列表场景由 handler 批量回填,不落库;为空表示创建者无法解析(用户已删除、\nCreatorID 为空的老数据等)。前端用它在卡片来源徽章上做 mine vs workspace 的二分。",
+ "allowed_tools": {
+ "description": "Allowed tools (only for agent type)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "asr_model_id": {
+ "description": "ASR model ID for audio transcription (optional)",
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time of the knowledge base",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "attachment_image_understanding": {
+ "description": "AttachmentImageUnderstanding enables VLM OCR fallback for image-only /\nscanned documents (PDF/PPT whose pages are images). Disabled by default\nbecause it materially increases parse latency; only triggers when the\nextracted text is below a threshold and a VLM model is configured.",
+ "type": "boolean"
},
- "description": {
- "description": "Description of the knowledge base",
- "type": "string"
+ "attachment_ocr_max_pages": {
+ "description": "AttachmentOCRMaxPages caps how many pages of a scanned / image-only\ndocument this agent sends to the VLM for OCR. 0 falls back to the global\ndefault (WEKNORA_CHAT_ATTACHMENT_OCR_MAX_PAGES). More pages means higher\ncoverage but slower parsing and more VLM cost.",
+ "type": "integer"
},
- "embedding_model_id": {
- "description": "ID of the embedding model",
- "type": "string"
+ "attachment_parse_wait_timeout_sec": {
+ "description": "AttachmentParseWaitTimeoutSec bounds, in seconds, how long a chat turn\nwaits for this agent's still-parsing attachments before proceeding with\nonly the finished ones. 0 falls back to the global default\n(WEKNORA_CHAT_ATTACHMENT_WAIT_TIMEOUT_SEC).",
+ "type": "integer"
},
- "extract_config": {
- "description": "Extract config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
- }
- ]
+ "audio_upload_enabled": {
+ "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
+ "type": "boolean"
},
- "faq_config": {
- "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
- }
- ]
+ "chat_parser_engine_rules": {
+ "description": "===== Chat Attachment Parsing Settings =====\nChatParserEngineRules selects parser engines for session-scoped chat\nattachments by file type. Takes precedence over the tenant-level\nParserEngineConfig.ChatParserEngineRules; an explicit per-request\nparser_engine still overrides both.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
},
- "generated_profile": {
- "description": "GeneratedProfile is the machine-generated description: a gist, merged\ntopics, typical questions and the aggregate snapshot they came from. It\nnever overwrites the user-authored Description; both are shown to agents.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile"
- }
- ]
+ "citation_enabled": {
+ "description": "Whether final answers include knowledge/web source citations. Nil defaults to true\nso agents saved before this option was introduced keep their existing behavior.",
+ "type": "boolean"
},
- "id": {
- "description": "Unique identifier of the knowledge base",
+ "context_template": {
+ "description": "Context template for normal mode (how to format retrieved chunks)",
"type": "string"
},
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
- }
- ]
- },
- "indexing_strategy": {
- "description": "IndexingStrategy controls which indexing pipelines are active for this knowledge base.\nPipelines: vector search, keyword search, wiki generation, knowledge graph extraction.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
- }
- ]
+ "context_template_id": {
+ "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content is resolved at request time for saved agents.",
+ "type": "string"
},
- "is_pinned": {
- "description": "IsPinned and PinnedAt are computed per-caller from user_kb_pins\n(see migration 000050). They used to be stored on the row itself,\nwhich made pinning a workspace-wide ordering decision gated behind\nthe kb-edit RBAC guard. The columns are still present in legacy\nschemas for rollback safety but are no longer read or written by\nthe application — both fields are tagged `gorm:\"-\"` so GORM\nignores them on every CRUD call and the list handler stamps them\nafter enriching with the caller's pin set.",
+ "data_analysis_enabled": {
+ "description": "===== Data Analysis Settings =====\nWhether to run the legacy in-pipeline DuckDB SQL data-analysis stage when\nthe retrieved chunks include CSV/Excel files. This issues an extra LLM\ncall to generate a SQL query and is disabled by default because most\nquick-answer / RAG-style agents do not want the added latency.",
"type": "boolean"
},
- "is_processing": {
- "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
+ "embedding_top_k": {
+ "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
+ "type": "integer"
+ },
+ "enable_query_expansion": {
+ "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
"type": "boolean"
},
- "is_temporary": {
- "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
+ "enable_rewrite": {
+ "description": "Whether to enable query rewrite for multi-turn conversations",
"type": "boolean"
},
- "knowledge_count": {
- "description": "Knowledge count (not stored in database, calculated on query)",
- "type": "integer"
+ "fallback_prompt": {
+ "description": "Fallback prompt (when FallbackStrategy is \"model\")",
+ "type": "string"
},
- "name": {
- "description": "Name of the knowledge base",
+ "fallback_response": {
+ "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
"type": "string"
},
- "pinned_at": {
- "description": "PinnedAt records when the current caller pinned this knowledge\nbase; nil when they have not.",
+ "fallback_strategy": {
+ "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
"type": "string"
},
- "processing_count": {
- "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
- "type": "integer"
+ "faq_direct_answer_threshold": {
+ "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
+ "type": "number"
},
- "profile_config": {
- "description": "ProfileConfig controls automatic generation of the knowledge-base\ndescription from per-document profiles (document knowledge bases only).",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
- }
- ]
+ "faq_priority_enabled": {
+ "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "type": "boolean"
},
- "question_generation_config": {
- "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
- }
- ]
+ "faq_score_boost": {
+ "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
+ "type": "number"
},
- "share_count": {
- "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "history_turns": {
+ "description": "Number of history turns to keep in context. Quick-answer only; smart-reasoning sizes history by context window",
"type": "integer"
},
- "storage_backend_id": {
- "description": "StorageBackendID binds this KB to one concrete storage instance. The\nlegacy provider field remains readable during migration only.",
+ "image_storage_provider": {
+ "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\".\nEmpty means use the global/workspace default provider.",
"type": "string"
},
- "storage_config": {
- "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
- }
- ]
+ "image_upload_enabled": {
+ "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "type": "boolean"
},
- "storage_provider_config": {
- "description": "Storage provider config (new): only stores provider selection; credentials from workspace StorageEngineConfig",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
- }
- ]
+ "intent_prompts": {
+ "description": "IntentPrompts holds per-intent system prompt overrides for non-retrieval\nintents (greeting, chitchat, etc.). Empty values fall back to templates\nunder config/prompt_templates/intent_prompts.yaml.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "summary_model_id": {
- "description": "Summary model ID",
+ "kb_selection_mode": {
+ "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
"type": "string"
},
- "tenant_id": {
- "description": "Workspace ID",
+ "keyword_threshold": {
+ "description": "Keyword retrieval threshold",
+ "type": "number"
+ },
+ "knowledge_bases": {
+ "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "llm_call_timeout": {
+ "description": "Timeout for a single LLM call in seconds (0 = use global default)",
"type": "integer"
},
- "type": {
- "description": "Type of the knowledge base (document, faq, etc.)",
- "type": "string"
+ "max_completion_tokens": {
+ "description": "Maximum completion tokens. Quick-answer uses this for the RAG answer.\nSmart-reasoning ReAct rounds send this value as-is (zero becomes\nDefaultMaxCompletionTokens at call time: 4096, or 24576 with a sandbox).",
+ "type": "integer"
},
- "updated_at": {
- "description": "Last updated time of the knowledge base",
- "type": "string"
+ "max_iterations": {
+ "description": "===== Agent Mode Settings =====\nMaximum iterations for the ReAct loop. Zero is unset (filled with a\ndefault). A negative value is unlimited: the loop runs until the model\nstops, the user cancels, or another guard fires.",
+ "type": "integer"
},
- "vector_store_id": {
- "description": "VectorStoreID references the VectorStore this knowledge base is bound to.\nWhen nil, the KB falls back to the workspace's effective engines derived from\nthe RETRIEVE_DRIVER environment variable (env store flow).\nThis field is set once at creation time and must not be modified afterwards;\nenforcement lives at the GORM layer (`\u003c-:create`) plus the service-layer\nKB update path, which omits this field from its update DTO.",
- "type": "string"
+ "mcp_auth_wait_timeout": {
+ "description": "MCPAuthWaitTimeout is how many seconds to wait for in-conversation OAuth\nauthorization before skipping. \u003c=0 uses the gate's configured timeout.",
+ "type": "integer"
},
- "vlm_config": {
- "description": "VLM config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
- }
- ]
+ "mcp_selection_mode": {
+ "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
+ "type": "string"
},
- "wiki_config": {
- "description": "WikiConfig stores wiki-specific configuration (only for wiki type knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
- "type": "object",
- "properties": {
- "auto_tag_config": {
- "description": "AutoTagConfig controls optional automatic association of existing KB tags.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
- }
- ]
+ "mcp_services": {
+ "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
+ "memory_enabled": {
+ "description": "Whether this agent may read the user's long-term memory. Nil inherits\nthe workspace setting; false opts a single agent out of memory even when\nthe workspace has it on. There is no \"on\" that overrides the workspace.",
+ "type": "boolean"
},
- "faq_config": {
- "description": "FAQ configuration (only for FAQ type knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
- }
- ]
+ "model_id": {
+ "description": "===== Model Settings =====\nModel ID to use for conversations",
+ "type": "string"
},
- "image_processing_config": {
- "description": "Image processing configuration.\n\nnil means \"no change\" when updating, the same contract IndexingStrategy\nuses. A request that does not mention this field must leave the image\nsettings alone: the attribute-observation switch and the attribute policy\nare things a knowledge base accumulates, and a client that predates them\nwould otherwise reset the lot on any save. Sending an object — empty\nincluded — replaces the whole configuration.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
- }
- ]
+ "multi_turn_enabled": {
+ "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
+ "type": "boolean"
},
- "indexing_strategy": {
- "description": "IndexingStrategy controls which indexing pipelines are active.\nnil means \"no change\" when updating (preserves existing strategy).",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
- }
- ]
+ "query_understand_model_id": {
+ "description": "Dedicated chat model ID for the query-understanding (rewrite + intent) step.\nWhen empty, the main conversation ModelID is used as a fallback.",
+ "type": "string"
},
- "profile_config": {
- "description": "ProfileConfig controls optional automatic knowledge-base description\ngeneration. nil means \"no change\" when updating.",
+ "question_suggestions": {
+ "description": "===== Conversation Question Suggestions =====\nQuestionSuggestions owns both the static/knowledge-backed prompts shown\nbefore the first user turn and the contextual follow-up questions shown\nafter a completed assistant answer.",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig"
}
]
},
- "wiki_config": {
- "description": "Wiki configuration (only for wiki-enabled knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile": {
- "type": "object",
- "properties": {
- "aggregate_hash": {
- "description": "AggregateHash identifies the aggregate the gist was generated from. A\nmismatch with the live aggregate means the text is stale.",
+ "reasoning_effort": {
+ "description": "ReasoningEffort selects the thinking intensity (off | auto | minimal |\nlow | medium | high | xhigh | max). Empty keeps the boolean Thinking\nsemantics: true means \"auto\". See internal/models/api.ReasoningEffort.",
"type": "string"
},
- "error": {
- "description": "Error holds the last generation error when Status is failed.",
+ "rerank_model_id": {
+ "description": "ReRank model ID for retrieval",
"type": "string"
},
- "generated_at": {
- "description": "GeneratedAt records when the text was produced.",
- "type": "string"
+ "rerank_threshold": {
+ "description": "Rerank threshold",
+ "type": "number"
},
- "gist": {
- "description": "Gist is a short statement of what the knowledge base covers.",
- "type": "string"
+ "rerank_top_k": {
+ "description": "Rerank top K",
+ "type": "integer"
},
- "model_id": {
- "description": "ModelID records which chat model produced the text.",
+ "retain_retrieval_history": {
+ "description": "Whether to retain retrieval history across turns",
+ "type": "boolean"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
+ "type": "boolean"
+ },
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompt system message",
"type": "string"
},
- "stats": {
- "description": "Stats is the aggregate snapshot the text was generated from.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileStats"
- }
- ]
+ "rewrite_prompt_user": {
+ "description": "Rewrite prompt user message template",
+ "type": "string"
},
- "status": {
- "description": "Status is one of the KnowledgeBaseProfileStatus* values.",
+ "sandbox_config_id": {
+ "description": "===== Sandbox Settings =====\nSandboxConfigID selects which workspace sandbox config this agent's\nskill scripts run on. Empty means sandbox execution is disabled.\n\nThis references the LOGICAL config, never a specific revision: keeping\nthe indirection here is what would let credential rotation happen\nwithout re-pointing every agent (see the spec's §4.8).",
"type": "string"
},
- "topics": {
- "description": "Topics is the merged topic list (at most KnowledgeBaseProfileMaxTopics).",
+ "selected_skills": {
+ "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
"type": "array",
"items": {
"type": "string"
}
},
- "typical_questions": {
- "description": "TypicalQuestions lists questions this knowledge base can answer.",
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig": {
- "type": "object",
- "properties": {
- "custom_instructions": {
- "description": "CustomInstructions is appended to the stable system prompt, e.g. the\naudience the description should address or terms to keep.",
+ "skills_selection_mode": {
+ "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all installed skills, \"selected\" = specific skills, \"none\" = no skills",
"type": "string"
},
- "enabled": {
- "type": "boolean"
- },
- "model_id": {
- "description": "ModelID overrides the chat model; empty falls back to the KB summary model.",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileStats": {
- "type": "object",
- "properties": {
- "doc_types": {
- "description": "DocTypes counts documents per model-assigned document type.",
+ "supported_file_types": {
+ "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ "type": "string"
}
},
- "document_count": {
- "description": "DocumentCount is the number of eligible documents at generation time.",
- "type": "integer"
+ "system_prompt": {
+ "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
+ "type": "string"
},
- "earliest_at": {
- "description": "EarliestAt and LatestAt bound document creation times.",
+ "system_prompt_id": {
+ "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content is resolved at request time for saved agents.",
"type": "string"
},
- "file_types": {
- "description": "FileTypes counts documents per file extension.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
- }
+ "temperature": {
+ "description": "Temperature for LLM (0-1)",
+ "type": "number"
},
- "folders": {
- "description": "Folders lists the top-level folder names present.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
},
- "latest_at": {
+ "vector_threshold": {
+ "description": "Vector retrieval threshold",
+ "type": "number"
+ },
+ "vlm_model_id": {
+ "description": "VLM model ID for image analysis (optional, falls back to workspace-level VLM)",
"type": "string"
},
- "profiled_count": {
- "description": "ProfiledCount is how many of them carried a document profile.",
+ "web_fetch_enabled": {
+ "description": "Whether to auto-fetch full page content for reranked web search results",
+ "type": "boolean"
+ },
+ "web_fetch_top_n": {
+ "description": "Max number of pages to fetch after rerank (default: 3)",
"type": "integer"
},
- "raw_topics": {
- "description": "RawTopics counts documents per normalized topic keyword before merging.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
- }
+ "web_search_enabled": {
+ "description": "===== Web Search Settings =====\nWhether web search is enabled",
+ "type": "boolean"
},
- "tags": {
- "description": "Tags counts documents per knowledge-base tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
- }
+ "web_search_max_results": {
+ "description": "Maximum web search results",
+ "type": "integer"
+ },
+ "web_search_provider_id": {
+ "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the workspace's default provider (is_default=true) is used.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
+ "github_com_Tencent_WeKnora_internal_types.DataSource": {
"type": "object",
"properties": {
- "chunk_count": {
- "type": "integer"
+ "config": {
+ "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "type": "object"
+ },
+ "conflict_strategy": {
+ "description": "Conflict resolution strategy: overwrite or skip",
+ "type": "string"
},
"created_at": {
+ "description": "Creation timestamp",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "error_message": {
+ "description": "Error message if status is \"error\"",
"type": "string"
},
"id": {
+ "description": "Unique identifier",
"type": "string"
},
"knowledge_base_id": {
+ "description": "Target knowledge base ID",
"type": "string"
},
- "knowledge_base_name": {
+ "last_sync_at": {
+ "description": "Last successful sync timestamp",
"type": "string"
},
- "knowledge_base_type": {
- "type": "string"
+ "last_sync_cursor": {
+ "description": "Cursor or state for incremental sync (connector-specific)",
+ "type": "object"
},
- "knowledge_count": {
- "type": "integer"
+ "last_sync_result": {
+ "description": "Summary of last sync result",
+ "type": "object"
},
- "my_permission": {
- "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
- "type": "string"
+ "latest_sync_log": {
+ "description": "Latest sync log (not stored in DB, populated on query)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ }
+ ]
},
- "my_role_in_org": {
- "description": "Current user's role in this organization (admin/editor/viewer)",
+ "name": {
+ "description": "User-friendly name",
"type": "string"
},
- "organization_id": {
+ "status": {
+ "description": "Current status: active, paused, error",
"type": "string"
},
- "organization_name": {
+ "sync_deletions": {
+ "description": "Whether to sync deletions from source",
+ "type": "boolean"
+ },
+ "sync_log_retention_days": {
+ "description": "Number of days to keep sync logs (default: 30)",
+ "type": "integer"
+ },
+ "sync_mode": {
+ "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
"type": "string"
},
- "permission": {
- "description": "Share permission (what the space was granted: viewer/editor)",
+ "sync_schedule": {
+ "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
"type": "string"
},
- "require_approval": {
- "type": "boolean"
+ "tenant_id": {
+ "description": "Workspace ID for multi-workspace isolation",
+ "type": "integer"
},
- "shared_by_user_id": {
- "type": "string"
+ "total_items_synced": {
+ "description": "Total items synced (not stored in DB, calculated on query)",
+ "type": "integer"
},
- "shared_by_username": {
+ "type": {
+ "description": "Connector type (feishu, notion, confluence, etc.)",
"type": "string"
},
- "source_tenant_id": {
- "type": "integer"
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress": {
+ "github_com_Tencent_WeKnora_internal_types.DockerSandboxConfig": {
"type": "object",
"properties": {
- "created_at": {
- "description": "任务创建时间",
- "type": "integer"
+ "cpu_limit": {
+ "description": "CPULimit is the number of CPU cores one sandbox may use. 0 uses the\nbuilt-in default.",
+ "type": "number"
},
- "error": {
- "description": "错误信息",
+ "host": {
+ "description": "Host is the daemon endpoint in DOCKER_HOST form. Empty means the local\nunix socket.",
"type": "string"
},
- "failed": {
- "description": "失败数",
+ "http_timeout_sec": {
+ "description": "HTTPTimeoutSec bounds each Engine API call. 0 uses the built-in default.",
"type": "integer"
},
- "message": {
- "description": "状态消息",
+ "idle_ttl_seconds": {
+ "description": "IdleTTLSeconds is how long a session container may go unused before it\nis reclaimed. The daemon has no idle timeout of its own, so this is what\nstops an abandoned session from pinning host memory indefinitely.",
+ "type": "integer"
+ },
+ "image": {
"type": "string"
},
- "processed": {
- "description": "已处理数",
+ "memory_limit_mb": {
+ "description": "MemoryLimitMB caps one sandbox's memory. 0 uses the built-in default.",
"type": "integer"
},
- "progress": {
- "description": "0-100",
+ "network_mode": {
+ "description": "NetworkMode is the Docker network sandboxes join: \"bridge\" (default) or\n\"none\" for no egress. Nothing else is accepted — host and container:\nmodes share another namespace outright, and a named network is usually\nthe deployment's own compose network, which would put the sandbox next\nto Postgres and Redis.",
+ "type": "string"
+ },
+ "pids_limit": {
+ "description": "PidsLimit caps how many processes one sandbox may run. 0 uses the\nbuilt-in default.",
"type": "integer"
},
- "source_kb_id": {
+ "runtime": {
+ "description": "Runtime selects an alternative OCI runtime such as \"runsc\" (gVisor).\nEmpty uses the daemon default.",
"type": "string"
},
- "status": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus"
+ "tls_cert_path": {
+ "description": "TLSCertPath is a directory on the WeKnora host containing ca.pem,\ncert.pem and key.pem. Required when Host is a TCP endpoint.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.E2BHostRule": {
+ "type": "object",
+ "properties": {
+ "headers": {
+ "description": "Headers values are credentials and are encrypted at rest; names stay\nreadable so operators can see which headers are injected.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "target_kb_id": {
+ "host": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.E2BSandboxConfig": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "description": "加密",
"type": "string"
},
- "task_id": {
+ "api_url": {
"type": "string"
},
- "total": {
- "description": "总知识数",
+ "e2b_sandbox_ttl_seconds": {
"type": "integer"
},
- "updated_at": {
- "description": "最后更新时间",
+ "http_timeout_sec": {
+ "description": "HTTPTimeoutSec bounds each HTTP call to the sandbox control plane.\n0 means use the built-in default (30s), never the deployment's value.",
"type": "integer"
+ },
+ "proxy_url": {
+ "description": "ProxyURL is the data-plane gateway that fronts envd. E2B Cloud resolves\n\"\u003cport\u003e-\u003csandboxID\u003e.\u003csandbox_domain\u003e\" through public DNS and TLS, so it\nneeds no value here. Self-hosted E2B-compatible control planes usually\nserve every sandbox from one gateway address and expect the sandbox\nauthority in the Host header; setting this makes WeKnora dial the\ngateway directly instead of requiring wildcard DNS and a certificate\nfor the sandbox domain. An \"http://\" gateway also downgrades the\ndata-plane scheme, which the E2B SDK otherwise pins to https.",
+ "type": "string"
+ },
+ "sandbox_domain": {
+ "type": "string"
+ },
+ "template_id": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides": {
+ "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": {
"type": "object",
"properties": {
- "asr_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
- },
- "chunking_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ "dimension": {
+ "type": "integer"
},
- "enable_multimodel": {
+ "supports_dimension_override": {
"type": "boolean"
},
- "extract_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
- },
- "graph_enabled": {
- "type": "boolean"
+ "truncate_prompt_tokens": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.EvaluationDetail": {
+ "type": "object",
+ "properties": {
+ "metric": {
+ "description": "Evaluation metrics",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MetricResult"
+ }
+ ]
},
- "image_actions": {
- "description": "ImageActions overrides rows of the attribute-\u003ework table for this document\n(merged per action key on top of the knowledge base's table).\nnil keeps the knowledge base's setting.",
+ "params": {
+ "description": "Evaluation parameters",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatManage"
}
]
},
- "image_attrs_enabled": {
- "description": "ImageAttrsEnabled overrides the knowledge base's attribute-observed image\npipeline switch for this one document. nil keeps the knowledge base's\nsetting.",
- "type": "boolean"
- },
- "image_vector_enabled": {
- "description": "ImageVectorEnabled overrides image vector indexing for this document.\nIt does not change the KB-wide retrieval setting or embedding model.",
- "type": "boolean"
- },
- "parser_engine_overrides": {
- "description": "ParserEngineOverrides passes key-value configuration to docreader parsers\n(e.g. pdf_force_scanned=true). Merged with workspace-level overrides in the\nparse pipeline; per-upload values take priority on conflict.",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "parser_engine_rules": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
- },
- "question_generation_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
- },
- "summary_enabled": {
- "description": "SummaryEnabled defaults to true when omitted for backward compatibility.",
- "type": "boolean"
- },
- "vlm_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ "task": {
+ "description": "Evaluation task info",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationTask"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
+ "github_com_Tencent_WeKnora_internal_types.EvaluationStatue": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "x-enum-comments": {
+ "EvaluationStatueFailed": "Task failed",
+ "EvaluationStatuePending": "Task is waiting to start",
+ "EvaluationStatueRunning": "Task is in progress",
+ "EvaluationStatueSuccess": "Task completed successfully"
+ },
+ "x-enum-descriptions": [
+ "Task is waiting to start",
+ "Task is in progress",
+ "Task completed successfully",
+ "Task failed"
+ ],
+ "x-enum-varnames": [
+ "EvaluationStatuePending",
+ "EvaluationStatueRunning",
+ "EvaluationStatueSuccess",
+ "EvaluationStatueFailed"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.EvaluationTask": {
"type": "object",
"properties": {
- "members": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
- }
+ "dataset_id": {
+ "description": "Dataset ID for evaluation",
+ "type": "string"
},
- "total": {
+ "err_msg": {
+ "description": "Error message if failed",
+ "type": "string"
+ },
+ "finished": {
+ "description": "Completed items count",
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
- "type": "object",
- "properties": {
- "organizations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
- }
},
- "resource_counts": {
- "description": "各空间内知识库/智能体数量,供列表侧栏展示",
+ "id": {
+ "description": "Unique task ID",
+ "type": "string"
+ },
+ "start_time": {
+ "description": "Task start time",
+ "type": "string"
+ },
+ "status": {
+ "description": "Current task status",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationStatue"
}
]
},
+ "tenant_id": {
+ "description": "Tenant/Organization ID",
+ "type": "integer"
+ },
"total": {
+ "description": "Total items to evaluate",
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
+ "github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
"type": "object",
"properties": {
- "shares": {
+ "custom_instructions": {
+ "description": "CustomInstructions adds domain-specific extraction guidance while the\nsystem keeps ownership of the structured graph output protocol.",
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
}
},
- "total": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": {
- "type": "object",
- "properties": {
- "path_prefix": {
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.LoginRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": {
"type": "object",
"required": [
- "email",
- "password"
+ "entries"
],
"properties": {
- "email": {
- "type": "string"
- },
- "password": {
- "type": "string",
- "minLength": 6
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.LoginResponse": {
- "type": "object",
- "properties": {
- "active_tenant": {
- "description": "ActiveTenant is the workspace whose ID is encoded in the issued JWT;\nfuture requests are scoped to it until the client calls /auth/switch-tenant.\nDefaults to the user's home workspace on a fresh login.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
- }
- ]
+ "dry_run": {
+ "description": "仅验证,不实际导入",
+ "type": "boolean"
},
- "memberships": {
- "description": "Memberships lists every workspace the user can authenticate into,\nalong with their role in each. Always populated (length 1 for users\nwho only belong to their home workspace) so frontends can render a\nworkspace switcher without a follow-up request. Serialised without\nomitempty so the field is always present as a JSON array (possibly\nempty) — the \"always populated\" contract relies on the server side\nguaranteeing a non-nil slice.",
+ "entries": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Membership"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
}
},
- "message": {
- "type": "string"
- },
- "refresh_token": {
+ "knowledge_id": {
"type": "string"
},
- "success": {
- "type": "boolean"
+ "mode": {
+ "type": "string",
+ "enum": [
+ "append",
+ "replace"
+ ]
},
- "token": {
+ "task_id": {
+ "description": "可选,如果不传则自动生成UUID",
"type": "string"
- },
- "user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig": {
+ "github_com_Tencent_WeKnora_internal_types.FAQConfig": {
"type": "object",
"properties": {
- "retry_count": {
- "description": "Number of retries, default: 3",
- "type": "integer"
- },
- "retry_delay": {
- "description": "Delay between retries in seconds, default: 1",
- "type": "integer"
+ "index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
},
- "timeout": {
- "description": "Timeout in seconds, default: 30",
- "type": "integer"
+ "question_index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntry": {
"type": "object",
"properties": {
- "api_key": {
- "type": "string"
+ "answer_strategy": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
},
- "api_key_header": {
- "description": "APIKeyHeader is the header name that carries APIKey when AuthType is\napi_key. Empty defaults to \"X-API-Key\". This is non-secret structural\nconfig (the secret is APIKey), so it is not encrypted and is safe to echo\nback in responses. It lets services that expect the key in a different\nheader (e.g. the raw token directly in \"Authorization\") work without\nresorting to plaintext custom headers.",
+ "answers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "chunk_id": {
"type": "string"
},
- "auth_server_metadata_url": {
- "description": "AuthServerMetadataURL optionally pins the OAuth authorization server\nmetadata URL. When empty, the server is discovered automatically from\nthe MCP URL (RFC 9728 / RFC 8414).",
+ "chunk_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkType"
+ },
+ "created_at": {
"type": "string"
},
- "auth_type": {
- "description": "AuthType selects the authentication strategy. Empty (\"\") is treated as\nnone for backward compatibility with rows that pre-date this field.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthType"
- }
- ]
+ "id": {
+ "type": "integer"
},
- "client_id": {
- "description": "ClientID optionally names an OAuth client registered with the\nauthorization server in advance. When set it is used instead of dynamic\nclient registration, for servers that offer no registration endpoint or\nallow grants only to clients an administrator registered. Non-secret.",
+ "index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
+ },
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "is_recommended": {
+ "type": "boolean"
+ },
+ "knowledge_base_id": {
"type": "string"
},
- "client_secret": {
- "description": "ClientSecret is the secret of ClientID for a confidential client.\nSecret: encrypted at rest like APIKey and Token, never returned, and\nchanged only through the credentials subresource after creation.",
+ "knowledge_id": {
"type": "string"
},
- "custom_headers": {
- "type": "object",
- "additionalProperties": {
+ "match_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
+ },
+ "matched_question": {
+ "description": "MatchedQuestion is the actual question text that was matched in FAQ search\nCould be the standard question or one of the similar questions",
+ "type": "string"
+ },
+ "negative_questions": {
+ "type": "array",
+ "items": {
"type": "string"
}
},
- "scopes": {
- "description": "Scopes are the OAuth scopes requested during authorization. Optional.",
+ "score": {
+ "type": "number"
+ },
+ "similar_questions": {
"type": "array",
"items": {
"type": "string"
}
},
- "token": {
+ "standard_question": {
+ "type": "string"
+ },
+ "tag_id": {
+ "type": "integer"
+ },
+ "tag_name": {
+ "type": "string"
+ },
+ "updated_at": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPAuthType": {
- "type": "string",
- "enum": [
- "",
- "api_key",
- "bearer",
- "oauth"
- ],
- "x-enum-varnames": [
- "MCPAuthNone",
- "MCPAuthAPIKey",
- "MCPAuthBearer",
- "MCPAuthOAuth"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": {
"type": "object",
- "additionalProperties": {
- "type": "string"
+ "properties": {
+ "by_id": {
+ "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
+ }
+ },
+ "by_tag": {
+ "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
+ }
+ },
+ "exclude_ids": {
+ "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPHeaders": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": {
"type": "object",
- "additionalProperties": {
- "type": "string"
+ "properties": {
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "is_recommended": {
+ "type": "boolean"
+ },
+ "tag_id": {
+ "type": "integer"
+ }
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPService": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": {
"type": "object",
+ "required": [
+ "standard_question"
+ ],
"properties": {
- "advanced_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
- },
- "auth_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig"
+ "answer_strategy": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
},
- "created_at": {
- "type": "string"
+ "answers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
+ "id": {
+ "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "type": "integer"
},
- "description": {
- "type": "string"
+ "is_enabled": {
+ "type": "boolean"
},
- "enabled": {
+ "is_recommended": {
"type": "boolean"
},
- "env_vars": {
- "description": "Environment variables for stdio",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
- }
- ]
+ "negative_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "headers": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
+ "similar_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "id": {
+ "standard_question": {
"type": "string"
},
- "is_builtin": {
- "description": "Whether this is a builtin MCP service (visible to all workspaces)",
- "type": "boolean"
+ "tag_id": {
+ "type": "integer"
},
- "name": {
+ "tag_name": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQFailedEntry": {
+ "type": "object",
+ "properties": {
+ "answer_all": {
+ "description": "是否全部回复",
+ "type": "boolean"
},
- "stdio_config": {
- "description": "Required for stdio transport",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
- }
- ]
+ "answers": {
+ "description": "答案",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "tenant_id": {
+ "failure_type": {
+ "description": "失败类型:pre_validation / post_validation",
+ "type": "string"
+ },
+ "index": {
+ "description": "条目在批次中的索引(从0开始)",
"type": "integer"
},
- "transport_type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
+ "is_disabled": {
+ "description": "是否停用",
+ "type": "boolean"
},
- "updated_at": {
+ "is_partial_failure": {
+ "description": "是否为部分失败(相似问/反例被移除,但整条仍可导入)",
+ "type": "boolean"
+ },
+ "negative_questions": {
+ "description": "反例问题",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "reason": {
+ "description": "失败原因",
"type": "string"
},
- "url": {
- "description": "Optional: required for SSE/HTTP Streamable",
+ "removed_negative_questions": {
+ "description": "被移除的反例及原因",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "removed_similar_questions": {
+ "description": "部分失败详情(当 IsPartialFailure 为 true 时)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "similar_questions": {
+ "description": "相似问题",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "standard_question": {
+ "description": "标准问题",
"type": "string"
},
- "usage_instructions": {
- "description": "UsageInstructions is maintained locally and is not overwritten by directory refresh.",
+ "tag_name": {
+ "description": "分类",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": {
+ "github_com_Tencent_WeKnora_internal_types.FAQImportProgress": {
"type": "object",
"properties": {
- "args": {
- "description": "Command arguments array",
+ "added_count": {
+ "description": "新增的条目数",
+ "type": "integer"
+ },
+ "created_at": {
+ "description": "Task creation timestamp",
+ "type": "integer"
+ },
+ "display_status": {
+ "description": "显示状态:open 或 close",
+ "type": "string"
+ },
+ "dry_run": {
+ "description": "是否为 dry run 模式",
+ "type": "boolean"
+ },
+ "error": {
+ "description": "Error message if failed",
+ "type": "string"
+ },
+ "failed_count": {
+ "description": "失败的条目数",
+ "type": "integer"
+ },
+ "failed_entries": {
+ "description": "失败条目详情(少量时直接返回)",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQFailedEntry"
}
},
- "command": {
- "description": "Command: \"uvx\" or \"npx\"",
+ "failed_entries_url": {
+ "description": "失败条目CSV下载URL(大量时返回URL)",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MCPTransportType": {
- "type": "string",
- "enum": [
- "sse",
- "http-streamable",
- "stdio"
- ],
- "x-enum-comments": {
- "MCPTransportHTTPStreamable": "HTTP Streamable",
- "MCPTransportSSE": "Server-Sent Events",
- "MCPTransportStdio": "Stdio (Standard Input/Output)"
- },
- "x-enum-descriptions": [
- "Server-Sent Events",
- "HTTP Streamable",
- "Stdio (Standard Input/Output)"
- ],
- "x-enum-varnames": [
- "MCPTransportSSE",
- "MCPTransportHTTPStreamable",
- "MCPTransportStdio"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": {
- "type": "object",
- "properties": {
- "channel": {
+ },
+ "import_mode": {
+ "description": "Result fields (populated when Status == \"completed\")",
"type": "string"
},
- "content": {
+ "imported_at": {
+ "description": "导入完成时间",
"type": "string"
},
- "process_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides"
+ "kb_id": {
+ "description": "Knowledge Base ID",
+ "type": "string"
},
- "status": {
+ "knowledge_id": {
+ "description": "FAQ Knowledge ID",
"type": "string"
},
- "tag_ids": {
+ "merge_details": {
+ "description": "合并详情",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQMergeDetail"
}
},
- "title": {
+ "merge_entry_indices": {
+ "description": "需要合并的条目索引(内部使用,用于重试时跳过识别)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "merged_count": {
+ "description": "合并更新的条目数",
+ "type": "integer"
+ },
+ "message": {
+ "description": "Status message",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MatchType": {
- "type": "integer",
- "enum": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "x-enum-comments": {
- "MatchTypeDataAnalysis": "数据分析匹配类型",
- "MatchTypeDirectLoad": "Deprecated: reserved to preserve serialized enum values",
- "MatchTypeParentChunk": "父Chunk匹配类型",
- "MatchTypeRelationChunk": "关系Chunk匹配类型",
- "MatchTypeWebSearch": "网络搜索匹配类型"
- },
- "x-enum-descriptions": [
- "",
- "",
- "",
- "",
- "父Chunk匹配类型",
- "关系Chunk匹配类型",
- "",
- "网络搜索匹配类型",
- "Deprecated: reserved to preserve serialized enum values",
- "数据分析匹配类型"
+ },
+ "partial_failed_count": {
+ "description": "部分失败的条目数(相似问/反例被移除)",
+ "type": "integer"
+ },
+ "processed": {
+ "description": "Entries processed so far",
+ "type": "integer"
+ },
+ "processing_time": {
+ "description": "处理耗时(毫秒)",
+ "type": "integer"
+ },
+ "progress": {
+ "description": "0-100 percentage",
+ "type": "integer"
+ },
+ "skipped_count": {
+ "description": "跳过的条目数(如重复等)",
+ "type": "integer"
+ },
+ "status": {
+ "description": "Task status",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQImportTaskStatus"
+ }
+ ]
+ },
+ "success_count": {
+ "description": "完全成功的条目数(不包含部分成功/部分失败)",
+ "type": "integer"
+ },
+ "success_entries": {
+ "description": "成功条目简单信息(少量时直接返回)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSuccessEntry"
+ }
+ },
+ "task_id": {
+ "description": "UUID for the import task",
+ "type": "string"
+ },
+ "total": {
+ "description": "Total entries to import",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "integer"
+ },
+ "valid_entry_indices": {
+ "description": "验证通过的条目索引(用于重试时跳过验证)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQImportTaskStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "processing",
+ "completed",
+ "failed"
],
"x-enum-varnames": [
- "MatchTypeEmbedding",
- "MatchTypeKeywords",
- "MatchTypeNearByChunk",
- "MatchTypeHistory",
- "MatchTypeParentChunk",
- "MatchTypeRelationChunk",
- "MatchTypeGraph",
- "MatchTypeWebSearch",
- "MatchTypeDirectLoad",
- "MatchTypeDataAnalysis"
+ "FAQImportStatusPending",
+ "FAQImportStatusProcessing",
+ "FAQImportStatusCompleted",
+ "FAQImportStatusFailed"
]
},
- "github_com_Tencent_WeKnora_internal_types.MatchedImage": {
+ "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": {
+ "type": "string",
+ "enum": [
+ "question_only",
+ "question_answer"
+ ],
+ "x-enum-varnames": [
+ "FAQIndexModeQuestionOnly",
+ "FAQIndexModeQuestionAnswer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQMergeDetail": {
"type": "object",
"properties": {
- "chunk_id": {
- "type": "string"
+ "answer_changed": {
+ "description": "答案是否变更",
+ "type": "boolean"
},
- "knowledge_base_id": {
- "type": "string"
+ "index": {
+ "description": "行号(在批次中的索引)",
+ "type": "integer"
},
- "url": {
+ "new_negative_count": {
+ "description": "新增反例数量",
+ "type": "integer"
+ },
+ "new_similar_count": {
+ "description": "新增相似问数量",
+ "type": "integer"
+ },
+ "standard_question": {
+ "description": "标准问",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Membership": {
+ "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": {
+ "type": "string",
+ "enum": [
+ "combined",
+ "separate"
+ ],
+ "x-enum-varnames": [
+ "FAQQuestionIndexModeCombined",
+ "FAQQuestionIndexModeSeparate"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": {
"type": "object",
+ "required": [
+ "query_text"
+ ],
"properties": {
- "role": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantRole"
+ "first_priority_tag_ids": {
+ "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
- "tenant_id": {
+ "match_count": {
"type": "integer"
},
- "tenant_name": {
+ "only_recommended": {
+ "description": "是否仅返回推荐的条目",
+ "type": "boolean"
+ },
+ "query_text": {
"type": "string"
+ },
+ "second_priority_tag_ids": {
+ "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MemoryConfig": {
+ "github_com_Tencent_WeKnora_internal_types.FAQSuccessEntry": {
"type": "object",
"properties": {
- "embedding_model_id": {
- "description": "EmbeddingModelID is the single model used to score memory against a\nquestion. It is pinned per workspace: knowledge bases each have their\nown embedding model, and grabbing whichever one happens to be listed\nfirst would mix incomparable vector spaces. Blank means semantic recall\nis off and matching stays lexical.",
- "type": "string"
- },
- "enabled": {
- "description": "Enabled defaults to false. Memory retains user statements across\nsessions, so a workspace admin has to turn it on deliberately.",
- "type": "boolean"
- },
- "extract_delay_seconds": {
- "description": "ExtractDelaySeconds is how long a finished turn waits before\ndistillation runs. Waiting lets one model call cover the several\nmessages a user usually sends in a row. 0 means the default.",
+ "index": {
+ "description": "条目在批次中的索引(从0开始)",
"type": "integer"
},
- "extract_instructions": {
- "description": "ExtractInstructions are workspace-specific rules appended to the\ndistillation prompt, for policies the product cannot guess (\"never record\ncustomer names\", \"always note the environment a question is about\").",
- "type": "string"
- },
- "extract_min_interval_seconds": {
- "description": "ExtractMinIntervalSeconds is the floor between two distillation runs for\nthe same person, and exists purely to bound cost. It never drops a turn:\na turn arriving inside the interval is queued and picked up by the next\nrun. 0 means the default.",
+ "seq_id": {
+ "description": "导入后的条目序列ID",
"type": "integer"
},
- "extract_model_id": {
- "description": "ExtractModelID is the model used by the background extraction task.\nEmpty means \"use the model the conversation itself used\", which is what\nthe settings UI promises, so the extraction task must never fail merely\nbecause this is blank.",
+ "standard_question": {
+ "description": "标准问题",
"type": "string"
},
- "interest_threshold": {
- "description": "InterestThreshold is how many separate conversations must touch a topic\nbefore it becomes a stored interest. 0 means the default. Setting it to 1\nrecords every topic on first sight, which is usually too noisy.",
- "type": "integer"
- },
- "max_items": {
- "description": "MaxItems caps active items per subject. 0 means DefaultMemoryMaxItems.",
+ "tag_id": {
+ "description": "分类ID(seq_id)",
"type": "integer"
},
- "retrieval_conditioning": {
- "description": "RetrievalConditioning lets memory shape retrieval — query rewriting and\nper-document ranking — rather than only being appended to the answer\nprompt. This is where memory earns its keep in a knowledge-base product.",
- "type": "boolean"
- },
- "vector_recall": {
- "description": "VectorRecall adds semantic similarity to memory recall. Nil means on\nwhen an embedding model is reachable.\n\nLexical matching alone cannot find a memory the user has re-worded, which\nis most of them: \"回答直接给结论\" and \"别铺垫那么多\" share no tokens. The\ncost is one embedding call per turn, bounded and degraded to lexical on\nfailure, so the feature never becomes a reason a chat is slow.",
- "type": "boolean"
- },
- "write_mode": {
- "description": "WriteMode is MemoryWriteExplicitOnly or MemoryWriteAuto.",
+ "tag_name": {
+ "description": "分类名称",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MentionedItem": {
+ "github_com_Tencent_WeKnora_internal_types.FallbackStrategy": {
+ "type": "string",
+ "enum": [
+ "fixed",
+ "model"
+ ],
+ "x-enum-comments": {
+ "FallbackStrategyFixed": "Fixed response",
+ "FallbackStrategyModel": "Model fallback response"
+ },
+ "x-enum-descriptions": [
+ "Fixed response",
+ "Model fallback response"
+ ],
+ "x-enum-varnames": [
+ "FallbackStrategyFixed",
+ "FallbackStrategyModel"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig": {
"type": "object",
"properties": {
- "id": {
+ "additional_instruction": {
"type": "string"
},
- "kb_id": {
- "description": "Parent knowledge base for file/tag mentions",
- "type": "string"
+ "allow_regenerate": {
+ "type": "boolean"
},
- "kb_name": {
- "description": "Display name for parent KB",
- "type": "string"
+ "categories": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
- "type": "string"
+ "count": {
+ "type": "integer"
},
- "name": {
- "type": "string"
+ "enabled": {
+ "type": "boolean"
},
- "service_id": {
- "description": "Parent MCP service for MCP tool mentions",
- "type": "string"
+ "knowledge_fallback": {
+ "type": "boolean"
},
- "skill_name": {
- "description": "Preloaded agent skill name",
+ "max_context_turns": {
+ "type": "integer"
+ },
+ "mode": {
"type": "string"
},
- "type": {
- "description": "\"kb\", \"file\", \"tag\", \"mcp\", \"skill\"",
+ "model_id": {
"type": "string"
+ },
+ "suppress_on_fallback": {
+ "type": "boolean"
+ },
+ "suppress_when_answer_asks_question": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Message": {
+ "github_com_Tencent_WeKnora_internal_types.GalleryUserPrefs": {
"type": "object",
"properties": {
- "agent_duration_ms": {
- "description": "Agent total execution duration in milliseconds (from query start to answer start)",
- "type": "integer"
- },
- "agent_id": {
- "description": "AgentID is the agent used for this individual assistant turn. Unlike the\nsession's last_request_state it remains stable when users switch agents.",
+ "mode": {
+ "description": "Mode is \"all\" (every search-eligible field active) or \"custom\"\n(per-field Status governs). Empty = \"all\".",
"type": "string"
},
- "agent_steps": {
- "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep"
+ "status": {
+ "description": "Status maps a namespaced attribute id (\"builtin:caption\") to\n\"on\"/\"off\". Only consulted in custom mode; an unrecorded field is\noff. Source-declared on/off does not exist — activation is always\nthe user's own record.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.GenerationMetrics": {
+ "type": "object",
+ "properties": {
+ "bleu1": {
+ "description": "BLEU-1 score",
+ "type": "number"
},
- "artifacts": {
- "description": "Skill-generated files produced during this assistant turn (assistant messages only).\nPopulated by ArtifactCollector after the sandbox finishes, referenced by the\nartifact download endpoint. Empty for user messages and turns without skills.\n\nStored in the message_artifacts table, not on the message row: the message\nrepository loads it with every message it returns and writes it whenever it\nis non-nil on create or update. A nil slice leaves the stored rows alone.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageArtifact"
- }
- },
- "attachments": {
- "description": "Attached files (documents, audio, etc., for user messages)",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageAttachment"
- }
- },
- "channel": {
- "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
- "type": "string"
- },
- "content": {
- "description": "Message text content",
- "type": "string"
- },
- "created_at": {
- "description": "Message creation timestamp",
- "type": "string"
- },
- "deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "id": {
- "description": "Unique identifier for the message",
- "type": "string"
- },
- "images": {
- "description": "Attached images with OCR/Caption text (for user messages)",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage"
- }
+ "bleu2": {
+ "description": "BLEU-2 score",
+ "type": "number"
},
- "is_completed": {
- "description": "Whether message generation is complete",
- "type": "boolean"
+ "bleu4": {
+ "description": "BLEU-4 score",
+ "type": "number"
},
- "is_fallback": {
- "description": "Whether this response is a fallback (no knowledge base match found)",
- "type": "boolean"
+ "rouge1": {
+ "description": "ROUGE-1 score",
+ "type": "number"
},
- "knowledge_id": {
- "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
- "type": "string"
+ "rouge2": {
+ "description": "ROUGE-2 score",
+ "type": "number"
},
- "knowledge_references": {
- "description": "References to knowledge chunks used in the response",
+ "rougel": {
+ "description": "ROUGE-L score",
+ "type": "number"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.GraphNode": {
+ "type": "object",
+ "properties": {
+ "attributes": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
+ "type": "string"
}
},
- "mentioned_items": {
- "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "chunks": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
+ "type": "string"
}
},
- "model_id": {
- "description": "ModelID is the requested/effective chat model binding captured for this\nturn. It is useful for reproducibility and suggestion generation.",
+ "name": {
"type": "string"
- },
- "request_id": {
- "description": "Request identifier for tracking API requests",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.GraphRelation": {
+ "type": "object",
+ "properties": {
+ "node1": {
"type": "string"
},
- "role": {
- "description": "Message role: \"user\", \"assistant\", \"system\"",
+ "node2": {
"type": "string"
},
- "sandbox_checkpoint": {
- "description": "SandboxCheckpoint is the git commit this assistant turn produced in the\nsession sandbox's /workspace. Nil for user messages, for turns that ran\nwithout a sandbox, and for turns whose commit failed (best-effort — a\nfailed checkpoint must never block the reply). A message without a\ncheckpoint cannot serve as a fork point with sandbox state.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SandboxCheckpoint"
- }
- ]
- },
- "session_id": {
- "description": "ID of the session this message belongs to",
+ "type": {
"type": "string"
- },
- "updated_at": {
- "description": "Last update timestamp",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.History": {
+ "type": "object",
+ "properties": {
+ "answer": {
+ "description": "System response text",
"type": "string"
},
- "usage": {
- "description": "LLM token usage aggregated across every round of the turn that produced this\nassistant message. Persisted so history reads can attribute cost after the\nlive stream is gone; NULL (nil) for user messages and pre-feature rows.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TokenUsage"
- }
- ]
+ "createAt": {
+ "description": "When this history entry was created",
+ "type": "string"
},
- "used_memories": {
- "description": "UsedMemories records which long-term memories were injected into this\nanswer, so the chat UI can show them and let the user delete one on the\nspot. Persisted rather than only streamed so reopening a conversation\nstill explains what the answer saw.",
+ "knowledgeReferences": {
+ "description": "Knowledge references used in the answer",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UsedMemory"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
}
+ },
+ "query": {
+ "description": "User query text",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MessageArtifact": {
+ "github_com_Tencent_WeKnora_internal_types.ImageActionsConfig": {
"type": "object",
"properties": {
- "content_hash": {
- "description": "SHA-256 of the persisted bytes",
- "type": "string"
+ "ocr": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageOCRAction"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ImageAsset": {
+ "type": "object",
+ "properties": {
+ "attrs": {
+ "description": "Attrs is the observed attribute map (e.g. contain.text, contain.data_visual)\nproduced by the attribute pipeline. Absent keys mean \"not observed\".",
+ "type": "object",
+ "additionalProperties": {}
},
- "created_at": {
- "description": "When WeKnora persisted the blob",
+ "caption": {
+ "description": "Caption is the model-generated image description.",
"type": "string"
},
- "deleted_at": {
- "description": "DeletedAt marks a file the user deleted. The entry stays in the list\nrather than being removed because its position IS the download address\n(msg.Artifacts[index]); dropping it would shift every later file's index\nand hand an old link the wrong blob. Keeping it also keeps the entry in\nArtifactCollector's de-duplication set, so the next collect does not\nre-attach the very file that was deleted — its sandbox mtime has not\nmoved. Clients filter these out; the bytes are already reclaimed.",
+ "chunk_id": {
+ "description": "ChunkID is the owning chunk (text chunk for embedded images, or the\nimage_ocr / image_caption chunk for dedicated image assets).",
"type": "string"
},
- "file_name": {
- "description": "Original filename inside the sandbox",
+ "chunk_type": {
+ "description": "ChunkType is the owning chunk's type; empty for images discovered on a\ntext (document) chunk. Helps the UI label the source.",
"type": "string"
},
- "file_size": {
- "description": "File size in bytes",
- "type": "integer"
- },
- "file_type": {
- "description": "File extension (e.g., \".pptx\", \".pdf\")",
+ "created_at": {
+ "description": "CreatedAt is the owning chunk's creation time.",
"type": "string"
},
- "mod_time": {
- "description": "Sandbox-side modification time (used for diff)",
+ "id": {
+ "description": "ID is stable and unique within a KB: \"\u003cchunkID\u003e#\u003cindex-in-array\u003e\".",
"type": "string"
},
- "source_path": {
- "description": "Absolute path inside the sandbox (used for diff)",
- "type": "string"
+ "is_enabled": {
+ "description": "IsEnabled mirrors the owning chunk's enabled flag.",
+ "type": "boolean"
},
- "url": {
- "description": "Storage URL (provider://path); persisted, not sent to client",
+ "knowledge_id": {
+ "description": "KnowledgeID is the document/knowledge item the image belongs to.",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.MessageAttachment": {
- "type": "object",
- "properties": {
- "content": {
- "description": "Extracted text content (for small text files)",
+ },
+ "ocr_text": {
+ "description": "OCRText is the extracted text from the image, if any.",
"type": "string"
},
- "content_mode": {
- "description": "full or selected_chunks",
+ "original_url": {
+ "description": "OriginalURL is the pre-transform source reference, when different.",
"type": "string"
},
- "file_name": {
- "description": "Original filename",
+ "source_name": {
+ "description": "SourceName is the human-readable name of the source knowledge item\n(document), resolved from KnowledgeID. Empty when the item no longer\nexists (e.g. deleted), in which case KnowledgeID is still shown.",
"type": "string"
},
- "file_size": {
- "description": "File size in bytes",
+ "status": {
+ "description": "Status mirrors the owning chunk's index status.",
"type": "integer"
},
- "file_type": {
- "description": "File extension (e.g., \".pdf\", \".docx\")",
+ "updated_at": {
+ "description": "UpdatedAt is the owning chunk's last update time.",
"type": "string"
},
- "id": {
- "description": "Temporary document ID for session-scoped uploads",
+ "url": {
+ "description": "URL is the rendered image URL (COS / storage provider).",
"type": "string"
- },
- "is_truncated": {
- "description": "Whether content was truncated",
- "type": "boolean"
- },
- "line_count": {
- "description": "Total line count (for text files)",
- "type": "integer"
- },
- "selected_chunks": {
- "description": "Chunks included in this message prompt",
- "type": "integer"
- },
- "token_count": {
- "description": "Approximate tokens in the parsed document",
- "type": "integer"
- },
- "total_chunks": {
- "description": "Total parsed chunks",
- "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MessageImage": {
+ "github_com_Tencent_WeKnora_internal_types.ImageAttrCondition": {
"type": "object",
"properties": {
- "caption": {
+ "is": {
"type": "string"
},
- "url": {
+ "prop": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ImageOCRAction": {
"type": "object",
"properties": {
- "access_key_id": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
- },
- "endpoint": {
- "type": "string"
- },
- "mode": {
- "description": "\"docker\" or \"remote\"",
- "type": "string"
- },
- "path_prefix": {
- "type": "string"
- },
- "secret_access_key": {
- "type": "string"
+ "on": {
+ "description": "On is the list of attribute conditions that enable OCR. Matching any one\nturns OCR on.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAttrCondition"
+ }
},
- "use_ssl": {
+ "on_unobserved": {
+ "description": "OnUnobserved is the OCR decision used when the observation does not\nanswer for one of the attributes the policy reads — the attribute is\nabsent because the model skipped the line, or because the value it wrote\nwas not one of the allowed ones. The default is true: an incomplete\nobservation keeps extracting, so a missed block of text costs one extra\ncall instead of being lost. Turn it off only with a model reliable enough\nto answer every attribute line.",
"type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ModelParameters": {
+ "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": {
"type": "object",
"properties": {
- "api_key": {
- "type": "string"
+ "image_actions": {
+ "description": "ImageActions overrides the built-in attribute→work table (see\nDefaultImageActions). A nil value keeps the conservative default: run OCR\nfor block text, data visuals, and unobserved images.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ }
+ ]
},
- "app_id": {
- "description": "WeKnoraCloud 厂商专用凭证",
+ "image_attrs_enabled": {
+ "description": "ImageAttrsEnabled turns the attribute-observed image pipeline on for this\nknowledge base. It is off by default on purpose, so upgrading an\nexisting deployment never changes what happens to documents already\nbeing ingested: with it off every image is described and OCR'd exactly\nas before. When on, the describe round also observes image attributes and\nthe attribute policy decides whether OCR runs for it. A single upload can\noverride it per document through\nKnowledgeProcessOverrides.ImageAttrsEnabled.",
+ "type": "boolean"
+ },
+ "image_vector_enabled": {
+ "description": "ImageVectorEnabled lets a knowledge base whose embedding model takes\nimages index each image by its own vector and recall it with one. It\nis off by default on purpose: a model that takes images is also used\nfor plain text, and turning this on costs an embedding call per image\nand widens vector recall. Existing knowledge bases stay off after an\nupgrade because the stored JSON has no such key.",
+ "type": "boolean"
+ },
+ "model_id": {
+ "description": "Model ID",
"type": "string"
+ }
+ }
+ },
+ "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"
},
- "app_secret": {
- "description": "AES-256 加密存储,实际承载上游 API Key",
+ "collection_name": {
+ "description": "Milvus",
"type": "string"
},
- "base_url": {
+ "collection_prefix": {
+ "description": "Qdrant, Weaviate",
"type": "string"
},
- "context_window": {
- "description": "ContextWindow is the model's total context window in tokens and\nMaxOutputTokens the most it emits in one response. Both are provider\nfacts the agent cannot discover but has to act on: the context window is\nwhat decides when conversation history gets compacted, and assuming a\nwindow larger than the real one means compaction never fires and the\nprovider rejects the request mid-conversation instead. 0 means unknown,\nwhich falls back to DefaultMaxContextTokens.",
+ "desired_shard_count": {
+ "description": "Weaviate: number of shards per collection",
"type": "integer"
},
- "custom_headers": {
- "description": "CustomHeaders 允许在调用远程模型 API 时附加自定义 HTTP 请求头,\n用途类似 Python OpenAI SDK 的 extra_headers 参数,\n常见场景包括透传企业网关鉴权信息、追踪 ID、路由标识等。\n保留字段(Authorization、api-key、Content-Type、Accept 等)会在运行期被忽略以避免破坏签名/鉴权流程。",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "hnsw_ef_construction": {
+ "description": "OpenSearch: HNSW index-build candidate list size",
+ "type": "integer"
},
- "embedding_parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
+ "hnsw_ef_search": {
+ "description": "OpenSearch: HNSW search candidate list size (faiss; lucene reads at query time)",
+ "type": "integer"
},
- "extra_config": {
- "description": "Provider-specific configuration",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "hnsw_m": {
+ "description": "--- OpenSearch k-NN HNSW fields ---\nAll omitempty so other engines' serialized IndexConfig is unchanged.\nZero / empty values fall back to the driver defaults in buildInternalCfg.",
+ "type": "integer"
},
- "interface_type": {
+ "index_name": {
+ "description": "--- Existing fields ---",
"type": "string"
},
- "max_concurrency": {
- "description": "MaxConcurrency caps concurrent in-flight BACKGROUND (ingestion /\nenrichment) calls to THIS specific model, keyed by model ID and shared\nacross all replicas. 0 (the default) means \"fall back to the\nprocess-wide model.max_concurrency\". Interactive user-facing calls are\nnever gated. Only chat / vlm / embedding honour this (see limiter.Gate).",
+ "knn_engine": {
+ "description": "OpenSearch: k-NN backend (\"lucene\" | \"faiss\")",
+ "type": "string"
+ },
+ "number_of_replicas": {
+ "description": "ES, OpenSearch",
"type": "integer"
},
- "max_output_tokens": {
+ "number_of_shards": {
+ "description": "ES, OpenSearch",
"type": "integer"
},
- "parameter_size": {
- "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
- "type": "string"
+ "replica_number": {
+ "description": "Milvus LoadCollection / Tencent VectorDB CreateCollection replicas",
+ "type": "integer"
},
- "provider": {
- "description": "Provider identifier: openai, aliyun, zhipu, generic",
- "type": "string"
+ "replication_factor": {
+ "description": "Qdrant, Weaviate: number of replicas",
+ "type": "integer"
},
- "spec": {
- "description": "Spec overrides the catalog entry for this row: protocol, capability\nflags and the flat protocol compat object. Everything omitted is\ninherited from the vendor catalog (see internal/models/catalog).",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSpecOverride"
- }
- ]
+ "replication_num": {
+ "description": "Doris: replication_num PROPERTIES",
+ "type": "integer"
},
- "supports_vision": {
- "description": "Whether the model accepts image/multimodal input",
- "type": "boolean"
+ "shard_number": {
+ "description": "--- Scalability fields ---",
+ "type": "integer"
+ },
+ "shards_num": {
+ "description": "Milvus: number of shards per collection (CreateCollection)",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ModelSource": {
- "type": "string",
- "enum": [
- "local",
- "remote",
- "aliyun",
- "zhipu",
- "volcengine",
- "deepseek",
- "hunyuan",
- "minimax",
- "openai",
- "gemini",
- "mimo",
- "siliconflow",
- "jina",
- "openrouter",
- "litellm",
- "requesty",
- "nvidia",
- "novita",
- "azure_openai"
- ],
- "x-enum-comments": {
- "ModelSourceAliyun": "Aliyun DashScope model",
- "ModelSourceAzureOpenAI": "Azure OpenAI model",
- "ModelSourceDeepseek": "Deepseek model",
- "ModelSourceGemini": "Gemini model",
- "ModelSourceHunyuan": "Hunyuan model",
- "ModelSourceJina": "Jina AI model",
- "ModelSourceLiteLLM": "LiteLLM proxy model",
- "ModelSourceLocal": "Local model",
- "ModelSourceMimo": "Mimo model",
- "ModelSourceMinimax": "Minimax mode",
- "ModelSourceNovita": "Novita AI model",
- "ModelSourceNvidia": "NVIDIA model",
- "ModelSourceOpenAI": "OpenAI model",
- "ModelSourceOpenRouter": "OpenRouter model",
- "ModelSourceRemote": "Remote model",
- "ModelSourceRequesty": "Requesty model",
- "ModelSourceSiliconFlow": "SiliconFlow model",
- "ModelSourceVolcengine": "Volcengine model",
- "ModelSourceZhipu": "Zhipu model"
- },
- "x-enum-descriptions": [
- "Local model",
- "Remote model",
- "Aliyun DashScope model",
- "Zhipu model",
- "Volcengine model",
- "Deepseek model",
- "Hunyuan model",
- "Minimax mode",
- "OpenAI model",
- "Gemini model",
- "Mimo model",
- "SiliconFlow model",
- "Jina AI model",
- "OpenRouter model",
- "LiteLLM proxy model",
- "Requesty model",
- "NVIDIA model",
- "Novita AI model",
- "Azure OpenAI model"
- ],
- "x-enum-varnames": [
- "ModelSourceLocal",
- "ModelSourceRemote",
- "ModelSourceAliyun",
- "ModelSourceZhipu",
- "ModelSourceVolcengine",
- "ModelSourceDeepseek",
- "ModelSourceHunyuan",
- "ModelSourceMinimax",
- "ModelSourceOpenAI",
- "ModelSourceGemini",
- "ModelSourceMimo",
- "ModelSourceSiliconFlow",
- "ModelSourceJina",
- "ModelSourceOpenRouter",
- "ModelSourceLiteLLM",
- "ModelSourceRequesty",
- "ModelSourceNvidia",
- "ModelSourceNovita",
- "ModelSourceAzureOpenAI"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ModelSpecOverride": {
+ "github_com_Tencent_WeKnora_internal_types.IndexingStrategy": {
"type": "object",
"properties": {
- "api": {
- "type": "string"
+ "graph_enabled": {
+ "description": "GraphEnabled enables knowledge graph entity/relation extraction",
+ "type": "boolean"
},
- "compat": {
- "description": "Compat is a plain object so it round-trips through both JSON (API,\ndatabase column) and YAML (builtin_models.yaml).",
- "type": "object",
- "additionalProperties": {}
+ "keyword_enabled": {
+ "description": "KeywordEnabled enables keyword-based (BM25) search",
+ "type": "boolean"
},
- "context_window": {
- "type": "integer"
+ "vector_enabled": {
+ "description": "VectorEnabled enables semantic vector embedding and search",
+ "type": "boolean"
},
- "input": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "wiki_enabled": {
+ "description": "WikiEnabled enables automatic wiki page generation from documents",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "representative_user_id": {
+ "description": "RepresentativeUserID is accepted for compatibility and ignored: a\ndirect add attaches no user of the enrolled workspace, since the\ninviter must not choose whose details the roster shows.",
+ "type": "string"
},
- "max_output_tokens": {
- "type": "integer"
+ "role": {
+ "description": "Role to assign: admin/editor/viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
},
- "reasoning": {
- "type": "boolean"
+ "tenant_id": {
+ "description": "TenantID is the workspace to enrol as an org member. Preferred field.",
+ "type": "integer"
},
- "thinking_levels": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "user_id": {
+ "description": "UserID is retained for backward compatibility. When set without\nTenantID, the handler resolves the user's TenantID.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ModelType": {
- "type": "string",
- "enum": [
- "Embedding",
- "Rerank",
- "KnowledgeQA",
- "VLLM",
- "ASR"
- ],
- "x-enum-comments": {
- "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
- "ModelTypeEmbedding": "Embedding model",
- "ModelTypeKnowledgeQA": "KnowledgeQA model",
- "ModelTypeRerank": "Rerank model",
- "ModelTypeVLLM": "VLLM model"
- },
- "x-enum-descriptions": [
- "Embedding model",
- "Rerank model",
- "KnowledgeQA model",
- "VLLM model",
- "ASR (Automatic Speech Recognition) model"
- ],
- "x-enum-varnames": [
- "ModelTypeEmbedding",
- "ModelTypeRerank",
- "ModelTypeKnowledgeQA",
- "ModelTypeVLLM",
- "ModelTypeASR"
- ]
+ "github_com_Tencent_WeKnora_internal_types.JSONMap": {
+ "type": "object",
+ "additionalProperties": {}
},
- "github_com_Tencent_WeKnora_internal_types.NamedCount": {
+ "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
"type": "object",
+ "required": [
+ "organization_id"
+ ],
"properties": {
- "count": {
- "type": "integer"
+ "message": {
+ "description": "Optional message for join request",
+ "type": "string",
+ "maxLength": 500
},
- "name": {
+ "organization_id": {
"type": "string"
+ },
+ "role": {
+ "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OBSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
+ ],
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinRequestResponse": {
"type": "object",
"properties": {
- "access_key": {
+ "created_at": {
"type": "string"
},
- "bucket_name": {
+ "email": {
"type": "string"
},
- "endpoint": {
+ "id": {
"type": "string"
},
- "path_prefix": {
+ "message": {
"type": "string"
},
- "region": {
+ "prev_role": {
+ "description": "Previous role (only for upgrade requests)",
"type": "string"
},
- "secret_key": {
+ "request_type": {
+ "description": "'join' or 'upgrade'",
"type": "string"
},
- "use_ssl": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": {
- "type": "object",
- "properties": {
- "authorization_url": {
+ "requested_role": {
+ "description": "Role the applicant requested (admin/editor/viewer)",
"type": "string"
},
- "provider_display_name": {
+ "reviewed_at": {
"type": "string"
},
- "state": {
+ "status": {
"type": "string"
},
- "success": {
- "type": "boolean"
+ "user_id": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": {
+ "github_com_Tencent_WeKnora_internal_types.JoinRequestStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "approved",
+ "rejected"
+ ],
+ "x-enum-varnames": [
+ "JoinRequestStatusPending",
+ "JoinRequestStatusApproved",
+ "JoinRequestStatusRejected"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinRequestType": {
+ "type": "string",
+ "enum": [
+ "join",
+ "upgrade"
+ ],
+ "x-enum-varnames": [
+ "JoinRequestTypeJoin",
+ "JoinRequestTypeUpgrade"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.KBCapabilities": {
"type": "object",
"properties": {
- "enabled": {
+ "faq": {
+ "description": "FAQ means the KB is a FAQ-type KB (Q/A pairs).",
"type": "boolean"
},
- "provider_display_name": {
- "type": "string"
+ "graph": {
+ "description": "Graph means knowledge-graph extraction is enabled.",
+ "type": "boolean"
},
- "success": {
+ "keyword": {
+ "description": "Keyword means BM25 / sparse keyword search is indexed.",
+ "type": "boolean"
+ },
+ "vector": {
+ "description": "Vector means semantic (embedding) search is indexed.",
+ "type": "boolean"
+ },
+ "wiki": {
+ "description": "Wiki means the wiki feature is enabled and authored pages exist / will be generated.",
"type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OSSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KBCloneProgress": {
"type": "object",
"properties": {
- "access_key": {
- "type": "string"
+ "created_at": {
+ "description": "任务创建时间",
+ "type": "integer"
},
- "bucket_name": {
+ "error": {
+ "description": "错误信息",
"type": "string"
},
- "endpoint": {
+ "message": {
+ "description": "状态消息",
"type": "string"
},
- "path_prefix": {
- "type": "string"
+ "processed": {
+ "description": "已处理数",
+ "type": "integer"
},
- "region": {
- "type": "string"
+ "progress": {
+ "description": "0-100",
+ "type": "integer"
},
- "secret_key": {
+ "source_id": {
"type": "string"
},
- "temp_bucket_name": {
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus"
+ },
+ "target_id": {
"type": "string"
},
- "temp_region": {
+ "task_id": {
"type": "string"
},
- "use_temp_bucket": {
- "type": "boolean"
+ "total": {
+ "description": "总知识数",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "最后更新时间",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
+ "github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus": {
"type": "string",
"enum": [
- "admin",
- "editor",
- "viewer"
+ "pending",
+ "processing",
+ "completed",
+ "failed"
],
"x-enum-varnames": [
- "OrgRoleAdmin",
- "OrgRoleEditor",
- "OrgRoleViewer"
+ "KBCloneStatusPending",
+ "KBCloneStatusProcessing",
+ "KBCloneStatusCompleted",
+ "KBCloneStatusFailed"
]
},
- "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
+ "github_com_Tencent_WeKnora_internal_types.KS3EngineConfig": {
"type": "object",
"properties": {
- "avatar": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "id": {
- "type": "string"
- },
- "joined_at": {
+ "access_key": {
"type": "string"
},
- "representative_user_id": {
+ "bucket_name": {
"type": "string"
},
- "role": {
+ "endpoint": {
"type": "string"
},
- "tenant_id": {
- "type": "integer"
- },
- "tenant_name": {
+ "path_prefix": {
"type": "string"
},
- "user_id": {
+ "region": {
"type": "string"
},
- "username": {
+ "secret_key": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
+ "github_com_Tencent_WeKnora_internal_types.Knowledge": {
"type": "object",
"properties": {
- "agent_share_count": {
- "description": "共享到该组织的智能体数量",
- "type": "integer"
- },
- "avatar": {
+ "channel": {
+ "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
"type": "string"
},
"created_at": {
+ "description": "Creation time of the knowledge",
"type": "string"
},
+ "custom_metadata": {
+ "description": "CustomMetadata is user-authored descriptive metadata. It is deliberately\nseparate from Metadata, which contains internal ingestion state and IDs.",
+ "type": "object"
+ },
+ "deleted_at": {
+ "description": "Deletion time of the knowledge",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
"description": {
+ "description": "Description of the knowledge",
"type": "string"
},
- "has_pending_upgrade": {
- "description": "当前用户是否有待处理的权限升级申请",
- "type": "boolean"
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
+ "type": "string"
},
- "id": {
+ "enable_status": {
+ "description": "Enable status of the knowledge",
"type": "string"
},
- "invite_code": {
+ "error_message": {
+ "description": "Error message of the knowledge",
"type": "string"
},
- "invite_code_expires_at": {
+ "file_hash": {
+ "description": "File hash of the knowledge",
"type": "string"
},
- "invite_code_validity_days": {
- "type": "integer"
+ "file_name": {
+ "description": "File name of the knowledge",
+ "type": "string"
},
- "is_owner": {
- "type": "boolean"
+ "file_path": {
+ "description": "File path of the knowledge",
+ "type": "string"
},
- "member_count": {
+ "file_size": {
+ "description": "File size of the knowledge",
"type": "integer"
},
- "member_limit": {
- "description": "0 = unlimited",
- "type": "integer"
+ "file_type": {
+ "description": "File type of the knowledge",
+ "type": "string"
},
- "my_role": {
+ "folder_path": {
+ "description": "FolderPath is the canonical relative directory this entry belongs to\ninside the knowledge base, e.g. \"docs/spec\" for a folder upload of\n\"docs/spec/design.md\". Empty means the knowledge base root. It is a\ndisplay/navigation concern only: it never affects where the file is\nphysically stored (see FilePath).",
"type": "string"
},
- "name": {
+ "id": {
+ "description": "Unique identifier of the knowledge",
"type": "string"
},
- "owner_id": {
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base",
"type": "string"
},
- "owner_tenant_id": {
- "description": "OwnerTenantID is the persisted owner workspace of the organization\n(Plan 3, migration 000046). Frontend uses this to identify the\n\"owner row\" in the workspace-keyed members list — comparing\nmember.tenant_id against owner_tenant_id is the post-Plan-3\nequivalent of the old member.user_id == owner_id check.",
- "type": "integer"
+ "knowledge_base_name": {
+ "description": "Knowledge base name (not stored in database, populated on query)",
+ "type": "string"
},
- "pending_join_request_count": {
- "description": "待审批加入申请数(仅管理员可见)",
- "type": "integer"
+ "last_activity_at": {
+ "description": "Most recent processing progress (row or span write) for an in-flight\nrow, so clients can tell a slow stage from a stalled one. Not stored.",
+ "type": "string"
},
- "require_approval": {
- "type": "boolean"
+ "last_faq_import_result": {
+ "description": "Last FAQ import result (for FAQ type knowledge only)",
+ "type": "object"
},
- "searchable": {
- "type": "boolean"
- },
- "share_count": {
- "description": "共享到该组织的知识库数量",
- "type": "integer"
- },
- "updated_at": {
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": {
- "type": "object",
- "properties": {
- "chat_parser_engine_rules": {
- "description": "ChatParserEngineRules selects parser engines for session-scoped chat\ndocuments. Knowledge bases keep their own rules in ChunkingConfig.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
+ "metadata": {
+ "description": "Metadata of the knowledge",
+ "type": "object"
},
- "mineru_api_key": {
- "description": "MinerU 云 API Key",
+ "parse_status": {
+ "description": "Parse status of the knowledge",
"type": "string"
},
- "mineru_cloud_enable_formula": {
- "type": "boolean"
+ "pending_subtasks_count": {
+ "description": "PendingSubtasksCount is the outstanding enrichment subtask count\n(summary + question + graph chunks). Only meaningful while\nParseStatus == \"finalizing\"; defaults to 0 in any terminal state.",
+ "type": "integer"
},
- "mineru_cloud_enable_ocr": {
- "type": "boolean"
+ "processed_at": {
+ "description": "Processed time of the knowledge",
+ "type": "string"
},
- "mineru_cloud_enable_table": {
- "type": "boolean"
+ "profile": {
+ "description": "Profile is the structured companion of Description: a one-line gist,\ntopic keywords, a document type and one typical question. It is produced\nby the same model call as the summary and feeds the knowledge-base\nlevel description aggregation. nil when no summary has been generated.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProfile"
+ }
+ ]
},
- "mineru_cloud_language": {
+ "source": {
+ "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
"type": "string"
},
- "mineru_cloud_model": {
- "description": "MinerU 云 API 解析参数",
+ "stall_state": {
+ "description": "Verdict on an in-flight row gone quiet: StallStateQueued (its work is\nstill queued, i.e. backlogged) or StallStateStalled (nothing left to\nrun it). Empty while it is progressing or the probe failed. Not stored.",
"type": "string"
},
- "mineru_enable_formula": {
- "type": "boolean"
+ "storage_size": {
+ "description": "Storage size of the knowledge",
+ "type": "integer"
},
- "mineru_enable_ocr": {
- "description": "MinerUEnableOCR is retained for compatibility with configurations saved\nbefore parse_method supported auto/ocr/txt.",
- "type": "boolean"
+ "summary_status": {
+ "description": "Summary status for async summary generation",
+ "type": "string"
},
- "mineru_enable_table": {
- "type": "boolean"
+ "tags": {
+ "description": "Tags holds the tags associated with this knowledge (populated on query, not persisted directly).",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeTag"
+ }
},
- "mineru_endpoint": {
- "description": "MinerU 自建服务端点",
- "type": "string"
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
},
- "mineru_language": {
+ "title": {
+ "description": "Title of the knowledge",
"type": "string"
},
- "mineru_model": {
- "description": "以下 backend、vLLM、公式/表格、语言参数仅对 3.x 及更早版本生效。",
+ "type": {
+ "description": "Type of the knowledge",
"type": "string"
},
- "mineru_parse_method": {
+ "updated_at": {
+ "description": "Last updated time of the knowledge",
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": {
+ "type": "object",
+ "properties": {
+ "asr_config": {
+ "description": "ASR config (Automatic Speech Recognition)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
+ }
+ ]
},
- "mineru_server_api_key": {
- "description": "MinerU 自建解析参数。协议按服务端自动识别:4.0+ 走 V1 API,更早版本走 /file_parse。",
- "type": "string"
+ "auto_tag_config": {
+ "description": "AutoTagConfig controls asynchronous association of existing tags after parsing.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
+ }
+ ]
},
- "mineru_tier": {
- "description": "4.0+:flash/basic/standard/advanced,空为服务端默认",
- "type": "string"
+ "chunk_count": {
+ "description": "Chunk count (not stored in database, calculated on query)",
+ "type": "integer"
},
- "mineru_vlm_server_url": {
- "description": "vLLM 服务器地址 (vlm-http-client / hybrid-http-client)",
- "type": "string"
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
},
- "odl_hybrid": {
- "description": "OpenDataLoader PDF (docreader engine); hybrid requires opendataloader-pdf-hybrid service.",
+ "created_at": {
+ "description": "Creation time of the knowledge base",
"type": "string"
},
- "odl_hybrid_fallback": {
- "type": "boolean"
- },
- "odl_hybrid_mode": {
- "description": "auto, full",
+ "creator_id": {
+ "description": "CreatorID records the user ID of whoever originally created the KB.\nUsed by the workspace-level RBAC middleware to let Contributors edit\ntheir own KBs without granting them access to everyone else's.\nNullable for backward compatibility with rows created before the\nRBAC migration backfilled the column to the workspace Owner.",
"type": "string"
},
- "odl_hybrid_url": {
- "description": "e.g. http://odl-hybrid:5002",
+ "creator_name": {
+ "description": "CreatorName 是 CreatorID 对应用户的展示名(username / email 等),\n仅在列表场景由 handler 批量回填,不落库;为空表示创建者无法解析(用户已删除、\nCreatorID 为空的老数据等)。前端用它在卡片来源徽章上做 mine vs workspace 的二分。",
"type": "string"
},
- "odl_markdown_with_html": {
- "type": "boolean"
+ "deleted_at": {
+ "description": "Deletion time of the knowledge base",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
- "paddleocr_vl_cloud_model": {
- "description": "e.g. PaddleOCR-VL-1.6",
+ "description": {
+ "description": "Description of the knowledge base",
"type": "string"
},
- "paddleocr_vl_cloud_token": {
- "description": "PaddleOCR-VL AI Studio cloud API.",
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
"type": "string"
},
- "paddleocr_vl_cloud_use_chart_recognition": {
- "type": "boolean"
+ "extract_config": {
+ "description": "Extract config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
+ }
+ ]
},
- "paddleocr_vl_cloud_use_seal_recognition": {
- "type": "boolean"
+ "faq_config": {
+ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
},
- "paddleocr_vl_endpoint": {
- "description": "PaddleOCR-VL self-hosted pipeline service (full /layout-parsing API).",
+ "generated_profile": {
+ "description": "GeneratedProfile is the machine-generated description: a gist, merged\ntopics, typical questions and the aggregate snapshot they came from. It\nnever overwrites the user-authored Description; both are shown to agents.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the knowledge base",
"type": "string"
},
- "paddleocr_vl_use_chart_recognition": {
- "type": "boolean"
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
},
- "paddleocr_vl_use_seal_recognition": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": {
- "type": "object",
- "properties": {
- "engine": {
- "type": "string"
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active for this knowledge base.\nPipelines: vector search, keyword search, wiki generation, knowledge graph extraction.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
},
- "file_types": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "is_pinned": {
+ "description": "IsPinned and PinnedAt are computed per-caller from user_kb_pins\n(see migration 000050). They used to be stored on the row itself,\nwhich made pinning a workspace-wide ordering decision gated behind\nthe kb-edit RBAC guard. The columns are still present in legacy\nschemas for rollback safety but are no longer read or written by\nthe application — both fields are tagged `gorm:\"-\"` so GORM\nignores them on every CRUD call and the list handler stamps them\nafter enriching with the caller's pin set.",
+ "type": "boolean"
},
- "xlsx_first_row_as_header": {
- "description": "XLSXFirstRowAsHeader restores row-1 column context for flat XLSX tables.\nnil preserves the parser default; an explicit false disables the mode.",
+ "is_processing": {
+ "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
"type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.PromptCacheStatus": {
- "type": "string",
- "enum": [
- "unsupported",
- "unreported",
- "miss",
- "hit"
- ],
- "x-enum-varnames": [
- "PromptCacheStatusUnsupported",
- "PromptCacheStatusUnreported",
- "PromptCacheStatusMiss",
- "PromptCacheStatusHit"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ProviderMetadata": {
- "type": "object",
- "additionalProperties": {
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
- "type": "object",
- "properties": {
- "custom_instructions": {
- "description": "CustomInstructions describes the intended audience or question style.\nIt is appended to the stable system question-generation template.",
- "type": "string"
},
- "enabled": {
+ "is_temporary": {
+ "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
"type": "boolean"
},
- "question_count": {
- "description": "Number of questions to generate per chunk (default: 3, max: 10)",
+ "knowledge_count": {
+ "description": "Knowledge count (not stored in database, calculated on query)",
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.QuestionOrigin": {
- "type": "object",
- "properties": {
- "knowledge_base_id": {
- "type": "string"
},
- "knowledge_id": {
+ "name": {
+ "description": "Name of the knowledge base",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig": {
- "type": "object",
- "properties": {
- "follow_ups": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig"
- },
- "starters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.QueueStat": {
- "type": "object",
- "properties": {
- "active": {
- "type": "integer"
},
- "archived": {
- "type": "integer"
+ "pinned_at": {
+ "description": "PinnedAt records when the current caller pinned this knowledge\nbase; nil when they have not.",
+ "type": "string"
},
- "completed": {
+ "processing_count": {
+ "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
"type": "integer"
},
- "failed": {
- "type": "integer"
+ "profile_config": {
+ "description": "ProfileConfig controls automatic generation of the knowledge-base\ndescription from per-document profiles (document knowledge bases only).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
+ }
+ ]
},
- "latency_ms": {
- "description": "LatencyMs is the age of the oldest pending task, in milliseconds.",
- "type": "integer"
+ "question_generation_config": {
+ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
+ }
+ ]
},
- "memory_usage_bytes": {
- "description": "MemoryUsageBytes is the approximate Redis memory the queue occupies.",
+ "share_count": {
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
"type": "integer"
},
- "name": {
+ "storage_backend_id": {
+ "description": "StorageBackendID binds this KB to one concrete storage instance. The\nlegacy provider field remains readable during migration only.",
"type": "string"
},
- "paused": {
- "description": "Paused reports whether the queue is paused (tasks not consumed).",
- "type": "boolean"
+ "storage_config": {
+ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
+ }
+ ]
},
- "pending": {
- "type": "integer"
+ "storage_provider_config": {
+ "description": "Storage provider config (new): only stores provider selection; credentials from workspace StorageEngineConfig",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
+ }
+ ]
},
- "pool": {
- "description": "Pool is the independent worker pool that drains this queue.",
+ "summary_model_id": {
+ "description": "Summary model ID",
"type": "string"
},
- "processed": {
- "description": "Processed / Failed are today's counters (reset daily).",
- "type": "integer"
- },
- "retry": {
+ "tenant_id": {
+ "description": "Workspace ID",
"type": "integer"
},
- "scheduled": {
- "type": "integer"
+ "type": {
+ "description": "Type of the knowledge base (document, faq, etc.)",
+ "type": "string"
},
- "size": {
- "description": "Size is the total number of tasks in the queue (pending + active +\nscheduled + retry + aggregating + archived).",
- "type": "integer"
+ "updated_at": {
+ "description": "Last updated time of the knowledge base",
+ "type": "string"
},
- "weight": {
- "description": "Weight is the queue's scheduling weight inside its pool.",
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
- "type": "object",
- "required": [
- "email",
- "password",
- "username"
- ],
- "properties": {
- "email": {
+ "vector_store_id": {
+ "description": "VectorStoreID references the VectorStore this knowledge base is bound to.\nWhen nil, the KB falls back to the workspace's effective engines derived from\nthe RETRIEVE_DRIVER environment variable (env store flow).\nThis field is set once at creation time and must not be modified afterwards;\nenforcement lives at the GORM layer (`\u003c-:create`) plus the service-layer\nKB update path, which omits this field from its update DTO.",
"type": "string"
},
- "password": {
- "type": "string",
- "minLength": 6
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ ]
},
- "username": {
- "type": "string",
- "maxLength": 50,
- "minLength": 2
+ "wiki_config": {
+ "description": "WikiConfig stores wiki-specific configuration (only for wiki type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RegisterResponse": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
"type": "object",
"properties": {
- "message": {
- "type": "string"
- },
- "success": {
- "type": "boolean"
+ "auto_tag_config": {
+ "description": "AutoTagConfig controls optional automatic association of existing KB tags.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
+ }
+ ]
},
- "tenant": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
},
- "user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
- "type": "object",
- "required": [
- "requested_role"
- ],
- "properties": {
- "message": {
- "description": "Optional message explaining the reason",
- "type": "string",
- "maxLength": 500
+ "faq_config": {
+ "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
},
- "requested_role": {
- "description": "The role user wants to upgrade to",
+ "image_processing_config": {
+ "description": "Image processing configuration.\n\nnil means \"no change\" when updating, the same contract IndexingStrategy\nuses. A request that does not mention this field must leave the image\nsettings alone: the attribute-observation switch and the attribute policy\nare things a knowledge base accumulates, and a client that predates them\nwould otherwise reset the lot on any save. Sending an object — empty\nincluded — replaces the whole configuration.",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
}
]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RerankOptions": {
- "type": "object",
- "properties": {
- "enabled": {
- "description": "Enabled turns the rerank stage off when explicitly false. Nil means on.",
- "type": "boolean"
},
- "model_id": {
- "description": "ModelID selects the rerank model. Empty falls back to the tenant\nRetrievalConfig, then to the first rerank model of the tenant.",
- "type": "string"
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active.\nnil means \"no change\" when updating (preserves existing strategy).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
},
- "threshold": {
- "description": "Threshold is the minimum rerank model score. Nil uses the tenant\nRetrievalConfig. A pointer because 0 and negative scores are valid.",
- "type": "number"
+ "profile_config": {
+ "description": "ProfileConfig controls optional automatic knowledge-base description\ngeneration. nil means \"no change\" when updating.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
+ }
+ ]
},
- "top_k": {
- "description": "TopK caps the reranked results. Zero uses the endpoint's result count.",
- "type": "integer"
+ "wiki_config": {
+ "description": "Wiki configuration (only for wiki-enabled knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Resource": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile": {
"type": "object",
"properties": {
- "description": {
- "description": "Optional description",
- "type": "string"
- },
- "external_id": {
- "description": "Unique identifier in the external system",
+ "aggregate_hash": {
+ "description": "AggregateHash identifies the aggregate the gist was generated from. A\nmismatch with the live aggregate means the text is stale.",
"type": "string"
},
- "has_children": {
- "description": "Whether this resource has children that can be expanded",
- "type": "boolean"
- },
- "metadata": {
- "description": "Additional metadata",
- "type": "object",
- "additionalProperties": true
- },
- "modified_at": {
- "description": "Last modified time in external system",
+ "error": {
+ "description": "Error holds the last generation error when Status is failed.",
"type": "string"
},
- "name": {
- "description": "Display name",
+ "generated_at": {
+ "description": "GeneratedAt records when the text was produced.",
"type": "string"
},
- "parent_id": {
- "description": "For hierarchical resources (parent ID if applicable)",
+ "gist": {
+ "description": "Gist is a short statement of what the knowledge base covers.",
"type": "string"
},
- "type": {
- "description": "Resource type (document, folder, space, page, etc.)",
+ "model_id": {
+ "description": "ModelID records which chat model produced the text.",
"type": "string"
},
- "url": {
- "description": "URL to access in external system",
+ "stats": {
+ "description": "Stats is the aggregate snapshot the text was generated from.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileStats"
+ }
+ ]
+ },
+ "status": {
+ "description": "Status is one of the KnowledgeBaseProfileStatus* values.",
"type": "string"
+ },
+ "topics": {
+ "description": "Topics is the merged topic list (at most KnowledgeBaseProfileMaxTopics).",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "typical_questions": {
+ "description": "TypicalQuestions lists questions this knowledge base can answer.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig": {
"type": "object",
"properties": {
- "agents": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
+ "custom_instructions": {
+ "description": "CustomInstructions is appended to the stable system prompt, e.g. the\naudience the description should address or terms to keep.",
+ "type": "string"
},
- "knowledge_bases": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
+ "enabled": {
+ "type": "boolean"
+ },
+ "model_id": {
+ "description": "ModelID overrides the chat model; empty falls back to the KB summary model.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileStats": {
"type": "object",
"properties": {
- "embedding_top_k": {
- "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
- "type": "integer"
+ "doc_types": {
+ "description": "DocTypes counts documents per model-assigned document type.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ }
},
- "keyword_threshold": {
- "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
- "type": "number"
+ "document_count": {
+ "description": "DocumentCount is the number of eligible documents at generation time.",
+ "type": "integer"
},
- "rerank_model_id": {
- "description": "RerankModelID is the ID of the rerank model to use (required for search)",
+ "earliest_at": {
+ "description": "EarliestAt and LatestAt bound document creation times.",
"type": "string"
},
- "rerank_threshold": {
- "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
- "type": "number"
+ "file_types": {
+ "description": "FileTypes counts documents per file extension.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ }
},
- "rerank_top_k": {
- "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
- "type": "integer"
+ "folders": {
+ "description": "Folders lists the top-level folder names present.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "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"
+ "latest_at": {
+ "type": "string"
},
- "rrf_keyword_weight": {
- "description": "RRFKeywordWeight is the keyword counterpart. Default: 0.3.",
- "type": "number"
+ "profiled_count": {
+ "description": "ProfiledCount is how many of them carried a document profile.",
+ "type": "integer"
},
- "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"
+ "raw_topics": {
+ "description": "RawTopics counts documents per normalized topic keyword before merging.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ }
},
- "vector_threshold": {
- "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
- "type": "number"
+ "tags": {
+ "description": "Tags counts documents per knowledge-base tag.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare": {
"type": "object",
"properties": {
- "retriever_engine_type": {
- "description": "Retriever engine type",
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time (soft delete)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ "$ref": "#/definitions/gorm.DeletedAt"
}
]
},
- "retriever_type": {
- "description": "Retriever type",
+ "id": {
+ "description": "Unique identifier",
+ "type": "string"
+ },
+ "knowledge_base": {
+ "description": "Associations (not stored in database)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
}
]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": {
- "type": "string",
- "enum": [
- "postgres",
- "elasticsearch",
- "infinity",
- "elasticfaiss",
- "qdrant",
- "milvus",
- "weaviate",
- "doris",
- "sqlite",
- "tencent_vectordb",
- "opensearch"
- ],
- "x-enum-varnames": [
- "PostgresRetrieverEngineType",
- "ElasticsearchRetrieverEngineType",
- "InfinityRetrieverEngineType",
- "ElasticFaissRetrieverEngineType",
- "QdrantRetrieverEngineType",
- "MilvusRetrieverEngineType",
- "WeaviateRetrieverEngineType",
- "DorisRetrieverEngineType",
- "SQLiteRetrieverEngineType",
- "TencentVectorDBRetrieverEngineType",
- "OpenSearchRetrieverEngineType"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
- "type": "object",
- "properties": {
- "engines": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.RetrieverType": {
- "type": "string",
- "enum": [
- "keywords",
- "vector",
- "websearch"
- ],
- "x-enum-comments": {
- "KeywordsRetrieverType": "Keywords retriever",
- "VectorRetrieverType": "Vector retriever",
- "WebSearchRetrieverType": "Web search retriever"
- },
- "x-enum-descriptions": [
- "Keywords retriever",
- "Vector retriever",
- "Web search retriever"
- ],
- "x-enum-varnames": [
- "KeywordsRetrieverType",
- "VectorRetrieverType",
- "WebSearchRetrieverType"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
- "type": "object",
- "properties": {
- "approved": {
- "type": "boolean"
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "knowledge_base_id": {
+ "description": "Knowledge base ID being shared",
+ "type": "string"
},
- "role": {
- "description": "Optional: role to assign when approving; overrides applicant's requested role",
+ "organization": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Organization"
+ },
+ "organization_id": {
+ "description": "Organization ID receiving the share",
+ "type": "string"
+ },
+ "permission": {
+ "description": "Permission level (admin/editor/viewer)",
"allOf": [
{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
]
+ },
+ "shared_by_user_id": {
+ "description": "User ID who shared the knowledge base",
+ "type": "string"
+ },
+ "source_tenant_id": {
+ "description": "Original tenant ID of the knowledge base (for cross-tenant embedding model access)",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RuntimeTaskAction": {
- "type": "string",
- "enum": [
- "cancel",
- "run_now",
- "delete"
- ],
- "x-enum-varnames": [
- "RuntimeTaskActionCancel",
- "RuntimeTaskActionRunNow",
- "RuntimeTaskActionDelete"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.RuntimeTaskInfo": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
"type": "object",
"properties": {
- "allowed_actions": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RuntimeTaskAction"
- }
- },
- "completed_at": {
- "type": "string"
+ "chunk_count": {
+ "type": "integer"
},
- "data_source_id": {
+ "created_at": {
"type": "string"
},
- "deadline": {
+ "id": {
"type": "string"
},
- "enqueued_at": {
+ "knowledge_base_id": {
"type": "string"
},
- "id": {
+ "knowledge_base_name": {
"type": "string"
},
- "is_orphaned": {
- "type": "boolean"
- },
- "knowledge_base_id": {
+ "knowledge_base_type": {
"type": "string"
},
"knowledge_count": {
"type": "integer"
},
- "knowledge_id": {
+ "my_permission": {
+ "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
"type": "string"
},
- "last_error": {
+ "my_role_in_org": {
+ "description": "Current user's role in this organization (admin/editor/viewer)",
"type": "string"
},
- "last_failed_at": {
+ "organization_id": {
"type": "string"
},
- "max_retry": {
- "type": "integer"
- },
- "next_process_at": {
+ "organization_name": {
"type": "string"
},
- "queue": {
+ "permission": {
+ "description": "Share permission (what the space was granted: viewer/editor)",
"type": "string"
},
- "retried": {
- "type": "integer"
- },
- "source_id": {
- "type": "string"
+ "require_approval": {
+ "type": "boolean"
},
- "source_kb_id": {
+ "shared_by_user_id": {
"type": "string"
},
- "started_at": {
+ "shared_by_username": {
"type": "string"
},
- "state": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RuntimeTaskState"
- },
- "sync_log_id": {
- "type": "string"
+ "source_tenant_id": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeFolderNode": {
+ "type": "object",
+ "properties": {
+ "children": {
+ "description": "Children are the direct sub-folders, sorted by name.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeFolderNode"
+ }
},
- "target_id": {
- "type": "string"
+ "document_count": {
+ "description": "DocumentCount counts entries whose folder_path equals Path.",
+ "type": "integer"
},
- "target_kb_id": {
+ "name": {
+ "description": "Name is the last segment of Path, used as the tree row label.",
"type": "string"
},
- "task_id": {
+ "path": {
+ "description": "Path is the canonical folder path, e.g. \"docs/spec\".",
"type": "string"
},
- "tenant_id": {
+ "total_count": {
+ "description": "TotalCount counts entries in Path and in all descendant folders.",
"type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeFolderTree": {
+ "type": "object",
+ "properties": {
+ "folders": {
+ "description": "Folders are the top-level folders, sorted by name.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeFolderNode"
+ }
},
- "type": {
- "type": "string"
+ "root_document_count": {
+ "description": "RootDocumentCount counts entries that live at the knowledge base root\n(folder_path = \"\"), i.e. documents that were not uploaded as part of a\nfolder.",
+ "type": "integer"
},
- "worker": {
- "type": "string"
+ "total_document_count": {
+ "description": "TotalDocumentCount counts every entry in the knowledge base, matching\nthe unfiltered document list total.",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.RuntimeTaskState": {
- "type": "string",
- "enum": [
- "pending",
- "active",
- "scheduled",
- "retry",
- "archived",
- "completed"
- ],
- "x-enum-varnames": [
- "RuntimeTaskPending",
- "RuntimeTaskActive",
- "RuntimeTaskScheduled",
- "RuntimeTaskRetry",
- "RuntimeTaskArchived",
- "RuntimeTaskCompleted"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress": {
"type": "object",
"properties": {
- "access_key": {
- "type": "string"
+ "created_at": {
+ "description": "任务创建时间",
+ "type": "integer"
},
- "bucket_name": {
+ "error": {
+ "description": "错误信息",
"type": "string"
},
- "endpoint": {
+ "failed": {
+ "description": "失败数",
+ "type": "integer"
+ },
+ "message": {
+ "description": "状态消息",
"type": "string"
},
- "force_path_style": {
- "type": "boolean"
+ "processed": {
+ "description": "已处理数",
+ "type": "integer"
},
- "path_prefix": {
- "type": "string"
+ "progress": {
+ "description": "0-100",
+ "type": "integer"
},
- "region": {
+ "source_kb_id": {
"type": "string"
},
- "secret_key": {
- "type": "string"
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus"
},
- "use_ssl": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SandboxCheckpoint": {
- "type": "object",
- "properties": {
- "commit_sha": {
+ "target_kb_id": {
"type": "string"
},
- "committed_at": {
+ "task_id": {
"type": "string"
},
- "sandbox_id": {
- "type": "string"
+ "total": {
+ "description": "总知识数",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "最后更新时间",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SandboxNetworkPolicy": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides": {
"type": "object",
"properties": {
- "allow_out": {
- "description": "AllowOut accepts IPv4, IPv4 CIDR, a DNS name, or a single-label\nwildcard such as \"*.example.com\". Domain entries are only meaningful\ntogether with a deny-all; see ValidateSandboxNetworkPolicy.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "asr_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
},
- "allow_public_inbound": {
- "description": "AllowPublicInbound is accepted on the wire for old payloads and then\ncleared. Inbound is always credential-required; a true value has no\nruntime effect.",
+ "chunking_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ },
+ "enable_multimodel": {
"type": "boolean"
},
- "cube_rules": {
- "description": "CubeRules are validated whenever present and consumed only by the Cube\nprovider adapter.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeEgressRule"
- }
+ "extract_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
},
- "deny_egress_by_default": {
- "description": "DenyEgressByDefault installs a 0.0.0.0/0 deny-all, after which only\nAllowOut (and L7 rule targets) can reach the network. false allows\npublic egress, which is what skill installs need.",
+ "graph_enabled": {
"type": "boolean"
},
- "deny_out": {
- "description": "DenyOut accepts IPv4 and IPv4 CIDR only. Neither provider can deny a\ndomain: denial is a pure longest-prefix match on the destination IP.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "image_actions": {
+ "description": "ImageActions overrides rows of the attribute-\u003ework table for this document\n(merged per action key on top of the knowledge base's table).\nnil keeps the knowledge base's setting.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ }
+ ]
},
- "e2b_host_rules": {
- "description": "E2BHostRules are validated whenever present and consumed only by the E2B\nprovider adapter.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.E2BHostRule"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SearchParams": {
- "type": "object",
- "properties": {
- "disable_keywords_match": {
+ "image_attrs_enabled": {
+ "description": "ImageAttrsEnabled overrides the knowledge base's attribute-observed image\npipeline switch for this one document. nil keeps the knowledge base's\nsetting.",
"type": "boolean"
},
- "disable_vector_match": {
+ "image_vector_enabled": {
+ "description": "ImageVectorEnabled overrides image vector indexing for this document.\nIt does not change the KB-wide retrieval setting or embedding model.",
"type": "boolean"
},
- "keyword_threshold": {
- "type": "number"
- },
- "knowledge_base_ids": {
- "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
- "type": "array",
- "items": {
+ "parser_engine_overrides": {
+ "description": "ParserEngineOverrides passes key-value configuration to docreader parsers\n(e.g. pdf_force_scanned=true). Merged with workspace-level overrides in the\nparse pipeline; per-upload values take priority on conflict.",
+ "type": "object",
+ "additionalProperties": {
"type": "string"
}
},
- "knowledge_ids": {
+ "parser_engine_rules": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
}
},
- "match_count": {
- "type": "integer"
+ "question_generation_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
},
- "only_recommended": {
+ "summary_enabled": {
+ "description": "SummaryEnabled defaults to true when omitted for backward compatibility.",
"type": "boolean"
},
- "query_embedding": {
+ "vlm_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeProfile": {
+ "type": "object",
+ "properties": {
+ "doc_type": {
+ "description": "DocType is a coarse label such as \"user manual\", \"meeting notes\" or \"contract\".",
+ "type": "string"
+ },
+ "gist": {
+ "description": "Gist is a one-line statement of what the document is about.",
+ "type": "string"
+ },
+ "topics": {
+ "description": "Topics lists 3-5 short topic keywords.",
"type": "array",
"items": {
- "type": "number"
+ "type": "string"
}
},
- "query_text": {
- "description": "QueryText is required unless query_embedding is provided, keyword matching is disabled,\nand vector matching remains enabled.",
+ "typical_question": {
+ "description": "TypicalQuestion is one natural-language question this document answers.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeTag": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "description": "Optional display color",
"type": "string"
},
- "rerank": {
- "description": "Rerank, when present and enabled, reranks the fused candidates before\ntruncating to MatchCount. Only the hybrid-search API reads it; internal\ncallers rerank on their own.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankOptions"
- }
- ]
- },
- "scope_tag_ids": {
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier of the tag (UUID)",
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base ID that this tag belongs to",
+ "type": "string"
+ },
+ "name": {
+ "description": "Tag name, unique within the same knowledge base",
+ "type": "string"
+ },
+ "seq_id": {
+ "description": "SeqID is an auto-increment integer ID for external API usage",
+ "type": "integer"
+ },
+ "sort_order": {
+ "description": "Sort order within the same knowledge base",
+ "type": "integer"
+ },
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListJoinRequestsResponse": {
+ "type": "object",
+ "properties": {
+ "requests": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestResponse"
}
},
- "skip_context_enrichment": {
- "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
- "type": "boolean"
- },
- "tag_ids": {
- "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
+ "type": "object",
+ "properties": {
+ "members": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
}
},
- "vector_threshold": {
- "type": "number"
+ "total": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SearchResult": {
+ "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
"type": "object",
"properties": {
- "chunk_index": {
- "description": "Chunk index",
- "type": "integer"
+ "organizations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
},
- "chunk_metadata": {
- "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
+ "resource_counts": {
+ "description": "各空间内知识库/智能体数量,供列表侧栏展示",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
+ }
+ ]
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
+ "type": "object",
+ "properties": {
+ "shares": {
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
}
},
- "chunk_type": {
- "description": "Chunk 类型",
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": {
+ "type": "object",
+ "properties": {
+ "path_prefix": {
"type": "string"
- },
- "content": {
- "description": "Content",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LoginRequest": {
+ "type": "object",
+ "required": [
+ "email",
+ "password"
+ ],
+ "properties": {
+ "email": {
"type": "string"
},
- "end_at": {
- "description": "End at",
- "type": "integer"
+ "password": {
+ "type": "string",
+ "minLength": 6
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LoginResponse": {
+ "type": "object",
+ "properties": {
+ "active_tenant": {
+ "description": "ActiveTenant is the workspace whose ID is encoded in the issued JWT;\nfuture requests are scoped to it until the client calls /auth/switch-tenant.\nDefaults to the user's home workspace on a fresh login.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ }
+ ]
},
- "id": {
- "description": "ID",
- "type": "string"
+ "memberships": {
+ "description": "Memberships lists every workspace the user can authenticate into,\nalong with their role in each. Always populated (length 1 for users\nwho only belong to their home workspace) so frontends can render a\nworkspace switcher without a follow-up request. Serialised without\nomitempty so the field is always present as a JSON array (possibly\nempty) — the \"always populated\" contract relies on the server side\nguaranteeing a non-nil slice.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Membership"
+ }
},
- "image_info": {
- "description": "图片信息 (JSON 格式)",
+ "message": {
"type": "string"
},
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
+ "refresh_token": {
"type": "string"
},
- "knowledge_channel": {
- "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
- "type": "string"
+ "success": {
+ "type": "boolean"
},
- "knowledge_custom_metadata": {
- "description": "KnowledgeCustomMetadata is user-authored context safe to expose to models.",
+ "token": {
"type": "string"
},
- "knowledge_description": {
- "description": "KnowledgeDescription is the description of the knowledge document",
- "type": "string"
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig": {
+ "type": "object",
+ "properties": {
+ "retry_count": {
+ "description": "Number of retries, default: 3",
+ "type": "integer"
},
- "knowledge_filename": {
- "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
- "type": "string"
+ "retry_delay": {
+ "description": "Delay between retries in seconds, default: 1",
+ "type": "integer"
},
- "knowledge_id": {
- "description": "Knowledge ID",
+ "timeout": {
+ "description": "Timeout in seconds, default: 30",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": {
+ "type": "object",
+ "properties": {
+ "api_key": {
"type": "string"
},
- "knowledge_source": {
- "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
+ "api_key_header": {
+ "description": "APIKeyHeader is the header name that carries APIKey when AuthType is\napi_key. Empty defaults to \"X-API-Key\". This is non-secret structural\nconfig (the secret is APIKey), so it is not encrypted and is safe to echo\nback in responses. It lets services that expect the key in a different\nheader (e.g. the raw token directly in \"Authorization\") work without\nresorting to plaintext custom headers.",
"type": "string"
},
- "knowledge_title": {
- "description": "Knowledge title",
+ "auth_server_metadata_url": {
+ "description": "AuthServerMetadataURL optionally pins the OAuth authorization server\nmetadata URL. When empty, the server is discovered automatically from\nthe MCP URL (RFC 9728 / RFC 8414).",
"type": "string"
},
- "match_type": {
- "description": "Match type",
+ "auth_type": {
+ "description": "AuthType selects the authentication strategy. Empty (\"\") is treated as\nnone for backward compatibility with rows that pre-date this field.",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthType"
}
]
},
- "matched_content": {
- "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "client_id": {
+ "description": "ClientID optionally names an OAuth client registered with the\nauthorization server in advance. When set it is used instead of dynamic\nclient registration, for servers that offer no registration endpoint or\nallow grants only to clients an administrator registered. Non-secret.",
"type": "string"
},
- "matched_images": {
- "description": "MatchedImages survives merging, deduplication and stored reference replay.\nIt contains storage references, never image bytes.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchedImage"
- }
+ "client_secret": {
+ "description": "ClientSecret is the secret of ClientID for a confidential client.\nSecret: encrypted at rest like APIKey and Token, never returned, and\nchanged only through the credentials subresource after creation.",
+ "type": "string"
},
- "metadata": {
- "description": "Metadata",
+ "custom_headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
- "parent_chunk_id": {
- "description": "父 Chunk ID",
- "type": "string"
- },
- "score": {
- "description": "Score",
- "type": "number"
- },
- "seq": {
- "description": "Seq",
- "type": "integer"
- },
- "source_locators": {
- "description": "SourceLocators point back into the original file for citation\nnavigation. Merged results carry the union of their chunks' locators.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SourceLocator"
- }
- },
- "start_at": {
- "description": "Start at",
- "type": "integer"
- },
- "sub_chunk_id": {
- "description": "SubChunkIndex",
+ "scopes": {
+ "description": "Scopes are the OAuth scopes requested during authorization. Optional.",
"type": "array",
"items": {
"type": "string"
}
+ },
+ "token": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Session": {
+ "github_com_Tencent_WeKnora_internal_types.MCPAuthType": {
+ "type": "string",
+ "enum": [
+ "",
+ "api_key",
+ "bearer",
+ "oauth"
+ ],
+ "x-enum-varnames": [
+ "MCPAuthNone",
+ "MCPAuthAPIKey",
+ "MCPAuthBearer",
+ "MCPAuthOAuth"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPResource": {
"type": "object",
"properties": {
- "created_at": {
+ "description": {
"type": "string"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "description": {
- "description": "Description",
+ "mimeType": {
"type": "string"
},
- "forked_from_message_id": {
- "description": "ForkedFromMessageID is the user or assistant message, IN THE PARENT\nSESSION, that the fork branched at. For a user point, messages strictly\nbefore it were copied here. For an assistant point, that answer is\nincluded so the branch continues after it.",
+ "name": {
"type": "string"
},
- "host_workspace_dir": {
- "description": "HostWorkspaceDir is the user-selected project directory this session\noperates in, for the WeKnora Lite host sandbox only. Empty means the session\ngets an auto-allocated workspace instead.\n\nWritten once at creation and never updated: re-pointing a live session\nat a different directory would leave its transcript describing files\nthat are no longer there. Standard edition never writes it.",
+ "uri": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPService": {
+ "type": "object",
+ "properties": {
+ "advanced_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
},
- "id": {
- "description": "ID",
+ "auth_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig"
+ },
+ "created_at": {
"type": "string"
},
- "im_platform": {
- "description": "IMPlatform is the originating IM platform (e.g. \"feishu\", \"wecom\") when\nthis session is bound to an IM channel. It is not stored on the sessions\ntable (it lives in im_channel_sessions) and is populated on read so the\nWeb console can classify a session's origin folder without a list query.",
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
"type": "string"
},
- "is_pinned": {
- "description": "IsPinned indicates whether the session is pinned in the list.",
+ "enabled": {
"type": "boolean"
},
- "last_request_state": {
- "description": "LastRequestState records the input-bar state used the last time this\nsession sent a question (agent, model, KB scope, web search, MCPs).\nPersisted on every successful POST to /knowledge-chat or /agent-chat so\nthat reopening the session can restore the original request context to\nthe chat UI. Stored in the legacy sessions.agent_config JSONB column to\navoid a new migration; the shape used today is `SessionLastRequestState`.",
+ "env_vars": {
+ "description": "Environment variables for stdio",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SessionLastRequestState"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
}
]
},
- "parent_session_id": {
- "description": "ParentSessionID names the session this one was forked from. Empty for\nordinary sessions. Deliberately not a foreign key: the parent may be\ndeleted while the branch lives on, and a branch must not cascade away\nwith it. A dangling value simply renders as an ordinary session.",
- "type": "string"
+ "headers": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
},
- "pinned_at": {
- "description": "PinnedAt records when the session was pinned; nil when not pinned.",
+ "id": {
"type": "string"
},
- "sandbox_config_id": {
- "description": "SandboxConfigID pins which sandbox config this session's CURRENT live\nsandbox was created on. Empty means no live sandbox;\nSandboxConfigIDGlobalDefault means the deployment-wide default config.\n\nThis is an ephemeral pin that dies with the sandbox, not a permanent\nowner: sessions outlive sandboxes by months, so treating it as\npermanent would make \"no session references this config\" never true.",
+ "is_builtin": {
+ "description": "Whether this is a builtin MCP service (visible to all workspaces)",
+ "type": "boolean"
+ },
+ "name": {
"type": "string"
},
+ "stdio_config": {
+ "description": "Required for stdio transport",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
+ }
+ ]
+ },
"tenant_id": {
- "description": "Workspace ID",
"type": "integer"
},
- "title": {
- "description": "Title",
- "type": "string"
+ "transport_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
},
"updated_at": {
"type": "string"
},
- "user_id": {
- "description": "UserID is the owner scope for this session. WeKnora user UUIDs, API\nexternal-user principals, and embed visitor principals all use this column.",
+ "url": {
+ "description": "Optional: required for SSE/HTTP Streamable",
+ "type": "string"
+ },
+ "usage_instructions": {
+ "description": "UsageInstructions is maintained locally and is not overwritten by directory refresh.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SessionLastRequestState": {
+ "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": {
"type": "object",
"properties": {
- "agent_enabled": {
- "type": "boolean"
- },
- "agent_id": {
- "type": "string"
- },
- "knowledge_base_ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "local_browser_enabled": {
- "type": "boolean"
- },
- "mcp_service_ids": {
+ "args": {
+ "description": "Command arguments array",
"type": "array",
"items": {
"type": "string"
}
},
- "mentioned_items": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
- }
- },
- "model_id": {
+ "command": {
+ "description": "Command: \"uvx\" or \"npx\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPTestResult": {
+ "type": "object",
+ "properties": {
+ "description": {
"type": "string"
},
- "reasoning_effort": {
+ "message": {
"type": "string"
},
- "skill_names": {
+ "oauth_required": {
+ "description": "OAuthRequired is true when the connection failed because the server\nrequires OAuth authorization (RFC 9728), even though the service was not\nconfigured for OAuth. The UI uses it to guide the user to switch the auth\nstrategy to OAuth.",
+ "type": "boolean"
+ },
+ "resources": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPResource"
}
},
- "tag_ids": {
+ "success": {
+ "type": "boolean"
+ },
+ "tools": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTool"
}
- },
- "web_search_enabled": {
- "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MCPTool": {
"type": "object",
- "required": [
- "organization_id",
- "permission"
- ],
"properties": {
- "organization_id": {
+ "description": {
"type": "string"
},
- "permission": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "inputSchema": {
+ "description": "JSON Schema for tool parameters",
+ "type": "object"
+ },
+ "name": {
+ "type": "string"
+ },
+ "require_approval": {
+ "description": "RequireApproval when true: agent execution pauses until the user approves in UI (issue #1173).",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SkillImageConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MCPTransportType": {
+ "type": "string",
+ "enum": [
+ "sse",
+ "http-streamable",
+ "stdio"
+ ],
+ "x-enum-comments": {
+ "MCPTransportHTTPStreamable": "HTTP Streamable",
+ "MCPTransportSSE": "Server-Sent Events",
+ "MCPTransportStdio": "Stdio (Standard Input/Output)"
+ },
+ "x-enum-descriptions": [
+ "Server-Sent Events",
+ "HTTP Streamable",
+ "Stdio (Standard Input/Output)"
+ ],
+ "x-enum-varnames": [
+ "MCPTransportSSE",
+ "MCPTransportHTTPStreamable",
+ "MCPTransportStdio"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": {
"type": "object",
"properties": {
- "base_template_id": {
- "description": "BaseTemplateID is the template this chain was originally built from;\nthe rebuild path starts over from it.",
+ "channel": {
"type": "string"
},
- "built_at": {
- "description": "BuiltAt records when this generation was produced.",
+ "content": {
"type": "string"
},
- "generation": {
- "description": "Generation increments on every successful install/remove, for naming\nand troubleshooting.",
- "type": "integer"
+ "process_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides"
},
- "owner_fingerprint": {
- "description": "OwnerFingerprint identifies the provider account that owns the snapshot.\nSnapshots are invisible across accounts, so a mismatch means \"fall back\nto the base template\" rather than \"fail\".",
+ "status": {
"type": "string"
},
- "snapshot_id": {
- "description": "SnapshotID is the currently effective snapshot; empty = base template.",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SourceLocator": {
- "type": "object",
- "properties": {
- "bbox": {
- "description": "BBox is [x0, y0, x1, y1] as fractions of the page width and height,\norigin at the top-left corner of the rendered page.",
+ "tag_ids": {
"type": "array",
"items": {
- "type": "number"
+ "type": "string"
}
},
- "block": {
- "description": "Block is the 1-based index among a Word file's body paragraphs and tables.",
- "type": "integer"
- },
- "end": {
- "type": "integer"
- },
- "end_ms": {
- "type": "integer"
- },
- "mapping": {
- "description": "Mapping records verified text-to-source alignment. Empty means legacy.",
- "type": "string"
- },
- "page": {
- "description": "Page is the 1-based PDF page.",
- "type": "integer"
- },
- "partial": {
- "description": "Partial means some of the chunk has no source mapping.",
- "type": "boolean"
- },
- "quote": {
- "description": "Quote is the complete cited overlap as parsed. Viewers match it\ninside the rendered original and against the\nanswer sentence that cites the chunk.",
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MatchType": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "x-enum-comments": {
+ "MatchTypeDataAnalysis": "数据分析匹配类型",
+ "MatchTypeDirectLoad": "Deprecated: reserved to preserve serialized enum values",
+ "MatchTypeParentChunk": "父Chunk匹配类型",
+ "MatchTypeRelationChunk": "关系Chunk匹配类型",
+ "MatchTypeWebSearch": "网络搜索匹配类型"
+ },
+ "x-enum-descriptions": [
+ "",
+ "",
+ "",
+ "",
+ "父Chunk匹配类型",
+ "关系Chunk匹配类型",
+ "",
+ "网络搜索匹配类型",
+ "Deprecated: reserved to preserve serialized enum values",
+ "数据分析匹配类型"
+ ],
+ "x-enum-varnames": [
+ "MatchTypeEmbedding",
+ "MatchTypeKeywords",
+ "MatchTypeNearByChunk",
+ "MatchTypeHistory",
+ "MatchTypeParentChunk",
+ "MatchTypeRelationChunk",
+ "MatchTypeGraph",
+ "MatchTypeWebSearch",
+ "MatchTypeDirectLoad",
+ "MatchTypeDataAnalysis"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.MatchedImage": {
+ "type": "object",
+ "properties": {
+ "chunk_id": {
"type": "string"
},
- "row_end": {
- "type": "integer"
+ "knowledge_base_id": {
+ "type": "string"
},
- "row_start": {
- "type": "integer"
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.Membership": {
+ "type": "object",
+ "properties": {
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantRole"
},
- "section": {
- "description": "Section is the 1-based EPUB spine index.",
+ "tenant_id": {
"type": "integer"
},
- "sheet": {
- "description": "Sheet is the spreadsheet sheet name; RowStart/RowEnd are its 1-based\nrow numbers as shown by spreadsheet applications.",
+ "tenant_name": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MemoryConfig": {
+ "type": "object",
+ "properties": {
+ "embedding_model_id": {
+ "description": "EmbeddingModelID is the single model used to score memory against a\nquestion. It is pinned per workspace: knowledge bases each have their\nown embedding model, and grabbing whichever one happens to be listed\nfirst would mix incomparable vector spaces. Blank means semantic recall\nis off and matching stays lexical.",
"type": "string"
},
- "slide": {
- "description": "Slide is the 1-based slide number in presentation order.",
+ "enabled": {
+ "description": "Enabled defaults to false. Memory retains user statements across\nsessions, so a workspace admin has to turn it on deliberately.",
+ "type": "boolean"
+ },
+ "extract_delay_seconds": {
+ "description": "ExtractDelaySeconds is how long a finished turn waits before\ndistillation runs. Waiting lets one model call cover the several\nmessages a user usually sends in a row. 0 means the default.",
"type": "integer"
},
- "source_hash": {
- "description": "SourceHash binds the locator to the knowledge record’s source revision hash.",
+ "extract_instructions": {
+ "description": "ExtractInstructions are workspace-specific rules appended to the\ndistillation prompt, for policies the product cannot guess (\"never record\ncustomer names\", \"always note the environment a question is about\").",
"type": "string"
},
- "source_id": {
- "description": "SourceID identifies a block within the parser result, not a rendered item.",
+ "extract_min_interval_seconds": {
+ "description": "ExtractMinIntervalSeconds is the floor between two distillation runs for\nthe same person, and exists purely to bound cost. It never drops a turn:\na turn arriving inside the interval is queued and picked up by the next\nrun. 0 means the default.",
+ "type": "integer"
+ },
+ "extract_model_id": {
+ "description": "ExtractModelID is the model used by the background extraction task.\nEmpty means \"use the model the conversation itself used\", which is what\nthe settings UI promises, so the extraction task must never fail merely\nbecause this is blank.",
"type": "string"
},
- "start": {
- "description": "Start/End are rune offsets into the original text file.",
+ "interest_threshold": {
+ "description": "InterestThreshold is how many separate conversations must touch a topic\nbefore it becomes a stored interest. 0 means the default. Setting it to 1\nrecords every topic on first sight, which is usually too noisy.",
"type": "integer"
},
- "start_ms": {
- "description": "StartMs/EndMs bound an audio segment.",
+ "max_items": {
+ "description": "MaxItems caps active items per subject. 0 means DefaultMemoryMaxItems.",
"type": "integer"
},
- "title": {
- "description": "Title names the section or slide when the source has one.",
- "type": "string"
+ "retrieval_conditioning": {
+ "description": "RetrievalConditioning lets memory shape retrieval — query rewriting and\nper-document ranking — rather than only being appended to the answer\nprompt. This is where memory earns its keep in a knowledge-base product.",
+ "type": "boolean"
},
- "type": {
+ "vector_recall": {
+ "description": "VectorRecall adds semantic similarity to memory recall. Nil means on\nwhen an embedding model is reachable.\n\nLexical matching alone cannot find a memory the user has re-worded, which\nis most of them: \"回答直接给结论\" and \"别铺垫那么多\" share no tokens. The\ncost is one embedding call per turn, bounded and degraded to lexical on\nfailure, so the feature never becomes a reason a chat is slow.",
+ "type": "boolean"
+ },
+ "write_mode": {
+ "description": "WriteMode is MemoryWriteExplicitOnly or MemoryWriteAuto.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MemoryConsolidationResult": {
"type": "object",
"properties": {
- "count": {
+ "candidates": {
+ "description": "Candidates is how many groups were put in front of the model.",
"type": "integer"
},
- "enabled": {
- "type": "boolean"
+ "demoted": {
+ "type": "integer"
},
- "items": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "expired": {
+ "type": "integer"
},
- "mode": {
+ "merged": {
+ "type": "integer"
+ },
+ "reviewed": {
+ "description": "Reviewed is how many active memories the pass looked at.",
+ "type": "integer"
+ },
+ "skipped": {
+ "description": "Skipped is why nothing was merged, empty when something was.",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StorageBackendConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MemoryDocView": {
"type": "object",
"properties": {
- "access_key_id": {
+ "hits": {
+ "type": "integer"
+ },
+ "id": {
"type": "string"
},
- "app_id": {
+ "knowledge_base_id": {
"type": "string"
},
- "bucket_name": {
+ "knowledge_id": {
"type": "string"
},
- "endpoint": {
+ "last_used_at": {
"type": "string"
},
- "force_path_style": {
- "type": "boolean"
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MemoryItem": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
},
- "mode": {
+ "created_at": {
"type": "string"
},
- "path_prefix": {
+ "expires_at": {
+ "description": "ExpiresAt is when the statement stops being worth recalling, used for\nthings that are true only for a while (\"finish the migration this week\").\nWithout it an in-flight task stays in context forever and slowly turns\nthe memory into a list of things the user finished months ago.",
"type": "string"
},
- "region": {
+ "id": {
"type": "string"
},
- "secret_access_key": {
+ "importance": {
+ "type": "integer"
+ },
+ "invalid_at": {
"type": "string"
},
- "temp_bucket_name": {
+ "kind": {
"type": "string"
},
- "temp_region": {
+ "last_used_at": {
"type": "string"
},
- "use_ssl": {
- "type": "boolean"
+ "normalized_key": {
+ "description": "NormalizedKey identifies the topic this item is about. A new item with\nthe same key as an active one supersedes it, which is how contradictions\n(\"I use MySQL\" then \"I moved to Postgres\") resolve without an LLM in the\nread path.",
+ "type": "string"
},
- "use_temp_bucket": {
- "type": "boolean"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.StorageConfig": {
- "type": "object",
- "properties": {
- "app_id": {
- "description": "App ID (COS specific)",
+ "origin": {
"type": "string"
},
- "bucket_name": {
- "description": "Bucket Name",
+ "replaces_id": {
"type": "string"
},
- "endpoint": {
- "description": "Endpoint (S3 specific) - e.g., s3.amazonaws.com, oss-cn-hangzhou.aliyuncs.com",
+ "source_message_id": {
"type": "string"
},
- "force_path_style": {
- "description": "ForcePathStyle (S3 specific) - whether to use path-style URLs",
- "type": "boolean"
+ "source_session_id": {
+ "type": "string"
},
- "path_prefix": {
- "description": "Path Prefix",
+ "status": {
"type": "string"
},
- "provider": {
- "description": "Provider: \"cos\", \"minio\", \"s3\"",
+ "subject_id": {
"type": "string"
},
- "region": {
- "description": "Region",
+ "superseded_by": {
"type": "string"
},
- "secret_id": {
- "description": "Secret ID (COS) / Access Key ID (S3, MinIO)",
+ "tenant_id": {
+ "type": "integer"
+ },
+ "topic": {
+ "description": "Topic is the readable subject the statement is about, as the extraction\nmodel named it (\"在用的数据库\"). It is kept verbatim next to the\nnormalized key because it is the best retrieval handle available: a\nquestion often names the topic while the statement itself only carries\nthe value (\"已经迁到 PostgreSQL\").",
"type": "string"
},
- "secret_key": {
- "description": "Secret Key (COS) / Secret Access Key (S3, MinIO)",
+ "updated_at": {
"type": "string"
},
- "use_ssl": {
- "description": "UseSSL (S3 specific) - whether to use HTTPS",
- "type": "boolean"
+ "use_count": {
+ "type": "integer"
+ },
+ "valid_from": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MemorySettings": {
"type": "object",
"properties": {
- "cos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
- },
- "default_provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\", \"obs\"",
- "type": "string"
- },
- "ks3": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig"
- },
- "local": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
+ "effective": {
+ "description": "Effective is what actually happens: WorkspaceEnabled \u0026\u0026 UserEnabled.",
+ "type": "boolean"
},
- "minio": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
+ "item_count": {
+ "description": "ItemCount is how many active memories the caller currently has.",
+ "type": "integer"
},
- "obs": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OBSEngineConfig"
+ "max_items": {
+ "description": "MaxItems is the capacity cap after which the lowest ranked are archived.",
+ "type": "integer"
},
- "oss": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
+ "user_enabled": {
+ "description": "UserEnabled is the caller's own opt out. Meaningless while the\nworkspace switch is off, but still reported so the toggle keeps its\nposition when an admin turns the workspace back on.",
+ "type": "boolean"
},
- "s3": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
+ "workspace_enabled": {
+ "description": "WorkspaceEnabled is the admin switch on the workspace.",
+ "type": "boolean"
},
- "tos": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
+ "write_mode": {
+ "description": "WriteMode is the workspace write mode.",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MemoryTopicView": {
"type": "object",
"properties": {
- "provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\", \"obs\"",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
- "type": "object",
- "required": [
- "invite_code"
- ],
- "properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
+ "aliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "hits": {
+ "type": "integer"
},
- "role": {
- "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SuggestionAttribution": {
- "type": "object",
- "properties": {
- "question_id": {
+ "id": {
"type": "string"
},
- "suggestion_set_id": {
+ "last_seen_at": {
+ "type": "string"
+ },
+ "threshold": {
+ "type": "integer"
+ },
+ "topic": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SyncLog": {
+ "github_com_Tencent_WeKnora_internal_types.MentionedItem": {
"type": "object",
"properties": {
- "created_at": {
- "description": "Creation timestamp (usually same as StartedAt)",
+ "id": {
"type": "string"
},
- "data_source_id": {
- "description": "Reference to the data source",
+ "kb_id": {
+ "description": "Parent knowledge base for file/tag mentions",
"type": "string"
},
- "error_message": {
- "description": "Error details if status is \"failed\"",
+ "kb_name": {
+ "description": "Display name for parent KB",
"type": "string"
},
- "finished_at": {
- "description": "Sync completion time",
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
"type": "string"
},
- "id": {
- "description": "Unique identifier",
+ "name": {
"type": "string"
},
- "items_created": {
- "description": "New items created in knowledge base",
- "type": "integer"
- },
- "items_deleted": {
- "description": "Items deleted from knowledge base",
- "type": "integer"
+ "service_id": {
+ "description": "Parent MCP service for MCP tool mentions",
+ "type": "string"
},
- "items_failed": {
- "description": "Items that failed to sync",
- "type": "integer"
+ "skill_name": {
+ "description": "Preloaded agent skill name",
+ "type": "string"
},
- "items_skipped": {
- "description": "Items skipped (no changes detected)",
+ "type": {
+ "description": "\"kb\", \"file\", \"tag\", \"mcp\", \"skill\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.Message": {
+ "type": "object",
+ "properties": {
+ "agent_duration_ms": {
+ "description": "Agent total execution duration in milliseconds (from query start to answer start)",
"type": "integer"
},
- "items_total": {
- "description": "Total items fetched from source",
- "type": "integer"
+ "agent_id": {
+ "description": "AgentID is the agent used for this individual assistant turn. Unlike the\nsession's last_request_state it remains stable when users switch agents.",
+ "type": "string"
},
- "items_updated": {
- "description": "Existing items updated",
- "type": "integer"
+ "agent_steps": {
+ "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep"
+ }
},
- "result": {
- "description": "Detailed sync result (JSON-encoded)",
+ "artifacts": {
+ "description": "Skill-generated files produced during this assistant turn (assistant messages only).\nPopulated by ArtifactCollector after the sandbox finishes, referenced by the\nartifact download endpoint. Empty for user messages and turns without skills.\n\nStored in the message_artifacts table, not on the message row: the message\nrepository loads it with every message it returns and writes it whenever it\nis non-nil on create or update. A nil slice leaves the stored rows alone.",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageArtifact"
}
},
- "started_at": {
- "description": "Sync start time",
- "type": "string"
+ "attachments": {
+ "description": "Attached files (documents, audio, etc., for user messages)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageAttachment"
+ }
},
- "status": {
- "description": "Sync status: running, success, partial, failed, canceled",
+ "channel": {
+ "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
"type": "string"
},
- "tenant_id": {
- "description": "Workspace ID",
- "type": "integer"
- },
- "updated_at": {
- "description": "Last update timestamp",
- "type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.SystemSetting": {
- "type": "object",
- "properties": {
- "category": {
- "description": "Category groups settings in the management UI (\"limits\", \"agent\",\n\"auth\", ...). Free-form string so adding a new category is a\ndata-only change.",
+ "content": {
+ "description": "Message text content",
"type": "string"
},
"created_at": {
+ "description": "Message creation timestamp",
"type": "string"
},
- "description": {
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier for the message",
"type": "string"
},
- "enum": {
- "description": "Enum is populated by the service layer (NOT persisted) from the\nin-code registry. Empty/nil means \"free-form input\"; non-empty\nmeans the UI should render a select with these options. Tagged\n`gorm:\"-\"` so GORM never tries to read/write the column.",
+ "images": {
+ "description": "Attached images with OCR/Caption text (for user messages)",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage"
}
},
- "id": {
- "type": "integer"
+ "is_completed": {
+ "description": "Whether message generation is complete",
+ "type": "boolean"
},
- "is_secret": {
- "description": "IsSecret reserves UI affordances for P3 (mask + reveal-with-confirm).\nIn P1 every row is is_secret=false; service Update accepts the\ncolumn but does not yet enforce special handling.",
+ "is_fallback": {
+ "description": "Whether this response is a fallback (no knowledge base match found)",
"type": "boolean"
},
- "key": {
+ "knowledge_id": {
+ "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
"type": "string"
},
- "last_modified_by": {
+ "knowledge_references": {
+ "description": "References to knowledge chunks used in the response",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
+ }
+ },
+ "mentioned_items": {
+ "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
+ }
+ },
+ "model_id": {
+ "description": "ModelID is the requested/effective chat model binding captured for this\nturn. It is useful for reproducibility and suggestion generation.",
"type": "string"
},
- "last_modified_by_name": {
- "description": "LastModifiedByName is a display label resolved from LastModifiedBy\n(the user's UUID) at handler time — username when available,\notherwise email. Empty for virtual rows that were never persisted\n(LastModifiedBy=\"\"). Not stored: derived per request so renaming\na user reflects on the next reload without a backfill job.",
+ "pending_prompt": {
+ "description": "PendingPrompt is the prompt an awaiting_input message waits on. The\nmessage list fills it in for the prompt's owner; it is never stored.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PendingPromptView"
+ }
+ ]
+ },
+ "request_id": {
+ "description": "Request identifier for tracking API requests",
"type": "string"
},
- "requires_restart": {
- "description": "RequiresRestart reserves UI affordances for P3 (banner \"this\nchange won't take effect until the next restart\"). In P1 the\nonly seeded key is per-request, so always false.",
- "type": "boolean"
+ "role": {
+ "description": "Message role: \"user\", \"assistant\", \"system\"",
+ "type": "string"
+ },
+ "run_state": {
+ "description": "RunState refines an incomplete message: MessageRunStateAwaitingInput\nmeans the run ended suspended on a prompt instead of still generating.\nEmpty means IsCompleted alone describes the message.",
+ "type": "string"
+ },
+ "sandbox_checkpoint": {
+ "description": "SandboxCheckpoint is the git commit this assistant turn produced in the\nsession sandbox's /workspace. Nil for user messages, for turns that ran\nwithout a sandbox, and for turns whose commit failed (best-effort — a\nfailed checkpoint must never block the reply). A message without a\ncheckpoint cannot serve as a fork point with sandbox state.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SandboxCheckpoint"
+ }
+ ]
+ },
+ "session_id": {
+ "description": "ID of the session this message belongs to",
+ "type": "string"
},
"updated_at": {
+ "description": "Last update timestamp",
"type": "string"
},
- "value": {
+ "usage": {
+ "description": "LLM token usage aggregated across every round of the turn that produced this\nassistant message. Persisted so history reads can attribute cost after the\nlive stream is gone; NULL (nil) for user messages and pre-feature rows.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TokenUsage"
+ }
+ ]
+ },
+ "used_memories": {
+ "description": "UsedMemories records which long-term memories were injected into this\nanswer, so the chat UI can show them and let the user delete one on the\nspot. Persisted rather than only streamed so reopening a conversation\nstill explains what the answer saw.",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UsedMemory"
}
- },
- "value_type": {
- "description": "ValueType is one of \"int\", \"string\", \"bool\". Service layer rejects\nupdates whose payload type does not match; UI uses it to pick\nInputNumber vs Input vs Switch.",
- "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MessageArtifact": {
"type": "object",
"properties": {
- "access_key": {
+ "content_hash": {
+ "description": "SHA-256 of the persisted bytes",
"type": "string"
},
- "bucket_name": {
+ "created_at": {
+ "description": "When WeKnora persisted the blob",
"type": "string"
},
- "endpoint": {
+ "deleted_at": {
+ "description": "DeletedAt marks a file the user deleted. The entry stays in the list\nrather than being removed because its position IS the download address\n(msg.Artifacts[index]); dropping it would shift every later file's index\nand hand an old link the wrong blob. Keeping it also keeps the entry in\nArtifactCollector's de-duplication set, so the next collect does not\nre-attach the very file that was deleted — its sandbox mtime has not\nmoved. Clients filter these out; the bytes are already reclaimed.",
"type": "string"
},
- "path_prefix": {
+ "file_name": {
+ "description": "Original filename inside the sandbox",
"type": "string"
},
- "region": {
- "type": "string"
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
},
- "secret_key": {
+ "file_type": {
+ "description": "File extension (e.g., \".pptx\", \".pdf\")",
"type": "string"
},
- "temp_bucket_name": {
+ "mod_time": {
+ "description": "Sandbox-side modification time (used for diff)",
"type": "string"
},
- "temp_region": {
+ "source_path": {
+ "description": "Absolute path inside the sandbox (used for diff)",
+ "type": "string"
+ },
+ "url": {
+ "description": "Storage URL (provider://path); persisted, not sent to client",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.Tenant": {
+ "github_com_Tencent_WeKnora_internal_types.MessageAttachment": {
"type": "object",
"properties": {
- "business": {
- "description": "Business",
+ "content": {
+ "description": "Extracted text content (for small text files)",
"type": "string"
},
- "chat_history_config": {
- "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
- }
- ]
- },
- "context_config": {
- "description": "Global Context configuration for this workspace (default for all sessions)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
- }
- ]
- },
- "created_at": {
- "description": "Creation time",
+ "content_mode": {
+ "description": "full or selected_chunks",
"type": "string"
},
- "credentials": {
- "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig"
- }
- ]
- },
- "default_storage_backend_id": {
- "description": "DefaultStorageBackendID is the workspace default concrete storage instance.",
+ "file_name": {
+ "description": "Original filename",
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
},
- "description": {
- "description": "Description",
+ "file_type": {
+ "description": "File extension (e.g., \".pdf\", \".docx\")",
"type": "string"
},
"id": {
- "description": "ID",
- "type": "integer"
- },
- "memory_config": {
- "description": "Memory config: workspace switch for cross-session long-term memory",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConfig"
- }
- ]
- },
- "name": {
- "description": "Name",
+ "description": "Temporary document ID for session-scoped uploads",
"type": "string"
},
- "parser_engine_config": {
- "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
- }
- ]
- },
- "retrieval_config": {
- "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
- }
- ]
- },
- "retriever_engines": {
- "description": "Retriever engines",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
- }
- ]
- },
- "status": {
- "description": "Status",
- "type": "string"
+ "is_truncated": {
+ "description": "Whether content was truncated",
+ "type": "boolean"
},
- "storage_engine_config": {
- "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
- }
- ]
+ "line_count": {
+ "description": "Total line count (for text files)",
+ "type": "integer"
},
- "storage_quota": {
- "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
+ "selected_chunks": {
+ "description": "Chunks included in this message prompt",
"type": "integer"
},
- "storage_used": {
- "description": "Storage used (Bytes)",
+ "token_count": {
+ "description": "Approximate tokens in the parsed document",
"type": "integer"
},
- "updated_at": {
- "description": "Last updated time",
+ "total_chunks": {
+ "description": "Total parsed chunks",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MessageImage": {
+ "type": "object",
+ "properties": {
+ "caption": {
"type": "string"
},
- "web_search_config": {
- "description": "Global WebSearch configuration for this workspace",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
- }
- ]
+ "url": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.TenantRole": {
- "type": "string",
- "enum": [
- "owner",
- "admin",
- "contributor",
- "viewer"
- ],
- "x-enum-varnames": [
- "TenantRoleOwner",
- "TenantRoleAdmin",
- "TenantRoleContributor",
- "TenantRoleViewer"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.TenantSandboxConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem": {
"type": "object",
"properties": {
- "allow_private_endpoints": {
- "description": "AllowPrivateEndpoints permits this workspace config to reach RFC1918 or\nloopback cluster endpoints. Link-local/cloud-metadata addresses remain\nblocked. It is explicit in the UI instead of hidden in process env.",
- "type": "boolean"
- },
- "cube": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeSandboxConfig"
- },
- "default_timeout_sec": {
- "description": "DefaultTimeoutSec is the per-execution timeout in seconds. 0 uses the\nprogram's built-in default.",
- "type": "integer"
- },
- "desktop_enabled": {
- "description": "DesktopEnabled declares that this config's base template is a desktop\nimage (XFCE + x11vnc + websockify). It is NOT a second template: a\nconfig has exactly one boot target, and skill snapshots stack on top of\nthis base generation after generation. Flipping it changes the base, so\nany installed skills must be rebuilt from the new one.",
- "type": "boolean"
- },
- "docker": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DockerSandboxConfig"
+ "answer_content": {
+ "description": "Assistant answer content (role=assistant), may be empty if only Q matched",
+ "type": "string"
},
- "e2b": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.E2BSandboxConfig"
+ "created_at": {
+ "description": "Timestamp of the earliest message in the group",
+ "type": "string"
},
- "env_vars": {
- "description": "EnvVars are additional environment variables injected into every\nsandbox created for this tenant. 🔒 Values are encrypted at rest.\nThese become visible to all scripts running in the tenant's\nsandboxes — do not place secrets here that scripts must not access.",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "match_type": {
+ "description": "How this result was matched: \"keyword\", \"vector\", or \"hybrid\"",
+ "type": "string"
},
- "network": {
- "description": "Network is the outbound/inbound network policy applied to every sandbox\ncreated from this config — chat sessions, skill installs and deep\nconnectivity probes alike. nil and the zero value mean the same thing:\noutbound egress allowed, inbound public access closed.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SandboxNetworkPolicy"
- }
- ]
+ "query_content": {
+ "description": "User query content (role=user)",
+ "type": "string"
},
- "sandbox_type": {
- "description": "SandboxType is cube, e2b, or docker; disabled is the hidden policy row.",
+ "request_id": {
+ "description": "The request_id that groups Q\u0026A together",
"type": "string"
},
- "skill_image": {
- "description": "SkillImage points at the snapshot that carries this config's installed\nskills. Empty means \"use the base template\". Written only by the skill\ninstall/remove path: MergeSandboxConfigForUpdate ignores client values\nso a settings-form save cannot wipe or plant the pointer.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SkillImageConfig"
- }
- ]
+ "score": {
+ "description": "Best score among the matched messages in this group",
+ "type": "number"
},
- "skill_rollout": {
- "description": "SkillRollout decides whether sessions that already hold a sandbox of\nthis config rebuild after a skill install or removal. Empty and\nSkillRolloutNextTurn rebuild on the next chat turn. SkillRolloutNewSession\nleaves those sandboxes on the previous image; only sessions that start\nafterwards boot the new snapshot.",
+ "session_id": {
+ "description": "Session info",
"type": "string"
},
- "terminal_idle_disconnect_sec": {
- "description": "TerminalIdleDisconnectSec is how long an interactive terminal or\ndesktop may go without user activity before WeKnora closes the\nconnection so the sandbox can pause on its provider TTL. Terminal\ncounts keystrokes and PTY output; desktop counts mouse and keyboard.\n0 uses the built-in default (15 minutes). Not an identity field.",
- "type": "integer"
- },
- "volume_mount": {
- "description": "VolumeMount configures an optional shared volume mounted into every\nsandbox created for this tenant. Currently used for tenant-installed\nskills, but the configuration itself is skill-agnostic and can serve\nany volume-mount use case (shared datasets, pre-installed toolchains,\netc.).",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VolumeMountConfig"
- }
- ]
+ "session_title": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.TokenUsage": {
+ "github_com_Tencent_WeKnora_internal_types.MessageSearchResult": {
"type": "object",
"properties": {
- "cache_miss_tokens": {
- "type": "integer"
+ "items": {
+ "description": "List of merged Q\u0026A pairs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem"
+ }
},
- "cache_read_tokens": {
+ "total": {
+ "description": "Total number of results",
"type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet": {
+ "type": "object",
+ "properties": {
+ "agent_id": {
+ "type": "string"
},
- "cache_reported": {
+ "allow_regenerate": {
"type": "boolean"
},
- "cache_status": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptCacheStatus"
- },
- "cache_write_tokens": {
- "type": "integer"
- },
- "cached_tokens": {
- "description": "CachedTokens is the legacy alias for CacheReadTokens. It remains on the\nwire for compatibility with existing API consumers.",
- "type": "integer"
+ "assistant_message_id": {
+ "type": "string"
},
"completion_tokens": {
"type": "integer"
},
- "context_token_scale": {
- "description": "ContextTokenScale is provider prompt tokens per cl100k-estimated token,\nmeasured over the turn's rounds. Persisted with the turn so the next\nturn's history loading and first compaction check are calibrated before\nany provider count of their own. Zero when the turn measured none.",
- "type": "number"
- },
- "prompt_tokens": {
- "type": "integer"
- },
- "total_tokens": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ToolCall": {
- "type": "object",
- "properties": {
- "args": {
- "description": "Tool arguments",
- "type": "object",
- "additionalProperties": true
- },
- "duration": {
- "description": "Execution time in milliseconds",
- "type": "integer"
- },
- "id": {
- "description": "Function call ID from LLM",
+ "config_hash": {
"type": "string"
},
- "name": {
- "description": "Tool name",
+ "created_at": {
"type": "string"
},
- "provider_metadata": {
- "description": "Provider-specific tool-call state for replay",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCallMetadata"
- }
- ]
+ "error_code": {
+ "type": "string"
},
- "reflection": {
- "description": "Agent's reflection on this tool call result (if enabled)",
+ "generated_at": {
"type": "string"
},
- "result": {
- "description": "Execution result (contains Output)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult"
- }
- ]
+ "id": {
+ "type": "string"
},
- "target": {
- "description": "Target identifies the actual proxy target; Name/Args retain the model call for replay.",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCallTarget"
- }
- ]
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ToolCallMetadata": {
- "type": "object",
- "additionalProperties": {
- "type": "array",
- "items": {
+ "latency_ms": {
"type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ToolCallTarget": {
- "type": "object",
- "properties": {
- "args": {
- "type": "object",
- "additionalProperties": true
},
- "name": {
+ "locale": {
"type": "string"
},
- "service_name": {
+ "model_id": {
"type": "string"
},
- "tool_name": {
+ "placement": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.ToolResult": {
- "type": "object",
- "properties": {
- "data": {
- "description": "Structured data for programmatic use",
- "type": "object",
- "additionalProperties": true
},
- "error": {
- "description": "Error message if execution failed",
- "type": "string"
+ "prompt_tokens": {
+ "type": "integer"
},
- "images": {
- "description": "Base64 data URIs from tool (e.g. MCP image content)",
+ "questions": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestionItem"
}
},
- "output": {
- "description": "Human-readable output",
+ "session_id": {
"type": "string"
},
- "success": {
- "description": "Whether the tool executed successfully",
- "type": "boolean"
+ "status": {
+ "type": "string"
+ },
+ "suppression_reason": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MetricResult": {
"type": "object",
- "required": [
- "role"
- ],
"properties": {
- "role": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ "generation_metrics": {
+ "description": "Text generation quality metrics",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GenerationMetrics"
+ }
+ ]
+ },
+ "retrieval_metrics": {
+ "description": "Retrieval performance metrics",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalMetrics"
+ }
+ ]
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": {
"type": "object",
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
+ "access_key_id": {
+ "type": "string"
},
- "description": {
- "type": "string",
- "maxLength": 1000
+ "bucket_name": {
+ "type": "string"
},
- "invite_code_validity_days": {
- "description": "0=never, 1, 7, 30",
- "type": "integer"
+ "endpoint": {
+ "type": "string"
},
- "member_limit": {
- "description": "max members; 0=unlimited",
- "type": "integer"
+ "mode": {
+ "description": "\"docker\" or \"remote\"",
+ "type": "string"
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
+ "path_prefix": {
+ "type": "string"
},
- "require_approval": {
- "type": "boolean"
+ "secret_access_key": {
+ "type": "string"
},
- "searchable": {
- "description": "open for search so others can discover and join",
+ "use_ssl": {
"type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
- "type": "object",
- "required": [
- "permission"
- ],
- "properties": {
- "permission": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.UsedMemory": {
+ "github_com_Tencent_WeKnora_internal_types.ModelParameters": {
"type": "object",
"properties": {
- "content": {
+ "api_key": {
"type": "string"
},
- "id": {
+ "app_id": {
+ "description": "WeKnoraCloud 厂商专用凭证",
"type": "string"
},
- "kind": {
+ "app_secret": {
+ "description": "AES-256 加密存储,实际承载上游 API Key",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.User": {
- "type": "object",
- "properties": {
- "avatar": {
- "description": "Avatar URL of the user",
+ },
+ "base_url": {
"type": "string"
},
- "can_access_all_tenants": {
- "description": "Whether the user can access all workspaces (cross-workspace access)",
- "type": "boolean"
+ "context_window": {
+ "description": "ContextWindow is the model's total context window in tokens and\nMaxOutputTokens the most it emits in one response. Both are provider\nfacts the agent cannot discover but has to act on: the context window is\nwhat decides when conversation history gets compacted, and assuming a\nwindow larger than the real one means compaction never fires and the\nprovider rejects the request mid-conversation instead. 0 means unknown,\nwhich falls back to DefaultMaxContextTokens.",
+ "type": "integer"
},
- "created_at": {
- "description": "Creation time of the user",
- "type": "string"
+ "custom_headers": {
+ "description": "CustomHeaders 允许在调用远程模型 API 时附加自定义 HTTP 请求头,\n用途类似 Python OpenAI SDK 的 extra_headers 参数,\n常见场景包括透传企业网关鉴权信息、追踪 ID、路由标识等。\n保留字段(Authorization、api-key、Content-Type、Accept 等)会在运行期被忽略以避免破坏签名/鉴权流程。",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "deleted_at": {
- "description": "Deletion time of the user",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "embedding_parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
},
- "email": {
- "description": "Email address of the user",
- "type": "string"
+ "extra_config": {
+ "description": "Provider-specific configuration",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "id": {
- "description": "Unique identifier of the user",
+ "interface_type": {
"type": "string"
},
- "is_active": {
- "description": "Whether the user is active",
- "type": "boolean"
+ "max_concurrency": {
+ "description": "MaxConcurrency caps concurrent in-flight BACKGROUND (ingestion /\nenrichment) calls to THIS specific model, keyed by model ID and shared\nacross all replicas. 0 (the default) means \"fall back to the\nprocess-wide model.max_concurrency\". Interactive user-facing calls are\nnever gated. Only chat / vlm / embedding honour this (see limiter.Gate).",
+ "type": "integer"
},
- "is_system_admin": {
- "description": "Whether the user is a system administrator (independent of workspace roles)",
- "type": "boolean"
+ "max_output_tokens": {
+ "type": "integer"
},
- "preferences": {
- "description": "Per-user UI/feature preferences.\nStored as JSON (jsonb on Postgres, TEXT on SQLite) via the\ndriver.Valuer / sql.Scanner methods on UserPreferences.",
+ "parameter_size": {
+ "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
+ "type": "string"
+ },
+ "provider": {
+ "description": "Provider identifier: openai, aliyun, zhipu, generic",
+ "type": "string"
+ },
+ "spec": {
+ "description": "Spec overrides the catalog entry for this row: protocol, capability\nflags and the flat protocol compat object. Everything omitted is\ninherited from the vendor catalog (see internal/models/catalog).",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSpecOverride"
}
]
},
- "tenant": {
- "description": "Association relationship, not stored in the database",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
- }
- ]
- },
- "tenant_id": {
- "description": "Workspace ID that the user belongs to",
- "type": "integer"
- },
- "updated_at": {
- "description": "Last updated time of the user",
- "type": "string"
- },
- "username": {
- "description": "Username of the user",
- "type": "string"
+ "supports_vision": {
+ "description": "Whether the model accepts image/multimodal input",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UserInfo": {
+ "github_com_Tencent_WeKnora_internal_types.ModelSource": {
+ "type": "string",
+ "enum": [
+ "local",
+ "remote",
+ "aliyun",
+ "zhipu",
+ "volcengine",
+ "deepseek",
+ "hunyuan",
+ "minimax",
+ "openai",
+ "gemini",
+ "mimo",
+ "siliconflow",
+ "jina",
+ "openrouter",
+ "litellm",
+ "requesty",
+ "nvidia",
+ "novita",
+ "azure_openai"
+ ],
+ "x-enum-comments": {
+ "ModelSourceAliyun": "Aliyun DashScope model",
+ "ModelSourceAzureOpenAI": "Azure OpenAI model",
+ "ModelSourceDeepseek": "Deepseek model",
+ "ModelSourceGemini": "Gemini model",
+ "ModelSourceHunyuan": "Hunyuan model",
+ "ModelSourceJina": "Jina AI model",
+ "ModelSourceLiteLLM": "LiteLLM proxy model",
+ "ModelSourceLocal": "Local model",
+ "ModelSourceMimo": "Mimo model",
+ "ModelSourceMinimax": "Minimax mode",
+ "ModelSourceNovita": "Novita AI model",
+ "ModelSourceNvidia": "NVIDIA model",
+ "ModelSourceOpenAI": "OpenAI model",
+ "ModelSourceOpenRouter": "OpenRouter model",
+ "ModelSourceRemote": "Remote model",
+ "ModelSourceRequesty": "Requesty model",
+ "ModelSourceSiliconFlow": "SiliconFlow model",
+ "ModelSourceVolcengine": "Volcengine model",
+ "ModelSourceZhipu": "Zhipu model"
+ },
+ "x-enum-descriptions": [
+ "Local model",
+ "Remote model",
+ "Aliyun DashScope model",
+ "Zhipu model",
+ "Volcengine model",
+ "Deepseek model",
+ "Hunyuan model",
+ "Minimax mode",
+ "OpenAI model",
+ "Gemini model",
+ "Mimo model",
+ "SiliconFlow model",
+ "Jina AI model",
+ "OpenRouter model",
+ "LiteLLM proxy model",
+ "Requesty model",
+ "NVIDIA model",
+ "Novita AI model",
+ "Azure OpenAI model"
+ ],
+ "x-enum-varnames": [
+ "ModelSourceLocal",
+ "ModelSourceRemote",
+ "ModelSourceAliyun",
+ "ModelSourceZhipu",
+ "ModelSourceVolcengine",
+ "ModelSourceDeepseek",
+ "ModelSourceHunyuan",
+ "ModelSourceMinimax",
+ "ModelSourceOpenAI",
+ "ModelSourceGemini",
+ "ModelSourceMimo",
+ "ModelSourceSiliconFlow",
+ "ModelSourceJina",
+ "ModelSourceOpenRouter",
+ "ModelSourceLiteLLM",
+ "ModelSourceRequesty",
+ "ModelSourceNvidia",
+ "ModelSourceNovita",
+ "ModelSourceAzureOpenAI"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ModelSpecOverride": {
"type": "object",
"properties": {
- "avatar": {
- "type": "string"
- },
- "can_access_all_tenants": {
- "type": "boolean"
- },
- "created_at": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "id": {
+ "api": {
"type": "string"
},
- "is_active": {
- "type": "boolean"
+ "compat": {
+ "description": "Compat is a plain object so it round-trips through both JSON (API,\ndatabase column) and YAML (builtin_models.yaml).",
+ "type": "object",
+ "additionalProperties": {}
},
- "is_system_admin": {
- "type": "boolean"
+ "context_window": {
+ "type": "integer"
},
- "preferences": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ "input": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "tenant_id": {
+ "max_output_tokens": {
"type": "integer"
},
- "updated_at": {
- "type": "string"
+ "reasoning": {
+ "type": "boolean"
},
- "username": {
- "type": "string"
+ "thinking_levels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
}
}
},
- "github_com_Tencent_WeKnora_internal_types.UserPreferences": {
+ "github_com_Tencent_WeKnora_internal_types.ModelStatus": {
+ "type": "string",
+ "enum": [
+ "active",
+ "downloading",
+ "download_failed"
+ ],
+ "x-enum-comments": {
+ "ModelStatusActive": "Model is active",
+ "ModelStatusDownloadFailed": "Model download failed",
+ "ModelStatusDownloading": "Model is downloading"
+ },
+ "x-enum-descriptions": [
+ "Model is active",
+ "Model is downloading",
+ "Model download failed"
+ ],
+ "x-enum-varnames": [
+ "ModelStatusActive",
+ "ModelStatusDownloading",
+ "ModelStatusDownloadFailed"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ModelType": {
+ "type": "string",
+ "enum": [
+ "Embedding",
+ "Rerank",
+ "KnowledgeQA",
+ "VLLM",
+ "ASR"
+ ],
+ "x-enum-comments": {
+ "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
+ "ModelTypeEmbedding": "Embedding model",
+ "ModelTypeKnowledgeQA": "KnowledgeQA model",
+ "ModelTypeRerank": "Rerank model",
+ "ModelTypeVLLM": "VLLM model"
+ },
+ "x-enum-descriptions": [
+ "Embedding model",
+ "Rerank model",
+ "KnowledgeQA model",
+ "VLLM model",
+ "ASR (Automatic Speech Recognition) model"
+ ],
+ "x-enum-varnames": [
+ "ModelTypeEmbedding",
+ "ModelTypeRerank",
+ "ModelTypeKnowledgeQA",
+ "ModelTypeVLLM",
+ "ModelTypeASR"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.NamedCount": {
"type": "object",
"properties": {
- "browser_search_instructions": {
- "description": "BrowserSearchInstructions customizes browser search for this user. Nil/empty uses the platform default.",
- "type": "string"
- },
- "gallery": {
- "description": "Gallery holds the user's image-gallery UI state: the search\nactivation mode and the per-attribute search-field toggles. Written\nby the gallery's mode / checkbox interactions via the preferences\nPUT; read back by GET /knowledge-bases/:id/gallery-config so the\ngallery renders the same activation state on every device. Nil = the\nuser never touched the gallery controls (mode defaults to \"all\").",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GalleryUserPrefs"
- }
- ]
- },
- "last_active_tenant_id": {
- "description": "LastActiveTenantID remembers the last workspace the user actively\nswitched into, so a fresh login (new device, cleared browser, new\nrefresh token) lands them back in that workspace instead of always\nbouncing to their home workspace. Written by the SPA's preferences\nPUT and by service-level SwitchTenant (including when switching\nhome, which stores the home ID). Login / RefreshToken validate that\nthe workspace still exists and the user still has an active membership\n(or CanAccessAllTenants) before honouring this preference; an\ninvalid pointer is best-effort cleared and the user falls back to\nhome. Refresh JWT claims have no tenant_id, so RefreshToken\nre-resolves from this field.\n\nnil = no preference (use user.TenantID, i.e. home)\n*0 = \"clear preference\" sentinel for the partial-update endpoint\n (UpdateUserPreferences turns this into nil). Otherwise treat\n a stored *0 the same as nil.\n*N = preferred workspace id.",
+ "count": {
"type": "integer"
},
- "oidc_only_login": {
- "description": "OidcOnlyLogin is set server-side when an account is auto-provisioned\nvia OIDC with a random password the user never received. The profile\nUI hides self-service password rotation until the user sets a known\npassword via ChangePassword (which clears this flag).",
- "type": "boolean"
+ "name": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.VLMConfig": {
+ "github_com_Tencent_WeKnora_internal_types.OBSEngineConfig": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API Key",
+ "access_key": {
"type": "string"
},
- "base_url": {
- "description": "Base URL",
+ "bucket_name": {
"type": "string"
},
- "custom_instructions": {
- "description": "CustomInstructions adds KB-specific image interpretation guidance without\nreplacing the system-owned OCR and Markdown output contract.",
+ "endpoint": {
"type": "string"
},
- "description_language": {
- "description": "DescriptionLanguage controls the language used for generated image\ncaptions. Empty means follow the document/request language.",
+ "path_prefix": {
"type": "string"
},
- "enabled": {
- "type": "boolean"
- },
- "interface_type": {
- "description": "Interface Type: \"ollama\" or \"openai\"",
+ "region": {
"type": "string"
},
- "model_id": {
+ "secret_key": {
"type": "string"
},
- "model_name": {
- "description": "兼容老版本\nModel Name",
- "type": "string"
+ "use_ssl": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.VolumeMountConfig": {
+ "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": {
"type": "object",
"properties": {
- "enabled": {
- "description": "Enabled toggles the volume mount for this tenant.",
- "type": "boolean"
+ "authorization_url": {
+ "type": "string"
},
- "mount_path": {
- "description": "MountPath is the sandbox-internal path where the volume is mounted.\nDefault: /weknora/tenant/skills (customizable per use case).",
+ "provider_display_name": {
"type": "string"
},
- "provider": {
- "description": "Provider identifies the volume backend. Currently \"e2b\" or \"cube\".",
+ "state": {
"type": "string"
},
- "volume_id": {
- "description": "VolumeID is the provider-specific volume identifier, populated after\nEnsureVolume / CreateVolume succeeds.",
- "type": "string"
- },
- "volume_name": {
- "description": "VolumeName is the human-readable volume name, e.g.\n\"weknora-tenant-\u003cid\u003e-skills\".",
- "type": "string"
- },
- "volume_owner_fingerprint": {
- "description": "VolumeOwnerFingerprint = sha256(provider + APIKey + APIURL).\nUsed to detect when the tenant switched to a different backend or\nAPI key, at which point the volume is no longer reachable and must\nbe recreated.",
- "type": "string"
+ "success": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials": {
+ "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
+ "enabled": {
+ "type": "boolean"
},
- "app_secret": {
+ "provider_display_name": {
"type": "string"
+ },
+ "success": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": {
+ "github_com_Tencent_WeKnora_internal_types.OSSEngineConfig": {
"type": "object",
"properties": {
- "api_key": {
- "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "access_key": {
"type": "string"
},
- "blacklist": {
- "description": "黑名单规则列表",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "compression_method": {
- "description": "压缩方法:none, summary, extract, rag",
+ "bucket_name": {
"type": "string"
},
- "document_fragments": {
- "description": "文档片段数量(用于RAG压缩)",
- "type": "integer"
- },
- "embedding_dimension": {
- "description": "嵌入维度(用于RAG压缩)",
- "type": "integer"
- },
- "embedding_model_id": {
- "description": "RAG压缩相关配置",
+ "endpoint": {
"type": "string"
},
- "include_date": {
- "description": "是否包含日期",
- "type": "boolean"
+ "path_prefix": {
+ "type": "string"
},
- "max_results": {
- "description": "最大搜索结果数",
- "type": "integer"
+ "region": {
+ "type": "string"
},
- "provider": {
- "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "secret_key": {
"type": "string"
},
- "proxy_url": {
- "description": "Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url. Merged at call time when set.",
+ "temp_bucket_name": {
"type": "string"
},
- "rerank_model_id": {
- "description": "重排模型ID(用于RAG压缩)",
+ "temp_region": {
"type": "string"
+ },
+ "use_temp_bucket": {
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity": {
+ "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "OrgRoleAdmin",
+ "OrgRoleEditor",
+ "OrgRoleViewer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.Organization": {
"type": "object",
"properties": {
+ "avatar": {
+ "description": "Avatar URL for display in list and settings",
+ "type": "string"
+ },
"created_at": {
- "description": "Timestamps",
+ "description": "Creation time",
"type": "string"
},
"deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
+ "description": "Deletion time (soft delete)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
"description": {
- "description": "Description",
+ "description": "Description of the organization",
"type": "string"
},
"id": {
- "description": "Unique identifier (UUID, auto-generated)",
+ "description": "Unique identifier of the organization",
"type": "string"
},
- "is_default": {
- "description": "Whether this is the default provider for the workspace",
- "type": "boolean"
+ "invite_code": {
+ "description": "Unique invitation code for joining the organization",
+ "type": "string"
+ },
+ "invite_code_expires_at": {
+ "description": "When the current invite code expires; nil means no expiry",
+ "type": "string"
+ },
+ "invite_code_validity_days": {
+ "description": "Invite link validity in days: 0=never, 1/7/30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "Max members allowed; 0 means no limit",
+ "type": "integer"
+ },
+ "members": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationTenantMember"
+ }
},
"name": {
- "description": "User-friendly name, e.g., \"Production Bing Search\"",
+ "description": "Name of the organization",
"type": "string"
},
- "parameters": {
- "description": "Provider-specific parameters (API key, engine ID, etc.) stored as encrypted JSON",
+ "owner": {
+ "description": "Associations (not stored in database)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
}
]
},
- "provider": {
- "description": "Provider type: bing, google, duckduckgo, tavily",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderType"
- }
- ]
+ "owner_id": {
+ "description": "User ID of the organization owner",
+ "type": "string"
},
- "tenant_id": {
- "description": "Workspace ID for scoping",
+ "owner_tenant_id": {
+ "description": "OwnerTenantID is the tenant the owner belonged to when the\norganization was created. Plan 3 (#1303) treats this tenant as\nthe org's \"owning tenant\": its membership row in\norganization_tenant_members is undeletable / unchangeable so\nthe org can never be orphaned even if the owner user later\nswitches tenants or is soft-deleted. See migration 000046.",
"type": "integer"
},
+ "require_approval": {
+ "description": "Whether joining requires admin approval",
+ "type": "boolean"
+ },
+ "searchable": {
+ "description": "Whether the space is open for search (discoverable; non-members can search and join by org ID)",
+ "type": "boolean"
+ },
+ "shares": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare"
+ }
+ },
"updated_at": {
+ "description": "Last updated time",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationJoinRequest": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API key for the search provider (encrypted in DB)",
+ "created_at": {
+ "description": "Creation time",
"type": "string"
},
- "base_url": {
- "description": "Base URL for self-hosted search engines (e.g. SearXNG instance URL).\nValidated with utils.ValidateURLForSSRF; private hosts must be added to SSRF_WHITELIST.",
+ "id": {
+ "description": "Unique identifier",
"type": "string"
},
- "engine_id": {
- "description": "Google Custom Search Engine ID (only for Google provider)",
+ "message": {
+ "description": "Optional message from the requester",
"type": "string"
},
- "extra_config": {
- "description": "Provider-specific extra configuration for future extensibility",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "organization": {
+ "description": "Associations (not stored in database)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Organization"
+ }
+ ]
},
- "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": [
- "brave",
- "bing",
- "google",
- "duckduckgo",
- "tavily",
- "ollama",
- "baidu",
- "searxng",
- "keenable",
- "zhipu",
- "exa",
- "metaso",
- "bocha",
- "serply"
- ],
- "x-enum-varnames": [
- "WebSearchProviderTypeBrave",
- "WebSearchProviderTypeBing",
- "WebSearchProviderTypeGoogle",
- "WebSearchProviderTypeDuckDuckGo",
- "WebSearchProviderTypeTavily",
- "WebSearchProviderTypeOllama",
- "WebSearchProviderTypeBaidu",
- "WebSearchProviderTypeSearxng",
- "WebSearchProviderTypeKeenable",
- "WebSearchProviderTypeZhipu",
- "WebSearchProviderTypeExa",
- "WebSearchProviderTypeMetaso",
- "WebSearchProviderTypeBocha",
- "WebSearchProviderTypeSerply"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.WikiConfig": {
- "type": "object",
- "properties": {
- "content_instructions": {
- "description": "ContentInstructions controls tone, structure and emphasis for generated\nsummary/entity/index prose. Citation and merge rules remain system-owned.",
+ "organization_id": {
+ "description": "Organization ID",
"type": "string"
},
- "extraction_granularity": {
- "description": "ExtractionGranularity controls how many candidate slugs Pass 0 extracts\nper document. Empty / unknown value is treated as WikiExtractionStandard.",
+ "prev_role": {
+ "description": "Previous role before upgrade (only for upgrade requests)",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
]
},
- "extraction_instructions": {
- "description": "ExtractionInstructions tells candidate extraction which domain concepts\nto emphasize without replacing the stable JSON/citation protocol.",
+ "request_type": {
+ "description": "Type of request: 'join' for new member, 'upgrade' for role upgrade",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestType"
+ }
+ ]
+ },
+ "requested_role": {
+ "description": "Role requested by the applicant (admin/editor/viewer)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ },
+ "review_message": {
+ "description": "Optional message from the reviewer",
"type": "string"
},
- "ingest_batch_size": {
- "description": "IngestBatchSize controls how many pending ops a single batch claims and\nprocesses before scheduling a follow-up. 0 falls back to the hard-coded\ndefault (5). Larger batches amortize per-batch setup and let more docs\nshare the batch-internal Map/Reduce fan-out; smaller batches spread a\nKB's backlog across more concurrent batches (finer scheduling grain).",
- "type": "integer"
+ "reviewed_at": {
+ "description": "Time when the request was reviewed",
+ "type": "string"
},
- "ingest_map_parallel": {
- "description": "IngestMapParallel sets the errgroup limit for the Map phase\n(per-document extraction + summary + chunk citation) WITHIN one batch.\n0 falls back to 10. Bound by the LLM provider's concurrency limit and\nthe worker's outbound HTTP pool. Remember it multiplies with the number\nof concurrent batches (IngestMaxInflight).",
- "type": "integer"
+ "reviewed_by": {
+ "description": "User ID of the admin who reviewed the request",
+ "type": "string"
},
- "ingest_max_inflight": {
- "description": "IngestMaxInflight caps how many ingest batches for THIS KB may run\nconcurrently in the shared wiki worker pool (standard/Redis mode\nonly). 0 falls back to the hard-coded default (4). Since Phase 3\nremoved the exclusive per-KB lock, one KB's backlog could otherwise\nmonopolize the whole pool during a bulk import and starve other KBs;\nthis knob trades a single KB's peak throughput for cross-KB fairness.\nSet it \u003e= the wiki pool size to effectively disable the cap.",
- "type": "integer"
+ "reviewer": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
},
- "ingest_reduce_parallel": {
- "description": "IngestReduceParallel sets the errgroup limit for the Reduce phase\n(per-slug page write) WITHIN one batch. 0 falls back to 10. Bound by the\nsame LLM concurrency / HTTP pool considerations as the Map phase, plus\nDB connection pool size. Same multiplier caveat as IngestMapParallel.",
- "type": "integer"
+ "status": {
+ "description": "Status of the request",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestStatus"
+ }
+ ]
},
- "max_pages_per_ingest": {
- "description": "MaxPagesPerIngest limits pages created/updated per ingest operation (0 = no limit)",
+ "tenant_id": {
+ "description": "Tenant ID of the requester",
"type": "integer"
},
- "synthesis_model_id": {
- "description": "SynthesisModelID is the LLM model ID used for wiki page generation and updates",
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
+ },
+ "user_id": {
+ "description": "User ID of the requester",
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity": {
- "type": "string",
- "enum": [
- "focused",
- "standard",
- "exhaustive"
- ],
- "x-enum-varnames": [
- "WikiExtractionFocused",
- "WikiExtractionStandard",
- "WikiExtractionExhaustive"
- ]
- },
- "github_com_Tencent_WeKnora_internal_types.WikiFolder": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
"type": "object",
"properties": {
- "created_at": {
+ "avatar": {
"type": "string"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "depth": {
- "type": "integer"
- },
- "id": {
+ "email": {
"type": "string"
},
- "knowledge_base_id": {
+ "id": {
"type": "string"
},
- "name": {
+ "joined_at": {
"type": "string"
},
- "parent_id": {
+ "representative_user_id": {
"type": "string"
},
- "path": {
+ "role": {
"type": "string"
},
- "sort_order": {
- "type": "integer"
- },
"tenant_id": {
"type": "integer"
},
- "updated_at": {
+ "tenant_name": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiFolderCreateRequest": {
- "type": "object",
- "properties": {
- "name": {
+ },
+ "user_id": {
"type": "string"
},
- "parent_id": {
+ "username": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiFolderListResponse": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
"type": "object",
"properties": {
- "folders": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiFolderNode"
- }
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
+ "type": "integer"
},
- "parent_id": {
+ "avatar": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiFolderNode": {
- "type": "object",
- "properties": {
+ },
"created_at": {
"type": "string"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "depth": {
- "type": "integer"
+ "description": {
+ "type": "string"
},
- "has_children": {
+ "has_pending_upgrade": {
+ "description": "当前用户是否有待处理的权限升级申请",
"type": "boolean"
},
"id": {
"type": "string"
},
- "knowledge_base_id": {
+ "invite_code": {
"type": "string"
},
- "name": {
+ "invite_code_expires_at": {
"type": "string"
},
- "page_count": {
+ "invite_code_validity_days": {
"type": "integer"
},
- "parent_id": {
+ "is_owner": {
+ "type": "boolean"
+ },
+ "member_count": {
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "0 = unlimited",
+ "type": "integer"
+ },
+ "my_role": {
"type": "string"
},
- "path": {
+ "name": {
"type": "string"
},
- "sort_order": {
+ "owner_id": {
+ "type": "string"
+ },
+ "owner_tenant_id": {
+ "description": "OwnerTenantID is the persisted owner workspace of the organization\n(Plan 3, migration 000046). Frontend uses this to identify the\n\"owner row\" in the workspace-keyed members list — comparing\nmember.tenant_id against owner_tenant_id is the post-Plan-3\nequivalent of the old member.user_id == owner_id check.",
"type": "integer"
},
- "tenant_id": {
+ "pending_join_request_count": {
+ "description": "待审批加入申请数(仅管理员可见)",
+ "type": "integer"
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "type": "boolean"
+ },
+ "share_count": {
+ "description": "共享到该组织的知识库数量",
"type": "integer"
},
"updated_at": {
@@ -25538,1381 +27934,5791 @@
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiFolderUpdateRequest": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationSharedAgentItem": {
"type": "object",
"properties": {
- "move_parent": {
+ "agent": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ },
+ "disabled_by_me": {
+ "description": "DisabledByMe: current tenant has hidden this shared agent from their conversation dropdown (per-user preference)",
"type": "boolean"
},
- "name": {
+ "is_mine": {
+ "type": "boolean"
+ },
+ "org_name": {
"type": "string"
},
- "parent_id": {
+ "organization_id": {
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiGraphData": {
- "type": "object",
- "properties": {
- "edges": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge"
- }
},
- "meta": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphMeta"
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
},
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphNode"
- }
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiGraphEdge": {
- "type": "object",
- "properties": {
- "source": {
- "description": "source slug",
+ "share_id": {
"type": "string"
},
- "target": {
- "description": "target slug",
+ "shared_at": {
+ "type": "string"
+ },
+ "shared_by_user_id": {
"type": "string"
+ },
+ "shared_by_username": {
+ "type": "string"
+ },
+ "source_tenant_id": {
+ "type": "integer"
+ },
+ "web_search_ready": {
+ "description": "WebSearchReady is resolved against the source workspace without exposing\nits provider list or credentials. Receivers must not compare the agent's\nprovider ID with their own workspace resources.",
+ "type": "boolean"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiGraphMeta": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationTenantMember": {
"type": "object",
"properties": {
- "center": {
- "description": "populated in ego mode",
+ "created_at": {
"type": "string"
},
- "depth": {
- "description": "populated in ego mode",
- "type": "integer"
+ "id": {
+ "type": "string"
},
- "familiar_count": {
- "description": "FamiliarCount is how many returned nodes are lit up for this person.",
- "type": "integer"
+ "joined_at": {
+ "type": "string"
},
- "mode": {
+ "organization": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Organization"
+ },
+ "organization_id": {
"type": "string"
},
- "returned": {
- "description": "number of nodes actually returned",
- "type": "integer"
+ "representative_user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
},
- "total": {
- "description": "total node count in the KB before filtering/limit",
+ "representative_user_id": {
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ },
+ "tenant_id": {
"type": "integer"
},
- "truncated": {
- "description": "true when Returned \u003c Total (after filters)",
- "type": "boolean"
+ "updated_at": {
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiGraphNode": {
+ "github_com_Tencent_WeKnora_internal_types.PageResult": {
"type": "object",
"properties": {
- "familiar": {
- "description": "Familiar is true when this page was built from a document this person\nkeeps citing in answers. It is a personal overlay, not a property of\nthe page: two people looking at the same wiki see different highlights.",
- "type": "boolean"
+ "data": {
+ "description": "Data"
},
- "link_count": {
- "description": "Number of inbound + outbound links",
+ "page": {
+ "description": "Current page number",
"type": "integer"
},
- "page_type": {
- "type": "string"
- },
- "slug": {
- "type": "string"
+ "page_size": {
+ "description": "Page size",
+ "type": "integer"
},
- "title": {
- "type": "string"
+ "total": {
+ "description": "Total number of records",
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiIndexEntry": {
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": {
"type": "object",
"properties": {
- "category_path": {
+ "chat_parser_engine_rules": {
+ "description": "ChatParserEngineRules selects parser engines for session-scoped chat\ndocuments. Knowledge bases keep their own rules in ChunkingConfig.",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
}
},
- "depth": {
- "type": "integer"
- },
- "parent_slug": {
+ "mineru_api_key": {
+ "description": "MinerU 云 API Key",
"type": "string"
},
- "slug": {
- "type": "string"
+ "mineru_cloud_enable_formula": {
+ "type": "boolean"
},
- "sort_order": {
- "type": "integer"
+ "mineru_cloud_enable_ocr": {
+ "type": "boolean"
},
- "summary": {
- "type": "string"
+ "mineru_cloud_enable_table": {
+ "type": "boolean"
},
- "title": {
+ "mineru_cloud_language": {
"type": "string"
},
- "wiki_path": {
+ "mineru_cloud_model": {
+ "description": "MinerU 云 API 解析参数",
"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"
+ "mineru_enable_formula": {
+ "type": "boolean"
},
- "total": {
- "type": "integer"
+ "mineru_enable_ocr": {
+ "description": "MinerUEnableOCR is retained for compatibility with configurations saved\nbefore parse_method supported auto/ocr/txt.",
+ "type": "boolean"
},
- "type": {
+ "mineru_enable_table": {
+ "type": "boolean"
+ },
+ "mineru_endpoint": {
+ "description": "MinerU 自建服务端点",
"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": {
+ "mineru_language": {
"type": "string"
},
- "version": {
- "type": "integer"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiPage": {
- "type": "object",
- "properties": {
- "aliases": {
- "description": "Alternate names, abbreviations, acronyms or translated names",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "mineru_model": {
+ "description": "以下 backend、vLLM、公式/表格、语言参数仅对 3.x 及更早版本生效。",
+ "type": "string"
},
- "category_path": {
- "description": "CategoryPath is the directory breadcrumb that groups this page in the\nwiki browser, e.g. [\"AI\", \"LLM 应用\", \"RAG\"]. Derived cache of the\nfolder chain identified by FolderID.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "mineru_parse_method": {
+ "type": "string"
},
- "chunk_refs": {
- "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "mineru_server_api_key": {
+ "description": "MinerU 自建解析参数。协议按服务端自动识别:4.0+ 走 V1 API,更早版本走 /file_parse。",
+ "type": "string"
},
- "content": {
- "description": "Full markdown content",
+ "mineru_tier": {
+ "description": "4.0+:flash/basic/standard/advanced,空为服务端默认",
"type": "string"
},
- "created_at": {
- "description": "Creation time",
+ "mineru_vlm_server_url": {
+ "description": "vLLM 服务器地址 (vlm-http-client / hybrid-http-client)",
"type": "string"
},
- "deleted_at": {
- "description": "Soft delete",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "odl_hybrid": {
+ "description": "OpenDataLoader PDF (docreader engine); hybrid requires opendataloader-pdf-hybrid service.",
+ "type": "string"
},
- "depth": {
- "description": "Depth is len(CategoryPath), cached for filtering / display.",
- "type": "integer"
+ "odl_hybrid_fallback": {
+ "type": "boolean"
},
- "folder_id": {
- "description": "FolderID is the single source of truth for where this page sits in the\ndirectory tree — a reference to wiki_folders.id (\"\" = wiki root). The\nCategoryPath / WikiPath / Depth fields below are denormalized caches\nrecomputed from this folder's chain on every write so list/index/search\nqueries don't have to join wiki_folders.",
+ "odl_hybrid_mode": {
+ "description": "auto, full",
"type": "string"
},
- "id": {
- "description": "Unique identifier (UUID)",
+ "odl_hybrid_url": {
+ "description": "e.g. http://odl-hybrid:5002",
"type": "string"
},
- "in_links": {
- "description": "Slugs of pages that link TO this page (backlinks)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "odl_markdown_with_html": {
+ "type": "boolean"
},
- "knowledge_base_id": {
- "description": "Knowledge base this page belongs to",
+ "paddleocr_vl_cloud_model": {
+ "description": "e.g. PaddleOCR-VL-1.6",
"type": "string"
},
- "last_edit_source": {
- "description": "LastEditSource records who authored the CURRENT version: pipeline |\nagent | user | revert. Empty for legacy rows (treated as pipeline).\nWhen the version is superseded this value travels into the revision\nsnapshot, so each historical version keeps its own author kind.",
+ "paddleocr_vl_cloud_token": {
+ "description": "PaddleOCR-VL AI Studio cloud API.",
"type": "string"
},
- "last_editor_id": {
- "description": "LastEditorID is the user id of the caller that produced the current\nversion (empty for background pipeline writes).",
+ "paddleocr_vl_cloud_use_chart_recognition": {
+ "type": "boolean"
+ },
+ "paddleocr_vl_cloud_use_seal_recognition": {
+ "type": "boolean"
+ },
+ "paddleocr_vl_endpoint": {
+ "description": "PaddleOCR-VL self-hosted pipeline service (full /layout-parsing API).",
"type": "string"
},
- "out_links": {
- "description": "Slugs of pages this page links to (outbound links)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "paddleocr_vl_use_chart_recognition": {
+ "type": "boolean"
},
- "page_metadata": {
- "description": "Arbitrary metadata (tags, categories, dates, etc.)",
+ "paddleocr_vl_use_seal_recognition": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineInfo": {
+ "type": "object",
+ "properties": {
+ "available": {
+ "type": "boolean"
+ },
+ "description": {
+ "type": "string"
+ },
+ "fileTypes": {
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
},
- "page_type": {
- "description": "Page type: summary, entity, concept, index, synthesis, comparison",
+ "name": {
"type": "string"
},
- "parent_slug": {
- "description": "ParentSlug optionally points at the wiki page that should act as this\npage's semantic parent in the directory tree. The parent may be empty\nwhen the page is grouped only by FolderID.",
+ "unavailableReason": {
"type": "string"
- },
- "slug": {
- "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": {
+ "type": "object",
+ "properties": {
+ "engine": {
"type": "string"
},
- "sort_order": {
- "description": "SortOrder allows generated or manually edited pages to control sibling\nordering before falling back to title.",
- "type": "integer"
- },
- "source_refs": {
- "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on `|`\nto recover the title. Document-level granularity.",
+ "file_types": {
"type": "array",
"items": {
"type": "string"
}
},
- "status": {
- "description": "Page status: draft, published, archived",
+ "xlsx_first_row_as_header": {
+ "description": "XLSXFirstRowAsHeader restores row-1 column context for flat XLSX tables.\nnil preserves the parser default; an explicit false disables the mode.",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.PendingPromptView": {
+ "type": "object",
+ "properties": {
+ "created_at": {
"type": "string"
},
- "summary": {
- "description": "One-line summary for index listing",
+ "expires_at": {
"type": "string"
},
- "tenant_id": {
- "description": "Workspace ID for multi-workspace isolation",
- "type": "integer"
- },
- "title": {
- "description": "Human-readable title",
+ "id": {
"type": "string"
},
- "updated_at": {
- "description": "Last update time",
+ "kind": {
"type": "string"
},
- "version": {
- "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
- "type": "integer"
+ "request": {
+ "type": "object"
},
- "wiki_path": {
- "description": "WikiPath is a normalized, sortable path derived from page_type,\ncategory_path, and title. It keeps large directory listings cheap to sort.",
+ "tool_call_id": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageDetail": {
+ "github_com_Tencent_WeKnora_internal_types.PromptCacheStatus": {
+ "type": "string",
+ "enum": [
+ "unsupported",
+ "unreported",
+ "miss",
+ "hit"
+ ],
+ "x-enum-varnames": [
+ "PromptCacheStatusUnsupported",
+ "PromptCacheStatusUnreported",
+ "PromptCacheStatusMiss",
+ "PromptCacheStatusHit"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.PromptPlaceholder": {
"type": "object",
"properties": {
- "aliases": {
- "description": "Alternate names, abbreviations, acronyms or translated names",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "category_path": {
- "description": "CategoryPath is the directory breadcrumb that groups this page in the\nwiki browser, e.g. [\"AI\", \"LLM 应用\", \"RAG\"]. Derived cache of the\nfolder chain identified by FolderID.",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "chunk_refs": {
- "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "content": {
- "description": "Full markdown content",
+ "description": {
+ "description": "Description explains what this placeholder represents",
"type": "string"
},
- "created_at": {
- "description": "Creation time",
+ "label": {
+ "description": "Label is a short label for the placeholder",
"type": "string"
},
- "deleted_at": {
- "description": "Soft delete",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "depth": {
- "description": "Depth is len(CategoryPath), cached for filtering / display.",
- "type": "integer"
- },
- "folder_id": {
- "description": "FolderID is the single source of truth for where this page sits in the\ndirectory tree — a reference to wiki_folders.id (\"\" = wiki root). The\nCategoryPath / WikiPath / Depth fields below are denormalized caches\nrecomputed from this folder's chain on every write so list/index/search\nqueries don't have to join wiki_folders.",
- "type": "string"
- },
- "id": {
- "description": "Unique identifier (UUID)",
- "type": "string"
- },
- "in_link_titles": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "in_links": {
- "description": "Slugs of pages that link TO this page (backlinks)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_base_id": {
- "description": "Knowledge base this page belongs to",
- "type": "string"
- },
- "last_edit_source": {
- "description": "LastEditSource records who authored the CURRENT version: pipeline |\nagent | user | revert. Empty for legacy rows (treated as pipeline).\nWhen the version is superseded this value travels into the revision\nsnapshot, so each historical version keeps its own author kind.",
- "type": "string"
- },
- "last_editor_id": {
- "description": "LastEditorID is the user id of the caller that produced the current\nversion (empty for background pipeline writes).",
- "type": "string"
- },
- "out_links": {
- "description": "Slugs of pages this page links to (outbound links)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "page_metadata": {
- "description": "Arbitrary metadata (tags, categories, dates, etc.)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "page_type": {
- "description": "Page type: summary, entity, concept, index, synthesis, comparison",
- "type": "string"
- },
- "parent_slug": {
- "description": "ParentSlug optionally points at the wiki page that should act as this\npage's semantic parent in the directory tree. The parent may be empty\nwhen the page is grouped only by FolderID.",
- "type": "string"
- },
- "slug": {
- "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ "name": {
+ "description": "Name is the placeholder name (without braces), e.g., \"query\"",
"type": "string"
- },
- "sort_order": {
- "description": "SortOrder allows generated or manually edited pages to control sibling\nordering before falling back to title.",
- "type": "integer"
- },
- "source_refs": {
- "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on `|`\nto recover the title. Document-level granularity.",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "status": {
- "description": "Page status: draft, published, archived",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ProviderMetadata": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.QueryIntent": {
+ "type": "string",
+ "enum": [
+ "kb_search",
+ "web_search",
+ "greeting",
+ "chitchat",
+ "follow_up",
+ "image_only",
+ "doc_only",
+ "summarize",
+ "clarification"
+ ],
+ "x-enum-varnames": [
+ "IntentKBSearch",
+ "IntentWebSearch",
+ "IntentGreeting",
+ "IntentChitchat",
+ "IntentFollowUp",
+ "IntentImageOnly",
+ "IntentDocOnly",
+ "IntentSummarize",
+ "IntentClarification"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
+ "type": "object",
+ "properties": {
+ "custom_instructions": {
+ "description": "CustomInstructions describes the intended audience or question style.\nIt is appended to the stable system question-generation template.",
"type": "string"
},
- "summary": {
- "description": "One-line summary for index listing",
- "type": "string"
+ "enabled": {
+ "type": "boolean"
},
- "tenant_id": {
- "description": "Workspace ID for multi-workspace isolation",
+ "question_count": {
+ "description": "Number of questions to generate per chunk (default: 3, max: 10)",
"type": "integer"
- },
- "title": {
- "description": "Human-readable title",
- "type": "string"
- },
- "updated_at": {
- "description": "Last update time",
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.QuestionOrigin": {
+ "type": "object",
+ "properties": {
+ "knowledge_base_id": {
"type": "string"
},
- "version": {
- "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
- "type": "integer"
- },
- "wiki_path": {
- "description": "WikiPath is a normalized, sortable path derived from page_type,\ncategory_path, and title. It keeps large directory listings cheap to sort.",
+ "knowledge_id": {
"type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageIssue": {
+ "github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig": {
"type": "object",
"properties": {
- "created_at": {
- "type": "string"
- },
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
+ "follow_ups": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig"
},
- "description": {
- "type": "string"
+ "starters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.QueueStat": {
+ "type": "object",
+ "properties": {
+ "active": {
+ "type": "integer"
},
- "id": {
- "type": "string"
+ "archived": {
+ "type": "integer"
},
- "issue_type": {
- "type": "string"
+ "completed": {
+ "type": "integer"
},
- "knowledge_base_id": {
- "type": "string"
+ "failed": {
+ "type": "integer"
},
- "reported_by": {
- "type": "string"
+ "latency_ms": {
+ "description": "LatencyMs is the age of the oldest pending task, in milliseconds.",
+ "type": "integer"
},
- "slug": {
- "type": "string"
+ "memory_usage_bytes": {
+ "description": "MemoryUsageBytes is the approximate Redis memory the queue occupies.",
+ "type": "integer"
},
- "status": {
+ "name": {
"type": "string"
},
- "suspected_knowledge_ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "paused": {
+ "description": "Paused reports whether the queue is paused (tasks not consumed).",
+ "type": "boolean"
},
- "tenant_id": {
+ "pending": {
"type": "integer"
},
- "updated_at": {
+ "pool": {
+ "description": "Pool is the independent worker pool that drains this queue.",
"type": "string"
- }
- }
- },
- "github_com_Tencent_WeKnora_internal_types.WikiPageListResponse": {
- "type": "object",
- "properties": {
- "page": {
+ },
+ "processed": {
+ "description": "Processed / Failed are today's counters (reset daily).",
"type": "integer"
},
- "page_size": {
+ "retry": {
"type": "integer"
},
- "pages": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
- }
+ "scheduled": {
+ "type": "integer"
},
- "total": {
+ "size": {
+ "description": "Size is the total number of tasks in the queue (pending + active +\nscheduled + retry + aggregating + archived).",
"type": "integer"
},
- "total_pages": {
+ "weight": {
+ "description": "Weight is the queue's scheduling weight inside its pool.",
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageMoveRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
"type": "object",
"required": [
- "slug"
+ "email",
+ "password",
+ "username"
],
"properties": {
- "folder_id": {
+ "email": {
"type": "string"
},
- "slug": {
- "type": "string"
+ "password": {
+ "type": "string",
+ "minLength": 6
+ },
+ "username": {
+ "type": "string",
+ "maxLength": 50,
+ "minLength": 2
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageRevertRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RegisterResponse": {
"type": "object",
- "required": [
- "slug",
- "version"
- ],
"properties": {
- "slug": {
+ "message": {
"type": "string"
},
- "version": {
- "type": "integer"
+ "success": {
+ "type": "boolean"
+ },
+ "tenant": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageRevision": {
+ "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
"type": "object",
+ "required": [
+ "requested_role"
+ ],
"properties": {
- "aliases": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "content": {
- "type": "string"
- },
- "created_at": {
- "type": "string"
- },
- "edit_source": {
- "description": "Author of THIS version (same semantics as WikiPage.LastEditSource).",
- "type": "string"
+ "message": {
+ "description": "Optional message explaining the reason",
+ "type": "string",
+ "maxLength": 500
},
- "edited_at": {
- "description": "When this version was authored (the page's updated_at while current).",
- "type": "string"
+ "requested_role": {
+ "description": "The role user wants to upgrade to",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.RerankDiagnostics": {
+ "type": "object",
+ "properties": {
+ "applied": {
+ "description": "Applied is true when rerank scores decided the returned order.",
+ "type": "boolean"
},
- "editor_id": {
- "type": "string"
+ "candidate_count": {
+ "type": "integer"
},
- "id": {
- "type": "string"
+ "effective_threshold": {
+ "type": "number"
},
- "knowledge_base_id": {
+ "error": {
+ "description": "Error carries the reason for model_error / model_unavailable.",
"type": "string"
},
- "page_id": {
- "type": "string"
+ "images_kept": {
+ "type": "integer"
},
- "page_type": {
- "type": "string"
+ "images_scored": {
+ "description": "ImagesScored counts image hits a multimodal reranker scored by their\nimage; ImagesKept the pictorial image hits kept over a text reranker's\nrejection on their vector's evidence.",
+ "type": "integer"
},
- "slug": {
+ "model_id": {
+ "description": "ModelID and ModelSource (request / tenant / auto) identify the model.",
"type": "string"
},
- "status": {
+ "model_source": {
"type": "string"
},
- "summary": {
- "type": "string"
+ "outcome": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankOutcome"
},
- "tenant_id": {
+ "result_count": {
"type": "integer"
},
- "title": {
- "type": "string"
+ "threshold": {
+ "description": "Threshold is the requested minimum score; EffectiveThreshold is the one\napplied after degradation.",
+ "type": "number"
},
- "version": {
- "type": "integer"
+ "top_score": {
+ "description": "TopScore is the best rerank model score among the candidates.",
+ "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageRevisionListResponse": {
+ "github_com_Tencent_WeKnora_internal_types.RerankOptions": {
"type": "object",
"properties": {
- "current_version": {
- "type": "integer"
+ "enabled": {
+ "description": "Enabled turns the rerank stage off when explicitly false. Nil means on.",
+ "type": "boolean"
},
- "revisions": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageRevision"
- }
+ "model_id": {
+ "description": "ModelID selects the rerank model. Empty falls back to the tenant\nRetrievalConfig, then to the first rerank model of the tenant.",
+ "type": "string"
},
- "total": {
+ "threshold": {
+ "description": "Threshold is the minimum rerank model score. Nil uses the tenant\nRetrievalConfig. A pointer because 0 and negative scores are valid.",
+ "type": "number"
+ },
+ "top_k": {
+ "description": "TopK caps the reranked results. Zero uses the endpoint's result count.",
"type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiPageUpdateRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RerankOutcome": {
+ "type": "string",
+ "enum": [
+ "ok",
+ "threshold_degraded",
+ "fallback_top1",
+ "all_below_threshold",
+ "model_error",
+ "model_unavailable",
+ "no_model",
+ "disabled",
+ "no_candidates"
+ ],
+ "x-enum-varnames": [
+ "RerankOutcomeOK",
+ "RerankOutcomeThresholdDegraded",
+ "RerankOutcomeFallbackTop1",
+ "RerankOutcomeAllBelowThreshold",
+ "RerankOutcomeModelError",
+ "RerankOutcomeModelUnavailable",
+ "RerankOutcomeNoModel",
+ "RerankOutcomeDisabled",
+ "RerankOutcomeNoCandidates"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.Resource": {
"type": "object",
"properties": {
- "aliases": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "description": {
+ "description": "Optional description",
+ "type": "string"
},
- "content": {
+ "external_id": {
+ "description": "Unique identifier in the external system",
"type": "string"
},
- "page_type": {
+ "has_children": {
+ "description": "Whether this resource has children that can be expanded",
+ "type": "boolean"
+ },
+ "metadata": {
+ "description": "Additional metadata",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "modified_at": {
+ "description": "Last modified time in external system",
"type": "string"
},
- "status": {
+ "name": {
+ "description": "Display name",
"type": "string"
},
- "summary": {
+ "parent_id": {
+ "description": "For hierarchical resources (parent ID if applicable)",
"type": "string"
},
- "title": {
+ "type": {
+ "description": "Resource type (document, folder, space, page, etc.)",
"type": "string"
},
- "version": {
- "description": "Version is the optimistic-lock guard: when \u003e 0 the update is rejected\nwith a conflict if the stored version differs (someone else edited the\npage since the client loaded it). 0 skips the check (legacy clients).",
- "type": "integer"
+ "url": {
+ "description": "URL to access in external system",
+ "type": "string"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.WikiStats": {
+ "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
"type": "object",
"properties": {
- "is_active": {
- "description": "whether wiki ingestion is currently running",
- "type": "boolean"
- },
- "orphan_count": {
- "description": "pages with no inbound links",
- "type": "integer"
- },
- "pages_by_type": {
+ "agents": {
"type": "object",
- "additionalProperties": {
- "type": "integer",
- "format": "int64"
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
}
},
- "pending_issues": {
- "description": "number of pending wiki issues",
- "type": "integer"
- },
- "pending_tasks": {
- "description": "number of documents waiting to be ingested",
- "type": "integer"
- },
- "recent_updates": {
- "description": "last N updated pages",
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ "knowledge_bases": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
}
- },
- "total_links": {
- "type": "integer"
- },
- "total_pages": {
- "type": "integer"
}
}
},
- "gorm.DeletedAt": {
+ "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": {
"type": "object",
"properties": {
- "time": {
+ "embedding_top_k": {
+ "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
+ "type": "integer"
+ },
+ "keyword_threshold": {
+ "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
+ "type": "number"
+ },
+ "rerank_model_id": {
+ "description": "RerankModelID is the ID of the rerank model to use (required for search)",
"type": "string"
},
- "valid": {
- "description": "Valid is true if Time is not NULL",
- "type": "boolean"
+ "rerank_threshold": {
+ "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
+ "type": "number"
+ },
+ "rerank_top_k": {
+ "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
+ "type": "integer"
+ },
+ "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"
}
}
},
- "internal_handler.AddFavoriteRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RetrievalMeta": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
- },
- "type": {
- "type": "string"
+ "rerank": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankDiagnostics"
}
}
},
- "internal_handler.BatchDeleteKnowledgeRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RetrievalMetrics": {
"type": "object",
- "required": [
- "ids",
- "kb_id"
- ],
"properties": {
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "map": {
+ "description": "Mean Average Precision",
+ "type": "number"
},
- "kb_id": {
- "type": "string"
+ "mrr": {
+ "description": "Mean Reciprocal Rank",
+ "type": "number"
+ },
+ "ndcg10": {
+ "description": "Normalized Discounted Cumulative Gain at 10",
+ "type": "number"
+ },
+ "ndcg3": {
+ "description": "Normalized Discounted Cumulative Gain at 3",
+ "type": "number"
+ },
+ "precision": {
+ "description": "Precision score",
+ "type": "number"
+ },
+ "recall": {
+ "description": "Recall score",
+ "type": "number"
}
}
},
- "internal_handler.BatchDownloadKnowledgeRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
"type": "object",
- "required": [
- "ids"
- ],
"properties": {
- "ids": {
- "type": "array",
- "maxItems": 200,
- "minItems": 1,
+ "retriever_engine_type": {
+ "description": "Retriever engine type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ }
+ ]
+ },
+ "retriever_type": {
+ "description": "Retriever type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": {
+ "type": "string",
+ "enum": [
+ "postgres",
+ "elasticsearch",
+ "infinity",
+ "elasticfaiss",
+ "qdrant",
+ "milvus",
+ "weaviate",
+ "doris",
+ "sqlite",
+ "tencent_vectordb",
+ "opensearch"
+ ],
+ "x-enum-varnames": [
+ "PostgresRetrieverEngineType",
+ "ElasticsearchRetrieverEngineType",
+ "InfinityRetrieverEngineType",
+ "ElasticFaissRetrieverEngineType",
+ "QdrantRetrieverEngineType",
+ "MilvusRetrieverEngineType",
+ "WeaviateRetrieverEngineType",
+ "DorisRetrieverEngineType",
+ "SQLiteRetrieverEngineType",
+ "TencentVectorDBRetrieverEngineType",
+ "OpenSearchRetrieverEngineType"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
+ "type": "object",
+ "properties": {
+ "engines": {
+ "type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams"
}
}
}
},
- "internal_handler.CopyKnowledgeBaseRequest": {
- "type": "object",
- "required": [
- "source_id"
+ "github_com_Tencent_WeKnora_internal_types.RetrieverType": {
+ "type": "string",
+ "enum": [
+ "keywords",
+ "vector",
+ "websearch"
+ ],
+ "x-enum-comments": {
+ "KeywordsRetrieverType": "Keywords retriever",
+ "VectorRetrieverType": "Vector retriever",
+ "WebSearchRetrieverType": "Web search retriever"
+ },
+ "x-enum-descriptions": [
+ "Keywords retriever",
+ "Vector retriever",
+ "Web search retriever"
],
+ "x-enum-varnames": [
+ "KeywordsRetrieverType",
+ "VectorRetrieverType",
+ "WebSearchRetrieverType"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
+ "type": "object",
"properties": {
- "source_id": {
- "type": "string"
+ "approved": {
+ "type": "boolean"
},
- "target_id": {
- "type": "string"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "task_id": {
- "type": "string"
+ "role": {
+ "description": "Optional: role to assign when approving; overrides applicant's requested role",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "internal_handler.CopyModelRequest": {
- "type": "object",
- "required": [
- "display_name"
+ "github_com_Tencent_WeKnora_internal_types.RuntimeTaskAction": {
+ "type": "string",
+ "enum": [
+ "cancel",
+ "run_now",
+ "delete"
],
- "properties": {
- "display_name": {
- "type": "string"
- }
- }
+ "x-enum-varnames": [
+ "RuntimeTaskActionCancel",
+ "RuntimeTaskActionRunNow",
+ "RuntimeTaskActionDelete"
+ ]
},
- "internal_handler.CreateAgentRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RuntimeTaskInfo": {
"type": "object",
- "required": [
- "name"
- ],
"properties": {
- "avatar": {
- "type": "string"
+ "allowed_actions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RuntimeTaskAction"
+ }
},
- "config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ "completed_at": {
+ "type": "string"
},
- "description": {
+ "data_source_id": {
"type": "string"
},
- "name": {
+ "deadline": {
"type": "string"
- }
- }
- },
- "internal_handler.CreateModelRequest": {
- "type": "object",
- "required": [
- "name",
- "parameters",
- "source",
- "type"
- ],
- "properties": {
- "description": {
+ },
+ "enqueued_at": {
"type": "string"
},
- "display_name": {
+ "id": {
"type": "string"
},
- "name": {
+ "is_orphaned": {
+ "type": "boolean"
+ },
+ "knowledge_base_id": {
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
+ "knowledge_count": {
+ "type": "integer"
},
- "source": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ "knowledge_id": {
+ "type": "string"
},
- "type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
- }
- }
- },
- "internal_handler.CreateStoreRequest": {
- "type": "object",
- "required": [
- "connection_config",
- "engine_type",
- "name"
- ],
- "properties": {
- "connection_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
+ "last_error": {
+ "type": "string"
},
- "engine_type": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ "last_failed_at": {
+ "type": "string"
},
- "index_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig"
+ "max_retry": {
+ "type": "integer"
},
- "name": {
+ "next_process_at": {
"type": "string"
- }
- }
- },
- "internal_handler.CreateSystemUserResponse": {
- "type": "object",
- "properties": {
- "generated_password": {
- "description": "GeneratedPassword is the plaintext password when the server\nauto-generated one. Absent when the caller supplied the password.",
+ },
+ "queue": {
"type": "string"
},
- "user": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
- }
- }
- },
- "internal_handler.DeleteTagRequest": {
- "type": "object",
- "properties": {
- "exclude_ids": {
- "description": "Chunk seq_ids to exclude from deletion",
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- }
- },
- "internal_handler.EnsureMessageSuggestionsRequest": {
- "type": "object",
- "properties": {
- "regenerate": {
- "type": "boolean"
- }
- }
- },
- "internal_handler.EvaluationRequest": {
- "type": "object",
- "properties": {
- "chat_id": {
- "description": "ID of chat model to use",
+ "retried": {
+ "type": "integer"
+ },
+ "source_id": {
"type": "string"
},
- "dataset_id": {
- "description": "ID of dataset to evaluate",
+ "source_kb_id": {
"type": "string"
},
- "knowledge_base_id": {
- "description": "ID of knowledge base to use",
+ "started_at": {
"type": "string"
},
- "rerank_id": {
- "description": "ID of rerank model to use",
+ "state": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RuntimeTaskState"
+ },
+ "sync_log_id": {
"type": "string"
- }
- }
+ },
+ "target_id": {
+ "type": "string"
+ },
+ "target_kb_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ },
+ "worker": {
+ "type": "string"
+ }
+ }
},
- "internal_handler.FabriTextRequest": {
- "type": "object",
- "required": [
- "model_id"
+ "github_com_Tencent_WeKnora_internal_types.RuntimeTaskState": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "active",
+ "scheduled",
+ "retry",
+ "archived",
+ "completed"
],
+ "x-enum-varnames": [
+ "RuntimeTaskPending",
+ "RuntimeTaskActive",
+ "RuntimeTaskScheduled",
+ "RuntimeTaskRetry",
+ "RuntimeTaskArchived",
+ "RuntimeTaskCompleted"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": {
+ "type": "object",
"properties": {
- "model_id": {
+ "access_key": {
"type": "string"
},
- "tags": {
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "force_path_style": {
+ "type": "boolean"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
+ "type": "string"
+ },
+ "use_ssl": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SandboxCheckpoint": {
+ "type": "object",
+ "properties": {
+ "commit_sha": {
+ "type": "string"
+ },
+ "committed_at": {
+ "type": "string"
+ },
+ "sandbox_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SandboxNetworkPolicy": {
+ "type": "object",
+ "properties": {
+ "allow_out": {
+ "description": "AllowOut accepts IPv4, IPv4 CIDR, a DNS name, or a single-label\nwildcard such as \"*.example.com\". Domain entries are only meaningful\ntogether with a deny-all; see ValidateSandboxNetworkPolicy.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "allow_public_inbound": {
+ "description": "AllowPublicInbound is accepted on the wire for old payloads and then\ncleared. Inbound is always credential-required; a true value has no\nruntime effect.",
+ "type": "boolean"
+ },
+ "cube_rules": {
+ "description": "CubeRules are validated whenever present and consumed only by the Cube\nprovider adapter.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeEgressRule"
+ }
+ },
+ "deny_egress_by_default": {
+ "description": "DenyEgressByDefault installs a 0.0.0.0/0 deny-all, after which only\nAllowOut (and L7 rule targets) can reach the network. false allows\npublic egress, which is what skill installs need.",
+ "type": "boolean"
+ },
+ "deny_out": {
+ "description": "DenyOut accepts IPv4 and IPv4 CIDR only. Neither provider can deny a\ndomain: denial is a pure longest-prefix match on the destination IP.",
"type": "array",
"items": {
"type": "string"
}
+ },
+ "e2b_host_rules": {
+ "description": "E2BHostRules are validated whenever present and consumed only by the E2B\nprovider adapter.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.E2BHostRule"
+ }
}
}
},
- "internal_handler.GetStorageEngineStatusResponse": {
+ "github_com_Tencent_WeKnora_internal_types.SearchParams": {
"type": "object",
"properties": {
- "allowed_providers": {
+ "disable_keywords_match": {
+ "type": "boolean"
+ },
+ "disable_vector_match": {
+ "type": "boolean"
+ },
+ "keyword_threshold": {
+ "type": "number"
+ },
+ "knowledge_base_ids": {
+ "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
"type": "array",
"items": {
"type": "string"
}
},
- "engines": {
+ "knowledge_ids": {
"type": "array",
"items": {
- "$ref": "#/definitions/internal_handler.StorageEngineStatusItem"
+ "type": "string"
}
},
- "minio_env_available": {
+ "match_count": {
+ "type": "integer"
+ },
+ "only_recommended": {
+ "type": "boolean"
+ },
+ "query_embedding": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ },
+ "query_text": {
+ "description": "QueryText is required unless query_embedding is provided, keyword matching is disabled,\nand vector matching remains enabled.",
+ "type": "string"
+ },
+ "rerank": {
+ "description": "Rerank, when present and enabled, reranks the fused candidates before\ntruncating to MatchCount. Only the hybrid-search API reads it; internal\ncallers rerank on their own.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankOptions"
+ }
+ ]
+ },
+ "scope_tag_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skip_context_enrichment": {
+ "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
"type": "boolean"
+ },
+ "tag_ids": {
+ "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "internal_handler.GetSystemInfoResponse": {
+ "github_com_Tencent_WeKnora_internal_types.SearchResult": {
"type": "object",
"properties": {
- "build_time": {
+ "chunk_index": {
+ "description": "Chunk index",
+ "type": "integer"
+ },
+ "chunk_metadata": {
+ "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
+ "type": "object"
+ },
+ "chunk_type": {
+ "description": "Chunk 类型",
"type": "string"
},
- "commit_id": {
+ "content": {
+ "description": "Content",
"type": "string"
},
- "db_migration_error": {
- "description": "DBMigrationError carries the human-readable error message recorded when\nthe most recent startup migration attempt failed. Empty when migrations\nsucceeded; non-empty values let the frontend surface a troubleshooting\nbanner instead of silently hiding the DB version row (see issue #1319).",
+ "end_at": {
+ "description": "End at",
+ "type": "integer"
+ },
+ "id": {
+ "description": "ID",
"type": "string"
},
- "db_version": {
+ "image_info": {
+ "description": "图片信息 (JSON 格式)",
"type": "string"
},
- "edition": {
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
"type": "string"
},
- "go_version": {
+ "knowledge_channel": {
+ "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
"type": "string"
},
- "graph_database_engine": {
+ "knowledge_custom_metadata": {
+ "description": "KnowledgeCustomMetadata is user-authored context safe to expose to models.",
"type": "string"
},
- "keyword_index_engine": {
+ "knowledge_description": {
+ "description": "KnowledgeDescription is the description of the knowledge document",
"type": "string"
},
- "minio_enabled": {
- "type": "boolean"
+ "knowledge_filename": {
+ "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
+ "type": "string"
},
- "started_at": {
- "description": "StartedAt is the server process boot time (RFC3339, UTC).",
+ "knowledge_id": {
+ "description": "Knowledge ID",
"type": "string"
},
- "uptime_seconds": {
- "description": "UptimeSeconds is seconds elapsed since process start.",
- "type": "integer"
+ "knowledge_source": {
+ "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
+ "type": "string"
},
- "vector_store_engine": {
+ "knowledge_title": {
+ "description": "Knowledge title",
"type": "string"
},
- "version": {
+ "match_type": {
+ "description": "Match type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
+ }
+ ]
+ },
+ "matched_content": {
+ "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
"type": "string"
- }
- }
- },
- "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"
- }
- }
+ },
+ "matched_images": {
+ "description": "MatchedImages survives merging, deduplication and stored reference replay.\nIt contains storage references, never image bytes.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchedImage"
}
},
- "embedding": {
+ "metadata": {
+ "description": "Metadata",
"type": "object",
- "required": [
- "modelName",
- "source"
- ],
- "properties": {
- "apiKey": {
- "type": "string"
- },
- "baseUrl": {
- "type": "string"
- },
- "dimension": {
- "description": "添加embedding维度字段",
- "type": "integer"
- },
- "modelName": {
- "type": "string"
- },
- "source": {
- "type": "string"
- }
+ "additionalProperties": {
+ "type": "string"
}
},
- "llm": {
- "type": "object",
- "required": [
- "modelName",
- "source"
- ],
- "properties": {
- "apiKey": {
- "type": "string"
- },
- "baseUrl": {
- "type": "string"
- },
- "modelName": {
- "type": "string"
- },
- "source": {
- "type": "string"
- }
+ "parent_chunk_id": {
+ "description": "父 Chunk ID",
+ "type": "string"
+ },
+ "score": {
+ "description": "Score",
+ "type": "number"
+ },
+ "seq": {
+ "description": "Seq",
+ "type": "integer"
+ },
+ "source_locators": {
+ "description": "SourceLocators point back into the original file for citation\nnavigation. Merged results carry the union of their chunks' locators.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SourceLocator"
}
},
- "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"
- }
- }
+ "start_at": {
+ "description": "Start at",
+ "type": "integer"
+ },
+ "sub_chunk_id": {
+ "description": "SubChunkIndex",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SearchableOrganizationItem": {
+ "type": "object",
+ "properties": {
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
+ "type": "integer"
+ },
+ "avatar": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_already_member": {
+ "type": "boolean"
+ },
+ "member_count": {
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "0 = unlimited",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "share_count": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.Session": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description",
+ "type": "string"
+ },
+ "forked_from_message_id": {
+ "description": "ForkedFromMessageID is the user or assistant message, IN THE PARENT\nSESSION, that the fork branched at. For a user point, messages strictly\nbefore it were copied here. For an assistant point, that answer is\nincluded so the branch continues after it.",
+ "type": "string"
+ },
+ "host_workspace_dir": {
+ "description": "HostWorkspaceDir is the user-selected project directory this session\noperates in, for the WeKnora Lite host sandbox only. Empty means the session\ngets an auto-allocated workspace instead.\n\nWritten once at creation and never updated: re-pointing a live session\nat a different directory would leave its transcript describing files\nthat are no longer there. Standard edition never writes it.",
+ "type": "string"
+ },
+ "id": {
+ "description": "ID",
+ "type": "string"
+ },
+ "im_platform": {
+ "description": "IMPlatform is the originating IM platform (e.g. \"feishu\", \"wecom\") when\nthis session is bound to an IM channel. It is not stored on the sessions\ntable (it lives in im_channel_sessions) and is populated on read so the\nWeb console can classify a session's origin folder without a list query.",
+ "type": "string"
+ },
+ "is_pinned": {
+ "description": "IsPinned indicates whether the session is pinned in the list.",
+ "type": "boolean"
+ },
+ "last_request_state": {
+ "description": "LastRequestState records the input-bar state used the last time this\nsession sent a question (agent, model, KB scope, web search, MCPs).\nPersisted on every successful POST to /knowledge-chat or /agent-chat so\nthat reopening the session can restore the original request context to\nthe chat UI. Stored in the legacy sessions.agent_config JSONB column to\navoid a new migration; the shape used today is `SessionLastRequestState`.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SessionLastRequestState"
}
+ ]
+ },
+ "parent_session_id": {
+ "description": "ParentSessionID names the session this one was forked from. Empty for\nordinary sessions. Deliberately not a foreign key: the parent may be\ndeleted while the branch lives on, and a branch must not cascade away\nwith it. A dangling value simply renders as an ordinary session.",
+ "type": "string"
+ },
+ "pinned_at": {
+ "description": "PinnedAt records when the session was pinned; nil when not pinned.",
+ "type": "string"
+ },
+ "sandbox_config_id": {
+ "description": "SandboxConfigID pins which sandbox config this session's CURRENT live\nsandbox was created on. Empty means no live sandbox;\nSandboxConfigIDGlobalDefault means the deployment-wide default config.\n\nThis is an ephemeral pin that dies with the sandbox, not a permanent\nowner: sessions outlive sandboxes by months, so treating it as\npermanent would make \"no session references this config\" never true.",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Title",
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "user_id": {
+ "description": "UserID is the owner scope for this session. WeKnora user UUIDs, API\nexternal-user principals, and embed visitor principals all use this column.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SessionLastRequestState": {
+ "type": "object",
+ "properties": {
+ "agent_enabled": {
+ "type": "boolean"
+ },
+ "agent_id": {
+ "type": "string"
+ },
+ "knowledge_base_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "local_browser_enabled": {
+ "type": "boolean"
+ },
+ "mcp_service_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "mentioned_items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
+ }
+ },
+ "model_id": {
+ "type": "string"
+ },
+ "reasoning_effort": {
+ "type": "string"
+ },
+ "skill_names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tag_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "web_search_enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "organization_id",
+ "permission"
+ ],
+ "properties": {
+ "organization_id": {
+ "type": "string"
+ },
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SharedAgentInfo": {
+ "type": "object",
+ "properties": {
+ "agent": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ },
+ "disabled_by_me": {
+ "description": "DisabledByMe: current tenant has hidden this shared agent from their conversation dropdown (per-user preference)",
+ "type": "boolean"
+ },
+ "org_name": {
+ "type": "string"
+ },
+ "organization_id": {
+ "type": "string"
+ },
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ },
+ "share_id": {
+ "type": "string"
+ },
+ "shared_at": {
+ "type": "string"
+ },
+ "shared_by_user_id": {
+ "type": "string"
+ },
+ "shared_by_username": {
+ "type": "string"
+ },
+ "source_tenant_id": {
+ "type": "integer"
+ },
+ "web_search_ready": {
+ "description": "WebSearchReady is resolved against the source workspace without exposing\nits provider list or credentials. Receivers must not compare the agent's\nprovider ID with their own workspace resources.",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SkillImageConfig": {
+ "type": "object",
+ "properties": {
+ "base_template_id": {
+ "description": "BaseTemplateID is the template this chain was originally built from;\nthe rebuild path starts over from it.",
+ "type": "string"
+ },
+ "built_at": {
+ "description": "BuiltAt records when this generation was produced.",
+ "type": "string"
+ },
+ "generation": {
+ "description": "Generation increments on every successful install/remove, for naming\nand troubleshooting.",
+ "type": "integer"
+ },
+ "owner_fingerprint": {
+ "description": "OwnerFingerprint identifies the provider account that owns the snapshot.\nSnapshots are invisible across accounts, so a mismatch means \"fall back\nto the base template\" rather than \"fail\".",
+ "type": "string"
+ },
+ "snapshot_id": {
+ "description": "SnapshotID is the currently effective snapshot; empty = base template.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SourceLocator": {
+ "type": "object",
+ "properties": {
+ "bbox": {
+ "description": "BBox is [x0, y0, x1, y1] as fractions of the page width and height,\norigin at the top-left corner of the rendered page.",
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ },
+ "block": {
+ "description": "Block is the 1-based index among a Word file's body paragraphs and tables.",
+ "type": "integer"
+ },
+ "end": {
+ "type": "integer"
+ },
+ "end_ms": {
+ "type": "integer"
+ },
+ "mapping": {
+ "description": "Mapping records verified text-to-source alignment. Empty means legacy.",
+ "type": "string"
+ },
+ "page": {
+ "description": "Page is the 1-based PDF page.",
+ "type": "integer"
+ },
+ "partial": {
+ "description": "Partial means some of the chunk has no source mapping.",
+ "type": "boolean"
+ },
+ "quote": {
+ "description": "Quote is the complete cited overlap as parsed. Viewers match it\ninside the rendered original and against the\nanswer sentence that cites the chunk.",
+ "type": "string"
+ },
+ "row_end": {
+ "type": "integer"
+ },
+ "row_start": {
+ "type": "integer"
+ },
+ "section": {
+ "description": "Section is the 1-based EPUB spine index.",
+ "type": "integer"
+ },
+ "sheet": {
+ "description": "Sheet is the spreadsheet sheet name; RowStart/RowEnd are its 1-based\nrow numbers as shown by spreadsheet applications.",
+ "type": "string"
+ },
+ "slide": {
+ "description": "Slide is the 1-based slide number in presentation order.",
+ "type": "integer"
+ },
+ "source_hash": {
+ "description": "SourceHash binds the locator to the knowledge record’s source revision hash.",
+ "type": "string"
+ },
+ "source_id": {
+ "description": "SourceID identifies a block within the parser result, not a rendered item.",
+ "type": "string"
+ },
+ "start": {
+ "description": "Start/End are rune offsets into the original text file.",
+ "type": "integer"
+ },
+ "start_ms": {
+ "description": "StartMs/EndMs bound an audio segment.",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Title names the section or slide when the source has one.",
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SpanTreeNode": {
+ "type": "object",
+ "properties": {
+ "attempt": {
+ "type": "integer"
+ },
+ "children": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SpanTreeNode"
+ }
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "duration_ms": {
+ "type": "integer"
+ },
+ "error_code": {
+ "type": "string"
+ },
+ "error_message": {
+ "type": "string"
+ },
+ "finished_at": {
+ "type": "string"
+ },
+ "input": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JSONMap"
+ },
+ "kind": {
+ "type": "string"
+ },
+ "knowledge_id": {
+ "type": "string"
+ },
+ "metadata": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JSONMap"
+ },
+ "name": {
+ "type": "string"
+ },
+ "output": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JSONMap"
+ },
+ "parent_span_id": {
+ "type": "string"
+ },
+ "span_id": {
+ "type": "string"
+ },
+ "started_at": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "mode": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageBackend": {
+ "type": "object",
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackendConfig"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "id": {
+ "type": "string"
+ },
+ "legacy_alias": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "source": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageBackendConfig": {
+ "type": "object",
+ "properties": {
+ "access_key_id": {
+ "type": "string"
+ },
+ "app_id": {
+ "type": "string"
+ },
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "force_path_style": {
+ "type": "boolean"
+ },
+ "mode": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_access_key": {
+ "type": "string"
+ },
+ "temp_bucket_name": {
+ "type": "string"
+ },
+ "temp_region": {
+ "type": "string"
+ },
+ "use_ssl": {
+ "type": "boolean"
+ },
+ "use_temp_bucket": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageConfig": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "description": "App ID (COS specific)",
+ "type": "string"
+ },
+ "bucket_name": {
+ "description": "Bucket Name",
+ "type": "string"
+ },
+ "endpoint": {
+ "description": "Endpoint (S3 specific) - e.g., s3.amazonaws.com, oss-cn-hangzhou.aliyuncs.com",
+ "type": "string"
+ },
+ "force_path_style": {
+ "description": "ForcePathStyle (S3 specific) - whether to use path-style URLs",
+ "type": "boolean"
+ },
+ "path_prefix": {
+ "description": "Path Prefix",
+ "type": "string"
+ },
+ "provider": {
+ "description": "Provider: \"cos\", \"minio\", \"s3\"",
+ "type": "string"
+ },
+ "region": {
+ "description": "Region",
+ "type": "string"
+ },
+ "secret_id": {
+ "description": "Secret ID (COS) / Access Key ID (S3, MinIO)",
+ "type": "string"
+ },
+ "secret_key": {
+ "description": "Secret Key (COS) / Secret Access Key (S3, MinIO)",
+ "type": "string"
+ },
+ "use_ssl": {
+ "description": "UseSSL (S3 specific) - whether to use HTTPS",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
+ },
+ "default_provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\", \"obs\"",
+ "type": "string"
+ },
+ "ks3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KS3EngineConfig"
+ },
+ "local": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
+ },
+ "minio": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
+ },
+ "obs": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OBSEngineConfig"
+ },
+ "oss": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
+ },
+ "s3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
+ },
+ "tos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": {
+ "type": "object",
+ "properties": {
+ "provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\", \"ks3\", \"obs\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
+ ],
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ },
+ "message": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "role": {
+ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SuggestedQuestion": {
+ "type": "object",
+ "properties": {
+ "knowledge_base_id": {
+ "description": "来源知识库ID(仅 faq/document/wiki 来源时有值)",
+ "type": "string"
+ },
+ "knowledge_id": {
+ "description": "来源文档ID(仅 faq/document 来源时有值)",
+ "type": "string"
+ },
+ "question": {
+ "description": "问题文本",
+ "type": "string"
+ },
+ "source": {
+ "description": "来源类型: \"agent_config\", \"faq\", \"document\", \"wiki\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SuggestionAttribution": {
+ "type": "object",
+ "properties": {
+ "question_id": {
+ "type": "string"
+ },
+ "suggestion_set_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SuggestionItem": {
+ "type": "object",
+ "properties": {
+ "category": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "source": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SummaryConfig": {
+ "type": "object",
+ "properties": {
+ "context_template": {
+ "description": "Context template",
+ "type": "string"
+ },
+ "frequency_penalty": {
+ "description": "Frequency penalty",
+ "type": "number"
+ },
+ "max_completion_tokens": {
+ "description": "Max completion tokens",
+ "type": "integer"
+ },
+ "max_tokens": {
+ "description": "Max tokens",
+ "type": "integer"
+ },
+ "no_match_prefix": {
+ "description": "No match prefix",
+ "type": "string"
+ },
+ "presence_penalty": {
+ "description": "Presence penalty",
+ "type": "number"
+ },
+ "prompt": {
+ "description": "Prompt",
+ "type": "string"
+ },
+ "reasoning_effort": {
+ "description": "ReasoningEffort is the graded thinking level; empty falls back to Thinking.",
+ "type": "string"
+ },
+ "repeat_penalty": {
+ "description": "Repeat penalty",
+ "type": "number"
+ },
+ "seed": {
+ "description": "Seed",
+ "type": "integer"
+ },
+ "temperature": {
+ "description": "Temperature",
+ "type": "number"
+ },
+ "thinking": {
+ "description": "Thinking - whether to enable thinking mode",
+ "type": "boolean"
+ },
+ "top_k": {
+ "description": "TopK",
+ "type": "integer"
+ },
+ "top_p": {
+ "description": "TopP",
+ "type": "number"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SyncLog": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "description": "Creation timestamp (usually same as StartedAt)",
+ "type": "string"
+ },
+ "data_source_id": {
+ "description": "Reference to the data source",
+ "type": "string"
+ },
+ "error_message": {
+ "description": "Error details if status is \"failed\"",
+ "type": "string"
+ },
+ "finished_at": {
+ "description": "Sync completion time",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier",
+ "type": "string"
+ },
+ "items_created": {
+ "description": "New items created in knowledge base",
+ "type": "integer"
+ },
+ "items_deleted": {
+ "description": "Items deleted from knowledge base",
+ "type": "integer"
+ },
+ "items_failed": {
+ "description": "Items that failed to sync",
+ "type": "integer"
+ },
+ "items_skipped": {
+ "description": "Items skipped (no changes detected)",
+ "type": "integer"
+ },
+ "items_total": {
+ "description": "Total items fetched from source",
+ "type": "integer"
+ },
+ "items_updated": {
+ "description": "Existing items updated",
+ "type": "integer"
+ },
+ "result": {
+ "description": "Detailed sync result (JSON-encoded)",
+ "type": "object"
+ },
+ "started_at": {
+ "description": "Sync start time",
+ "type": "string"
+ },
+ "status": {
+ "description": "Sync status: running, success, partial, failed, canceled",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SystemSetting": {
+ "type": "object",
+ "properties": {
+ "category": {
+ "description": "Category groups settings in the management UI (\"limits\", \"agent\",\n\"auth\", ...). Free-form string so adding a new category is a\ndata-only change.",
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "enum": {
+ "description": "Enum is populated by the service layer (NOT persisted) from the\nin-code registry. Empty/nil means \"free-form input\"; non-empty\nmeans the UI should render a select with these options. Tagged\n`gorm:\"-\"` so GORM never tries to read/write the column.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "id": {
+ "type": "integer"
+ },
+ "is_secret": {
+ "description": "IsSecret reserves UI affordances for P3 (mask + reveal-with-confirm).\nIn P1 every row is is_secret=false; service Update accepts the\ncolumn but does not yet enforce special handling.",
+ "type": "boolean"
+ },
+ "key": {
+ "type": "string"
+ },
+ "last_modified_by": {
+ "type": "string"
+ },
+ "last_modified_by_name": {
+ "description": "LastModifiedByName is a display label resolved from LastModifiedBy\n(the user's UUID) at handler time — username when available,\notherwise email. Empty for virtual rows that were never persisted\n(LastModifiedBy=\"\"). Not stored: derived per request so renaming\na user reflects on the next reload without a backfill job.",
+ "type": "string"
+ },
+ "requires_restart": {
+ "description": "RequiresRestart reserves UI affordances for P3 (banner \"this\nchange won't take effect until the next restart\"). In P1 the\nonly seeded key is per-request, so always false.",
+ "type": "boolean"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "value": {
+ "type": "object"
+ },
+ "value_type": {
+ "description": "ValueType is one of \"int\", \"string\", \"bool\". Service layer rejects\nupdates whose payload type does not match; UI uses it to pick\nInputNumber vs Input vs Switch.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": {
+ "type": "object",
+ "properties": {
+ "access_key": {
+ "type": "string"
+ },
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
+ "type": "string"
+ },
+ "temp_bucket_name": {
+ "type": "string"
+ },
+ "temp_region": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.Tenant": {
+ "type": "object",
+ "properties": {
+ "business": {
+ "description": "Business",
+ "type": "string"
+ },
+ "chat_history_config": {
+ "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
+ }
+ ]
+ },
+ "context_config": {
+ "description": "Global Context configuration for this workspace (default for all sessions)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
+ }
+ ]
+ },
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "credentials": {
+ "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig"
+ }
+ ]
+ },
+ "default_storage_backend_id": {
+ "description": "DefaultStorageBackendID is the workspace default concrete storage instance.",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "description": {
+ "description": "Description",
+ "type": "string"
+ },
+ "id": {
+ "description": "ID",
+ "type": "integer"
+ },
+ "memory_config": {
+ "description": "Memory config: workspace switch for cross-session long-term memory",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConfig"
+ }
+ ]
+ },
+ "name": {
+ "description": "Name",
+ "type": "string"
+ },
+ "parser_engine_config": {
+ "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
+ }
+ ]
+ },
+ "retrieval_config": {
+ "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
+ }
+ ]
+ },
+ "retriever_engines": {
+ "description": "Retriever engines",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
+ }
+ ]
+ },
+ "status": {
+ "description": "Status",
+ "type": "string"
+ },
+ "storage_engine_config": {
+ "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
+ }
+ ]
+ },
+ "storage_quota": {
+ "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
+ "type": "integer"
+ },
+ "storage_used": {
+ "description": "Storage used (Bytes)",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time",
+ "type": "string"
+ },
+ "web_search_config": {
+ "description": "Global WebSearch configuration for this workspace",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantInvitationResponse": {
+ "type": "object",
+ "properties": {
+ "accepted_count": {
+ "description": "AcceptedCount mirrors TenantInvitation.AcceptedCount. Surfaced\nfor share-link rows so the management UI can show \"N 人已通过此\n链接加入\"; informational only for per-user invitations.",
+ "type": "integer"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "expires_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "integer"
+ },
+ "invite_url": {
+ "description": "InviteURL is set on share-link rows that are still pending.\nComposed by the handler from FrontendBaseURL + the row's plaintext\ntoken, so the management UI can render a \"copy link\" button per\nrow without ever exposing the raw token through the JSON wire.",
+ "type": "string"
+ },
+ "invited_by": {
+ "type": "string"
+ },
+ "invitee_email": {
+ "type": "string"
+ },
+ "invitee_name": {
+ "type": "string"
+ },
+ "invitee_user_id": {
+ "type": "string"
+ },
+ "inviter_email": {
+ "type": "string"
+ },
+ "inviter_name": {
+ "type": "string"
+ },
+ "is_share_link": {
+ "description": "IsShareLink is a convenience flag so the SPA doesn't have to\nspecial-case \"invitee_user_id == ''\" everywhere when distinguishing\nshare-link rows from per-user invitations.",
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string"
+ },
+ "responded_at": {
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantRole"
+ },
+ "status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInvitationStatus"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "tenant_name": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantInvitationStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "accepted",
+ "declined",
+ "revoked",
+ "expired"
+ ],
+ "x-enum-varnames": [
+ "TenantInvitationStatusPending",
+ "TenantInvitationStatusAccepted",
+ "TenantInvitationStatusDeclined",
+ "TenantInvitationStatusRevoked",
+ "TenantInvitationStatusExpired"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantInviteCandidate": {
+ "type": "object",
+ "properties": {
+ "representative_avatar": {
+ "type": "string"
+ },
+ "representative_email": {
+ "type": "string"
+ },
+ "representative_user_id": {
+ "type": "string"
+ },
+ "representative_username": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "tenant_name": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantRole": {
+ "type": "string",
+ "enum": [
+ "owner",
+ "admin",
+ "contributor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "TenantRoleOwner",
+ "TenantRoleAdmin",
+ "TenantRoleContributor",
+ "TenantRoleViewer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.TenantSandboxConfig": {
+ "type": "object",
+ "properties": {
+ "allow_private_endpoints": {
+ "description": "AllowPrivateEndpoints permits this workspace config to reach RFC1918 or\nloopback cluster endpoints. Link-local/cloud-metadata addresses remain\nblocked. It is explicit in the UI instead of hidden in process env.",
+ "type": "boolean"
+ },
+ "cube": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CubeSandboxConfig"
+ },
+ "default_timeout_sec": {
+ "description": "DefaultTimeoutSec is the per-execution timeout in seconds. 0 uses the\nprogram's built-in default.",
+ "type": "integer"
+ },
+ "desktop_enabled": {
+ "description": "DesktopEnabled declares that this config's base template is a desktop\nimage (XFCE + x11vnc + websockify). It is NOT a second template: a\nconfig has exactly one boot target, and skill snapshots stack on top of\nthis base generation after generation. Flipping it changes the base, so\nany installed skills must be rebuilt from the new one.",
+ "type": "boolean"
+ },
+ "docker": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DockerSandboxConfig"
+ },
+ "e2b": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.E2BSandboxConfig"
+ },
+ "env_vars": {
+ "description": "EnvVars are additional environment variables injected into every\nsandbox created for this tenant. 🔒 Values are encrypted at rest.\nThese become visible to all scripts running in the tenant's\nsandboxes — do not place secrets here that scripts must not access.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "network": {
+ "description": "Network is the outbound/inbound network policy applied to every sandbox\ncreated from this config — chat sessions, skill installs and deep\nconnectivity probes alike. nil and the zero value mean the same thing:\noutbound egress allowed, inbound public access closed.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SandboxNetworkPolicy"
+ }
+ ]
+ },
+ "sandbox_type": {
+ "description": "SandboxType is cube, e2b, or docker; disabled is the hidden policy row.",
+ "type": "string"
+ },
+ "skill_image": {
+ "description": "SkillImage points at the snapshot that carries this config's installed\nskills. Empty means \"use the base template\". Written only by the skill\ninstall/remove path: MergeSandboxConfigForUpdate ignores client values\nso a settings-form save cannot wipe or plant the pointer.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SkillImageConfig"
+ }
+ ]
+ },
+ "skill_rollout": {
+ "description": "SkillRollout decides whether sessions that already hold a sandbox of\nthis config rebuild after a skill install or removal. Empty and\nSkillRolloutNextTurn rebuild on the next chat turn. SkillRolloutNewSession\nleaves those sandboxes on the previous image; only sessions that start\nafterwards boot the new snapshot.",
+ "type": "string"
+ },
+ "terminal_idle_disconnect_sec": {
+ "description": "TerminalIdleDisconnectSec is how long an interactive terminal or\ndesktop may go without user activity before WeKnora closes the\nconnection so the sandbox can pause on its provider TTL. Terminal\ncounts keystrokes and PTY output; desktop counts mouse and keyboard.\n0 uses the built-in default (15 minutes). Not an identity field.",
+ "type": "integer"
+ },
+ "volume_mount": {
+ "description": "VolumeMount configures an optional shared volume mounted into every\nsandbox created for this tenant. Currently used for tenant-installed\nskills, but the configuration itself is skill-agnostic and can serve\nany volume-mount use case (shared datasets, pre-installed toolchains,\netc.).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VolumeMountConfig"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TokenUsage": {
+ "type": "object",
+ "properties": {
+ "cache_miss_tokens": {
+ "type": "integer"
+ },
+ "cache_read_tokens": {
+ "type": "integer"
+ },
+ "cache_reported": {
+ "type": "boolean"
+ },
+ "cache_status": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptCacheStatus"
+ },
+ "cache_write_tokens": {
+ "type": "integer"
+ },
+ "cached_tokens": {
+ "description": "CachedTokens is the legacy alias for CacheReadTokens. It remains on the\nwire for compatibility with existing API consumers.",
+ "type": "integer"
+ },
+ "completion_tokens": {
+ "type": "integer"
+ },
+ "context_token_scale": {
+ "description": "ContextTokenScale is provider prompt tokens per cl100k-estimated token,\nmeasured over the turn's rounds. Persisted with the turn so the next\nturn's history loading and first compaction check are calibrated before\nany provider count of their own. Zero when the turn measured none.",
+ "type": "number"
+ },
+ "prompt_tokens": {
+ "type": "integer"
+ },
+ "total_tokens": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ToolCall": {
+ "type": "object",
+ "properties": {
+ "args": {
+ "description": "Tool arguments",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "duration": {
+ "description": "Execution time in milliseconds",
+ "type": "integer"
+ },
+ "id": {
+ "description": "Function call ID from LLM",
+ "type": "string"
+ },
+ "name": {
+ "description": "Tool name",
+ "type": "string"
+ },
+ "provider_metadata": {
+ "description": "Provider-specific tool-call state for replay",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCallMetadata"
+ }
+ ]
+ },
+ "reflection": {
+ "description": "Agent's reflection on this tool call result (if enabled)",
+ "type": "string"
+ },
+ "result": {
+ "description": "Execution result (contains Output)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult"
+ }
+ ]
+ },
+ "target": {
+ "description": "Target identifies the actual proxy target; Name/Args retain the model call for replay.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCallTarget"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ToolCallMetadata": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ToolCallTarget": {
+ "type": "object",
+ "properties": {
+ "args": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "name": {
+ "type": "string"
+ },
+ "service_name": {
+ "type": "string"
+ },
+ "tool_name": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ToolResult": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "description": "Structured data for programmatic use",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "error": {
+ "description": "Error message if execution failed",
+ "type": "string"
+ },
+ "images": {
+ "description": "Base64 data URIs from tool (e.g. MCP image content)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "output": {
+ "description": "Human-readable output",
+ "type": "string"
+ },
+ "success": {
+ "description": "Whether the tool executed successfully",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 1000
+ },
+ "invite_code_validity_days": {
+ "description": "0=never, 1, 7, 30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "max members; 0=unlimited",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "description": "open for search so others can discover and join",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
+ "type": "object",
+ "required": [
+ "permission"
+ ],
+ "properties": {
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UsedMemory": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kind": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.User": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "description": "Avatar URL of the user",
+ "type": "string"
+ },
+ "can_access_all_tenants": {
+ "description": "Whether the user can access all workspaces (cross-workspace access)",
+ "type": "boolean"
+ },
+ "created_at": {
+ "description": "Creation time of the user",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time of the user",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "email": {
+ "description": "Email address of the user",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier of the user",
+ "type": "string"
+ },
+ "is_active": {
+ "description": "Whether the user is active",
+ "type": "boolean"
+ },
+ "is_system_admin": {
+ "description": "Whether the user is a system administrator (independent of workspace roles)",
+ "type": "boolean"
+ },
+ "preferences": {
+ "description": "Per-user UI/feature preferences.\nStored as JSON (jsonb on Postgres, TEXT on SQLite) via the\ndriver.Valuer / sql.Scanner methods on UserPreferences.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ }
+ ]
+ },
+ "tenant": {
+ "description": "Association relationship, not stored in the database",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ }
+ ]
+ },
+ "tenant_id": {
+ "description": "Workspace ID that the user belongs to",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time of the user",
+ "type": "string"
+ },
+ "username": {
+ "description": "Username of the user",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UserInfo": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "can_access_all_tenants": {
+ "type": "boolean"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_active": {
+ "type": "boolean"
+ },
+ "is_system_admin": {
+ "type": "boolean"
+ },
+ "preferences": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UserPreferences": {
+ "type": "object",
+ "properties": {
+ "browser_search_instructions": {
+ "description": "BrowserSearchInstructions customizes browser search for this user. Nil/empty uses the platform default.",
+ "type": "string"
+ },
+ "gallery": {
+ "description": "Gallery holds the user's image-gallery UI state: the search\nactivation mode and the per-attribute search-field toggles. Written\nby the gallery's mode / checkbox interactions via the preferences\nPUT; read back by GET /knowledge-bases/:id/gallery-config so the\ngallery renders the same activation state on every device. Nil = the\nuser never touched the gallery controls (mode defaults to \"all\").",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GalleryUserPrefs"
+ }
+ ]
+ },
+ "last_active_tenant_id": {
+ "description": "LastActiveTenantID remembers the last workspace the user actively\nswitched into, so a fresh login (new device, cleared browser, new\nrefresh token) lands them back in that workspace instead of always\nbouncing to their home workspace. Written by the SPA's preferences\nPUT and by service-level SwitchTenant (including when switching\nhome, which stores the home ID). Login / RefreshToken validate that\nthe workspace still exists and the user still has an active membership\n(or CanAccessAllTenants) before honouring this preference; an\ninvalid pointer is best-effort cleared and the user falls back to\nhome. Refresh JWT claims have no tenant_id, so RefreshToken\nre-resolves from this field.\n\nnil = no preference (use user.TenantID, i.e. home)\n*0 = \"clear preference\" sentinel for the partial-update endpoint\n (UpdateUserPreferences turns this into nil). Otherwise treat\n a stored *0 the same as nil.\n*N = preferred workspace id.",
+ "type": "integer"
+ },
+ "oidc_only_login": {
+ "description": "OidcOnlyLogin is set server-side when an account is auto-provisioned\nvia OIDC with a random password the user never received. The profile\nUI hides self-service password rotation until the user sets a known\npassword via ChangePassword (which clears this flag).",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UserResourceFavorite": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "resource_id": {
+ "type": "string"
+ },
+ "resource_type": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VLMConfig": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "description": "API Key",
+ "type": "string"
+ },
+ "base_url": {
+ "description": "Base URL",
+ "type": "string"
+ },
+ "custom_instructions": {
+ "description": "CustomInstructions adds KB-specific image interpretation guidance without\nreplacing the system-owned OCR and Markdown output contract.",
+ "type": "string"
+ },
+ "description_language": {
+ "description": "DescriptionLanguage controls the language used for generated image\ncaptions. Empty means follow the document/request language.",
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "interface_type": {
+ "description": "Interface Type: \"ollama\" or \"openai\"",
+ "type": "string"
+ },
+ "model_id": {
+ "type": "string"
+ },
+ "model_name": {
+ "description": "兼容老版本\nModel Name",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VectorStoreFieldInfo": {
+ "type": "object",
+ "properties": {
+ "default": {},
+ "description": {
+ "type": "string"
+ },
+ "enum": {
+ "description": "Enum constrains the allowed string values. Empty means no\nconstraint. Used by fields whose value space is closed (e.g.\nOpenSearch's knn_engine ∈ {\"lucene\", \"faiss\"}).",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "immutable": {
+ "description": "Immutable marks a field whose value cannot be changed after the\nVectorStore is first created. The UI shows the input as read-only\nin edit mode; the backend rejects modification attempts. Used by\nengines whose underlying index structure is fixed at create time\n(e.g. OpenSearch's HNSW engine / M / ef_construction).",
+ "type": "boolean"
+ },
+ "max": {
+ "type": "number"
+ },
+ "min": {
+ "description": "Min / Max set inclusive bounds for \"number\"-typed fields. nil\nmeans no bound on that side. Frontend uses these to constrain\ninputs; backend re-validates as defense-in-depth.",
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "required": {
+ "type": "boolean"
+ },
+ "sensitive": {
+ "type": "boolean"
+ },
+ "type": {
+ "description": "\"string\", \"number\", \"boolean\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VectorStoreResponse": {
+ "type": "object",
+ "properties": {
+ "connection_config": {
+ "description": "Driver-specific connection parameters (sensitive fields encrypted with AES-GCM)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
+ }
+ ]
+ },
+ "created_at": {
+ "description": "Timestamps",
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "engine_type": {
+ "description": "Engine type: postgres, elasticsearch, qdrant, milvus, weaviate, sqlite",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier (UUID, auto-generated)",
+ "type": "string"
+ },
+ "index_config": {
+ "description": "Optional index/collection configuration (engine-specific defaults if empty)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig"
+ }
+ ]
+ },
+ "name": {
+ "description": "User-friendly name, e.g., \"elasticsearch-hot\"",
+ "type": "string"
+ },
+ "readonly": {
+ "description": "env stores are read-only",
+ "type": "boolean"
+ },
+ "source": {
+ "description": "\"env\" or \"user\"",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID for scoping",
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VectorStoreTypeInfo": {
+ "type": "object",
+ "properties": {
+ "connection_fields": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreFieldInfo"
+ }
+ },
+ "display_name": {
+ "type": "string"
+ },
+ "index_fields": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreFieldInfo"
+ }
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.VolumeMountConfig": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "description": "Enabled toggles the volume mount for this tenant.",
+ "type": "boolean"
+ },
+ "mount_path": {
+ "description": "MountPath is the sandbox-internal path where the volume is mounted.\nDefault: /weknora/tenant/skills (customizable per use case).",
+ "type": "string"
+ },
+ "provider": {
+ "description": "Provider identifies the volume backend. Currently \"e2b\" or \"cube\".",
+ "type": "string"
+ },
+ "volume_id": {
+ "description": "VolumeID is the provider-specific volume identifier, populated after\nEnsureVolume / CreateVolume succeeds.",
+ "type": "string"
+ },
+ "volume_name": {
+ "description": "VolumeName is the human-readable volume name, e.g.\n\"weknora-tenant-\u003cid\u003e-skills\".",
+ "type": "string"
+ },
+ "volume_owner_fingerprint": {
+ "description": "VolumeOwnerFingerprint = sha256(provider + APIKey + APIURL).\nUsed to detect when the tenant switched to a different backend or\nAPI key, at which point the volume is no longer reachable and must\nbe recreated.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WeKnoraCloudStatusResult": {
+ "type": "object",
+ "properties": {
+ "has_models": {
+ "description": "是否已配置 WeKnoraCloud 凭证",
+ "type": "boolean"
+ },
+ "needs_reinit": {
+ "description": "是否需要重新初始化(凭证损坏)",
+ "type": "boolean"
+ },
+ "reason": {
+ "description": "需要重新初始化的原因",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "blacklist": {
+ "description": "黑名单规则列表",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "compression_method": {
+ "description": "压缩方法:none, summary, extract, rag",
+ "type": "string"
+ },
+ "document_fragments": {
+ "description": "文档片段数量(用于RAG压缩)",
+ "type": "integer"
+ },
+ "embedding_dimension": {
+ "description": "嵌入维度(用于RAG压缩)",
+ "type": "integer"
+ },
+ "embedding_model_id": {
+ "description": "RAG压缩相关配置",
+ "type": "string"
+ },
+ "include_date": {
+ "description": "是否包含日期",
+ "type": "boolean"
+ },
+ "max_results": {
+ "description": "最大搜索结果数",
+ "type": "integer"
+ },
+ "provider": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "proxy_url": {
+ "description": "Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url. Merged at call time when set.",
+ "type": "string"
+ },
+ "rerank_model_id": {
+ "description": "重排模型ID(用于RAG压缩)",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigField": {
+ "type": "object",
+ "properties": {
+ "default": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "description_key": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "label_key": {
+ "type": "string"
+ },
+ "options": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigFieldOption"
+ }
+ },
+ "required": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigFieldOption": {
+ "type": "object",
+ "properties": {
+ "label": {
+ "type": "string"
+ },
+ "label_key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ "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 workspace",
+ "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": "Workspace 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"
+ },
+ "base_url": {
+ "description": "Base URL for self-hosted search engines (e.g. SearXNG instance URL).\nValidated with utils.ValidateURLForSSRF; private hosts must be added to SSRF_WHITELIST.",
+ "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": [
+ "brave",
+ "bing",
+ "google",
+ "duckduckgo",
+ "tavily",
+ "ollama",
+ "baidu",
+ "searxng",
+ "keenable",
+ "zhipu",
+ "exa",
+ "metaso",
+ "bocha",
+ "serply"
+ ],
+ "x-enum-varnames": [
+ "WebSearchProviderTypeBrave",
+ "WebSearchProviderTypeBing",
+ "WebSearchProviderTypeGoogle",
+ "WebSearchProviderTypeDuckDuckGo",
+ "WebSearchProviderTypeTavily",
+ "WebSearchProviderTypeOllama",
+ "WebSearchProviderTypeBaidu",
+ "WebSearchProviderTypeSearxng",
+ "WebSearchProviderTypeKeenable",
+ "WebSearchProviderTypeZhipu",
+ "WebSearchProviderTypeExa",
+ "WebSearchProviderTypeMetaso",
+ "WebSearchProviderTypeBocha",
+ "WebSearchProviderTypeSerply"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.WebSearchProviderTypeInfo": {
+ "type": "object",
+ "properties": {
+ "config_fields": {
+ "description": "Provider-specific non-secret configuration rendered dynamically by the frontend.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigField"
+ }
+ },
+ "description": {
+ "description": "Description",
+ "type": "string"
+ },
+ "docs_url": {
+ "description": "URL to the provider's official website or documentation for obtaining credentials",
+ "type": "string"
+ },
+ "id": {
+ "description": "Provider type identifier",
+ "type": "string"
+ },
+ "name": {
+ "description": "Human-readable name",
+ "type": "string"
+ },
+ "requires_api_key": {
+ "description": "Whether the provider requires an API key",
+ "type": "boolean"
+ },
+ "requires_base_url": {
+ "description": "Whether the provider requires a user-supplied base URL (e.g., self-hosted SearXNG instance)",
+ "type": "boolean"
+ },
+ "requires_engine_id": {
+ "description": "Whether the provider requires an engine ID (e.g., Google CSE)",
+ "type": "boolean"
+ },
+ "supports_optional_api_key": {
+ "description": "Whether the provider accepts an optional API key (keyless by default, but a\nkey unlocks higher limits — e.g. Keenable). Mutually exclusive with RequiresAPIKey.",
+ "type": "boolean"
+ },
+ "supports_proxy": {
+ "description": "Whether optional proxy_url in parameters is honored for outbound requests",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiConfig": {
+ "type": "object",
+ "properties": {
+ "content_instructions": {
+ "description": "ContentInstructions controls tone, structure and emphasis for generated\nsummary/entity/index prose. Citation and merge rules remain system-owned.",
+ "type": "string"
+ },
+ "extraction_granularity": {
+ "description": "ExtractionGranularity controls how many candidate slugs Pass 0 extracts\nper document. Empty / unknown value is treated as WikiExtractionStandard.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity"
+ }
+ ]
+ },
+ "extraction_instructions": {
+ "description": "ExtractionInstructions tells candidate extraction which domain concepts\nto emphasize without replacing the stable JSON/citation protocol.",
+ "type": "string"
+ },
+ "ingest_batch_size": {
+ "description": "IngestBatchSize controls how many pending ops a single batch claims and\nprocesses before scheduling a follow-up. 0 falls back to the hard-coded\ndefault (5). Larger batches amortize per-batch setup and let more docs\nshare the batch-internal Map/Reduce fan-out; smaller batches spread a\nKB's backlog across more concurrent batches (finer scheduling grain).",
+ "type": "integer"
+ },
+ "ingest_map_parallel": {
+ "description": "IngestMapParallel sets the errgroup limit for the Map phase\n(per-document extraction + summary + chunk citation) WITHIN one batch.\n0 falls back to 10. Bound by the LLM provider's concurrency limit and\nthe worker's outbound HTTP pool. Remember it multiplies with the number\nof concurrent batches (IngestMaxInflight).",
+ "type": "integer"
+ },
+ "ingest_max_inflight": {
+ "description": "IngestMaxInflight caps how many ingest batches for THIS KB may run\nconcurrently in the shared wiki worker pool (standard/Redis mode\nonly). 0 falls back to the hard-coded default (4). Since Phase 3\nremoved the exclusive per-KB lock, one KB's backlog could otherwise\nmonopolize the whole pool during a bulk import and starve other KBs;\nthis knob trades a single KB's peak throughput for cross-KB fairness.\nSet it \u003e= the wiki pool size to effectively disable the cap.",
+ "type": "integer"
+ },
+ "ingest_reduce_parallel": {
+ "description": "IngestReduceParallel sets the errgroup limit for the Reduce phase\n(per-slug page write) WITHIN one batch. 0 falls back to 10. Bound by the\nsame LLM concurrency / HTTP pool considerations as the Map phase, plus\nDB connection pool size. Same multiplier caveat as IngestMapParallel.",
+ "type": "integer"
+ },
+ "max_pages_per_ingest": {
+ "description": "MaxPagesPerIngest limits pages created/updated per ingest operation (0 = no limit)",
+ "type": "integer"
+ },
+ "synthesis_model_id": {
+ "description": "SynthesisModelID is the LLM model ID used for wiki page generation and updates",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity": {
+ "type": "string",
+ "enum": [
+ "focused",
+ "standard",
+ "exhaustive"
+ ],
+ "x-enum-varnames": [
+ "WikiExtractionFocused",
+ "WikiExtractionStandard",
+ "WikiExtractionExhaustive"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolder": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "depth": {
+ "type": "integer"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolderCreateRequest": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolderListResponse": {
+ "type": "object",
+ "properties": {
+ "folders": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiFolderNode"
+ }
+ },
+ "parent_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolderNode": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "depth": {
+ "type": "integer"
+ },
+ "has_children": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "page_count": {
+ "type": "integer"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiFolderUpdateRequest": {
+ "type": "object",
+ "properties": {
+ "move_parent": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphData": {
+ "type": "object",
+ "properties": {
+ "edges": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge"
+ }
+ },
+ "meta": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphMeta"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphNode"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphEdge": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "description": "source slug",
+ "type": "string"
+ },
+ "target": {
+ "description": "target slug",
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ },
+ "familiar_count": {
+ "description": "FamiliarCount is how many returned nodes are lit up for this person.",
+ "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": {
+ "familiar": {
+ "description": "Familiar is true when this page was built from a document this person\nkeeps citing in answers. It is a personal overlay, not a property of\nthe page: two people looking at the same wiki see different highlights.",
+ "type": "boolean"
+ },
+ "link_count": {
+ "description": "Number of inbound + outbound links",
+ "type": "integer"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiIndexEntry": {
+ "type": "object",
+ "properties": {
+ "category_path": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "depth": {
+ "type": "integer"
+ },
+ "parent_slug": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "wiki_path": {
+ "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.WikiPage": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "description": "Alternate names, abbreviations, acronyms or translated names",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "category_path": {
+ "description": "CategoryPath is the directory breadcrumb that groups this page in the\nwiki browser, e.g. [\"AI\", \"LLM 应用\", \"RAG\"]. Derived cache of the\nfolder chain identified by FolderID.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "chunk_refs": {
+ "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "description": "Full markdown content",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "depth": {
+ "description": "Depth is len(CategoryPath), cached for filtering / display.",
+ "type": "integer"
+ },
+ "folder_id": {
+ "description": "FolderID is the single source of truth for where this page sits in the\ndirectory tree — a reference to wiki_folders.id (\"\" = wiki root). The\nCategoryPath / WikiPath / Depth fields below are denormalized caches\nrecomputed from this folder's chain on every write so list/index/search\nqueries don't have to join wiki_folders.",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier (UUID)",
+ "type": "string"
+ },
+ "in_links": {
+ "description": "Slugs of pages that link TO this page (backlinks)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base this page belongs to",
+ "type": "string"
+ },
+ "last_edit_source": {
+ "description": "LastEditSource records who authored the CURRENT version: pipeline |\nagent | user | revert. Empty for legacy rows (treated as pipeline).\nWhen the version is superseded this value travels into the revision\nsnapshot, so each historical version keeps its own author kind.",
+ "type": "string"
+ },
+ "last_editor_id": {
+ "description": "LastEditorID is the user id of the caller that produced the current\nversion (empty for background pipeline writes).",
+ "type": "string"
+ },
+ "out_links": {
+ "description": "Slugs of pages this page links to (outbound links)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "page_metadata": {
+ "description": "Arbitrary metadata (tags, categories, dates, etc.)",
+ "type": "object"
+ },
+ "page_type": {
+ "description": "Page type: summary, entity, concept, index, synthesis, comparison",
+ "type": "string"
+ },
+ "parent_slug": {
+ "description": "ParentSlug optionally points at the wiki page that should act as this\npage's semantic parent in the directory tree. The parent may be empty\nwhen the page is grouped only by FolderID.",
+ "type": "string"
+ },
+ "slug": {
+ "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ "type": "string"
+ },
+ "sort_order": {
+ "description": "SortOrder allows generated or manually edited pages to control sibling\nordering before falling back to title.",
+ "type": "integer"
+ },
+ "source_refs": {
+ "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on `|`\nto recover the title. Document-level granularity.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "description": "Page status: draft, published, archived",
+ "type": "string"
+ },
+ "summary": {
+ "description": "One-line summary for index listing",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID for multi-workspace isolation",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Human-readable title",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update time",
+ "type": "string"
+ },
+ "version": {
+ "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
+ "type": "integer"
+ },
+ "wiki_path": {
+ "description": "WikiPath is a normalized, sortable path derived from page_type,\ncategory_path, and title. It keeps large directory listings cheap to sort.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageDetail": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "description": "Alternate names, abbreviations, acronyms or translated names",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "category_path": {
+ "description": "CategoryPath is the directory breadcrumb that groups this page in the\nwiki browser, e.g. [\"AI\", \"LLM 应用\", \"RAG\"]. Derived cache of the\nfolder chain identified by FolderID.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "chunk_refs": {
+ "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "description": "Full markdown content",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "depth": {
+ "description": "Depth is len(CategoryPath), cached for filtering / display.",
+ "type": "integer"
+ },
+ "folder_id": {
+ "description": "FolderID is the single source of truth for where this page sits in the\ndirectory tree — a reference to wiki_folders.id (\"\" = wiki root). The\nCategoryPath / WikiPath / Depth fields below are denormalized caches\nrecomputed from this folder's chain on every write so list/index/search\nqueries don't have to join wiki_folders.",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier (UUID)",
+ "type": "string"
+ },
+ "in_link_titles": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "in_links": {
+ "description": "Slugs of pages that link TO this page (backlinks)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base this page belongs to",
+ "type": "string"
+ },
+ "last_edit_source": {
+ "description": "LastEditSource records who authored the CURRENT version: pipeline |\nagent | user | revert. Empty for legacy rows (treated as pipeline).\nWhen the version is superseded this value travels into the revision\nsnapshot, so each historical version keeps its own author kind.",
+ "type": "string"
+ },
+ "last_editor_id": {
+ "description": "LastEditorID is the user id of the caller that produced the current\nversion (empty for background pipeline writes).",
+ "type": "string"
+ },
+ "out_links": {
+ "description": "Slugs of pages this page links to (outbound links)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "page_metadata": {
+ "description": "Arbitrary metadata (tags, categories, dates, etc.)",
+ "type": "object"
+ },
+ "page_type": {
+ "description": "Page type: summary, entity, concept, index, synthesis, comparison",
+ "type": "string"
+ },
+ "parent_slug": {
+ "description": "ParentSlug optionally points at the wiki page that should act as this\npage's semantic parent in the directory tree. The parent may be empty\nwhen the page is grouped only by FolderID.",
+ "type": "string"
+ },
+ "slug": {
+ "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ "type": "string"
+ },
+ "sort_order": {
+ "description": "SortOrder allows generated or manually edited pages to control sibling\nordering before falling back to title.",
+ "type": "integer"
+ },
+ "source_refs": {
+ "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on `|`\nto recover the title. Document-level granularity.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "description": "Page status: draft, published, archived",
+ "type": "string"
+ },
+ "summary": {
+ "description": "One-line summary for index listing",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID for multi-workspace isolation",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Human-readable title",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update time",
+ "type": "string"
+ },
+ "version": {
+ "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
+ "type": "integer"
+ },
+ "wiki_path": {
+ "description": "WikiPath is a normalized, sortable path derived from page_type,\ncategory_path, and title. It keeps large directory listings cheap to sort.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageIssue": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "issue_type": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "reported_by": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "suspected_knowledge_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageListResponse": {
+ "type": "object",
+ "properties": {
+ "page": {
+ "type": "integer"
+ },
+ "page_size": {
+ "type": "integer"
+ },
+ "pages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
+ },
+ "total": {
+ "type": "integer"
+ },
+ "total_pages": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageMoveRequest": {
+ "type": "object",
+ "required": [
+ "slug"
+ ],
+ "properties": {
+ "folder_id": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageRevertRequest": {
+ "type": "object",
+ "required": [
+ "slug",
+ "version"
+ ],
+ "properties": {
+ "slug": {
+ "type": "string"
+ },
+ "version": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageRevision": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "edit_source": {
+ "description": "Author of THIS version (same semantics as WikiPage.LastEditSource).",
+ "type": "string"
+ },
+ "edited_at": {
+ "description": "When this version was authored (the page's updated_at while current).",
+ "type": "string"
+ },
+ "editor_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "page_id": {
+ "type": "string"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "title": {
+ "type": "string"
+ },
+ "version": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageRevisionListResponse": {
+ "type": "object",
+ "properties": {
+ "current_version": {
+ "type": "integer"
+ },
+ "revisions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageRevision"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageUpdateRequest": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "type": "string"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "version": {
+ "description": "Version is the optimistic-lock guard: when \u003e 0 the update is rejected\nwith a conflict if the stored version differs (someone else edited the\npage since the client loaded it). 0 skips the check (legacy clients).",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiStats": {
+ "type": "object",
+ "properties": {
+ "is_active": {
+ "description": "whether wiki ingestion is currently running",
+ "type": "boolean"
+ },
+ "orphan_count": {
+ "description": "pages with no inbound links",
+ "type": "integer"
+ },
+ "pages_by_type": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "pending_issues": {
+ "description": "number of pending wiki issues",
+ "type": "integer"
+ },
+ "pending_tasks": {
+ "description": "number of documents waiting to be ingested",
+ "type": "integer"
+ },
+ "recent_updates": {
+ "description": "last N updated pages",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
+ },
+ "total_links": {
+ "type": "integer"
+ },
+ "total_pages": {
+ "type": "integer"
+ }
+ }
+ },
+ "gorm.DeletedAt": {
+ "type": "object",
+ "properties": {
+ "time": {
+ "type": "string"
+ },
+ "valid": {
+ "description": "Valid is true if Time is not NULL",
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.AddFavoriteRequest": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.AgentWriteResponse": {
+ "type": "object",
+ "properties": {
+ "allowed_tools_warnings": {
+ "$ref": "#/definitions/internal_handler.AllowedToolsWarningsDoc"
+ },
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.AllowedToolsWarningsDoc": {
+ "type": "object",
+ "properties": {
+ "dropped": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kept_unknown": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.ApplyDefaultStorageQuotaToAllTenantsResponse": {
+ "type": "object",
+ "properties": {
+ "affected": {
+ "type": "integer"
+ },
+ "quota_bytes": {
+ "type": "integer"
+ },
+ "quota_gb": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.AutoFixResponse": {
+ "type": "object",
+ "properties": {
+ "fixed": {
+ "type": "integer"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.BatchDeleteKnowledgeRequest": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.BatchDownloadKnowledgeRequest": {
+ "type": "object",
+ "required": [
+ "ids"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "maxItems": 200,
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.ClearResponse": {
+ "type": "object",
+ "properties": {
+ "removed": {
+ "type": "integer"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.CopyKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "source_id"
+ ],
+ "properties": {
+ "source_id": {
+ "type": "string"
+ },
+ "target_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CopyKnowledgeBaseResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "source_id": {
+ "type": "string"
+ },
+ "target_id": {
+ "type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CopyModelRequest": {
+ "type": "object",
+ "required": [
+ "display_name"
+ ],
+ "properties": {
+ "display_name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ },
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CreateModelRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "parameters",
+ "source",
+ "type"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "display_name": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
+ },
+ "source": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ },
+ "type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ }
+ }
+ },
+ "internal_handler.CreateStoreRequest": {
+ "type": "object",
+ "required": [
+ "connection_config",
+ "engine_type",
+ "name"
+ ],
+ "properties": {
+ "connection_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
+ },
+ "engine_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ },
+ "index_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CreateSystemUserResponse": {
+ "type": "object",
+ "properties": {
+ "generated_password": {
+ "description": "GeneratedPassword is the plaintext password when the server\nauto-generated one. Absent when the caller supplied the password.",
+ "type": "string"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ },
+ "internal_handler.CurrentUserCapabilities": {
+ "type": "object",
+ "properties": {
+ "auto_accept_invitation": {
+ "type": "boolean"
+ },
+ "can_create_tenant": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.CurrentUserData": {
+ "type": "object",
+ "properties": {
+ "capabilities": {
+ "$ref": "#/definitions/internal_handler.CurrentUserCapabilities"
+ },
+ "memberships": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Membership"
+ }
+ },
+ "preference_defaults": {
+ "$ref": "#/definitions/internal_handler.PreferenceDefaults"
+ },
+ "tenant": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ },
+ "tenant_required": {
+ "type": "boolean"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ },
+ "internal_handler.DataMessageResponse": {
+ "type": "object",
+ "properties": {
+ "data": {},
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.DataResponse": {
+ "type": "object",
+ "properties": {
+ "data": {},
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.DeleteTagRequest": {
+ "type": "object",
+ "properties": {
+ "exclude_ids": {
+ "description": "Chunk seq_ids to exclude from deletion",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "internal_handler.DeploymentCapabilitiesData": {
+ "type": "object",
+ "properties": {
+ "capabilities": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/internal_handler.DeploymentCapability"
+ }
+ },
+ "edition": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.DeploymentCapability": {
+ "type": "object",
+ "properties": {
+ "reason": {
+ "type": "string"
+ },
+ "supported": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.DownloadTask": {
+ "type": "object",
+ "properties": {
+ "endTime": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "modelName": {
+ "type": "string"
+ },
+ "progress": {
+ "type": "number"
+ },
+ "startTime": {
+ "type": "string"
+ },
+ "status": {
+ "description": "pending, downloading, completed, failed",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.DuplicateKnowledgeBaseData": {
+ "type": "object",
+ "properties": {
+ "knowledge_base": {
+ "$ref": "#/definitions/internal_handler.KnowledgeBaseView"
+ },
+ "message": {
+ "type": "string"
+ },
+ "source_id": {
+ "type": "string"
+ },
+ "target_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.EnsureMessageSuggestionsRequest": {
+ "type": "object",
+ "properties": {
+ "regenerate": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.EvaluationRequest": {
+ "type": "object",
+ "properties": {
+ "chat_id": {
+ "description": "ID of chat model to use",
+ "type": "string"
+ },
+ "dataset_id": {
+ "description": "ID of dataset to evaluate",
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "description": "ID of knowledge base to use",
+ "type": "string"
+ },
+ "rerank_id": {
+ "description": "ID of rerank model to use",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.ExportResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ },
+ "truncated": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.FabriTagResponse": {
+ "type": "object",
+ "properties": {
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.FabriTextRequest": {
+ "type": "object",
+ "required": [
+ "model_id"
+ ],
+ "properties": {
+ "model_id": {
+ "type": "string"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.FabriTextResponse": {
+ "type": "object",
+ "properties": {
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.FolderMoveData": {
+ "type": "object",
+ "properties": {
+ "folder_path": {
+ "type": "string"
+ },
+ "moved_count": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.GetAuthConfigResponse": {
+ "type": "object",
+ "properties": {
+ "complex_password_enabled": {
+ "type": "boolean"
+ },
+ "registration_mode": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.GetDeploymentCapabilitiesResponse": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer"
+ },
+ "data": {
+ "$ref": "#/definitions/internal_handler.DeploymentCapabilitiesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.GetStorageEngineStatusResponse": {
+ "type": "object",
+ "properties": {
+ "allowed_providers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "engines": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.StorageEngineStatusItem"
+ }
+ },
+ "minio_env_available": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.GetSystemInfoResponse": {
+ "type": "object",
+ "properties": {
+ "build_time": {
+ "type": "string"
+ },
+ "commit_id": {
+ "type": "string"
+ },
+ "db_migration_error": {
+ "description": "DBMigrationError carries the human-readable error message recorded when\nthe most recent startup migration attempt failed. Empty when migrations\nsucceeded; non-empty values let the frontend surface a troubleshooting\nbanner instead of silently hiding the DB version row (see issue #1319).",
+ "type": "string"
+ },
+ "db_version": {
+ "type": "string"
+ },
+ "edition": {
+ "type": "string"
+ },
+ "go_version": {
+ "type": "string"
+ },
+ "graph_database_engine": {
+ "type": "string"
+ },
+ "keyword_index_engine": {
+ "type": "string"
+ },
+ "minio_enabled": {
+ "type": "boolean"
+ },
+ "started_at": {
+ "description": "StartedAt is the server process boot time (RFC3339, UTC).",
+ "type": "string"
+ },
+ "uptime_seconds": {
+ "description": "UptimeSeconds is seconds elapsed since process start.",
+ "type": "integer"
+ },
+ "vector_store_engine": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.HybridSearchResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
+ }
+ },
+ "meta": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalMeta"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.ImageAttrSchemaData": {
+ "type": "object",
+ "properties": {
+ "attributes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AttrSpec"
+ }
+ },
+ "default_actions": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig"
+ },
+ "prompt": {
+ "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"
+ }
+ }
+ },
+ "rerank": {
+ "type": "object",
+ "properties": {
+ "apiKey": {
+ "type": "string"
+ },
+ "baseUrl": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "modelName": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "internal_handler.KBModelConfigRequest": {
+ "type": "object",
+ "required": [
+ "llmModelId"
+ ],
+ "properties": {
+ "asr_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
+ },
+ "documentSplitting": {
+ "description": "文档分块配置",
+ "type": "object",
+ "properties": {
+ "childChunkSize": {
+ "type": "integer"
+ },
+ "chunkOverlap": {
+ "type": "integer"
+ },
+ "chunkSize": {
+ "type": "integer"
+ },
+ "enableParentChild": {
+ "type": "boolean"
+ },
+ "languages": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "parentChunkSize": {
+ "type": "integer"
+ },
+ "parserEngineRules": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "type": "array",
+ "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"
+ },
+ "tableMetadataInstructions": {
+ "type": "string"
+ },
+ "tokenLimit": {
+ "type": "integer"
+ }
+ }
+ },
+ "embeddingModelId": {
+ "description": "optional when RAG indexing is disabled",
+ "type": "string"
+ },
+ "llmModelId": {
+ "type": "string"
+ },
+ "multimodal": {
+ "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "nodeExtract": {
+ "description": "知识图谱配置",
+ "type": "object",
+ "properties": {
+ "customInstructions": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "questionGeneration": {
+ "description": "问题生成配置",
+ "type": "object",
+ "properties": {
+ "customInstructions": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "questionCount": {
+ "type": "integer"
+ }
+ }
+ },
+ "storageBackendId": {
+ "type": "string"
+ },
+ "storageProvider": {
+ "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
+ "type": "string"
+ },
+ "vlm_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ }
+ },
+ "internal_handler.KnowledgeBaseView": {
+ "type": "object",
+ "properties": {
+ "asr_config": {
+ "description": "ASR config (Automatic Speech Recognition)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
+ }
+ ]
+ },
+ "auto_tag_config": {
+ "description": "AutoTagConfig controls asynchronous association of existing tags after parsing.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig"
+ }
+ ]
+ },
+ "capabilities": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KBCapabilities"
+ },
+ "chunk_count": {
+ "description": "Chunk count (not stored in database, calculated on query)",
+ "type": "integer"
+ },
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
+ },
+ "created_at": {
+ "description": "Creation time of the knowledge base",
+ "type": "string"
+ },
+ "creator_id": {
+ "description": "CreatorID records the user ID of whoever originally created the KB.\nUsed by the workspace-level RBAC middleware to let Contributors edit\ntheir own KBs without granting them access to everyone else's.\nNullable for backward compatibility with rows created before the\nRBAC migration backfilled the column to the workspace Owner.",
+ "type": "string"
+ },
+ "creator_name": {
+ "description": "CreatorName 是 CreatorID 对应用户的展示名(username / email 等),\n仅在列表场景由 handler 批量回填,不落库;为空表示创建者无法解析(用户已删除、\nCreatorID 为空的老数据等)。前端用它在卡片来源徽章上做 mine vs workspace 的二分。",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time of the knowledge base",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "description": {
+ "description": "Description of the knowledge base",
+ "type": "string"
+ },
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
+ "type": "string"
+ },
+ "extract_config": {
+ "description": "Extract config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
+ }
+ ]
+ },
+ "faq_config": {
+ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
+ },
+ "generated_profile": {
+ "description": "GeneratedProfile is the machine-generated description: a gist, merged\ntopics, typical questions and the aggregate snapshot they came from. It\nnever overwrites the user-authored Description; both are shown to agents.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the knowledge base",
+ "type": "string"
+ },
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
+ },
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active for this knowledge base.\nPipelines: vector search, keyword search, wiki generation, knowledge graph extraction.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
+ },
+ "is_pinned": {
+ "description": "IsPinned and PinnedAt are computed per-caller from user_kb_pins\n(see migration 000050). They used to be stored on the row itself,\nwhich made pinning a workspace-wide ordering decision gated behind\nthe kb-edit RBAC guard. The columns are still present in legacy\nschemas for rollback safety but are no longer read or written by\nthe application — both fields are tagged `gorm:\"-\"` so GORM\nignores them on every CRUD call and the list handler stamps them\nafter enriching with the caller's pin set.",
+ "type": "boolean"
+ },
+ "is_processing": {
+ "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
+ "type": "boolean"
+ },
+ "is_temporary": {
+ "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
+ "type": "boolean"
+ },
+ "knowledge_count": {
+ "description": "Knowledge count (not stored in database, calculated on query)",
+ "type": "integer"
+ },
+ "my_permission": {
+ "description": "MyPermission is the caller's role on a knowledge base shared from\nanother workspace; GET /knowledge-bases/{id} sets it.",
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ]
+ },
+ "name": {
+ "description": "Name of the knowledge base",
+ "type": "string"
+ },
+ "pinned_at": {
+ "description": "PinnedAt records when the current caller pinned this knowledge\nbase; nil when they have not.",
+ "type": "string"
+ },
+ "processing_count": {
+ "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
+ "type": "integer"
+ },
+ "profile_config": {
+ "description": "ProfileConfig controls automatic generation of the knowledge-base\ndescription from per-document profiles (document knowledge bases only).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig"
+ }
+ ]
+ },
+ "question_generation_config": {
+ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
+ }
+ ]
+ },
+ "share_count": {
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "type": "integer"
+ },
+ "storage_backend_id": {
+ "description": "StorageBackendID binds this KB to one concrete storage instance. The\nlegacy provider field remains readable during migration only.",
+ "type": "string"
+ },
+ "storage_config": {
+ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
+ }
+ ]
+ },
+ "storage_provider_config": {
+ "description": "Storage provider config (new): only stores provider selection; credentials from workspace StorageEngineConfig",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
+ }
+ ]
+ },
+ "summary_model_id": {
+ "description": "Summary model ID",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Workspace ID",
+ "type": "integer"
+ },
+ "type": {
+ "description": "Type of the knowledge base (document, faq, etc.)",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last updated time of the knowledge base",
+ "type": "string"
+ },
+ "vector_store_engine_type": {
+ "type": "string"
+ },
+ "vector_store_id": {
+ "description": "VectorStoreID references the VectorStore this knowledge base is bound to.\nWhen nil, the KB falls back to the workspace's effective engines derived from\nthe RETRIEVE_DRIVER environment variable (env store flow).\nThis field is set once at creation time and must not be modified afterwards;\nenforcement lives at the GORM layer (`\u003c-:create`) plus the service-layer\nKB update path, which omits this field from its update DTO.",
+ "type": "string"
+ },
+ "vector_store_name": {
+ "type": "string"
+ },
+ "vector_store_source": {
+ "type": "string"
+ },
+ "vector_store_status": {
+ "type": "string"
+ },
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ ]
+ },
+ "wiki_config": {
+ "description": "WikiConfig stores wiki-specific configuration (only for wiki type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
+ }
+ }
+ },
+ "internal_handler.KnowledgeSearchKnowledgeResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
+ },
+ "has_more": {
+ "type": "boolean"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.KnowledgeSpanError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string"
+ },
+ "error_code": {
+ "type": "string"
+ },
+ "error_message": {
+ "type": "string"
+ },
+ "finished_at": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "stage": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.KnowledgeSpansData": {
+ "type": "object",
+ "properties": {
+ "attempt": {
+ "description": "Attempt is the attempt the trace describes; equals CurrentAttempt.",
+ "type": "integer"
+ },
+ "current_attempt": {
+ "type": "integer"
+ },
+ "current_stage": {
+ "description": "CurrentStage is the stage running now, or the last one that ran.",
+ "type": "string"
+ },
+ "knowledge_id": {
+ "type": "string"
+ },
+ "last_activity_at": {
+ "description": "LastActivityAt is set while the parse is in flight.",
+ "type": "string"
+ },
+ "last_error": {
+ "$ref": "#/definitions/internal_handler.KnowledgeSpanError"
+ },
+ "latest_attempt": {
+ "type": "integer"
+ },
+ "parse_status": {
+ "type": "string"
+ },
+ "stall_state": {
+ "description": "StallState is types.StallStateQueued or types.StallStateStalled when an\nin-flight parse has gone quiet.",
+ "type": "string"
+ },
+ "trace": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SpanTreeNode"
+ }
+ }
+ },
+ "internal_handler.ListAgentsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent"
+ }
+ },
+ "disabled_own_agent_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.ListAllUsersResponse": {
+ "type": "object",
+ "properties": {
+ "has_more": {
+ "type": "boolean"
+ },
+ "limit": {
+ "type": "integer"
+ },
+ "offset": {
+ "type": "integer"
+ },
+ "users": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ }
+ },
+ "internal_handler.ListDocumentsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryDocView"
}
},
- "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"
- }
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListItemsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem"
}
},
- "questionGeneration": {
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "questionCount": {
- "type": "integer"
- }
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListOrganizationSharedAgentsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationSharedAgentItem"
}
},
- "rerank": {
- "type": "object",
- "properties": {
- "apiKey": {
- "type": "string"
- },
- "baseUrl": {
- "type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "modelName": {
- "type": "string"
- }
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListOrganizationSharedKnowledgeBasesResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
}
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
}
}
},
- "internal_handler.KBModelConfigRequest": {
+ "internal_handler.ListParserEnginesResponse": {
"type": "object",
- "required": [
- "llmModelId"
- ],
"properties": {
- "asr_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
+ "code": {
+ "type": "integer"
},
- "documentSplitting": {
- "description": "文档分块配置",
- "type": "object",
- "properties": {
- "childChunkSize": {
- "type": "integer"
- },
- "chunkOverlap": {
- "type": "integer"
- },
- "chunkSize": {
- "type": "integer"
- },
- "enableParentChild": {
- "type": "boolean"
- },
- "languages": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "parentChunkSize": {
- "type": "integer"
- },
- "parserEngineRules": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
- }
- },
- "separators": {
- "type": "array",
- "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"
- },
- "tableMetadataInstructions": {
- "type": "string"
- },
- "tokenLimit": {
- "type": "integer"
- }
+ "connected": {
+ "type": "boolean"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineInfo"
}
},
- "embeddingModelId": {
- "description": "optional when RAG indexing is disabled",
+ "docreader_addr": {
"type": "string"
},
- "llmModelId": {
+ "docreader_transport": {
"type": "string"
},
- "multimodal": {
- "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- }
+ "msg": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.ListResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend"
}
},
- "nodeExtract": {
- "description": "知识图谱配置",
- "type": "object",
- "properties": {
- "customInstructions": {
- "type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
- }
- },
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
- }
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "text": {
- "type": "string"
- }
+ "default_storage_backend_id": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.ListSharedAgentsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SharedAgentInfo"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListSharedKnowledgeBasesResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {}
}
},
- "questionGeneration": {
- "description": "问题生成配置",
- "type": "object",
- "properties": {
- "customInstructions": {
- "type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "questionCount": {
- "type": "integer"
- }
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListSkillsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.SkillInfoResponse"
}
},
- "storageBackendId": {
- "type": "string"
+ "skills_available": {
+ "type": "boolean"
},
- "storageProvider": {
- "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.ListSystemAdminsResponse": {
+ "type": "object",
+ "properties": {
+ "admins": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.ListTopicsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryTopicView"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.MessageResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
"type": "string"
},
- "vlm_config": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ "success": {
+ "type": "boolean",
+ "example": true
}
}
},
- "internal_handler.ListAllUsersResponse": {
+ "internal_handler.ModelCatalogEntryDTO": {
"type": "object",
"properties": {
- "has_more": {
- "type": "boolean"
+ "api": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
},
- "limit": {
+ "context_window": {
"type": "integer"
},
- "offset": {
+ "cost": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models.ModelCost"
+ },
+ "dimension": {
"type": "integer"
},
- "users": {
+ "id": {
+ "type": "string"
+ },
+ "input": {
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ "type": "string"
+ }
+ },
+ "max_output_tokens": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "reasoning": {
+ "type": "boolean"
+ },
+ "source": {
+ "description": "Source is the vendor page these facts were read from, so the editor can\nsend an operator to the documentation for this exact model.",
+ "type": "string"
+ },
+ "thinking_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort"
}
+ },
+ "type": {
+ "type": "string"
}
}
},
- "internal_handler.ListSystemAdminsResponse": {
+ "internal_handler.ModelProviderDTO": {
"type": "object",
"properties": {
- "admins": {
+ "api": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API"
+ },
+ "auth": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.AuthStyle"
+ },
+ "credentialLabels": {
+ "description": "CredentialLabels rename the primary credential input for the model\ntypes that do not take a plain API key (signed rerank APIs).",
"type": "array",
"items": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.CredentialLabel"
}
},
- "total": {
+ "defaultUrls": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "description": {
+ "type": "string"
+ },
+ "descriptions": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "extraFields": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.ExtraField"
+ }
+ },
+ "icon": {
+ "description": "Icon is a data: URI (image/svg+xml;base64) ready for \u003cimg src\u003e.",
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "labels": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "modelTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "models": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.ModelCatalogEntryDTO"
+ }
+ },
+ "order": {
"type": "integer"
+ },
+ "requiresAuth": {
+ "type": "boolean"
+ },
+ "thinking": {
+ "$ref": "#/definitions/internal_handler.ProviderThinkingDTO"
+ },
+ "value": {
+ "type": "string"
+ },
+ "website": {
+ "type": "string"
}
}
},
@@ -27045,6 +33851,80 @@
}
}
},
+ "internal_handler.PageResponse": {
+ "type": "object",
+ "properties": {
+ "data": {},
+ "page": {
+ "type": "integer"
+ },
+ "page_size": {
+ "type": "integer"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.PlaceholderGroups": {
+ "type": "object",
+ "properties": {
+ "agent_system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "all": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "context_template": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "fallback_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "rewrite_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "rewrite_system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ },
+ "system_prompt": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder"
+ }
+ }
+ }
+ },
+ "internal_handler.PreferenceDefaults": {
+ "type": "object",
+ "properties": {
+ "browser_search_instructions": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.PreviewChunkResult": {
"type": "object",
"properties": {
@@ -27170,20 +34050,64 @@
"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"
+ "truncated_to": {
+ "description": "TruncatedTo, when set, is the original chunk count before the\nresponse was truncated to previewMaxChunks for transport.",
+ "type": "integer"
+ }
+ }
+ },
+ "internal_handler.PromoteUserToSystemAdminRequest": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string"
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.ProviderThinkingDTO": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "type": "string"
+ },
+ "levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort"
+ }
+ }
+ }
+ },
+ "internal_handler.PurgeArchivedRuntimeTasksResponse": {
+ "type": "object",
+ "properties": {
+ "deleted": {
+ "type": "integer"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
}
}
},
- "internal_handler.PromoteUserToSystemAdminRequest": {
+ "internal_handler.RefreshTokenResponse": {
"type": "object",
"properties": {
- "email": {
+ "access_token": {
"type": "string"
},
- "user_id": {
+ "message": {
+ "type": "string"
+ },
+ "refresh_token": {
"type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
}
}
},
@@ -27258,6 +34182,19 @@
}
}
},
+ "internal_handler.ReparseKnowledgeRequest": {
+ "type": "object",
+ "properties": {
+ "process_config": {
+ "description": "ProcessConfig overrides the processing options stored at upload time.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides"
+ }
+ ]
+ }
+ }
+ },
"internal_handler.ResetUserPasswordRequest": {
"type": "object",
"required": [
@@ -27273,6 +34210,14 @@
}
}
},
+ "internal_handler.ResetUserPasswordResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.RevokeSystemAdminRequest": {
"type": "object",
"required": [
@@ -27470,6 +34415,24 @@
}
}
},
+ "internal_handler.SearchOrganizationsResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchableOrganizationItem"
+ }
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
"internal_handler.SearchWikiRequest": {
"type": "object",
"required": [
@@ -27508,6 +34471,31 @@
}
}
},
+ "internal_handler.SetUserStatusResponse": {
+ "type": "object",
+ "properties": {
+ "is_active": {
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string"
+ },
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ },
+ "internal_handler.SkillInfoResponse": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.StorageCheckRequest": {
"type": "object",
"properties": {
@@ -27572,6 +34560,67 @@
}
}
},
+ "internal_handler.SubmittedTaskData": {
+ "type": "object",
+ "properties": {
+ "deleted_count": {
+ "type": "integer"
+ },
+ "reparse_count": {
+ "type": "integer"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.SubmittedTaskResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/internal_handler.SubmittedTaskData"
+ },
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.SuccessErrorResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.SuccessResponse": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "internal_handler.SuggestedQuestionsData": {
+ "type": "object",
+ "properties": {
+ "questions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestedQuestion"
+ }
+ }
+ }
+ },
"internal_handler.SuggestionEventRequest": {
"type": "object",
"required": [
@@ -27590,6 +34639,45 @@
}
}
},
+ "internal_handler.TaskIDData": {
+ "type": "object",
+ "properties": {
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.TenantListData": {
+ "type": "object",
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ }
+ }
+ }
+ },
+ "internal_handler.TenantSearchData": {
+ "type": "object",
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse"
+ }
+ },
+ "page": {
+ "type": "integer"
+ },
+ "page_size": {
+ "type": "integer"
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
"internal_handler.TestProviderRequest": {
"type": "object",
"required": [
@@ -27604,6 +34692,36 @@
}
}
},
+ "internal_handler.TestStoreByIDResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.TestStoreRawResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.TestStoreRequest": {
"type": "object",
"required": [
@@ -27641,6 +34759,23 @@
}
}
},
+ "internal_handler.TextRelationExtractionResponse": {
+ "type": "object",
+ "properties": {
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
+ }
+ }
+ }
+ },
"internal_handler.UpdateAgentRequest": {
"type": "object",
"properties": {
@@ -27673,6 +34808,32 @@
}
}
},
+ "internal_handler.UpdateChunkResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Chunk"
+ },
+ "description": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ },
+ "summary_status": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.UpdateIMChannelResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_im.IMChannel"
+ }
+ }
+ },
"internal_handler.UpdateKnowledgeBaseRequest": {
"type": "object",
"required": [
@@ -27702,10 +34863,7 @@
"type": "object",
"properties": {
"custom_metadata": {
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "type": "object"
},
"description": {
"type": "string"
@@ -27715,6 +34873,21 @@
}
}
},
+ "internal_handler.UpdateKnowledgeResponse": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ },
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
"internal_handler.UpdateModelRequest": {
"type": "object",
"properties": {
@@ -27738,39 +34911,102 @@
}
}
},
- "internal_handler.UpdateProviderRequest": {
+ "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": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.UpdateSystemSettingRequest": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "description": "Value is intentionally `any` (decoded as float64 / string / bool /\netc. by the JSON unmarshaller). Service.encodeForType normalises\nthese against the registry's declared type and rejects mismatches."
+ }
+ }
+ },
+ "internal_handler.ValidateTokenResponse": {
"type": "object",
"properties": {
- "description": {
+ "message": {
"type": "string"
},
- "is_default": {
- "type": "boolean"
+ "success": {
+ "type": "boolean",
+ "example": true
},
- "name": {
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo"
+ }
+ }
+ },
+ "internal_handler.WikiErrorResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
"type": "string"
- },
- "parameters": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters"
}
}
},
- "internal_handler.UpdateStoreRequest": {
+ "internal_handler.WikiMessageResponse": {
"type": "object",
- "required": [
- "name"
- ],
"properties": {
- "name": {
+ "message": {
"type": "string"
}
}
},
- "internal_handler.UpdateSystemSettingRequest": {
+ "internal_handler.WikiSearchHit": {
"type": "object",
"properties": {
- "value": {
- "description": "Value is intentionally `any` (decoded as float64 / string / bool /\netc. by the JSON unmarshaller). Service.encodeForType normalises\nthese against the registry's declared type and rejects mismatches."
+ "aliases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "match_snippet": {
+ "type": "string"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
}
}
},
@@ -27835,6 +35071,27 @@
}
}
},
+ "internal_handler.apiPrincipalConfigResponse": {
+ "type": "object",
+ "properties": {
+ "direct_header_name": {
+ "type": "string"
+ },
+ "has_hmac_secret": {
+ "description": "HasHMACSecret reports whether a signing secret is configured. The\nplaintext secret is NEVER returned — clients only learn presence.",
+ "type": "boolean"
+ },
+ "mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.APIPrincipalMode"
+ },
+ "require_direct_header": {
+ "type": "boolean"
+ },
+ "signed_token_header_name": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.apiPrincipalTestTokenRequest": {
"type": "object",
"properties": {
@@ -27846,6 +35103,26 @@
}
}
},
+ "internal_handler.apiPrincipalTestTokenResponse": {
+ "type": "object",
+ "properties": {
+ "expires_at_unix": {
+ "type": "integer"
+ },
+ "expires_in_seconds": {
+ "type": "integer"
+ },
+ "external_user_id": {
+ "type": "string"
+ },
+ "header_name": {
+ "type": "string"
+ },
+ "token": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.auditLogListResponse": {
"type": "object",
"properties": {
@@ -27856,6 +35133,7 @@
}
},
"next_cursor": {
+ "description": "NextCursor is the id of the last entry on this page, 0 when it is empty.",
"type": "integer"
},
"success": {
@@ -28106,6 +35384,49 @@
}
}
},
+ "internal_handler.sandboxConfigResponse": {
+ "type": "object",
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TenantSandboxConfig"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "sandbox_type": {
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.skillEnvResponse": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "is_set": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "required": {
+ "type": "boolean"
+ }
+ }
+ },
"internal_handler.skillPatchRequest": {
"type": "object",
"properties": {
@@ -28122,6 +35443,64 @@
}
}
},
+ "internal_handler.skillResponse": {
+ "type": "object",
+ "properties": {
+ "bundle_sha256": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "envs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.skillEnvResponse"
+ }
+ },
+ "error": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "install_message_id": {
+ "type": "string"
+ },
+ "install_session_id": {
+ "type": "string"
+ },
+ "installed_snapshot_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "served": {
+ "description": "Served is the previous version that keeps running while this install\nis in flight or after it failed.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillServedInfo"
+ }
+ ]
+ },
+ "status": {
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.skillSourceRequest": {
"type": "object",
"properties": {
@@ -28152,6 +35531,91 @@
}
}
},
+ "internal_handler.tenantAPIKeyCreateResponse": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "type": "string"
+ },
+ "capabilities": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "expires_at": {
+ "type": "string"
+ },
+ "full_access": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "integer"
+ },
+ "knowledge_base_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "last_used_at": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "scope_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.APIKeyScopeType"
+ },
+ "token": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.tenantAPIKeyResponse": {
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "type": "string"
+ },
+ "capabilities": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "expires_at": {
+ "type": "string"
+ },
+ "full_access": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "integer"
+ },
+ "knowledge_base_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "last_used_at": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "scope_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.APIKeyScopeType"
+ }
+ }
+ },
"internal_handler.updateLastFAQImportResultDisplayStatusRequest": {
"type": "object",
"required": [
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 23f404900..e1d87832d 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1,5 +1,67 @@
basePath: /api/v1
definitions:
+ github_com_Tencent_WeKnora_internal_agent_tools.AgentToolCatalog:
+ properties:
+ default_tools:
+ description: DefaultTools apply when an agent's allowed_tools was never set
+ (null).
+ items:
+ type: string
+ type: array
+ switch_managed_tools:
+ description: |-
+ SwitchManagedTools follow other agent settings; naming them in the list
+ does not register them.
+ items:
+ type: string
+ type: array
+ tools:
+ description: Tools are the selectable tools, in display order.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.AgentToolInfo'
+ type: array
+ type: object
+ github_com_Tencent_WeKnora_internal_agent_tools.AgentToolInfo:
+ properties:
+ danger:
+ description: Danger marks tools that modify content, which the editor highlights.
+ type: boolean
+ description:
+ type: string
+ group:
+ type: string
+ label:
+ type: string
+ name:
+ type: string
+ requirement:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.AgentToolRequirement'
+ type: object
+ github_com_Tencent_WeKnora_internal_agent_tools.AgentToolRequirement:
+ properties:
+ all_of:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.KBCapability'
+ type: array
+ any_of:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.KBCapability'
+ type: array
+ type: object
+ github_com_Tencent_WeKnora_internal_agent_tools.KBCapability:
+ enum:
+ - vector
+ - keyword
+ - wiki
+ - graph
+ - faq
+ type: string
+ x-enum-varnames:
+ - CapVector
+ - CapKeyword
+ - CapWiki
+ - CapGraph
+ - CapFAQ
github_com_Tencent_WeKnora_internal_application_service.CatalogProviderView:
properties:
api:
@@ -87,6 +149,100 @@ definitions:
version:
type: integer
type: object
+ github_com_Tencent_WeKnora_internal_application_service.ConfigEnvGroup:
+ properties:
+ description:
+ type: string
+ sandbox_config_id:
+ type: string
+ sandbox_config_name:
+ type: string
+ skills:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillEnvGroup'
+ type: array
+ vars:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.EnvVarView'
+ type: array
+ type: object
+ github_com_Tencent_WeKnora_internal_application_service.EnvVarView:
+ properties:
+ description:
+ type: string
+ name:
+ type: string
+ required:
+ type: boolean
+ source:
+ type: string
+ updated_at:
+ description: |-
+ UpdatedAt is set only for the caller's own value; a workspace value has
+ no per-variable timestamp to report.
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_application_service.SandboxInventory:
+ properties:
+ agent_names:
+ items:
+ type: string
+ type: array
+ sandbox_count:
+ type: integer
+ session_ids:
+ items:
+ type: string
+ type: array
+ unverifiable:
+ description: |-
+ Unverifiable reports that SandboxCount is unknown rather than zero
+ because the provider could not be reached. The management page must say
+ so instead of rendering a reassuring "0 sandboxes".
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_application_service.SkillEnvGroup:
+ properties:
+ description:
+ type: string
+ skill_id:
+ type: string
+ skill_name:
+ type: string
+ vars:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.EnvVarView'
+ type: array
+ type: object
+ github_com_Tencent_WeKnora_internal_application_service.SkillFileContent:
+ properties:
+ binary:
+ type: boolean
+ content:
+ type: string
+ encoding:
+ type: string
+ media_type:
+ type: string
+ path:
+ type: string
+ size:
+ type: integer
+ truncated:
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_application_service.SkillFileEntry:
+ properties:
+ path:
+ type: string
+ size:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_application_service.SkillServedInfo:
+ properties:
+ version:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue:
properties:
auto_fixable:
@@ -148,6 +304,84 @@ definitions:
summary:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_config.PromptTemplate:
+ properties:
+ content:
+ type: string
+ default:
+ type: boolean
+ description:
+ type: string
+ has_knowledge_base:
+ type: boolean
+ has_web_search:
+ type: boolean
+ id:
+ type: string
+ mode:
+ type: string
+ name:
+ type: string
+ user:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_config.PromptTemplatesConfig:
+ properties:
+ agent_system_prompt:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ context_template:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ fallback:
+ description: Fallback 合并了固定回复模板和模型兜底 prompt(通过 mode:"model" 区分)
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ generate_kb_description:
+ description: GenerateKBDescription writes the knowledge-base gist from the
+ document profile aggregate.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ generate_questions:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ generate_session_title:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ generate_summary:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ graph_extraction:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ intent_prompts:
+ description: IntentPrompts holds per-intent system prompt overrides (template
+ ID = intent value).
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ keywords_extraction:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ rewrite:
+ description: Rewrite 合并了前端可选模板和运行时默认模板,每个模板同时包含 content + user
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ system_prompt:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplate'
+ type: array
+ type: object
github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata:
properties:
auth_type:
@@ -230,274 +464,659 @@ definitions:
- ErrVectorStoreBindingInvalid
- ErrVectorStoreUnavailable
- ErrModelInUse
- github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile:
+ github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata:
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
+ configured:
type: boolean
- md_heading_counts:
+ type: object
+ github_com_Tencent_WeKnora_internal_handler_dto.CredentialsResponse:
+ properties:
+ fields:
additionalProperties:
- type: integer
- description: Markdown structure
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata'
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:
+ github_com_Tencent_WeKnora_internal_handler_dto.MCPAuthConfigResponse:
properties:
- reason:
+ api_key_header:
type: string
- tier:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier'
+ auth_server_metadata_url:
+ type: string
+ auth_type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthType'
+ client_id:
+ type: string
+ custom_headers:
+ additionalProperties:
+ type: string
+ type: object
+ scopes:
+ items:
+ type: string
+ type: array
type: object
- github_com_Tencent_WeKnora_internal_models.ModelCost:
+ github_com_Tencent_WeKnora_internal_handler_dto.MCPCatalogSummary:
properties:
- cache_read:
- type: number
- cache_write:
- type: number
- currency:
+ stale:
+ type: boolean
+ synced_at:
type: string
- input:
- type: number
- output:
- type: number
+ tool_count:
+ type: integer
type: object
- github_com_Tencent_WeKnora_internal_models.ModelSpec:
+ github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse:
properties:
- aliases:
+ advanced_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig'
+ auth_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPAuthConfigResponse'
+ catalog:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPCatalogSummary'
description: |-
- Aliases are additional ids that resolve to this entry (dated
- snapshots, vendor-prefixed names on gateways).
- items:
- type: string
- type: array
- api:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.API'
- compat:
+ Catalog is the persisted tool-directory summary for list cards.
+ Omitted when this principal has never synchronized the service.
+ created_at:
+ type: string
+ credentials:
+ additionalProperties:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata'
description: |-
- Compat is the protocol-specific overlay for this model (flat object,
- fields depend on API). Decoded lazily by Resolve.
- items:
- type: integer
- type: array
- context_window:
- type: integer
- cost:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models.ModelCost'
- deprecated:
- description: Deprecated hides the entry from pickers but keeps resolution
- working.
+ Credentials is the per-field "configured?" map. Embedded on the main
+ response so the credential UI doesn't need a follow-up GET. The
+ frontend never sees the actual secret value — only whether one is
+ stored. Omitted entirely for builtin services (they can't have
+ per-tenant credentials).
+ type: object
+ description:
+ type: string
+ enabled:
type: boolean
- dimension:
- description: Dimension is the embedding vector width (embedding entries only).
- type: integer
+ env_vars:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars'
+ headers:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders'
id:
type: string
- input:
- description: 'Input lists accepted modalities: text, image, audio, video.'
- items:
+ is_builtin:
+ type: boolean
+ name:
+ type: string
+ stdio_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig'
+ tenant_id:
+ type: integer
+ transport_type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType'
+ updated_at:
+ type: string
+ url:
+ type: string
+ usage_instructions:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_handler_dto.ModelParametersDTO:
+ properties:
+ app_id:
+ type: string
+ base_url:
+ type: string
+ context_window:
+ type: integer
+ custom_headers:
+ additionalProperties:
type: string
- type: array
- match:
- description: |-
- Match is a case-insensitive glob ("gpt-5*", "*deepseek-r1*") that lets
- one entry describe a family. Exact ids and aliases win over patterns;
- among patterns the longest literal prefix wins.
+ type: object
+ embedding_parameters:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters'
+ extra_config:
+ additionalProperties:
+ type: string
+ type: object
+ interface_type:
type: string
+ max_concurrency:
+ type: integer
max_output_tokens:
type: integer
- name:
+ parameter_size:
type: string
- reasoning:
- description: Reasoning reports whether the model can emit thinking at all.
- type: boolean
- source:
- description: Source is the documentation URL the facts were taken from.
+ provider:
type: string
- thinking_levels:
+ spec:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSpecOverride'
+ supports_vision:
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse:
+ properties:
+ capabilities:
allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap'
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_runtime.Capabilities'
description: |-
- ThinkingLevels maps protocol-neutral levels to vendor values; missing
- keys inherit the vendor map. See api.ThinkingLevelMap.
- type:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
+ Capabilities is the catalog view of the model. Chat models get the
+ protocol, thinking levels and context window; embedding and rerank
+ models get input modalities, including support for image input.
+ created_at:
+ type: string
+ credentials:
+ additionalProperties:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata'
description: |-
- Type is the WeKnora model type this entry describes. Chat models with
- image input are still KnowledgeQA; the UI derives VLM eligibility from
- Input. Embedding / Rerank / ASR entries exist for the model picker.
- type: object
- github_com_Tencent_WeKnora_internal_models_api.API:
- enum:
- - openai-completions
- - openai-responses
- - anthropic-messages
- - google-generative-ai
- - ollama
- type: string
- x-enum-varnames:
- - APIOpenAICompletions
- - APIOpenAIResponses
- - APIAnthropicMessages
- - APIGoogleGenerativeAI
- - APIOllama
- github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort:
- enum:
- - "off"
- - auto
- - minimal
- - low
- - medium
- - high
- - xhigh
- - max
- type: string
- x-enum-varnames:
- - ReasoningOff
- - ReasoningAuto
- - ReasoningMinimal
- - ReasoningLow
- - ReasoningMedium
- - ReasoningHigh
- - ReasoningXHigh
- - ReasoningMax
- github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap:
- additionalProperties:
- type: string
+ Per-field "configured?" map. Omitted for builtin models unless the
+ caller is a system administrator. See MCPServiceResponse.Credentials.
+ type: object
+ description:
+ type: string
+ display_name:
+ type: string
+ id:
+ type: string
+ is_builtin:
+ type: boolean
+ is_default:
+ type: boolean
+ name:
+ type: string
+ parameters:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelParametersDTO'
+ source:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource'
+ status:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelStatus'
+ tenant_id:
+ type: integer
+ type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
+ updated_at:
+ type: string
type: object
- github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat:
+ github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse:
properties:
- active:
- type: integer
- limit:
- type: integer
- model_id:
+ business:
+ type: string
+ chat_history_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig'
+ context_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig'
+ created_at:
+ type: string
+ credentials:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig'
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ description:
type: string
+ id:
+ type: integer
+ memory_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConfig'
name:
type: string
- waiting:
+ parser_engine_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig'
+ retrieval_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig'
+ retriever_engines:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines'
+ status:
+ type: string
+ storage_engine_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig'
+ storage_quota:
+ type: integer
+ storage_used:
type: integer
+ updated_at:
+ type: string
+ web_search_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig'
type: object
- github_com_Tencent_WeKnora_internal_types.APIPrincipalMode:
- enum:
- - tenant
- - direct_header
- - signed_token
- type: string
- x-enum-varnames:
- - APIPrincipalModeTenant
- - APIPrincipalModeDirect
- - APIPrincipalModeSignedToken
- github_com_Tencent_WeKnora_internal_types.ASRConfig:
+ github_com_Tencent_WeKnora_internal_im.IMChannel:
properties:
+ agent_id:
+ type: string
+ bot_identity:
+ type: string
+ created_at:
+ type: string
+ credentials:
+ type: object
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
enabled:
type: boolean
- language:
- description: 'optional: language hint for transcription'
+ id:
type: string
- model_id:
+ knowledge_base_id:
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.AdminCreateUserRequest:
- properties:
- email:
+ locale:
type: string
- password:
+ mode:
type: string
- username:
- maxLength: 50
- minLength: 2
+ name:
type: string
- required:
- - email
- - username
- type: object
- github_com_Tencent_WeKnora_internal_types.AgentStep:
- properties:
- intermediate_answer:
- description: |-
- IntermediateAnswer preserves a plain answer followed by a loop-end steer.
- The canonical final answer is still stored in Message.Content.
- type: boolean
- iteration:
- description: Iteration number (0-indexed)
- type: integer
- reasoning_content:
- description: |-
- ReasoningContent stores the OpenAI-protocol reasoning_content emitted by the
- model in this round. Persisted on AgentStep so cross-turn replay can put it
- back on the assistant message — required by MiMo / DeepSeek V3.2+ thinking
- mode, ignored by providers that don't recognize the field.
+ output_mode:
type: string
- reasoning_metadata:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ProviderMetadata'
- reasoning_signature:
- description: |-
- ReasoningSignature / ReasoningMetadata are the provider artifacts that
- must accompany ReasoningContent on replay (Anthropic signatures,
- OpenAI Responses encrypted reasoning items).
+ platform:
type: string
- thought:
- description: LLM's reasoning/thinking (Think phase)
+ session_mode:
type: string
- timestamp:
- description: When this step occurred
+ tenant_id:
+ type: integer
+ updated_at:
type: string
- tool_calls:
- description: Tools called in this step (Act phase)
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall'
- type: array
- truncated:
- description: |-
+ type: object
+ 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_mcp.OAuthAuthorizationStatus:
+ properties:
+ authorized:
+ type: boolean
+ expires_at:
+ type: string
+ refresh_available:
+ type: boolean
+ state:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_models.ModelCost:
+ properties:
+ cache_read:
+ type: number
+ cache_write:
+ type: number
+ currency:
+ type: string
+ input:
+ type: number
+ output:
+ type: number
+ type: object
+ github_com_Tencent_WeKnora_internal_models.ModelSpec:
+ properties:
+ aliases:
+ description: |-
+ Aliases are additional ids that resolve to this entry (dated
+ snapshots, vendor-prefixed names on gateways).
+ items:
+ type: string
+ type: array
+ api:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.API'
+ compat:
+ description: |-
+ Compat is the protocol-specific overlay for this model (flat object,
+ fields depend on API). Decoded lazily by Resolve.
+ type: object
+ context_window:
+ type: integer
+ cost:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models.ModelCost'
+ deprecated:
+ description: Deprecated hides the entry from pickers but keeps resolution
+ working.
+ type: boolean
+ dimension:
+ description: Dimension is the embedding vector width (embedding entries only).
+ type: integer
+ id:
+ type: string
+ input:
+ description: 'Input lists accepted modalities: text, image, audio, video.'
+ items:
+ type: string
+ type: array
+ match:
+ description: |-
+ Match is a case-insensitive glob ("gpt-5*", "*deepseek-r1*") that lets
+ one entry describe a family. Exact ids and aliases win over patterns;
+ among patterns the longest literal prefix wins.
+ type: string
+ max_output_tokens:
+ type: integer
+ name:
+ type: string
+ reasoning:
+ description: Reasoning reports whether the model can emit thinking at all.
+ type: boolean
+ source:
+ description: Source is the documentation URL the facts were taken from.
+ type: string
+ thinking_levels:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap'
+ description: |-
+ ThinkingLevels maps protocol-neutral levels to vendor values; missing
+ keys inherit the vendor map. See api.ThinkingLevelMap.
+ type:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
+ description: |-
+ Type is the WeKnora model type this entry describes. Chat models with
+ image input are still KnowledgeQA; the UI derives VLM eligibility from
+ Input. Embedding / Rerank / ASR entries exist for the model picker.
+ type: object
+ github_com_Tencent_WeKnora_internal_models_api.API:
+ enum:
+ - openai-completions
+ - openai-responses
+ - anthropic-messages
+ - google-generative-ai
+ - ollama
+ type: string
+ x-enum-varnames:
+ - APIOpenAICompletions
+ - APIOpenAIResponses
+ - APIAnthropicMessages
+ - APIGoogleGenerativeAI
+ - APIOllama
+ github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort:
+ enum:
+ - "off"
+ - auto
+ - minimal
+ - low
+ - medium
+ - high
+ - xhigh
+ - max
+ type: string
+ x-enum-varnames:
+ - ReasoningOff
+ - ReasoningAuto
+ - ReasoningMinimal
+ - ReasoningLow
+ - ReasoningMedium
+ - ReasoningHigh
+ - ReasoningXHigh
+ - ReasoningMax
+ github_com_Tencent_WeKnora_internal_models_api.ThinkingLevelMap:
+ additionalProperties:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat:
+ properties:
+ active:
+ type: integer
+ limit:
+ type: integer
+ model_id:
+ type: string
+ name:
+ type: string
+ waiting:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_models_providers.AuthStyle:
+ enum:
+ - bearer
+ - api-key
+ - x-api-key
+ - x-goog-api-key
+ - none
+ - signed
+ type: string
+ x-enum-varnames:
+ - AuthBearer
+ - AuthAPIKeyHeader
+ - AuthXAPIKey
+ - AuthGoogleAPIKey
+ - AuthNone
+ - AuthSigned
+ github_com_Tencent_WeKnora_internal_models_providers.CredentialLabel:
+ properties:
+ hint:
+ description: Hint is rendered under the input, for a warning the label cannot
+ carry.
+ type: string
+ hints:
+ additionalProperties:
+ type: string
+ type: object
+ label:
+ type: string
+ labels:
+ additionalProperties:
+ type: string
+ type: object
+ model_types:
+ description: ModelTypes restricts the override; empty means every type.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
+ type: array
+ placeholder:
+ type: string
+ placeholders:
+ additionalProperties:
+ type: string
+ type: object
+ required:
+ description: |-
+ Required marks the credential mandatory even where the generic label
+ calls it optional.
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_models_providers.ExtraField:
+ properties:
+ default:
+ type: string
+ key:
+ type: string
+ label:
+ type: string
+ labels:
+ additionalProperties:
+ type: string
+ type: object
+ model_types:
+ description: ModelTypes restricts the field to some model types; empty means
+ all.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
+ type: array
+ options:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption'
+ type: array
+ placeholder:
+ type: string
+ placeholders:
+ additionalProperties:
+ type: string
+ description: Placeholders carries localized variants of Placeholder.
+ type: object
+ required:
+ type: boolean
+ secret:
+ description: Secret marks values that must never be echoed back to the UI.
+ type: boolean
+ type:
+ description: '"string", "number", "boolean", "select", "password"'
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption:
+ properties:
+ label:
+ type: string
+ labels:
+ additionalProperties:
+ type: string
+ type: object
+ value:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_models_runtime.Capabilities:
+ properties:
+ api:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.API'
+ cataloged:
+ type: boolean
+ context_window:
+ type: integer
+ input:
+ items:
+ type: string
+ type: array
+ max_output_tokens:
+ type: integer
+ max_tokens_field:
+ type: string
+ provider:
+ type: string
+ reasoning:
+ type: boolean
+ thinking_format:
+ type: string
+ thinking_levels:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort'
+ type: array
+ type: object
+ github_com_Tencent_WeKnora_internal_types.APIKeyScopeType:
+ enum:
+ - tenant
+ - platform
+ type: string
+ x-enum-varnames:
+ - APIKeyScopeTenant
+ - APIKeyScopePlatform
+ github_com_Tencent_WeKnora_internal_types.APIPrincipalMode:
+ enum:
+ - tenant
+ - direct_header
+ - signed_token
+ type: string
+ x-enum-varnames:
+ - APIPrincipalModeTenant
+ - APIPrincipalModeDirect
+ - APIPrincipalModeSignedToken
+ github_com_Tencent_WeKnora_internal_types.ASRConfig:
+ properties:
+ enabled:
+ type: boolean
+ language:
+ description: 'optional: language hint for transcription'
+ type: string
+ model_id:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.AdminCreateUserRequest:
+ properties:
+ email:
+ type: string
+ password:
+ type: string
+ username:
+ maxLength: 50
+ minLength: 2
+ type: string
+ required:
+ - email
+ - username
+ type: object
+ github_com_Tencent_WeKnora_internal_types.AgentStep:
+ properties:
+ intermediate_answer:
+ description: |-
+ IntermediateAnswer preserves a plain answer followed by a loop-end steer.
+ The canonical final answer is still stored in Message.Content.
+ type: boolean
+ iteration:
+ description: Iteration number (0-indexed)
+ type: integer
+ reasoning_content:
+ description: |-
+ ReasoningContent stores the OpenAI-protocol reasoning_content emitted by the
+ model in this round. Persisted on AgentStep so cross-turn replay can put it
+ back on the assistant message — required by MiMo / DeepSeek V3.2+ thinking
+ mode, ignored by providers that don't recognize the field.
+ type: string
+ reasoning_metadata:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ProviderMetadata'
+ reasoning_signature:
+ description: |-
+ ReasoningSignature / ReasoningMetadata are the provider artifacts that
+ must accompany ReasoningContent on replay (Anthropic signatures,
+ OpenAI Responses encrypted reasoning items).
+ type: string
+ thought:
+ description: LLM's reasoning/thinking (Think phase)
+ type: string
+ timestamp:
+ description: When this step occurred
+ type: string
+ tool_calls:
+ description: Tools called in this step (Act phase)
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall'
+ type: array
+ truncated:
+ description: |-
Truncated marks the round the completion-token cap cut off. It rides in
the agent_steps JSON so a reloaded, shared or re-opened conversation can
still show that the answer stops mid-sentence by design, rather than
@@ -512,6 +1131,72 @@ definitions:
type: string
type: array
type: object
+ github_com_Tencent_WeKnora_internal_types.AgentTypeKBFilter:
+ properties:
+ all_of:
+ description: 'AllOf: KB must expose ALL of these capability flags.'
+ items:
+ type: string
+ type: array
+ any_of:
+ description: 'AnyOf: KB must expose at least ONE of these capability flags.'
+ items:
+ type: string
+ type: array
+ none_of:
+ description: 'NoneOf: KB must expose NONE of these capability flags.'
+ items:
+ type: string
+ type: array
+ type: object
+ github_com_Tencent_WeKnora_internal_types.AgentTypePresetConfig:
+ properties:
+ allowed_tools:
+ items:
+ type: string
+ type: array
+ faq_priority_enabled:
+ type: boolean
+ kb_selection_mode:
+ description: |-
+ KBSelectionMode presets the KB picker mode: "all" | "selected" | "none".
+ When empty, the user's current value stays untouched.
+ type: string
+ max_iterations:
+ type: integer
+ retain_retrieval_history:
+ type: boolean
+ supported_file_types:
+ items:
+ type: string
+ type: array
+ system_prompt_id:
+ type: string
+ temperature:
+ type: number
+ web_search_enabled:
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_types.AgentTypePresetEntry:
+ properties:
+ config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetConfig'
+ i18n:
+ additionalProperties:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n'
+ type: object
+ id:
+ type: string
+ kb_filter:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypeKBFilter'
+ type: object
+ github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n:
+ properties:
+ description:
+ type: string
+ label:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.AnswerStrategy:
enum:
- all
@@ -520,6 +1205,55 @@ definitions:
x-enum-varnames:
- AnswerStrategyAll
- AnswerStrategyRandom
+ github_com_Tencent_WeKnora_internal_types.AttrSpec:
+ properties:
+ consumers:
+ description: downstream steps that read this attribute
+ items:
+ type: string
+ type: array
+ description:
+ description: one line explaining what the attribute measures
+ type: string
+ label:
+ description: human-readable name for the settings panel
+ type: string
+ name:
+ description: stable key, e.g. "contain.text"
+ type: string
+ question:
+ description: sentence shown to the model in the describe round
+ type: string
+ type:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AttrType'
+ description: extent | presence
+ values:
+ description: ordered low->high for extent attrs
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AttrValue'
+ type: array
+ type: object
+ github_com_Tencent_WeKnora_internal_types.AttrType:
+ enum:
+ - extent
+ - presence
+ type: string
+ x-enum-varnames:
+ - AttrTypeExtent
+ - AttrTypePresence
+ github_com_Tencent_WeKnora_internal_types.AttrValue:
+ properties:
+ description:
+ description: sentence explaining the value
+ type: string
+ label:
+ description: short on-screen name
+ type: string
+ value:
+ description: raw machine value, never localized
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.AuditAction:
enum:
- rbac.member_added
@@ -659,9 +1393,7 @@ definitions:
created_at:
type: string
details:
- items:
- type: integer
- type: array
+ type: object
id:
type: integer
outcome:
@@ -723,33 +1455,279 @@ definitions:
type: string
path_prefix:
type: string
- region:
+ region:
+ type: string
+ secret_id:
+ type: string
+ secret_key:
+ type: string
+ temp_bucket_name:
+ type: string
+ temp_region:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig:
+ properties:
+ embedding_model_id:
+ description: |-
+ EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.
+ Once messages have been indexed, the model cannot be changed (requires re-indexing).
+ type: string
+ enabled:
+ description: Enabled controls whether chat history indexing is active
+ type: boolean
+ knowledge_base_id:
+ description: |-
+ KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.
+ This is set internally when the feature is first enabled; users should not set this directly.
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ChatHistoryKBStats:
+ properties:
+ embedding_model_id:
+ description: ID of the embedding model used
+ type: string
+ enabled:
+ description: Whether the chat history KB is configured and enabled
+ type: boolean
+ has_indexed_messages:
+ description: Whether there are any indexed messages (used by frontend to lock
+ embedding model)
+ type: boolean
+ indexed_message_count:
+ description: Number of indexed message entries (Knowledge count)
+ type: integer
+ knowledge_base_id:
+ description: ID of the knowledge base used for chat history
+ type: string
+ knowledge_base_name:
+ description: Name of the knowledge base
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ChatManage:
+ properties:
+ chat_model_id:
+ description: Chat model parameters
+ type: string
+ citation_enabled:
+ description: |-
+ CitationEnabled controls only final knowledge/web source citations. Nil
+ defaults to true for requests and agents created before this option existed.
+ type: boolean
+ disable_keywords_match:
+ type: boolean
+ disable_vector_match:
+ description: |-
+ DisableVectorMatch / DisableKeywordsMatch turn off one recall path for
+ every search target. Set by the knowledge-search API.
+ type: boolean
+ embedding_top_k:
+ type: integer
+ enable_query_expansion:
+ type: boolean
+ enable_rewrite:
+ description: Rewrite parameters
+ type: boolean
+ fallback_prompt:
+ type: string
+ fallback_response:
+ type: string
+ fallback_strategy:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy'
+ history:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.History'
+ type: array
+ intent:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.QueryIntent'
+ keyword_threshold:
+ type: number
+ knowledge_base_ids:
+ description: Knowledge base retrieval parameters
+ items:
+ type: string
+ type: array
+ knowledge_ids:
+ items:
+ type: string
+ type: array
+ max_rounds:
+ type: integer
+ query:
+ type: string
+ query_understand_model_id:
+ description: |-
+ QueryUnderstandModelID, when set, overrides the chat model used for
+ the query-understanding (rewrite + intent classification) stage only.
+ Empty means fall back to ChatModelID.
+ type: string
+ rerank_model_id:
+ description: Rerank parameters
+ type: string
+ rerank_threshold:
+ type: number
+ rerank_top_k:
+ type: integer
+ rewrite_prompt_system:
+ type: string
+ rewrite_prompt_user:
+ type: string
+ rewrite_query:
+ type: string
+ session_id:
+ type: string
+ summary_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig'
+ user_id:
+ type: string
+ vector_database:
+ type: string
+ vector_threshold:
+ type: number
+ type: object
+ github_com_Tencent_WeKnora_internal_types.Chunk:
+ properties:
+ chunk_index:
+ description: Index position of the chunk in the original document
+ type: integer
+ chunk_type:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkType'
+ description: Chunk 类型,用于区分不同类型的 Chunk
+ content:
+ description: Actual text content of the chunk
+ type: string
+ content_hash:
+ description: ContentHash 存储内容的 hash 值,用于快速匹配(主要用于 FAQ)
+ type: string
+ content_revision:
+ description: ContentRevision is incremented for every user edit or rollback.
+ type: integer
+ created_at:
+ description: Chunk creation time
+ type: string
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Soft delete marker, supports data recovery
+ end_at:
+ description: Ending character position in the original text
+ type: integer
+ flags:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkFlags'
+ description: |-
+ Flags 存储多个布尔状态的位标志(如推荐状态等)
+ 默认值为 ChunkFlagRecommended (1),表示默认可推荐
+ id:
+ description: Unique identifier of the chunk, using UUID format
+ type: string
+ image_info:
+ description: 图片信息,存储为 JSON
+ type: string
+ index_status:
+ description: |-
+ IndexStatus reports whether the current content is reflected in the
+ retrieval stores: ready | processing | failed.
+ type: string
+ indirect_relation_chunks:
+ description: 间接关系 Chunk ID,用于关联间接关系 Chunk 和原始文本 Chunk
+ items:
+ type: string
+ type: array
+ is_enabled:
+ description: Whether the chunk is enabled, can be used to temporarily disable
+ certain chunks
+ type: boolean
+ knowledge_base_id:
+ description: ID of the knowledge base, for quick location
+ type: string
+ knowledge_id:
+ description: ID of the parent knowledge, associated with the Knowledge model
type: string
- secret_id:
+ last_editor_id:
+ description: LastEditorID records the actor that produced the current revision.
type: string
- secret_key:
+ metadata:
+ description: Metadata 存储 chunk 级别的扩展信息,例如 FAQ 元数据
+ type: object
+ next_chunk_id:
+ description: Next chunk ID
type: string
- temp_bucket_name:
+ parent_chunk_id:
+ description: 父 Chunk ID,用于关联图片 Chunk 和原始文本 Chunk
type: string
- temp_region:
+ pre_chunk_id:
+ description: Previous chunk ID
type: string
- type: object
- github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig:
- properties:
- embedding_model_id:
+ relation_chunks:
+ description: 关系 Chunk ID,用于关联关系 Chunk 和原始文本 Chunk
+ items:
+ type: string
+ type: array
+ seq_id:
+ description: SeqID is an auto-increment integer ID for external API usage
+ (FAQ entries)
+ type: integer
+ source_locators:
description: |-
- EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.
- Once messages have been indexed, the model cannot be changed (requires re-indexing).
+ SourceLocators point back into the original file (page and region,
+ slide, sheet rows, ...) so citations can open the file at this chunk.
+ Empty when the parser reported no positions.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SourceLocator'
+ type: array
+ start_at:
+ description: Starting character position in the original text
+ type: integer
+ status:
+ description: Status of the chunk
+ type: integer
+ tag_id:
+ description: Optional tag ID for categorization within a knowledge base (used
+ for FAQ)
type: string
- enabled:
- description: Enabled controls whether chat history indexing is active
- type: boolean
- knowledge_base_id:
- description: |-
- KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.
- This is set internally when the feature is first enabled; users should not set this directly.
+ tenant_id:
+ description: Tenant ID, used for multi-tenant isolation
+ type: integer
+ updated_at:
+ description: Chunk last update time
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.ChunkFlags:
+ enum:
+ - 1
+ type: integer
+ x-enum-varnames:
+ - ChunkFlagRecommended
+ github_com_Tencent_WeKnora_internal_types.ChunkType:
+ enum:
+ - text
+ - parent_text
+ - image_ocr
+ - image_caption
+ - image_vector
+ - entity
+ - relationship
+ - faq
+ - web_search
+ - table_summary
+ - table_column
+ - wiki_page
+ type: string
+ x-enum-varnames:
+ - ChunkTypeText
+ - ChunkTypeParentText
+ - ChunkTypeImageOCR
+ - ChunkTypeImageCaption
+ - ChunkTypeImageVector
+ - ChunkTypeEntity
+ - ChunkTypeRelationship
+ - ChunkTypeFAQ
+ - ChunkTypeWebSearch
+ - ChunkTypeTableSummary
+ - ChunkTypeTableColumn
+ - ChunkTypeWikiPage
github_com_Tencent_WeKnora_internal_types.ChunkingConfig:
properties:
child_chunk_size:
@@ -992,6 +1970,50 @@ definitions:
template_id:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.CustomAgent:
+ properties:
+ avatar:
+ description: Avatar/Icon of the agent (emoji or icon name)
+ type: string
+ config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig'
+ description: Agent configuration
+ created_at:
+ description: Timestamps
+ type: string
+ created_by:
+ description: Created by user ID
+ type: string
+ creator_name:
+ description: |-
+ CreatorName 由 list handler 在返回前批量回填,作用同 KnowledgeBase.CreatorName:
+ 让前端列表卡片区分「我创建」与「同空间其他成员创建」。不落库,内建 agent / 老数据
+ 仍可能为空。
+ type: string
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ description:
+ description: Description of the agent
+ type: string
+ id:
+ description: |-
+ Unique identifier of the agent (composite primary key with TenantID)
+ For built-in agents, this is 'builtin-quick-answer' or 'builtin-smart-reasoning'
+ For custom agents, this is a UUID
+ type: string
+ is_builtin:
+ description: Whether this is a built-in agent (normal mode / agent mode)
+ type: boolean
+ name:
+ description: Name of the agent
+ type: string
+ tenant_id:
+ description: Tenant ID (composite primary key with ID)
+ type: integer
+ updated_at:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.CustomAgentConfig:
properties:
agent_mode:
@@ -1312,9 +2334,7 @@ definitions:
description: |-
Encrypted configuration (API credentials, tokens, etc.)
Stored as JSON with AES-256-GCM encryption
- items:
- type: integer
- type: array
+ type: object
conflict_strategy:
description: 'Conflict resolution strategy: overwrite or skip'
type: string
@@ -1339,14 +2359,10 @@ definitions:
type: string
last_sync_cursor:
description: Cursor or state for incremental sync (connector-specific)
- items:
- type: integer
- type: array
+ type: object
last_sync_result:
description: Summary of last sync result
- items:
- type: integer
- type: array
+ type: object
latest_sync_log:
allOf:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog'
@@ -1486,6 +2502,71 @@ definitions:
truncate_prompt_tokens:
type: integer
type: object
+ github_com_Tencent_WeKnora_internal_types.EvaluationDetail:
+ properties:
+ metric:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MetricResult'
+ description: Evaluation metrics
+ params:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChatManage'
+ description: Evaluation parameters
+ task:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationTask'
+ description: Evaluation task info
+ type: object
+ github_com_Tencent_WeKnora_internal_types.EvaluationStatue:
+ enum:
+ - 0
+ - 1
+ - 2
+ - 3
+ type: integer
+ x-enum-comments:
+ EvaluationStatueFailed: Task failed
+ EvaluationStatuePending: Task is waiting to start
+ EvaluationStatueRunning: Task is in progress
+ EvaluationStatueSuccess: Task completed successfully
+ x-enum-descriptions:
+ - Task is waiting to start
+ - Task is in progress
+ - Task completed successfully
+ - Task failed
+ x-enum-varnames:
+ - EvaluationStatuePending
+ - EvaluationStatueRunning
+ - EvaluationStatueSuccess
+ - EvaluationStatueFailed
+ github_com_Tencent_WeKnora_internal_types.EvaluationTask:
+ properties:
+ dataset_id:
+ description: Dataset ID for evaluation
+ type: string
+ err_msg:
+ description: Error message if failed
+ type: string
+ finished:
+ description: Completed items count
+ type: integer
+ id:
+ description: Unique task ID
+ type: string
+ start_time:
+ description: Task start time
+ type: string
+ status:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationStatue'
+ description: Current task status
+ tenant_id:
+ description: Tenant/Organization ID
+ type: integer
+ total:
+ description: Total items to evaluate
+ type: integer
+ type: object
github_com_Tencent_WeKnora_internal_types.ExtractConfig:
properties:
custom_instructions:
@@ -1539,6 +2620,58 @@ definitions:
question_index_mode:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode'
type: object
+ github_com_Tencent_WeKnora_internal_types.FAQEntry:
+ properties:
+ answer_strategy:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy'
+ answers:
+ items:
+ type: string
+ type: array
+ chunk_id:
+ type: string
+ chunk_type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkType'
+ created_at:
+ type: string
+ id:
+ type: integer
+ index_mode:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode'
+ is_enabled:
+ type: boolean
+ is_recommended:
+ type: boolean
+ knowledge_base_id:
+ type: string
+ knowledge_id:
+ type: string
+ match_type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType'
+ matched_question:
+ description: |-
+ MatchedQuestion is the actual question text that was matched in FAQ search
+ Could be the standard question or one of the similar questions
+ type: string
+ negative_questions:
+ items:
+ type: string
+ type: array
+ score:
+ type: number
+ similar_questions:
+ items:
+ type: string
+ type: array
+ standard_question:
+ type: string
+ tag_id:
+ type: integer
+ tag_name:
+ type: string
+ updated_at:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate:
properties:
by_id:
@@ -1577,27 +2710,189 @@ definitions:
id:
description: ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)
type: integer
- is_enabled:
- type: boolean
- is_recommended:
- type: boolean
- negative_questions:
- items:
- type: string
- type: array
- similar_questions:
+ is_enabled:
+ type: boolean
+ is_recommended:
+ type: boolean
+ negative_questions:
+ items:
+ type: string
+ type: array
+ similar_questions:
+ items:
+ type: string
+ type: array
+ standard_question:
+ type: string
+ tag_id:
+ type: integer
+ tag_name:
+ type: string
+ required:
+ - standard_question
+ type: object
+ github_com_Tencent_WeKnora_internal_types.FAQFailedEntry:
+ properties:
+ answer_all:
+ description: 是否全部回复
+ type: boolean
+ answers:
+ description: 答案
+ items:
+ type: string
+ type: array
+ failure_type:
+ description: 失败类型:pre_validation / post_validation
+ type: string
+ index:
+ description: 条目在批次中的索引(从0开始)
+ type: integer
+ is_disabled:
+ description: 是否停用
+ type: boolean
+ is_partial_failure:
+ description: 是否为部分失败(相似问/反例被移除,但整条仍可导入)
+ type: boolean
+ negative_questions:
+ description: 反例问题
+ items:
+ type: string
+ type: array
+ reason:
+ description: 失败原因
+ type: string
+ removed_negative_questions:
+ description: 被移除的反例及原因
+ items:
+ type: string
+ type: array
+ removed_similar_questions:
+ description: 部分失败详情(当 IsPartialFailure 为 true 时)
+ items:
+ type: string
+ type: array
+ similar_questions:
+ description: 相似问题
+ items:
+ type: string
+ type: array
+ standard_question:
+ description: 标准问题
+ type: string
+ tag_name:
+ description: 分类
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.FAQImportProgress:
+ properties:
+ added_count:
+ description: 新增的条目数
+ type: integer
+ created_at:
+ description: Task creation timestamp
+ type: integer
+ display_status:
+ description: 显示状态:open 或 close
+ type: string
+ dry_run:
+ description: 是否为 dry run 模式
+ type: boolean
+ error:
+ description: Error message if failed
+ type: string
+ failed_count:
+ description: 失败的条目数
+ type: integer
+ failed_entries:
+ description: 失败条目详情(少量时直接返回)
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQFailedEntry'
+ type: array
+ failed_entries_url:
+ description: 失败条目CSV下载URL(大量时返回URL)
+ type: string
+ import_mode:
+ description: Result fields (populated when Status == "completed")
+ type: string
+ imported_at:
+ description: 导入完成时间
+ type: string
+ kb_id:
+ description: Knowledge Base ID
+ type: string
+ knowledge_id:
+ description: FAQ Knowledge ID
+ type: string
+ merge_details:
+ description: 合并详情
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQMergeDetail'
+ type: array
+ merge_entry_indices:
+ description: 需要合并的条目索引(内部使用,用于重试时跳过识别)
+ items:
+ type: integer
+ type: array
+ merged_count:
+ description: 合并更新的条目数
+ type: integer
+ message:
+ description: Status message
+ type: string
+ partial_failed_count:
+ description: 部分失败的条目数(相似问/反例被移除)
+ type: integer
+ processed:
+ description: Entries processed so far
+ type: integer
+ processing_time:
+ description: 处理耗时(毫秒)
+ type: integer
+ progress:
+ description: 0-100 percentage
+ type: integer
+ skipped_count:
+ description: 跳过的条目数(如重复等)
+ type: integer
+ status:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQImportTaskStatus'
+ description: Task status
+ success_count:
+ description: 完全成功的条目数(不包含部分成功/部分失败)
+ type: integer
+ success_entries:
+ description: 成功条目简单信息(少量时直接返回)
items:
- type: string
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSuccessEntry'
type: array
- standard_question:
+ task_id:
+ description: UUID for the import task
type: string
- tag_id:
+ total:
+ description: Total entries to import
type: integer
- tag_name:
- type: string
- required:
- - standard_question
+ updated_at:
+ description: Last update timestamp
+ type: integer
+ valid_entry_indices:
+ description: 验证通过的条目索引(用于重试时跳过验证)
+ items:
+ type: integer
+ type: array
type: object
+ github_com_Tencent_WeKnora_internal_types.FAQImportTaskStatus:
+ enum:
+ - pending
+ - processing
+ - completed
+ - failed
+ type: string
+ x-enum-varnames:
+ - FAQImportStatusPending
+ - FAQImportStatusProcessing
+ - FAQImportStatusCompleted
+ - FAQImportStatusFailed
github_com_Tencent_WeKnora_internal_types.FAQIndexMode:
enum:
- question_only
@@ -1606,6 +2901,24 @@ definitions:
x-enum-varnames:
- FAQIndexModeQuestionOnly
- FAQIndexModeQuestionAnswer
+ github_com_Tencent_WeKnora_internal_types.FAQMergeDetail:
+ properties:
+ answer_changed:
+ description: 答案是否变更
+ type: boolean
+ index:
+ description: 行号(在批次中的索引)
+ type: integer
+ new_negative_count:
+ description: 新增反例数量
+ type: integer
+ new_similar_count:
+ description: 新增相似问数量
+ type: integer
+ standard_question:
+ description: 标准问
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode:
enum:
- combined
@@ -1638,6 +2951,38 @@ definitions:
required:
- query_text
type: object
+ github_com_Tencent_WeKnora_internal_types.FAQSuccessEntry:
+ properties:
+ index:
+ description: 条目在批次中的索引(从0开始)
+ type: integer
+ seq_id:
+ description: 导入后的条目序列ID
+ type: integer
+ standard_question:
+ description: 标准问题
+ type: string
+ tag_id:
+ description: 分类ID(seq_id)
+ type: integer
+ tag_name:
+ description: 分类名称
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.FallbackStrategy:
+ enum:
+ - fixed
+ - model
+ type: string
+ x-enum-comments:
+ FallbackStrategyFixed: Fixed response
+ FallbackStrategyModel: Model fallback response
+ x-enum-descriptions:
+ - Fixed response
+ - Model fallback response
+ x-enum-varnames:
+ - FallbackStrategyFixed
+ - FallbackStrategyModel
github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig:
properties:
additional_instruction:
@@ -1682,6 +3027,27 @@ definitions:
the user's own record.
type: object
type: object
+ github_com_Tencent_WeKnora_internal_types.GenerationMetrics:
+ properties:
+ bleu1:
+ description: BLEU-1 score
+ type: number
+ bleu2:
+ description: BLEU-2 score
+ type: number
+ bleu4:
+ description: BLEU-4 score
+ type: number
+ rouge1:
+ description: ROUGE-1 score
+ type: number
+ rouge2:
+ description: ROUGE-2 score
+ type: number
+ rougel:
+ description: ROUGE-L score
+ type: number
+ type: object
github_com_Tencent_WeKnora_internal_types.GraphNode:
properties:
attributes:
@@ -1704,11 +3070,84 @@ definitions:
type:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.History:
+ properties:
+ answer:
+ description: System response text
+ type: string
+ createAt:
+ description: When this history entry was created
+ type: string
+ knowledgeReferences:
+ description: Knowledge references used in the answer
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult'
+ type: array
+ query:
+ description: User query text
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.ImageActionsConfig:
properties:
ocr:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageOCRAction'
type: object
+ github_com_Tencent_WeKnora_internal_types.ImageAsset:
+ properties:
+ attrs:
+ additionalProperties: {}
+ description: |-
+ Attrs is the observed attribute map (e.g. contain.text, contain.data_visual)
+ produced by the attribute pipeline. Absent keys mean "not observed".
+ type: object
+ caption:
+ description: Caption is the model-generated image description.
+ type: string
+ chunk_id:
+ description: |-
+ ChunkID is the owning chunk (text chunk for embedded images, or the
+ image_ocr / image_caption chunk for dedicated image assets).
+ type: string
+ chunk_type:
+ description: |-
+ ChunkType is the owning chunk's type; empty for images discovered on a
+ text (document) chunk. Helps the UI label the source.
+ type: string
+ created_at:
+ description: CreatedAt is the owning chunk's creation time.
+ type: string
+ id:
+ description: 'ID is stable and unique within a KB: "<chunkID>#<index-in-array>".'
+ type: string
+ is_enabled:
+ description: IsEnabled mirrors the owning chunk's enabled flag.
+ type: boolean
+ knowledge_id:
+ description: KnowledgeID is the document/knowledge item the image belongs
+ to.
+ type: string
+ ocr_text:
+ description: OCRText is the extracted text from the image, if any.
+ type: string
+ original_url:
+ description: OriginalURL is the pre-transform source reference, when different.
+ type: string
+ source_name:
+ description: |-
+ SourceName is the human-readable name of the source knowledge item
+ (document), resolved from KnowledgeID. Empty when the item no longer
+ exists (e.g. deleted), in which case KnowledgeID is still shown.
+ type: string
+ status:
+ description: Status mirrors the owning chunk's index status.
+ type: integer
+ updated_at:
+ description: UpdatedAt is the owning chunk's last update time.
+ type: string
+ url:
+ description: URL is the rendered image URL (COS / storage provider).
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.ImageAttrCondition:
properties:
is:
@@ -1864,6 +3303,9 @@ definitions:
required:
- role
type: object
+ github_com_Tencent_WeKnora_internal_types.JSONMap:
+ additionalProperties: {}
+ type: object
github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest:
properties:
message:
@@ -1872,47 +3314,272 @@ definitions:
type: string
organization_id:
type: string
- role:
+ role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: 'Optional: requested role (admin/editor/viewer); default viewer'
+ required:
+ - organization_id
+ type: object
+ github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest:
+ properties:
+ invite_code:
+ maxLength: 32
+ minLength: 8
+ type: string
+ required:
+ - invite_code
+ type: object
+ github_com_Tencent_WeKnora_internal_types.JoinRequestResponse:
+ properties:
+ created_at:
+ type: string
+ email:
+ type: string
+ id:
+ type: string
+ message:
+ type: string
+ prev_role:
+ description: Previous role (only for upgrade requests)
+ type: string
+ request_type:
+ description: '''join'' or ''upgrade'''
+ type: string
+ requested_role:
+ description: Role the applicant requested (admin/editor/viewer)
+ type: string
+ reviewed_at:
+ type: string
+ status:
+ type: string
+ user_id:
+ type: string
+ username:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.JoinRequestStatus:
+ enum:
+ - pending
+ - approved
+ - rejected
+ type: string
+ x-enum-varnames:
+ - JoinRequestStatusPending
+ - JoinRequestStatusApproved
+ - JoinRequestStatusRejected
+ github_com_Tencent_WeKnora_internal_types.JoinRequestType:
+ enum:
+ - join
+ - upgrade
+ type: string
+ x-enum-varnames:
+ - JoinRequestTypeJoin
+ - JoinRequestTypeUpgrade
+ github_com_Tencent_WeKnora_internal_types.KBCapabilities:
+ properties:
+ faq:
+ description: FAQ means the KB is a FAQ-type KB (Q/A pairs).
+ type: boolean
+ graph:
+ description: Graph means knowledge-graph extraction is enabled.
+ type: boolean
+ keyword:
+ description: Keyword means BM25 / sparse keyword search is indexed.
+ type: boolean
+ vector:
+ description: Vector means semantic (embedding) search is indexed.
+ type: boolean
+ wiki:
+ description: Wiki means the wiki feature is enabled and authored pages exist
+ / will be generated.
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_types.KBCloneProgress:
+ properties:
+ created_at:
+ description: 任务创建时间
+ type: integer
+ error:
+ description: 错误信息
+ type: string
+ message:
+ description: 状态消息
+ type: string
+ processed:
+ description: 已处理数
+ type: integer
+ progress:
+ description: 0-100
+ type: integer
+ source_id:
+ type: string
+ status:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus'
+ target_id:
+ type: string
+ task_id:
+ type: string
+ total:
+ description: 总知识数
+ type: integer
+ updated_at:
+ description: 最后更新时间
+ type: integer
+ 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:
+ description: Channel indicates through which channel the knowledge was ingested
+ (web, api, browser_extension, wechat, etc.)
+ type: string
+ created_at:
+ description: Creation time of the knowledge
+ type: string
+ custom_metadata:
+ description: |-
+ CustomMetadata is user-authored descriptive metadata. It is deliberately
+ separate from Metadata, which contains internal ingestion state and IDs.
+ type: object
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time of the knowledge
+ description:
+ description: Description of the knowledge
+ type: string
+ embedding_model_id:
+ description: ID of the embedding model
+ type: string
+ enable_status:
+ description: Enable status of the knowledge
+ type: string
+ error_message:
+ description: Error message of the knowledge
+ type: string
+ file_hash:
+ description: File hash of the knowledge
+ type: string
+ file_name:
+ description: File name of the knowledge
+ type: string
+ file_path:
+ description: File path of the knowledge
+ type: string
+ file_size:
+ description: File size of the knowledge
+ type: integer
+ file_type:
+ description: File type of the knowledge
+ type: string
+ folder_path:
+ description: |-
+ FolderPath is the canonical relative directory this entry belongs to
+ inside the knowledge base, e.g. "docs/spec" for a folder upload of
+ "docs/spec/design.md". Empty means the knowledge base root. It is a
+ display/navigation concern only: it never affects where the file is
+ physically stored (see FilePath).
+ type: string
+ id:
+ description: Unique identifier of the knowledge
+ type: string
+ knowledge_base_id:
+ description: ID of the knowledge base
+ type: string
+ knowledge_base_name:
+ description: Knowledge base name (not stored in database, populated on query)
+ type: string
+ last_activity_at:
+ description: |-
+ Most recent processing progress (row or span write) for an in-flight
+ row, so clients can tell a slow stage from a stalled one. Not stored.
+ type: string
+ last_faq_import_result:
+ description: Last FAQ import result (for FAQ type knowledge only)
+ type: object
+ metadata:
+ description: Metadata of the knowledge
+ type: object
+ parse_status:
+ description: Parse status of the knowledge
+ type: string
+ pending_subtasks_count:
+ description: |-
+ PendingSubtasksCount is the outstanding enrichment subtask count
+ (summary + question + graph chunks). Only meaningful while
+ ParseStatus == "finalizing"; defaults to 0 in any terminal state.
+ type: integer
+ processed_at:
+ description: Processed time of the knowledge
+ type: string
+ profile:
allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
- description: 'Optional: requested role (admin/editor/viewer); default viewer'
- required:
- - organization_id
- type: object
- github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest:
- properties:
- invite_code:
- maxLength: 32
- minLength: 8
- type: string
- 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:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProfile'
+ description: |-
+ Profile is the structured companion of Description: a one-line gist,
+ topic keywords, a document type and one typical question. It is produced
+ by the same model call as the summary and feeds the knowledge-base
+ level description aggregation. nil when no summary has been generated.
+ source:
+ description: Source of the knowledge (e.g. URL address for url type, "manual"
+ for manual type)
type: string
- bucket_name:
+ stall_state:
+ description: |-
+ Verdict on an in-flight row gone quiet: StallStateQueued (its work is
+ still queued, i.e. backlogged) or StallStateStalled (nothing left to
+ run it). Empty while it is progressing or the probe failed. Not stored.
type: string
- endpoint:
+ storage_size:
+ description: Storage size of the knowledge
+ type: integer
+ summary_status:
+ description: Summary status for async summary generation
type: string
- path_prefix:
+ tags:
+ description: Tags holds the tags associated with this knowledge (populated
+ on query, not persisted directly).
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeTag'
+ type: array
+ tenant_id:
+ description: Workspace ID
+ type: integer
+ title:
+ description: Title of the knowledge
type: string
- region:
+ type:
+ description: Type of the knowledge
type: string
- secret_key:
+ updated_at:
+ description: Last updated time of the knowledge
type: string
type: object
github_com_Tencent_WeKnora_internal_types.KnowledgeBase:
@@ -2220,6 +3887,45 @@ definitions:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.NamedCount'
type: array
type: object
+ github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare:
+ properties:
+ created_at:
+ description: Creation time
+ type: string
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time (soft delete)
+ id:
+ description: Unique identifier
+ type: string
+ knowledge_base:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase'
+ description: Associations (not stored in database)
+ knowledge_base_id:
+ description: Knowledge base ID being shared
+ type: string
+ organization:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Organization'
+ organization_id:
+ description: Organization ID receiving the share
+ type: string
+ permission:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: Permission level (admin/editor/viewer)
+ shared_by_user_id:
+ description: User ID who shared the knowledge base
+ type: string
+ source_tenant_id:
+ description: Original tenant ID of the knowledge base (for cross-tenant embedding
+ model access)
+ type: integer
+ updated_at:
+ description: Last updated time
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse:
properties:
chunk_count:
@@ -2258,6 +3964,45 @@ definitions:
source_tenant_id:
type: integer
type: object
+ github_com_Tencent_WeKnora_internal_types.KnowledgeFolderNode:
+ properties:
+ children:
+ description: Children are the direct sub-folders, sorted by name.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeFolderNode'
+ type: array
+ document_count:
+ description: DocumentCount counts entries whose folder_path equals Path.
+ type: integer
+ name:
+ description: Name is the last segment of Path, used as the tree row label.
+ type: string
+ path:
+ description: Path is the canonical folder path, e.g. "docs/spec".
+ type: string
+ total_count:
+ description: TotalCount counts entries in Path and in all descendant folders.
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.KnowledgeFolderTree:
+ properties:
+ folders:
+ description: Folders are the top-level folders, sorted by name.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeFolderNode'
+ type: array
+ root_document_count:
+ description: |-
+ RootDocumentCount counts entries that live at the knowledge base root
+ (folder_path = ""), i.e. documents that were not uploaded as part of a
+ folder.
+ type: integer
+ total_document_count:
+ description: |-
+ TotalDocumentCount counts every entry in the knowledge base, matching
+ the unfiltered document list total.
+ type: integer
+ type: object
github_com_Tencent_WeKnora_internal_types.KnowledgeMoveProgress:
properties:
created_at:
@@ -2343,6 +4088,64 @@ definitions:
vlm_config:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig'
type: object
+ github_com_Tencent_WeKnora_internal_types.KnowledgeProfile:
+ properties:
+ doc_type:
+ description: DocType is a coarse label such as "user manual", "meeting notes"
+ or "contract".
+ type: string
+ gist:
+ description: Gist is a one-line statement of what the document is about.
+ type: string
+ topics:
+ description: Topics lists 3-5 short topic keywords.
+ items:
+ type: string
+ type: array
+ typical_question:
+ description: TypicalQuestion is one natural-language question this document
+ answers.
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.KnowledgeTag:
+ properties:
+ color:
+ description: Optional display color
+ type: string
+ created_at:
+ description: Creation time
+ type: string
+ id:
+ description: Unique identifier of the tag (UUID)
+ type: string
+ knowledge_base_id:
+ description: Knowledge base ID that this tag belongs to
+ type: string
+ name:
+ description: Tag name, unique within the same knowledge base
+ type: string
+ seq_id:
+ description: SeqID is an auto-increment integer ID for external API usage
+ type: integer
+ sort_order:
+ description: Sort order within the same knowledge base
+ type: integer
+ tenant_id:
+ description: Workspace ID
+ type: integer
+ updated_at:
+ description: Last updated time
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ListJoinRequestsResponse:
+ properties:
+ requests:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestResponse'
+ type: array
+ total:
+ type: integer
+ type: object
github_com_Tencent_WeKnora_internal_types.ListMembersResponse:
properties:
members:
@@ -2504,6 +4307,17 @@ definitions:
additionalProperties:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.MCPResource:
+ properties:
+ description:
+ type: string
+ mimeType:
+ type: string
+ name:
+ type: string
+ uri:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.MCPService:
properties:
advanced_config:
@@ -2560,6 +4374,44 @@ definitions:
description: 'Command: "uvx" or "npx"'
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.MCPTestResult:
+ properties:
+ description:
+ type: string
+ message:
+ type: string
+ oauth_required:
+ description: |-
+ OAuthRequired is true when the connection failed because the server
+ requires OAuth authorization (RFC 9728), even though the service was not
+ configured for OAuth. The UI uses it to guide the user to switch the auth
+ strategy to OAuth.
+ type: boolean
+ resources:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPResource'
+ type: array
+ success:
+ type: boolean
+ tools:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTool'
+ type: array
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MCPTool:
+ properties:
+ description:
+ type: string
+ inputSchema:
+ description: JSON Schema for tool parameters
+ type: object
+ name:
+ type: string
+ require_approval:
+ description: 'RequireApproval when true: agent execution pauses until the
+ user approves in UI (issue #1173).'
+ type: boolean
+ type: object
github_com_Tencent_WeKnora_internal_types.MCPTransportType:
enum:
- sse
@@ -2675,53 +4527,189 @@ definitions:
distillation runs. Waiting lets one model call cover the several
messages a user usually sends in a row. 0 means the default.
type: integer
- extract_instructions:
+ extract_instructions:
+ description: |-
+ ExtractInstructions are workspace-specific rules appended to the
+ distillation prompt, for policies the product cannot guess ("never record
+ customer names", "always note the environment a question is about").
+ type: string
+ extract_min_interval_seconds:
+ description: |-
+ ExtractMinIntervalSeconds is the floor between two distillation runs for
+ the same person, and exists purely to bound cost. It never drops a turn:
+ a turn arriving inside the interval is queued and picked up by the next
+ run. 0 means the default.
+ type: integer
+ extract_model_id:
+ description: |-
+ ExtractModelID is the model used by the background extraction task.
+ Empty means "use the model the conversation itself used", which is what
+ the settings UI promises, so the extraction task must never fail merely
+ because this is blank.
+ type: string
+ interest_threshold:
+ description: |-
+ InterestThreshold is how many separate conversations must touch a topic
+ before it becomes a stored interest. 0 means the default. Setting it to 1
+ records every topic on first sight, which is usually too noisy.
+ type: integer
+ max_items:
+ description: MaxItems caps active items per subject. 0 means DefaultMemoryMaxItems.
+ type: integer
+ retrieval_conditioning:
+ description: |-
+ RetrievalConditioning lets memory shape retrieval — query rewriting and
+ per-document ranking — rather than only being appended to the answer
+ prompt. This is where memory earns its keep in a knowledge-base product.
+ type: boolean
+ vector_recall:
+ description: |-
+ VectorRecall adds semantic similarity to memory recall. Nil means on
+ when an embedding model is reachable.
+
+ Lexical matching alone cannot find a memory the user has re-worded, which
+ is most of them: "回答直接给结论" and "别铺垫那么多" share no tokens. The
+ cost is one embedding call per turn, bounded and degraded to lexical on
+ failure, so the feature never becomes a reason a chat is slow.
+ type: boolean
+ write_mode:
+ description: WriteMode is MemoryWriteExplicitOnly or MemoryWriteAuto.
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MemoryConsolidationResult:
+ properties:
+ candidates:
+ description: Candidates is how many groups were put in front of the model.
+ type: integer
+ demoted:
+ type: integer
+ expired:
+ type: integer
+ merged:
+ type: integer
+ reviewed:
+ description: Reviewed is how many active memories the pass looked at.
+ type: integer
+ skipped:
+ description: Skipped is why nothing was merged, empty when something was.
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MemoryDocView:
+ properties:
+ hits:
+ type: integer
+ id:
+ type: string
+ knowledge_base_id:
+ type: string
+ knowledge_id:
+ type: string
+ last_used_at:
+ type: string
+ title:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MemoryItem:
+ properties:
+ content:
+ type: string
+ created_at:
+ type: string
+ expires_at:
+ description: |-
+ ExpiresAt is when the statement stops being worth recalling, used for
+ things that are true only for a while ("finish the migration this week").
+ Without it an in-flight task stays in context forever and slowly turns
+ the memory into a list of things the user finished months ago.
+ type: string
+ id:
+ type: string
+ importance:
+ type: integer
+ invalid_at:
+ type: string
+ kind:
+ type: string
+ last_used_at:
+ type: string
+ normalized_key:
+ description: |-
+ NormalizedKey identifies the topic this item is about. A new item with
+ the same key as an active one supersedes it, which is how contradictions
+ ("I use MySQL" then "I moved to Postgres") resolve without an LLM in the
+ read path.
+ type: string
+ origin:
+ type: string
+ replaces_id:
+ type: string
+ source_message_id:
+ type: string
+ source_session_id:
+ type: string
+ status:
+ type: string
+ subject_id:
+ type: string
+ superseded_by:
+ type: string
+ tenant_id:
+ type: integer
+ topic:
description: |-
- ExtractInstructions are workspace-specific rules appended to the
- distillation prompt, for policies the product cannot guess ("never record
- customer names", "always note the environment a question is about").
+ Topic is the readable subject the statement is about, as the extraction
+ model named it ("在用的数据库"). It is kept verbatim next to the
+ normalized key because it is the best retrieval handle available: a
+ question often names the topic while the statement itself only carries
+ the value ("已经迁到 PostgreSQL").
type: string
- extract_min_interval_seconds:
- description: |-
- ExtractMinIntervalSeconds is the floor between two distillation runs for
- the same person, and exists purely to bound cost. It never drops a turn:
- a turn arriving inside the interval is queued and picked up by the next
- run. 0 means the default.
+ updated_at:
+ type: string
+ use_count:
type: integer
- extract_model_id:
- description: |-
- ExtractModelID is the model used by the background extraction task.
- Empty means "use the model the conversation itself used", which is what
- the settings UI promises, so the extraction task must never fail merely
- because this is blank.
+ valid_from:
type: string
- interest_threshold:
- description: |-
- InterestThreshold is how many separate conversations must touch a topic
- before it becomes a stored interest. 0 means the default. Setting it to 1
- records every topic on first sight, which is usually too noisy.
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MemorySettings:
+ properties:
+ effective:
+ description: 'Effective is what actually happens: WorkspaceEnabled && UserEnabled.'
+ type: boolean
+ item_count:
+ description: ItemCount is how many active memories the caller currently has.
type: integer
max_items:
- description: MaxItems caps active items per subject. 0 means DefaultMemoryMaxItems.
+ description: MaxItems is the capacity cap after which the lowest ranked are
+ archived.
type: integer
- retrieval_conditioning:
+ user_enabled:
description: |-
- RetrievalConditioning lets memory shape retrieval — query rewriting and
- per-document ranking — rather than only being appended to the answer
- prompt. This is where memory earns its keep in a knowledge-base product.
+ UserEnabled is the caller's own opt out. Meaningless while the
+ workspace switch is off, but still reported so the toggle keeps its
+ position when an admin turns the workspace back on.
type: boolean
- vector_recall:
- description: |-
- VectorRecall adds semantic similarity to memory recall. Nil means on
- when an embedding model is reachable.
-
- Lexical matching alone cannot find a memory the user has re-worded, which
- is most of them: "回答直接给结论" and "别铺垫那么多" share no tokens. The
- cost is one embedding call per turn, bounded and degraded to lexical on
- failure, so the feature never becomes a reason a chat is slow.
+ workspace_enabled:
+ description: WorkspaceEnabled is the admin switch on the workspace.
type: boolean
write_mode:
- description: WriteMode is MemoryWriteExplicitOnly or MemoryWriteAuto.
+ description: WriteMode is the workspace write mode.
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MemoryTopicView:
+ properties:
+ aliases:
+ items:
+ type: string
+ type: array
+ hits:
+ type: integer
+ id:
+ type: string
+ last_seen_at:
+ type: string
+ threshold:
+ type: integer
+ topic:
type: string
type: object
github_com_Tencent_WeKnora_internal_types.MentionedItem:
@@ -2836,12 +4824,24 @@ definitions:
ModelID is the requested/effective chat model binding captured for this
turn. It is useful for reproducibility and suggestion generation.
type: string
+ pending_prompt:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PendingPromptView'
+ description: |-
+ PendingPrompt is the prompt an awaiting_input message waits on. The
+ message list fills it in for the prompt's owner; it is never stored.
request_id:
description: Request identifier for tracking API requests
type: string
role:
description: 'Message role: "user", "assistant", "system"'
type: string
+ run_state:
+ description: |-
+ RunState refines an incomplete message: MessageRunStateAwaitingInput
+ means the run ended suspended on a prompt instead of still generating.
+ Empty means IsCompleted alone describes the message.
+ type: string
sandbox_checkpoint:
allOf:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SandboxCheckpoint'
@@ -2954,6 +4954,100 @@ definitions:
url:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem:
+ properties:
+ answer_content:
+ description: Assistant answer content (role=assistant), may be empty if only
+ Q matched
+ type: string
+ created_at:
+ description: Timestamp of the earliest message in the group
+ type: string
+ match_type:
+ description: 'How this result was matched: "keyword", "vector", or "hybrid"'
+ type: string
+ query_content:
+ description: User query content (role=user)
+ type: string
+ request_id:
+ description: The request_id that groups Q&A together
+ type: string
+ score:
+ description: Best score among the matched messages in this group
+ type: number
+ session_id:
+ description: Session info
+ type: string
+ session_title:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MessageSearchResult:
+ properties:
+ items:
+ description: List of merged Q&A pairs
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem'
+ type: array
+ total:
+ description: Total number of results
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet:
+ properties:
+ agent_id:
+ type: string
+ allow_regenerate:
+ type: boolean
+ assistant_message_id:
+ type: string
+ completion_tokens:
+ type: integer
+ config_hash:
+ type: string
+ created_at:
+ type: string
+ error_code:
+ type: string
+ generated_at:
+ type: string
+ id:
+ type: string
+ latency_ms:
+ type: integer
+ locale:
+ type: string
+ model_id:
+ type: string
+ placement:
+ type: string
+ prompt_tokens:
+ type: integer
+ questions:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestionItem'
+ type: array
+ session_id:
+ type: string
+ status:
+ type: string
+ suppression_reason:
+ type: string
+ tenant_id:
+ type: integer
+ updated_at:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MetricResult:
+ properties:
+ generation_metrics:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GenerationMetrics'
+ description: Text generation quality metrics
+ retrieval_metrics:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalMetrics'
+ description: Retrieval performance metrics
+ type: object
github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig:
properties:
access_key_id:
@@ -3146,6 +5240,24 @@ definitions:
type: string
type: object
type: object
+ github_com_Tencent_WeKnora_internal_types.ModelStatus:
+ enum:
+ - active
+ - downloading
+ - download_failed
+ type: string
+ x-enum-comments:
+ ModelStatusActive: Model is active
+ ModelStatusDownloadFailed: Model download failed
+ ModelStatusDownloading: Model is downloading
+ x-enum-descriptions:
+ - Model is active
+ - Model is downloading
+ - Model download failed
+ x-enum-varnames:
+ - ModelStatusActive
+ - ModelStatusDownloading
+ - ModelStatusDownloadFailed
github_com_Tencent_WeKnora_internal_types.ModelType:
enum:
- Embedding
@@ -3247,6 +5359,132 @@ definitions:
- OrgRoleAdmin
- OrgRoleEditor
- OrgRoleViewer
+ github_com_Tencent_WeKnora_internal_types.Organization:
+ properties:
+ avatar:
+ description: Avatar URL for display in list and settings
+ type: string
+ created_at:
+ description: Creation time
+ type: string
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time (soft delete)
+ description:
+ description: Description of the organization
+ type: string
+ id:
+ description: Unique identifier of the organization
+ type: string
+ invite_code:
+ description: Unique invitation code for joining the organization
+ type: string
+ invite_code_expires_at:
+ description: When the current invite code expires; nil means no expiry
+ type: string
+ invite_code_validity_days:
+ description: 'Invite link validity in days: 0=never, 1/7/30'
+ type: integer
+ member_limit:
+ description: Max members allowed; 0 means no limit
+ type: integer
+ members:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationTenantMember'
+ type: array
+ name:
+ description: Name of the organization
+ type: string
+ owner:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User'
+ description: Associations (not stored in database)
+ owner_id:
+ description: User ID of the organization owner
+ type: string
+ owner_tenant_id:
+ description: |-
+ OwnerTenantID is the tenant the owner belonged to when the
+ organization was created. Plan 3 (#1303) treats this tenant as
+ the org's "owning tenant": its membership row in
+ organization_tenant_members is undeletable / unchangeable so
+ the org can never be orphaned even if the owner user later
+ switches tenants or is soft-deleted. See migration 000046.
+ type: integer
+ require_approval:
+ description: Whether joining requires admin approval
+ type: boolean
+ searchable:
+ description: Whether the space is open for search (discoverable; non-members
+ can search and join by org ID)
+ type: boolean
+ shares:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare'
+ type: array
+ updated_at:
+ description: Last updated time
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.OrganizationJoinRequest:
+ properties:
+ created_at:
+ description: Creation time
+ type: string
+ id:
+ description: Unique identifier
+ type: string
+ message:
+ description: Optional message from the requester
+ type: string
+ organization:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Organization'
+ description: Associations (not stored in database)
+ organization_id:
+ description: Organization ID
+ type: string
+ prev_role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: Previous role before upgrade (only for upgrade requests)
+ request_type:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestType'
+ description: 'Type of request: ''join'' for new member, ''upgrade'' for role
+ upgrade'
+ requested_role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: Role requested by the applicant (admin/editor/viewer)
+ review_message:
+ description: Optional message from the reviewer
+ type: string
+ reviewed_at:
+ description: Time when the request was reviewed
+ type: string
+ reviewed_by:
+ description: User ID of the admin who reviewed the request
+ type: string
+ reviewer:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User'
+ status:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestStatus'
+ description: Status of the request
+ tenant_id:
+ description: Tenant ID of the requester
+ type: integer
+ updated_at:
+ description: Last updated time
+ type: string
+ user:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User'
+ user_id:
+ description: User ID of the requester
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse:
properties:
avatar:
@@ -3326,6 +5564,76 @@ definitions:
updated_at:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.OrganizationSharedAgentItem:
+ properties:
+ agent:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent'
+ disabled_by_me:
+ description: 'DisabledByMe: current tenant has hidden this shared agent from
+ their conversation dropdown (per-user preference)'
+ type: boolean
+ is_mine:
+ type: boolean
+ org_name:
+ type: string
+ organization_id:
+ type: string
+ permission:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ share_id:
+ type: string
+ shared_at:
+ type: string
+ shared_by_user_id:
+ type: string
+ shared_by_username:
+ type: string
+ source_tenant_id:
+ type: integer
+ web_search_ready:
+ description: |-
+ WebSearchReady is resolved against the source workspace without exposing
+ its provider list or credentials. Receivers must not compare the agent's
+ provider ID with their own workspace resources.
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_types.OrganizationTenantMember:
+ properties:
+ created_at:
+ type: string
+ id:
+ type: string
+ joined_at:
+ type: string
+ organization:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Organization'
+ organization_id:
+ type: string
+ representative_user:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User'
+ representative_user_id:
+ type: string
+ role:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ tenant_id:
+ type: integer
+ updated_at:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.PageResult:
+ properties:
+ data:
+ description: Data
+ page:
+ description: Current page number
+ type: integer
+ page_size:
+ description: Page size
+ type: integer
+ total:
+ description: Total number of records
+ type: integer
+ type: object
github_com_Tencent_WeKnora_internal_types.ParserEngineConfig:
properties:
chat_parser_engine_rules:
@@ -3410,6 +5718,21 @@ definitions:
paddleocr_vl_use_seal_recognition:
type: boolean
type: object
+ github_com_Tencent_WeKnora_internal_types.ParserEngineInfo:
+ properties:
+ available:
+ type: boolean
+ description:
+ type: string
+ fileTypes:
+ items:
+ type: string
+ type: array
+ name:
+ type: string
+ unavailableReason:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.ParserEngineRule:
properties:
engine:
@@ -3424,6 +5747,21 @@ definitions:
nil preserves the parser default; an explicit false disables the mode.
type: boolean
type: object
+ github_com_Tencent_WeKnora_internal_types.PendingPromptView:
+ properties:
+ created_at:
+ type: string
+ expires_at:
+ type: string
+ id:
+ type: string
+ kind:
+ type: string
+ request:
+ type: object
+ tool_call_id:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.PromptCacheStatus:
enum:
- unsupported
@@ -3436,12 +5774,44 @@ definitions:
- PromptCacheStatusUnreported
- PromptCacheStatusMiss
- PromptCacheStatusHit
+ github_com_Tencent_WeKnora_internal_types.PromptPlaceholder:
+ properties:
+ description:
+ description: Description explains what this placeholder represents
+ type: string
+ label:
+ description: Label is a short label for the placeholder
+ type: string
+ name:
+ description: Name is the placeholder name (without braces), e.g., "query"
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.ProviderMetadata:
additionalProperties:
- items:
- type: integer
- type: array
+ type: object
type: object
+ github_com_Tencent_WeKnora_internal_types.QueryIntent:
+ enum:
+ - kb_search
+ - web_search
+ - greeting
+ - chitchat
+ - follow_up
+ - image_only
+ - doc_only
+ - summarize
+ - clarification
+ type: string
+ x-enum-varnames:
+ - IntentKBSearch
+ - IntentWebSearch
+ - IntentGreeting
+ - IntentChitchat
+ - IntentFollowUp
+ - IntentImageOnly
+ - IntentDocOnly
+ - IntentSummarize
+ - IntentClarification
github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig:
properties:
custom_instructions:
@@ -3552,6 +5922,45 @@ definitions:
required:
- requested_role
type: object
+ github_com_Tencent_WeKnora_internal_types.RerankDiagnostics:
+ properties:
+ applied:
+ description: Applied is true when rerank scores decided the returned order.
+ type: boolean
+ candidate_count:
+ type: integer
+ effective_threshold:
+ type: number
+ error:
+ description: Error carries the reason for model_error / model_unavailable.
+ type: string
+ images_kept:
+ type: integer
+ images_scored:
+ description: |-
+ ImagesScored counts image hits a multimodal reranker scored by their
+ image; ImagesKept the pictorial image hits kept over a text reranker's
+ rejection on their vector's evidence.
+ type: integer
+ model_id:
+ description: ModelID and ModelSource (request / tenant / auto) identify the
+ model.
+ type: string
+ model_source:
+ type: string
+ outcome:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RerankOutcome'
+ result_count:
+ type: integer
+ threshold:
+ description: |-
+ Threshold is the requested minimum score; EffectiveThreshold is the one
+ applied after degradation.
+ type: number
+ top_score:
+ description: TopScore is the best rerank model score among the candidates.
+ type: number
+ type: object
github_com_Tencent_WeKnora_internal_types.RerankOptions:
properties:
enabled:
@@ -3573,6 +5982,28 @@ definitions:
count.
type: integer
type: object
+ github_com_Tencent_WeKnora_internal_types.RerankOutcome:
+ enum:
+ - ok
+ - threshold_degraded
+ - fallback_top1
+ - all_below_threshold
+ - model_error
+ - model_unavailable
+ - no_model
+ - disabled
+ - no_candidates
+ type: string
+ x-enum-varnames:
+ - RerankOutcomeOK
+ - RerankOutcomeThresholdDegraded
+ - RerankOutcomeFallbackTop1
+ - RerankOutcomeAllBelowThreshold
+ - RerankOutcomeModelError
+ - RerankOutcomeModelUnavailable
+ - RerankOutcomeNoModel
+ - RerankOutcomeDisabled
+ - RerankOutcomeNoCandidates
github_com_Tencent_WeKnora_internal_types.Resource:
properties:
description:
@@ -3663,6 +6094,32 @@ definitions:
default: 0.15)'
type: number
type: object
+ github_com_Tencent_WeKnora_internal_types.RetrievalMeta:
+ properties:
+ rerank:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RerankDiagnostics'
+ type: object
+ github_com_Tencent_WeKnora_internal_types.RetrievalMetrics:
+ properties:
+ map:
+ description: Mean Average Precision
+ type: number
+ mrr:
+ description: Mean Reciprocal Rank
+ type: number
+ ndcg3:
+ description: Normalized Discounted Cumulative Gain at 3
+ type: number
+ ndcg10:
+ description: Normalized Discounted Cumulative Gain at 10
+ type: number
+ precision:
+ description: Precision score
+ type: number
+ recall:
+ description: Recall score
+ type: number
+ type: object
github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams:
properties:
retriever_engine_type:
@@ -3960,9 +6417,7 @@ definitions:
type: integer
chunk_metadata:
description: ChunkMetadata stores chunk-level metadata (e.g., generated questions)
- items:
- type: integer
- type: array
+ type: object
chunk_type:
description: Chunk 类型
type: string
@@ -4055,6 +6510,31 @@ definitions:
type: string
type: array
type: object
+ github_com_Tencent_WeKnora_internal_types.SearchableOrganizationItem:
+ properties:
+ agent_share_count:
+ description: 共享到该组织的智能体数量
+ type: integer
+ avatar:
+ type: string
+ description:
+ type: string
+ id:
+ type: string
+ is_already_member:
+ type: boolean
+ member_count:
+ type: integer
+ member_limit:
+ description: 0 = unlimited
+ type: integer
+ name:
+ type: string
+ require_approval:
+ type: boolean
+ share_count:
+ type: integer
+ type: object
github_com_Tencent_WeKnora_internal_types.Session:
properties:
created_at:
@@ -4187,6 +6667,37 @@ definitions:
- organization_id
- permission
type: object
+ github_com_Tencent_WeKnora_internal_types.SharedAgentInfo:
+ properties:
+ agent:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent'
+ disabled_by_me:
+ description: 'DisabledByMe: current tenant has hidden this shared agent from
+ their conversation dropdown (per-user preference)'
+ type: boolean
+ org_name:
+ type: string
+ organization_id:
+ type: string
+ permission:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ share_id:
+ type: string
+ shared_at:
+ type: string
+ shared_by_user_id:
+ type: string
+ shared_by_username:
+ type: string
+ source_tenant_id:
+ type: integer
+ web_search_ready:
+ description: |-
+ WebSearchReady is resolved against the source workspace without exposing
+ its provider list or credentials. Receivers must not compare the agent's
+ provider ID with their own workspace resources.
+ type: boolean
+ type: object
github_com_Tencent_WeKnora_internal_types.SkillImageConfig:
properties:
base_template_id:
@@ -4281,6 +6792,47 @@ definitions:
type:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.SpanTreeNode:
+ properties:
+ attempt:
+ type: integer
+ children:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SpanTreeNode'
+ type: array
+ created_at:
+ type: string
+ duration_ms:
+ type: integer
+ error_code:
+ type: string
+ error_message:
+ type: string
+ finished_at:
+ type: string
+ input:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JSONMap'
+ kind:
+ type: string
+ knowledge_id:
+ type: string
+ metadata:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JSONMap'
+ name:
+ type: string
+ output:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JSONMap'
+ parent_span_id:
+ type: string
+ span_id:
+ type: string
+ started_at:
+ type: string
+ status:
+ type: string
+ updated_at:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig:
properties:
count:
@@ -4294,6 +6846,31 @@ definitions:
mode:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.StorageBackend:
+ properties:
+ config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackendConfig'
+ created_at:
+ type: string
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ id:
+ type: string
+ legacy_alias:
+ type: boolean
+ name:
+ type: string
+ provider:
+ type: string
+ source:
+ type: string
+ status:
+ type: string
+ tenant_id:
+ type: integer
+ updated_at:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.StorageBackendConfig:
properties:
access_key_id:
@@ -4401,6 +6978,21 @@ definitions:
required:
- invite_code
type: object
+ github_com_Tencent_WeKnora_internal_types.SuggestedQuestion:
+ properties:
+ knowledge_base_id:
+ description: 来源知识库ID(仅 faq/document/wiki 来源时有值)
+ type: string
+ knowledge_id:
+ description: 来源文档ID(仅 faq/document 来源时有值)
+ type: string
+ question:
+ description: 问题文本
+ type: string
+ source:
+ description: '来源类型: "agent_config", "faq", "document", "wiki"'
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.SuggestionAttribution:
properties:
question_id:
@@ -4408,6 +7000,67 @@ definitions:
suggestion_set_id:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.SuggestionItem:
+ properties:
+ category:
+ type: string
+ id:
+ type: string
+ knowledge_base_ids:
+ items:
+ type: string
+ type: array
+ source:
+ type: string
+ text:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.SummaryConfig:
+ properties:
+ context_template:
+ description: Context template
+ type: string
+ frequency_penalty:
+ description: Frequency penalty
+ type: number
+ max_completion_tokens:
+ description: Max completion tokens
+ type: integer
+ max_tokens:
+ description: Max tokens
+ type: integer
+ no_match_prefix:
+ description: No match prefix
+ type: string
+ presence_penalty:
+ description: Presence penalty
+ type: number
+ prompt:
+ description: Prompt
+ type: string
+ reasoning_effort:
+ description: ReasoningEffort is the graded thinking level; empty falls back
+ to Thinking.
+ type: string
+ repeat_penalty:
+ description: Repeat penalty
+ type: number
+ seed:
+ description: Seed
+ type: integer
+ temperature:
+ description: Temperature
+ type: number
+ thinking:
+ description: Thinking - whether to enable thinking mode
+ type: boolean
+ top_k:
+ description: TopK
+ type: integer
+ top_p:
+ description: TopP
+ type: number
+ type: object
github_com_Tencent_WeKnora_internal_types.SyncLog:
properties:
created_at:
@@ -4445,9 +7098,7 @@ definitions:
type: integer
result:
description: Detailed sync result (JSON-encoded)
- items:
- type: integer
- type: array
+ type: object
started_at:
description: Sync start time
type: string
@@ -4511,9 +7162,7 @@ definitions:
updated_at:
type: string
value:
- items:
- type: integer
- type: array
+ type: object
value_type:
description: |-
ValueType is one of "int", "string", "bool". Service layer rejects
@@ -4611,16 +7260,97 @@ definitions:
description: Storage quota (Bytes), default is 10GB, including vector, original
file, text, index, etc.
type: integer
- storage_used:
- description: Storage used (Bytes)
+ storage_used:
+ description: Storage used (Bytes)
+ type: integer
+ updated_at:
+ description: Last updated time
+ type: string
+ web_search_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig'
+ description: Global WebSearch configuration for this workspace
+ type: object
+ github_com_Tencent_WeKnora_internal_types.TenantInvitationResponse:
+ properties:
+ accepted_count:
+ description: |-
+ AcceptedCount mirrors TenantInvitation.AcceptedCount. Surfaced
+ for share-link rows so the management UI can show "N 人已通过此
+ 链接加入"; informational only for per-user invitations.
+ type: integer
+ created_at:
+ type: string
+ expires_at:
+ type: string
+ id:
+ type: integer
+ invite_url:
+ description: |-
+ InviteURL is set on share-link rows that are still pending.
+ Composed by the handler from FrontendBaseURL + the row's plaintext
+ token, so the management UI can render a "copy link" button per
+ row without ever exposing the raw token through the JSON wire.
+ type: string
+ invited_by:
+ type: string
+ invitee_email:
+ type: string
+ invitee_name:
+ type: string
+ invitee_user_id:
+ type: string
+ inviter_email:
+ type: string
+ inviter_name:
+ type: string
+ is_share_link:
+ description: |-
+ IsShareLink is a convenience flag so the SPA doesn't have to
+ special-case "invitee_user_id == ''" everywhere when distinguishing
+ share-link rows from per-user invitations.
+ type: boolean
+ message:
+ type: string
+ responded_at:
+ type: string
+ role:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TenantRole'
+ status:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInvitationStatus'
+ tenant_id:
+ type: integer
+ tenant_name:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.TenantInvitationStatus:
+ enum:
+ - pending
+ - accepted
+ - declined
+ - revoked
+ - expired
+ type: string
+ x-enum-varnames:
+ - TenantInvitationStatusPending
+ - TenantInvitationStatusAccepted
+ - TenantInvitationStatusDeclined
+ - TenantInvitationStatusRevoked
+ - TenantInvitationStatusExpired
+ github_com_Tencent_WeKnora_internal_types.TenantInviteCandidate:
+ properties:
+ representative_avatar:
+ type: string
+ representative_email:
+ type: string
+ representative_user_id:
+ type: string
+ representative_username:
+ type: string
+ tenant_id:
type: integer
- updated_at:
- description: Last updated time
+ tenant_name:
type: string
- web_search_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig'
- description: Global WebSearch configuration for this workspace
type: object
github_com_Tencent_WeKnora_internal_types.TenantRole:
enum:
@@ -4780,9 +7510,7 @@ definitions:
type: object
github_com_Tencent_WeKnora_internal_types.ToolCallMetadata:
additionalProperties:
- items:
- type: integer
- type: array
+ type: object
type: object
github_com_Tencent_WeKnora_internal_types.ToolCallTarget:
properties:
@@ -4983,6 +7711,19 @@ definitions:
password via ChangePassword (which clears this flag).
type: boolean
type: object
+ github_com_Tencent_WeKnora_internal_types.UserResourceFavorite:
+ properties:
+ created_at:
+ type: string
+ resource_id:
+ type: string
+ resource_type:
+ type: string
+ tenant_id:
+ type: integer
+ user_id:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.VLMConfig:
properties:
api_key:
@@ -5014,6 +7755,100 @@ definitions:
Model Name
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.VectorStoreFieldInfo:
+ properties:
+ default: {}
+ description:
+ type: string
+ enum:
+ description: |-
+ Enum constrains the allowed string values. Empty means no
+ constraint. Used by fields whose value space is closed (e.g.
+ OpenSearch's knn_engine ∈ {"lucene", "faiss"}).
+ items:
+ type: string
+ type: array
+ immutable:
+ description: |-
+ Immutable marks a field whose value cannot be changed after the
+ VectorStore is first created. The UI shows the input as read-only
+ in edit mode; the backend rejects modification attempts. Used by
+ engines whose underlying index structure is fixed at create time
+ (e.g. OpenSearch's HNSW engine / M / ef_construction).
+ type: boolean
+ max:
+ type: number
+ min:
+ description: |-
+ Min / Max set inclusive bounds for "number"-typed fields. nil
+ means no bound on that side. Frontend uses these to constrain
+ inputs; backend re-validates as defense-in-depth.
+ type: number
+ name:
+ type: string
+ required:
+ type: boolean
+ sensitive:
+ type: boolean
+ type:
+ description: '"string", "number", "boolean"'
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.VectorStoreResponse:
+ properties:
+ connection_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig'
+ description: Driver-specific connection parameters (sensitive fields encrypted
+ with AES-GCM)
+ created_at:
+ description: Timestamps
+ type: string
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ engine_type:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType'
+ description: 'Engine type: postgres, elasticsearch, qdrant, milvus, weaviate,
+ sqlite'
+ id:
+ description: Unique identifier (UUID, auto-generated)
+ type: string
+ index_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig'
+ description: Optional index/collection configuration (engine-specific defaults
+ if empty)
+ name:
+ description: User-friendly name, e.g., "elasticsearch-hot"
+ type: string
+ readonly:
+ description: env stores are read-only
+ type: boolean
+ source:
+ description: '"env" or "user"'
+ type: string
+ tenant_id:
+ description: Workspace ID for scoping
+ type: integer
+ updated_at:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.VectorStoreTypeInfo:
+ properties:
+ connection_fields:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreFieldInfo'
+ type: array
+ display_name:
+ type: string
+ index_fields:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreFieldInfo'
+ type: array
+ type:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.VolumeMountConfig:
properties:
enabled:
@@ -5052,6 +7887,18 @@ definitions:
app_secret:
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.WeKnoraCloudStatusResult:
+ properties:
+ has_models:
+ description: 是否已配置 WeKnoraCloud 凭证
+ type: boolean
+ needs_reinit:
+ description: 是否需要重新初始化(凭证损坏)
+ type: boolean
+ reason:
+ description: 需要重新初始化的原因
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.WebSearchConfig:
properties:
api_key:
@@ -5091,6 +7938,38 @@ definitions:
description: 重排模型ID(用于RAG压缩)
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigField:
+ properties:
+ default:
+ type: string
+ description:
+ type: string
+ description_key:
+ type: string
+ key:
+ type: string
+ label:
+ type: string
+ label_key:
+ type: string
+ options:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigFieldOption'
+ type: array
+ required:
+ type: boolean
+ type:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigFieldOption:
+ properties:
+ label:
+ type: string
+ label_key:
+ type: string
+ value:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.WebSearchProviderEntity:
properties:
created_at:
@@ -5181,6 +8060,47 @@ definitions:
- WebSearchProviderTypeMetaso
- WebSearchProviderTypeBocha
- WebSearchProviderTypeSerply
+ github_com_Tencent_WeKnora_internal_types.WebSearchProviderTypeInfo:
+ properties:
+ config_fields:
+ description: Provider-specific non-secret configuration rendered dynamically
+ by the frontend.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderConfigField'
+ type: array
+ description:
+ description: Description
+ type: string
+ docs_url:
+ description: URL to the provider's official website or documentation for obtaining
+ credentials
+ type: string
+ id:
+ description: Provider type identifier
+ type: string
+ name:
+ description: Human-readable name
+ type: string
+ requires_api_key:
+ description: Whether the provider requires an API key
+ type: boolean
+ requires_base_url:
+ description: Whether the provider requires a user-supplied base URL (e.g.,
+ self-hosted SearXNG instance)
+ type: boolean
+ requires_engine_id:
+ description: Whether the provider requires an engine ID (e.g., Google CSE)
+ type: boolean
+ supports_optional_api_key:
+ description: |-
+ Whether the provider accepts an optional API key (keyless by default, but a
+ key unlocks higher limits — e.g. Keenable). Mutually exclusive with RequiresAPIKey.
+ type: boolean
+ supports_proxy:
+ description: Whether optional proxy_url in parameters is honored for outbound
+ requests
+ type: boolean
+ type: object
github_com_Tencent_WeKnora_internal_types.WikiConfig:
properties:
content_instructions:
@@ -5517,9 +8437,7 @@ definitions:
type: array
page_metadata:
description: Arbitrary metadata (tags, categories, dates, etc.)
- items:
- type: integer
- type: array
+ type: object
page_type:
description: 'Page type: summary, entity, concept, index, synthesis, comparison'
type: string
@@ -5659,9 +8577,7 @@ definitions:
type: array
page_metadata:
description: Arbitrary metadata (tags, categories, dates, etc.)
- items:
- type: integer
- type: array
+ type: object
page_type:
description: 'Page type: summary, entity, concept, index, synthesis, comparison'
type: string
@@ -5899,6 +8815,43 @@ definitions:
type:
type: string
type: object
+ internal_handler.AgentWriteResponse:
+ properties:
+ allowed_tools_warnings:
+ $ref: '#/definitions/internal_handler.AllowedToolsWarningsDoc'
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent'
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.AllowedToolsWarningsDoc:
+ properties:
+ dropped:
+ items:
+ type: string
+ type: array
+ kept_unknown:
+ items:
+ type: string
+ type: array
+ type: object
+ internal_handler.ApplyDefaultStorageQuotaToAllTenantsResponse:
+ properties:
+ affected:
+ type: integer
+ quota_bytes:
+ type: integer
+ quota_gb:
+ type: integer
+ type: object
+ internal_handler.AutoFixResponse:
+ properties:
+ fixed:
+ type: integer
+ message:
+ type: string
+ type: object
internal_handler.BatchDeleteKnowledgeRequest:
properties:
ids:
@@ -5922,6 +8875,14 @@ definitions:
required:
- ids
type: object
+ internal_handler.ClearResponse:
+ properties:
+ removed:
+ type: integer
+ success:
+ example: true
+ type: boolean
+ type: object
internal_handler.CopyKnowledgeBaseRequest:
properties:
source_id:
@@ -5933,6 +8894,17 @@ definitions:
required:
- source_id
type: object
+ internal_handler.CopyKnowledgeBaseResponse:
+ properties:
+ message:
+ type: string
+ source_id:
+ type: string
+ target_id:
+ type: string
+ task_id:
+ type: string
+ type: object
internal_handler.CopyModelRequest:
properties:
display_name:
@@ -5998,6 +8970,46 @@ definitions:
user:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo'
type: object
+ internal_handler.CurrentUserCapabilities:
+ properties:
+ auto_accept_invitation:
+ type: boolean
+ can_create_tenant:
+ type: boolean
+ type: object
+ internal_handler.CurrentUserData:
+ properties:
+ capabilities:
+ $ref: '#/definitions/internal_handler.CurrentUserCapabilities'
+ memberships:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Membership'
+ type: array
+ preference_defaults:
+ $ref: '#/definitions/internal_handler.PreferenceDefaults'
+ tenant:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse'
+ tenant_required:
+ type: boolean
+ user:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo'
+ type: object
+ internal_handler.DataMessageResponse:
+ properties:
+ data: {}
+ message:
+ type: string
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.DataResponse:
+ properties:
+ data: {}
+ success:
+ example: true
+ type: boolean
+ type: object
internal_handler.DeleteTagRequest:
properties:
exclude_ids:
@@ -6006,6 +9018,51 @@ definitions:
type: integer
type: array
type: object
+ internal_handler.DeploymentCapabilitiesData:
+ properties:
+ capabilities:
+ additionalProperties:
+ $ref: '#/definitions/internal_handler.DeploymentCapability'
+ type: object
+ edition:
+ type: string
+ type: object
+ internal_handler.DeploymentCapability:
+ properties:
+ reason:
+ type: string
+ supported:
+ type: boolean
+ type: object
+ internal_handler.DownloadTask:
+ properties:
+ endTime:
+ type: string
+ id:
+ type: string
+ message:
+ type: string
+ modelName:
+ type: string
+ progress:
+ type: number
+ startTime:
+ type: string
+ status:
+ description: pending, downloading, completed, failed
+ type: string
+ type: object
+ internal_handler.DuplicateKnowledgeBaseData:
+ properties:
+ knowledge_base:
+ $ref: '#/definitions/internal_handler.KnowledgeBaseView'
+ message:
+ type: string
+ source_id:
+ type: string
+ target_id:
+ type: string
+ type: object
internal_handler.EnsureMessageSuggestionsRequest:
properties:
regenerate:
@@ -6026,6 +9083,27 @@ definitions:
description: ID of rerank model to use
type: string
type: object
+ internal_handler.ExportResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem'
+ type: array
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ truncated:
+ type: boolean
+ type: object
+ internal_handler.FabriTagResponse:
+ properties:
+ tags:
+ items:
+ type: string
+ type: array
+ type: object
internal_handler.FabriTextRequest:
properties:
model_id:
@@ -6037,6 +9115,37 @@ definitions:
required:
- model_id
type: object
+ internal_handler.FabriTextResponse:
+ properties:
+ text:
+ type: string
+ type: object
+ internal_handler.FolderMoveData:
+ properties:
+ folder_path:
+ type: string
+ moved_count:
+ type: integer
+ type: object
+ internal_handler.GetAuthConfigResponse:
+ properties:
+ complex_password_enabled:
+ type: boolean
+ registration_mode:
+ type: string
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.GetDeploymentCapabilitiesResponse:
+ properties:
+ code:
+ type: integer
+ data:
+ $ref: '#/definitions/internal_handler.DeploymentCapabilitiesData'
+ msg:
+ type: string
+ type: object
internal_handler.GetStorageEngineStatusResponse:
properties:
allowed_providers:
@@ -6086,6 +9195,31 @@ definitions:
version:
type: string
type: object
+ internal_handler.HybridSearchResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult'
+ type: array
+ meta:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalMeta'
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.ImageAttrSchemaData:
+ properties:
+ attributes:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AttrSpec'
+ type: array
+ default_actions:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageActionsConfig'
+ prompt:
+ type: string
+ version:
+ type: string
+ type: object
internal_handler.InitializationRequest:
properties:
documentSplitting:
@@ -6279,55 +9413,317 @@ definitions:
embeddingModelId:
description: optional when RAG indexing is disabled
type: string
- llmModelId:
+ llmModelId:
+ type: string
+ multimodal:
+ description: 多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)
+ properties:
+ enabled:
+ type: boolean
+ type: object
+ nodeExtract:
+ description: 知识图谱配置
+ properties:
+ customInstructions:
+ type: string
+ enabled:
+ type: boolean
+ nodes:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode'
+ type: array
+ relations:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation'
+ type: array
+ tags:
+ items:
+ type: string
+ type: array
+ text:
+ type: string
+ type: object
+ questionGeneration:
+ description: 问题生成配置
+ properties:
+ customInstructions:
+ type: string
+ enabled:
+ type: boolean
+ questionCount:
+ type: integer
+ type: object
+ storageBackendId:
+ type: string
+ storageProvider:
+ description: 存储引擎选择("local" | "minio" | "cos"),影响文档上传与文档内图片存储,参数从全局设置读取
+ type: string
+ vlm_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig'
+ required:
+ - llmModelId
+ type: object
+ internal_handler.KnowledgeBaseView:
+ properties:
+ asr_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig'
+ description: ASR config (Automatic Speech Recognition)
+ auto_tag_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AutoTagConfig'
+ description: AutoTagConfig controls asynchronous association of existing tags
+ after parsing.
+ capabilities:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KBCapabilities'
+ chunk_count:
+ description: Chunk count (not stored in database, calculated on query)
+ type: integer
+ chunking_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig'
+ description: Chunking configuration
+ created_at:
+ description: Creation time of the knowledge base
+ type: string
+ creator_id:
+ description: |-
+ CreatorID records the user ID of whoever originally created the KB.
+ Used by the workspace-level RBAC middleware to let Contributors edit
+ their own KBs without granting them access to everyone else's.
+ Nullable for backward compatibility with rows created before the
+ RBAC migration backfilled the column to the workspace Owner.
+ type: string
+ creator_name:
+ description: |-
+ CreatorName 是 CreatorID 对应用户的展示名(username / email 等),
+ 仅在列表场景由 handler 批量回填,不落库;为空表示创建者无法解析(用户已删除、
+ CreatorID 为空的老数据等)。前端用它在卡片来源徽章上做 mine vs workspace 的二分。
+ type: string
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time of the knowledge base
+ description:
+ description: Description of the knowledge base
+ type: string
+ embedding_model_id:
+ description: ID of the embedding model
+ type: string
+ extract_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig'
+ description: Extract config
+ faq_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig'
+ description: FAQConfig stores FAQ specific configuration such as indexing
+ strategy
+ generated_profile:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile'
+ description: |-
+ GeneratedProfile is the machine-generated description: a gist, merged
+ topics, typical questions and the aggregate snapshot they came from. It
+ never overwrites the user-authored Description; both are shown to agents.
+ id:
+ description: Unique identifier of the knowledge base
+ type: string
+ image_processing_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig'
+ description: Image processing configuration
+ indexing_strategy:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy'
+ description: |-
+ IndexingStrategy controls which indexing pipelines are active for this knowledge base.
+ Pipelines: vector search, keyword search, wiki generation, knowledge graph extraction.
+ is_pinned:
+ description: |-
+ IsPinned and PinnedAt are computed per-caller from user_kb_pins
+ (see migration 000050). They used to be stored on the row itself,
+ which made pinning a workspace-wide ordering decision gated behind
+ the kb-edit RBAC guard. The columns are still present in legacy
+ schemas for rollback safety but are no longer read or written by
+ the application — both fields are tagged `gorm:"-"` so GORM
+ ignores them on every CRUD call and the list handler stamps them
+ after enriching with the caller's pin set.
+ type: boolean
+ is_processing:
+ description: IsProcessing indicates if there is a processing import task (for
+ FAQ type knowledge bases)
+ type: boolean
+ is_temporary:
+ description: Whether this knowledge base is temporary (ephemeral) and should
+ be hidden from UI
+ type: boolean
+ knowledge_count:
+ description: Knowledge count (not stored in database, calculated on query)
+ type: integer
+ my_permission:
+ description: |-
+ MyPermission is the caller's role on a knowledge base shared from
+ another workspace; GET /knowledge-bases/{id} sets it.
+ enum:
+ - admin
+ - editor
+ - viewer
+ type: string
+ name:
+ description: Name of the knowledge base
+ type: string
+ pinned_at:
+ description: |-
+ PinnedAt records when the current caller pinned this knowledge
+ base; nil when they have not.
+ type: string
+ processing_count:
+ description: ProcessingCount indicates the number of knowledge items being
+ processed (for document type knowledge bases)
+ type: integer
+ profile_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfileConfig'
+ description: |-
+ ProfileConfig controls automatic generation of the knowledge-base
+ description from per-document profiles (document knowledge bases only).
+ question_generation_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig'
+ description: QuestionGenerationConfig stores question generation configuration
+ for document knowledge bases
+ share_count:
+ description: ShareCount indicates the number of organizations this knowledge
+ base is shared with (not stored in database)
+ type: integer
+ storage_backend_id:
+ description: |-
+ StorageBackendID binds this KB to one concrete storage instance. The
+ legacy provider field remains readable during migration only.
+ type: string
+ storage_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig'
+ description: 'Deprecated: legacy COS config column. Kept for backward compatibility
+ with old data.'
+ storage_provider_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig'
+ description: 'Storage provider config (new): only stores provider selection;
+ credentials from workspace StorageEngineConfig'
+ summary_model_id:
+ description: Summary model ID
+ type: string
+ tenant_id:
+ description: Workspace ID
+ type: integer
+ type:
+ description: Type of the knowledge base (document, faq, etc.)
+ type: string
+ updated_at:
+ description: Last updated time of the knowledge base
+ type: string
+ vector_store_engine_type:
+ type: string
+ vector_store_id:
+ description: |-
+ VectorStoreID references the VectorStore this knowledge base is bound to.
+ When nil, the KB falls back to the workspace's effective engines derived from
+ the RETRIEVE_DRIVER environment variable (env store flow).
+ This field is set once at creation time and must not be modified afterwards;
+ enforcement lives at the GORM layer (`<-:create`) plus the service-layer
+ KB update path, which omits this field from its update DTO.
+ type: string
+ vector_store_name:
type: string
- multimodal:
- description: 多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)
- properties:
- enabled:
- type: boolean
- type: object
- nodeExtract:
- description: 知识图谱配置
- properties:
- customInstructions:
- type: string
- enabled:
- type: boolean
- nodes:
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode'
- type: array
- relations:
- items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation'
- type: array
- tags:
- items:
- type: string
- type: array
- text:
- type: string
- type: object
- questionGeneration:
- description: 问题生成配置
- properties:
- customInstructions:
- type: string
- enabled:
- type: boolean
- questionCount:
- type: integer
- type: object
- storageBackendId:
+ vector_store_source:
type: string
- storageProvider:
- description: 存储引擎选择("local" | "minio" | "cos"),影响文档上传与文档内图片存储,参数从全局设置读取
+ vector_store_status:
type: string
vlm_config:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig'
- required:
- - llmModelId
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig'
+ description: VLM config
+ wiki_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig'
+ description: WikiConfig stores wiki-specific configuration (only for wiki
+ type knowledge bases)
+ type: object
+ internal_handler.KnowledgeSearchKnowledgeResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ type: array
+ has_more:
+ type: boolean
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
+ internal_handler.KnowledgeSpanError:
+ properties:
+ code:
+ type: string
+ error_code:
+ type: string
+ error_message:
+ type: string
+ finished_at:
+ type: string
+ message:
+ type: string
+ name:
+ type: string
+ stage:
+ type: string
+ type: object
+ internal_handler.KnowledgeSpansData:
+ properties:
+ attempt:
+ description: Attempt is the attempt the trace describes; equals CurrentAttempt.
+ type: integer
+ current_attempt:
+ type: integer
+ current_stage:
+ description: CurrentStage is the stage running now, or the last one that ran.
+ type: string
+ knowledge_id:
+ type: string
+ last_activity_at:
+ description: LastActivityAt is set while the parse is in flight.
+ type: string
+ last_error:
+ $ref: '#/definitions/internal_handler.KnowledgeSpanError'
+ latest_attempt:
+ type: integer
+ parse_status:
+ type: string
+ stall_state:
+ description: |-
+ StallState is types.StallStateQueued or types.StallStateStalled when an
+ in-flight parse has gone quiet.
+ type: string
+ trace:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SpanTreeNode'
+ type: object
+ internal_handler.ListAgentsResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent'
+ type: array
+ disabled_own_agent_ids:
+ items:
+ type: string
+ type: array
+ success:
+ example: true
+ type: boolean
type: object
internal_handler.ListAllUsersResponse:
properties:
@@ -6339,17 +9735,241 @@ definitions:
type: integer
users:
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo'
+ type: array
+ type: object
+ internal_handler.ListDocumentsResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryDocView'
+ type: array
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
+ internal_handler.ListItemsResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem'
+ type: array
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
+ internal_handler.ListOrganizationSharedAgentsResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationSharedAgentItem'
+ type: array
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
+ internal_handler.ListOrganizationSharedKnowledgeBasesResponse:
+ properties:
+ data:
+ items:
+ additionalProperties: {}
+ type: object
+ type: array
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
+ internal_handler.ListParserEnginesResponse:
+ properties:
+ code:
+ type: integer
+ connected:
+ type: boolean
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineInfo'
+ type: array
+ docreader_addr:
+ type: string
+ docreader_transport:
+ type: string
+ msg:
+ type: string
+ type: object
+ internal_handler.ListResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend'
+ type: array
+ default_storage_backend_id:
+ type: string
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.ListSharedAgentsResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SharedAgentInfo'
+ type: array
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
+ internal_handler.ListSharedKnowledgeBasesResponse:
+ properties:
+ data:
+ items:
+ additionalProperties: {}
+ type: object
+ type: array
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
+ internal_handler.ListSkillsResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/internal_handler.SkillInfoResponse'
+ type: array
+ skills_available:
+ type: boolean
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.ListSystemAdminsResponse:
+ properties:
+ admins:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo'
+ type: array
+ total:
+ type: integer
+ type: object
+ internal_handler.ListTopicsResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryTopicView'
+ type: array
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
+ internal_handler.MessageResponse:
+ properties:
+ message:
+ type: string
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.ModelCatalogEntryDTO:
+ properties:
+ api:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.API'
+ context_window:
+ type: integer
+ cost:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models.ModelCost'
+ dimension:
+ type: integer
+ id:
+ type: string
+ input:
+ items:
+ type: string
+ type: array
+ max_output_tokens:
+ type: integer
+ name:
+ type: string
+ reasoning:
+ type: boolean
+ source:
+ description: |-
+ Source is the vendor page these facts were read from, so the editor can
+ send an operator to the documentation for this exact model.
+ type: string
+ thinking_levels:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort'
+ type: array
+ type:
+ type: string
+ type: object
+ internal_handler.ModelProviderDTO:
+ properties:
+ api:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.API'
+ auth:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_providers.AuthStyle'
+ credentialLabels:
+ description: |-
+ CredentialLabels rename the primary credential input for the model
+ types that do not take a plain API key (signed rerank APIs).
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_providers.CredentialLabel'
+ type: array
+ defaultUrls:
+ additionalProperties:
+ type: string
+ type: object
+ description:
+ type: string
+ descriptions:
+ additionalProperties:
+ type: string
+ type: object
+ extraFields:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_providers.ExtraField'
type: array
- type: object
- internal_handler.ListSystemAdminsResponse:
- properties:
- admins:
+ icon:
+ description: 'Icon is a data: URI (image/svg+xml;base64) ready for <img src>.'
+ type: string
+ label:
+ type: string
+ labels:
+ additionalProperties:
+ type: string
+ type: object
+ modelTypes:
items:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo'
+ type: string
type: array
- total:
+ models:
+ items:
+ $ref: '#/definitions/internal_handler.ModelCatalogEntryDTO'
+ type: array
+ order:
type: integer
+ requiresAuth:
+ type: boolean
+ thinking:
+ $ref: '#/definitions/internal_handler.ProviderThinkingDTO'
+ value:
+ type: string
+ website:
+ type: string
type: object
internal_handler.ModelTestRequest:
properties:
@@ -6450,6 +10070,55 @@ definitions:
- kb_id
- knowledge_ids
type: object
+ internal_handler.PageResponse:
+ properties:
+ data: {}
+ page:
+ type: integer
+ page_size:
+ type: integer
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
+ internal_handler.PlaceholderGroups:
+ properties:
+ agent_system_prompt:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder'
+ type: array
+ all:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder'
+ type: array
+ context_template:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder'
+ type: array
+ fallback_prompt:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder'
+ type: array
+ rewrite_prompt:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder'
+ type: array
+ rewrite_system_prompt:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder'
+ type: array
+ system_prompt:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PromptPlaceholder'
+ type: array
+ type: object
+ internal_handler.PreferenceDefaults:
+ properties:
+ browser_search_instructions:
+ type: string
+ type: object
internal_handler.PreviewChunkResult:
properties:
content:
@@ -6545,6 +10214,35 @@ definitions:
user_id:
type: string
type: object
+ internal_handler.ProviderThinkingDTO:
+ properties:
+ format:
+ type: string
+ levels:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_api.ReasoningEffort'
+ type: array
+ type: object
+ internal_handler.PurgeArchivedRuntimeTasksResponse:
+ properties:
+ deleted:
+ type: integer
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.RefreshTokenResponse:
+ properties:
+ access_token:
+ type: string
+ message:
+ type: string
+ refresh_token:
+ type: string
+ success:
+ example: true
+ type: boolean
+ type: object
internal_handler.RemoteModelCheckRequest:
properties:
apiKey:
@@ -6601,6 +10299,14 @@ definitions:
- from
- to
type: object
+ internal_handler.ReparseKnowledgeRequest:
+ properties:
+ process_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeProcessOverrides'
+ description: ProcessConfig overrides the processing options stored at upload
+ time.
+ type: object
internal_handler.ResetUserPasswordRequest:
properties:
email:
@@ -6611,6 +10317,11 @@ definitions:
- email
- new_password
type: object
+ internal_handler.ResetUserPasswordResponse:
+ properties:
+ message:
+ type: string
+ type: object
internal_handler.RevokeSystemAdminRequest:
properties:
user_id:
@@ -6755,6 +10466,18 @@ definitions:
required:
- query
type: object
+ internal_handler.SearchOrganizationsResponse:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchableOrganizationItem'
+ type: array
+ success:
+ example: true
+ type: boolean
+ total:
+ type: integer
+ type: object
internal_handler.SearchWikiRequest:
properties:
knowledge_base_id:
@@ -6780,6 +10503,22 @@ definitions:
- is_active
- user_id
type: object
+ internal_handler.SetUserStatusResponse:
+ properties:
+ is_active:
+ type: boolean
+ message:
+ type: string
+ user:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo'
+ type: object
+ internal_handler.SkillInfoResponse:
+ properties:
+ description:
+ type: string
+ name:
+ type: string
+ type: object
internal_handler.StorageCheckRequest:
properties:
cos:
@@ -6823,6 +10562,46 @@ definitions:
description: '"local", "minio", "cos", "tos", "s3", "oss", "ks3", "obs"'
type: string
type: object
+ internal_handler.SubmittedTaskData:
+ properties:
+ deleted_count:
+ type: integer
+ reparse_count:
+ type: integer
+ task_id:
+ type: string
+ type: object
+ internal_handler.SubmittedTaskResponse:
+ properties:
+ data:
+ $ref: '#/definitions/internal_handler.SubmittedTaskData'
+ message:
+ type: string
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.SuccessErrorResponse:
+ properties:
+ error:
+ type: string
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.SuccessResponse:
+ properties:
+ success:
+ example: true
+ type: boolean
+ type: object
+ internal_handler.SuggestedQuestionsData:
+ properties:
+ questions:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestedQuestion'
+ type: array
+ type: object
internal_handler.SuggestionEventRequest:
properties:
event_type:
@@ -6835,6 +10614,31 @@ definitions:
- event_type
- suggestion_set_id
type: object
+ internal_handler.TaskIDData:
+ properties:
+ task_id:
+ type: string
+ type: object
+ internal_handler.TenantListData:
+ properties:
+ items:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse'
+ type: array
+ type: object
+ internal_handler.TenantSearchData:
+ properties:
+ items:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse'
+ type: array
+ page:
+ type: integer
+ page_size:
+ type: integer
+ total:
+ type: integer
+ type: object
internal_handler.TestProviderRequest:
properties:
parameters:
@@ -6844,6 +10648,26 @@ definitions:
required:
- provider
type: object
+ internal_handler.TestStoreByIDResponse:
+ properties:
+ error:
+ type: string
+ success:
+ example: true
+ type: boolean
+ version:
+ type: string
+ type: object
+ internal_handler.TestStoreRawResponse:
+ properties:
+ error:
+ type: string
+ success:
+ example: true
+ type: boolean
+ version:
+ type: string
+ type: object
internal_handler.TestStoreRequest:
properties:
connection_config:
@@ -6869,6 +10693,17 @@ definitions:
- tags
- text
type: object
+ internal_handler.TextRelationExtractionResponse:
+ properties:
+ 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
+ type: object
internal_handler.UpdateAgentRequest:
properties:
avatar:
@@ -6894,6 +10729,23 @@ definitions:
is_enabled:
type: boolean
type: object
+ internal_handler.UpdateChunkResponse:
+ properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Chunk'
+ description:
+ type: string
+ success:
+ example: true
+ type: boolean
+ summary_status:
+ type: string
+ type: object
+ internal_handler.UpdateIMChannelResponse:
+ properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_im.IMChannel'
+ type: object
internal_handler.UpdateKnowledgeBaseRequest:
properties:
config:
@@ -6915,14 +10767,22 @@ definitions:
internal_handler.UpdateKnowledgeRequest:
properties:
custom_metadata:
- items:
- type: integer
- type: array
+ type: object
description:
type: string
title:
type: string
type: object
+ internal_handler.UpdateKnowledgeResponse:
+ properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ message:
+ type: string
+ success:
+ example: true
+ type: boolean
+ type: object
internal_handler.UpdateModelRequest:
properties:
description:
@@ -6946,23 +10806,64 @@ definitions:
type: boolean
name:
type: string
- parameters:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters'
- type: object
- internal_handler.UpdateStoreRequest:
- properties:
- name:
+ parameters:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderParameters'
+ type: object
+ internal_handler.UpdateStoreRequest:
+ properties:
+ name:
+ type: string
+ required:
+ - name
+ type: object
+ internal_handler.UpdateSystemSettingRequest:
+ properties:
+ value:
+ description: |-
+ Value is intentionally `any` (decoded as float64 / string / bool /
+ etc. by the JSON unmarshaller). Service.encodeForType normalises
+ these against the registry's declared type and rejects mismatches.
+ type: object
+ internal_handler.ValidateTokenResponse:
+ properties:
+ message:
+ type: string
+ success:
+ example: true
+ type: boolean
+ user:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo'
+ type: object
+ internal_handler.WikiErrorResponse:
+ properties:
+ error:
+ type: string
+ type: object
+ internal_handler.WikiMessageResponse:
+ properties:
+ message:
+ type: string
+ type: object
+ internal_handler.WikiSearchHit:
+ properties:
+ aliases:
+ items:
+ type: string
+ type: array
+ id:
+ type: string
+ knowledge_base_id:
+ type: string
+ match_snippet:
+ type: string
+ page_type:
+ type: string
+ slug:
+ type: string
+ summary:
+ type: string
+ title:
type: string
- required:
- - name
- type: object
- internal_handler.UpdateSystemSettingRequest:
- properties:
- value:
- description: |-
- Value is intentionally `any` (decoded as float64 / string / bool /
- etc. by the JSON unmarshaller). Service.encodeForType normalises
- these against the registry's declared type and rejects mismatches.
type: object
internal_handler.acceptInvitationByTokenRequest:
properties:
@@ -7004,6 +10905,22 @@ definitions:
signed_token_header_name:
type: string
type: object
+ internal_handler.apiPrincipalConfigResponse:
+ properties:
+ direct_header_name:
+ type: string
+ has_hmac_secret:
+ description: |-
+ HasHMACSecret reports whether a signing secret is configured. The
+ plaintext secret is NEVER returned — clients only learn presence.
+ type: boolean
+ mode:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.APIPrincipalMode'
+ require_direct_header:
+ type: boolean
+ signed_token_header_name:
+ type: string
+ type: object
internal_handler.apiPrincipalTestTokenRequest:
properties:
expires_in_seconds:
@@ -7011,6 +10928,19 @@ definitions:
external_user_id:
type: string
type: object
+ internal_handler.apiPrincipalTestTokenResponse:
+ properties:
+ expires_at_unix:
+ type: integer
+ expires_in_seconds:
+ type: integer
+ external_user_id:
+ type: string
+ header_name:
+ type: string
+ token:
+ type: string
+ type: object
internal_handler.auditLogListResponse:
properties:
data:
@@ -7018,6 +10948,8 @@ definitions:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AuditLog'
type: array
next_cursor:
+ description: NextCursor is the id of the last entry on this page, 0 when it
+ is empty.
type: integer
success:
type: boolean
@@ -7188,6 +11120,34 @@ definitions:
required:
- name
type: object
+ internal_handler.sandboxConfigResponse:
+ properties:
+ config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TenantSandboxConfig'
+ created_at:
+ type: string
+ description:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ sandbox_type:
+ type: string
+ updated_at:
+ type: string
+ type: object
+ internal_handler.skillEnvResponse:
+ properties:
+ description:
+ type: string
+ is_set:
+ type: boolean
+ name:
+ type: string
+ required:
+ type: boolean
+ type: object
internal_handler.skillPatchRequest:
properties:
enabled:
@@ -7204,6 +11164,45 @@ definitions:
the second must leave every stored value alone.
type: object
type: object
+ internal_handler.skillResponse:
+ properties:
+ bundle_sha256:
+ type: string
+ created_at:
+ type: string
+ description:
+ type: string
+ enabled:
+ type: boolean
+ envs:
+ items:
+ $ref: '#/definitions/internal_handler.skillEnvResponse'
+ type: array
+ error:
+ type: string
+ id:
+ type: string
+ install_message_id:
+ type: string
+ install_session_id:
+ type: string
+ installed_snapshot_id:
+ type: string
+ name:
+ type: string
+ served:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillServedInfo'
+ description: |-
+ Served is the previous version that keeps running while this install
+ is in flight or after it failed.
+ status:
+ type: string
+ updated_at:
+ type: string
+ version:
+ type: string
+ type: object
internal_handler.skillSourceRequest:
properties:
source:
@@ -7229,6 +11228,62 @@ definitions:
- name
- provider
type: object
+ internal_handler.tenantAPIKeyCreateResponse:
+ properties:
+ api_key:
+ type: string
+ capabilities:
+ items:
+ type: string
+ type: array
+ created_at:
+ type: string
+ expires_at:
+ type: string
+ full_access:
+ type: boolean
+ id:
+ type: integer
+ knowledge_base_ids:
+ items:
+ type: string
+ type: array
+ last_used_at:
+ type: string
+ name:
+ type: string
+ scope_type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.APIKeyScopeType'
+ token:
+ type: string
+ type: object
+ internal_handler.tenantAPIKeyResponse:
+ properties:
+ api_key:
+ type: string
+ capabilities:
+ items:
+ type: string
+ type: array
+ created_at:
+ type: string
+ expires_at:
+ type: string
+ full_access:
+ type: boolean
+ id:
+ type: integer
+ knowledge_base_ids:
+ items:
+ type: string
+ type: array
+ last_used_at:
+ type: string
+ name:
+ type: string
+ scope_type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.APIKeyScopeType'
+ type: object
internal_handler.updateLastFAQImportResultDisplayStatusRequest:
properties:
display_status:
@@ -7579,10 +11634,9 @@ paths:
- text/event-stream
responses:
"200":
- description: 问答结果(SSE流)
+ description: SSE 事件流
schema:
- additionalProperties: true
- type: object
+ type: string
"400":
description: 请求参数错误
schema:
@@ -7617,8 +11671,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: Bad Request
schema:
@@ -7647,8 +11700,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"404":
description: Not Found
schema:
@@ -7658,6 +11710,51 @@ paths:
summary: 跳过对话内 MCP OAuth 授权
tags:
- MCP服务
+ /agent/prompts/{prompt_id}:
+ post:
+ consumes:
+ - application/json
+ description: |-
+ 回答 Agent 运行中发起的交互(ask_user 提问或工具审批)。
+ kind 须与交互一致,response 为该类型的回答 JSON(不接受未知字段):
+ ask_user 为 {selected?, values?, text?, declined?};
+ tool_approval 为 {approved: bool, modified_args?: object, reason?: string}。
+ 返回 resumed=true 表示运行已挂起并在本次回答后恢复,客户端需重新接入该消息的事件流
+ parameters:
+ - description: 交互 ID(事件中的 pending_id)
+ in: path
+ name: prompt_id
+ required: true
+ type: string
+ - description: '{kind: \'
+ in: body
+ name: request
+ required: true
+ schema:
+ additionalProperties: true
+ type: object
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: '{success: true, resumed: bool}'
+ 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: 回答 Agent 的交互请求
+ tags:
+ - Agent
/agent/tool-approvals/{pending_id}:
post:
consumes:
@@ -7703,14 +11800,21 @@ paths:
consumes:
- application/json
description: 获取当前空间的所有智能体(包括内置智能体)
+ parameters:
+ - description: 创建者过滤,仅 mine 与 others 生效
+ enum:
+ - mine
+ - others
+ in: query
+ name: creator
+ type: string
produces:
- application/json
responses:
"200":
description: 智能体列表
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListAgentsResponse'
"500":
description: 服务器错误
schema:
@@ -7738,8 +11842,7 @@ paths:
"201":
description: 创建的智能体
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.AgentWriteResponse'
"400":
description: 请求参数错误
schema:
@@ -7767,8 +11870,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -7803,8 +11905,12 @@ paths:
"200":
description: 智能体详情
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -7841,8 +11947,7 @@ paths:
"200":
description: 更新后的智能体
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.AgentWriteResponse'
"400":
description: 请求参数错误
schema:
@@ -7874,8 +11979,12 @@ paths:
"201":
description: 复制成功
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgent'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -7910,8 +12019,7 @@ paths:
"200":
description: 'success: true'
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"403":
description: 无权限
schema:
@@ -7955,8 +12063,12 @@ paths:
"200":
description: 推荐问题列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.SuggestedQuestionsData'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -7982,8 +12094,12 @@ paths:
"200":
description: 占位符定义
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.PlaceholderGroups'
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8001,8 +12117,12 @@ paths:
"200":
description: 工具目录
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_agent_tools.AgentToolCatalog'
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8021,8 +12141,14 @@ paths:
"200":
description: 预设列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetEntry'
+ type: array
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8144,8 +12270,7 @@ paths:
"200":
description: 修改成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -8166,8 +12291,7 @@ paths:
"200":
description: 认证配置
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.GetAuthConfigResponse'
summary: 获取认证配置
tags:
- 认证
@@ -8237,8 +12361,7 @@ paths:
"200":
description: 登出成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -8259,8 +12382,12 @@ paths:
"200":
description: 用户信息
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.CurrentUserData'
+ type: object
"401":
description: 未授权
schema:
@@ -8290,8 +12417,12 @@ paths:
"200":
description: 更新后的偏好
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserPreferences'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -8408,8 +12539,7 @@ paths:
"200":
description: 新令牌
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.RefreshTokenResponse'
"401":
description: 令牌无效
schema:
@@ -8538,8 +12668,7 @@ paths:
"200":
description: 令牌有效
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ValidateTokenResponse'
"401":
description: 令牌无效
schema:
@@ -8606,8 +12735,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -8621,7 +12749,10 @@ paths:
get:
consumes:
- application/json
- description: 获取指定知识下的所有分块列表,支持分页
+ description: |-
+ 获取指定知识下的所有分块列表,支持分页。chunk_type 可重复,缺省 text
+ 取值 text, parent_text, image_ocr, image_caption, image_vector, summary, entity,
+ relationship, faq, web_search, table_summary, table_column, wiki_page
parameters:
- description: 知识ID
in: path
@@ -8631,21 +12762,37 @@ paths:
- default: 1
description: 页码
in: query
+ minimum: 1
name: page
type: integer
- default: 10
description: 每页数量
in: query
+ maximum: 100
+ minimum: 1
name: page_size
type: integer
+ - collectionFormat: multi
+ description: 分块类型,可重复,缺省 text
+ in: query
+ items:
+ type: string
+ name: chunk_type
+ type: array
produces:
- application/json
responses:
"200":
description: 分块列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.PageResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Chunk'
+ type: array
+ type: object
"400":
description: 请求参数错误
schema:
@@ -8678,8 +12825,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -8721,8 +12867,7 @@ paths:
"200":
description: 更新后的分块
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.UpdateChunkResponse'
"400":
description: 请求参数错误
schema:
@@ -8754,8 +12899,12 @@ paths:
"200":
description: 分块详情
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Chunk'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -8796,8 +12945,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -9235,8 +13383,12 @@ paths:
"200":
description: 评估结果
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationDetail'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -9264,8 +13416,12 @@ paths:
"200":
description: 评估任务
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationDetail'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -9293,8 +13449,12 @@ paths:
"200":
description: 导入进度
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQImportProgress'
+ type: object
"404":
description: 任务不存在
schema:
@@ -9320,8 +13480,7 @@ paths:
"200":
description: 'success: true'
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: 请求参数错误
schema:
@@ -9361,8 +13520,7 @@ paths:
"200":
description: 更新后的渠道
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.UpdateIMChannelResponse'
"400":
description: 请求参数错误
schema:
@@ -9394,8 +13552,7 @@ paths:
"200":
description: 更新后的渠道
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.UpdateIMChannelResponse'
"400":
description: 请求参数错误
schema:
@@ -9475,6 +13632,27 @@ paths:
summary: IM 平台回调
tags:
- IM 回调
+ /image-attrs/schema:
+ get:
+ description: 返回当前版本的图片属性注册表、提示词版本和默认动作。全局只读,不绑定知识库。
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.ImageAttrSchemaData'
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取图片属性字典
+ tags:
+ - 知识库
/initialization/asr/check:
post:
consumes:
@@ -9556,8 +13734,7 @@ paths:
"200":
description: 更新成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -9613,8 +13790,12 @@ paths:
"200":
description: 生成的标签
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.FabriTagResponse'
+ type: object
summary: 生成随机标签
tags:
- 初始化
@@ -9636,8 +13817,12 @@ paths:
"200":
description: 生成的文本
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.FabriTextResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -9666,8 +13851,12 @@ paths:
"200":
description: 提取结果
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.TextRelationExtractionResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -9782,8 +13971,12 @@ paths:
"200":
description: 下载进度
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.DownloadTask'
+ type: object
"404":
description: 任务不存在
schema:
@@ -9805,8 +13998,14 @@ paths:
"200":
description: 任务列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/internal_handler.DownloadTask'
+ type: array
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -9990,14 +14189,31 @@ paths:
in: query
name: agent_id
type: string
+ - description: 按创建者过滤,仅 mine 与 others 生效
+ enum:
+ - mine
+ - others
+ in: query
+ name: creator
+ type: string
produces:
- application/json
responses:
"200":
description: 知识库列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/internal_handler.KnowledgeBaseView'
+ type: array
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"500":
description: 服务器错误
schema:
@@ -10025,12 +14241,20 @@ paths:
"201":
description: 创建的知识库
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.KnowledgeBaseView'
+ type: object
"400":
description: 请求参数错误
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "500":
+ description: 服务器错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -10054,12 +14278,19 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ 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: []
@@ -10086,12 +14317,20 @@ paths:
"200":
description: 知识库详情
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.KnowledgeBaseView'
+ 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'
"404":
description: 知识库不存在
schema:
@@ -10124,12 +14363,24 @@ paths:
"200":
description: 更新后的知识库
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.KnowledgeBaseView'
+ 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'
+ "404":
+ description: 知识库不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -10138,7 +14389,9 @@ paths:
- 知识库
/knowledge-bases/{id}/activity:
get:
- description: 返回知识库的重要变更与后台任务入口。仅知识库创建者或所属空间管理员可读,共享空间不可读。
+ description: |-
+ 返回知识库的重要变更与后台任务入口。仅知识库创建者或所属空间管理员可读,共享空间不可读。
+ 按 id 倒序;把 next_cursor 作为 after_id 取下一页,返回空列表表示没有更多。
parameters:
- description: 知识库ID
in: path
@@ -10149,15 +14402,25 @@ paths:
in: query
name: after_id
type: integer
- - description: 页大小,1-100,默认 50
+ - default: 50
+ description: 页大小
in: query
+ maximum: 100
+ minimum: 1
name: limit
type: integer
- - description: 按 action 精确过滤
+ - description: 按 action 精确过滤,如 knowledge.deleted
in: query
name: action
type: string
- - description: 按 outcome 精确过滤
+ - description: 结果过滤
+ enum:
+ - success
+ - accepted
+ - partial
+ - failed
+ - denied
+ - canceled
in: query
name: outcome
type: string
@@ -10173,7 +14436,11 @@ paths:
schema:
$ref: '#/definitions/internal_handler.auditLogListResponse'
"403":
- description: Forbidden
+ description: 非创建者或管理员,或知识库来自其他空间
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 知识库不存在
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
@@ -10198,12 +14465,24 @@ paths:
"201":
description: 创建后的知识库副本
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.DuplicateKnowledgeBaseData'
+ 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'
+ "404":
+ description: 知识库不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 创建知识库副本
@@ -10237,8 +14516,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: 请求参数错误
schema:
@@ -10298,8 +14576,12 @@ paths:
"200":
description: FAQ列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PageResult'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -10335,8 +14617,12 @@ paths:
"200":
description: 任务ID
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.TaskIDData'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -10369,8 +14655,12 @@ paths:
"200":
description: FAQ条目详情
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -10412,8 +14702,12 @@ paths:
"200":
description: 更新成功
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -10452,8 +14746,12 @@ paths:
"200":
description: 更新后的FAQ条目
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -10524,8 +14822,7 @@ paths:
"200":
description: 更新成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: 请求参数错误
schema:
@@ -10559,8 +14856,7 @@ paths:
"200":
description: 更新成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: 请求参数错误
schema:
@@ -10594,8 +14890,12 @@ paths:
"200":
description: 创建的FAQ条目
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -10629,8 +14929,7 @@ paths:
"200":
description: 更新成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: 请求参数错误
schema:
@@ -10668,8 +14967,14 @@ paths:
"200":
description: 搜索结果
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntry'
+ type: array
+ type: object
"400":
description: 请求参数错误
schema:
@@ -10712,12 +15017,15 @@ paths:
"200":
description: 搜索结果
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.HybridSearchResponse'
"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: []
@@ -10755,12 +15063,15 @@ paths:
"200":
description: 搜索结果
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.HybridSearchResponse'
"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: []
@@ -10824,8 +15135,14 @@ paths:
"200":
description: 图片资产分页列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.PageResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAsset'
+ type: array
+ type: object
"400":
description: 请求参数错误
schema:
@@ -10858,8 +15175,14 @@ paths:
"200":
description: 图片资产分页列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.PageResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageAsset'
+ type: array
+ type: object
"400":
description: 请求参数错误
schema:
@@ -10887,8 +15210,7 @@ paths:
"200":
description: 清空任务已提交
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SubmittedTaskResponse'
"400":
description: 请求参数错误
schema:
@@ -10906,19 +15228,26 @@ paths:
get:
consumes:
- application/json
- description: 获取知识库下的知识列表,支持分页和筛选
+ description: |-
+ 获取知识库下的知识列表,支持分页和筛选
+ 不传 parse_status 时不返回删除中(deleting)的文档。
parameters:
- description: 知识库ID
in: path
name: id
required: true
type: string
- - description: 页码
+ - default: 1
+ description: 页码
in: query
+ minimum: 1
name: page
type: integer
- - description: 每页数量
+ - default: 20
+ description: 每页数量
in: query
+ maximum: 1000
+ minimum: 1
name: page_size
type: integer
- description: 标签ID筛选,逗号分隔(OR语义)
@@ -10933,7 +15262,15 @@ paths:
in: query
name: file_type
type: string
- - description: 解析状态筛选 (pending/processing/completed/failed)
+ - description: 状态
+ enum:
+ - pending
+ - processing
+ - finalizing
+ - completed
+ - failed
+ - cancelled
+ - deleting
in: query
name: parse_status
type: string
@@ -10958,11 +15295,20 @@ paths:
in: query
name: folder_recursive
type: boolean
- - description: '排序字段: updated_at/created_at/file_name,默认 created_at'
+ - default: created_at
+ description: 排序字段
+ enum:
+ - created_at
+ - updated_at
+ - file_name
in: query
name: sort_by
type: string
- - description: '排序方向: asc/desc,默认 desc'
+ - default: desc
+ description: 排序方向
+ enum:
+ - asc
+ - desc
in: query
name: sort_order
type: string
@@ -10972,12 +15318,22 @@ paths:
"200":
description: 知识列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.PageResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ type: array
+ 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: []
- ApiKeyAuth: []
@@ -11080,8 +15436,12 @@ paths:
"200":
description: 创建的知识
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -11114,8 +15474,12 @@ paths:
"200":
description: 目录树
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeFolderTree'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -11148,8 +15512,12 @@ paths:
"200":
description: 重命名成功
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.FolderMoveData'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -11187,8 +15555,12 @@ paths:
"200":
description: 创建的知识
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -11237,8 +15609,12 @@ paths:
"201":
description: 创建的知识
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -11269,12 +15645,26 @@ paths:
"200":
description: 可移动目标列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase'
+ type: array
+ type: object
"400":
description: 请求参数错误
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "401":
+ description: 未认证
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ description: 无权限
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 知识库不存在
schema:
@@ -11302,12 +15692,24 @@ paths:
"200":
description: 更新后的知识库
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.KnowledgeBaseView'
+ 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'
+ "500":
+ description: 服务器错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -11329,12 +15731,24 @@ paths:
"200":
description: 生成的知识库画像
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseProfile'
+ 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'
+ "404":
+ description: 知识库不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -11384,8 +15798,12 @@ paths:
"201":
description: Created
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare'
+ type: object
"403":
description: Forbidden
schema:
@@ -11413,8 +15831,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"403":
description: Forbidden
schema:
@@ -11451,8 +15868,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"403":
description: Forbidden
schema:
@@ -11491,8 +15907,12 @@ paths:
"200":
description: 标签列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.PageResult'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -11532,8 +15952,12 @@ paths:
"200":
description: 创建的标签
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeTag'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -11579,8 +16003,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: 请求参数错误
schema:
@@ -11618,8 +16041,12 @@ paths:
"200":
description: 更新后的标签
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeTag'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -11648,12 +16075,24 @@ paths:
"200":
description: 任务ID
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.CopyKnowledgeBaseResponse'
+ type: object
"400":
description: 请求参数错误
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "401":
+ 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: []
@@ -11677,8 +16116,16 @@ paths:
"200":
description: 进度信息
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KBCloneProgress'
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 任务不存在
schema:
@@ -11718,10 +16165,9 @@ paths:
- text/event-stream
responses:
"200":
- description: 问答结果(SSE流)
+ description: SSE 事件流
schema:
- additionalProperties: true
- type: object
+ type: string
"400":
description: 请求参数错误
schema:
@@ -11788,12 +16234,24 @@ paths:
- application/json
responses:
"200":
- description: 任务已提交,返回 task_id
+ description: 任务已提交
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataMessageResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.TaskIDData'
+ type: object
"400":
- description: 请求参数错误
+ description: 请求参数错误或知识正在移动
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ description: 需要编辑权限
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 知识不存在
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
@@ -11818,12 +16276,20 @@ paths:
"200":
description: 知识详情
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ 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'
"404":
description: 知识不存在
schema:
@@ -11856,8 +16322,7 @@ paths:
"200":
description: 更新成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.UpdateKnowledgeResponse'
"400":
description: 请求参数错误
schema:
@@ -11886,8 +16351,12 @@ paths:
"200":
description: 取消已提交
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataMessageResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ type: object
"400":
description: 状态不支持取消
schema:
@@ -11976,19 +16445,23 @@ paths:
name: id
required: true
type: string
- - description: 可选的处理配置覆盖:{\
+ - description: 可选;不传则沿用上传时的处理配置
in: body
name: body
schema:
- type: object
+ $ref: '#/definitions/internal_handler.ReparseKnowledgeRequest'
produces:
- application/json
responses:
"200":
description: 重新解析任务已提交
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataMessageResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -11997,6 +16470,10 @@ paths:
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: []
@@ -12015,8 +16492,9 @@ paths:
name: id
required: true
type: string
- - description: 指定尝试号;省略=最新
+ - description: 指定尝试号;省略或非正数=最新
in: query
+ minimum: 1
name: attempt
type: integer
produces:
@@ -12025,8 +16503,20 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.KnowledgeSpansData'
+ type: object
+ "403":
+ 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: []
@@ -12061,8 +16551,14 @@ paths:
"200":
description: 知识列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ type: array
+ type: object
"400":
description: 请求参数错误
schema:
@@ -12091,8 +16587,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SubmittedTaskResponse'
"400":
description: 请求参数错误
schema:
@@ -12125,8 +16620,7 @@ paths:
"200":
description: 任务已提交
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SubmittedTaskResponse'
"400":
description: 请求参数错误
schema:
@@ -12159,8 +16653,12 @@ paths:
"200":
description: 移动成功
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.FolderMoveData'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -12206,8 +16704,7 @@ paths:
"200":
description: 更新成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -12241,8 +16738,12 @@ paths:
"200":
description: 更新后的知识
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -12349,8 +16850,7 @@ paths:
"200":
description: Search results
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.KnowledgeSearchKnowledgeResponse'
"400":
description: Invalid request
schema:
@@ -12379,8 +16879,7 @@ paths:
"200":
description: 更新成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: 请求参数错误
schema:
@@ -12406,8 +16905,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.AutoFixResponse'
security:
- Bearer: []
summary: Auto-fix wiki issues
@@ -12652,7 +17150,11 @@ paths:
in: query
name: slug
type: string
- - description: Filter by status (pending, ignored, resolved)
+ - description: Filter by status
+ enum:
+ - pending
+ - ignored
+ - resolved
in: query
name: status
type: string
@@ -12665,6 +17167,14 @@ paths:
items:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageIssue'
type: array
+ "400":
+ description: Not a Wiki knowledge base, or no access
+ schema:
+ $ref: '#/definitions/internal_handler.WikiErrorResponse'
+ "500":
+ description: Internal Server Error
+ schema:
+ $ref: '#/definitions/internal_handler.WikiErrorResponse'
security:
- Bearer: []
summary: List wiki page issues
@@ -12726,6 +17236,14 @@ paths:
description: OK
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintReport'
+ "400":
+ description: Not a Wiki knowledge base, or no access
+ schema:
+ $ref: '#/definitions/internal_handler.WikiErrorResponse'
+ "500":
+ description: Internal Server Error
+ schema:
+ $ref: '#/definitions/internal_handler.WikiErrorResponse'
security:
- Bearer: []
summary: Run wiki lint
@@ -12965,13 +17483,21 @@ paths:
name: kb_id
required: true
type: string
+ produces:
+ - application/json
responses:
"200":
description: OK
schema:
- additionalProperties:
- type: string
- type: object
+ $ref: '#/definitions/internal_handler.WikiMessageResponse'
+ "400":
+ description: Not a Wiki knowledge base, or no access
+ schema:
+ $ref: '#/definitions/internal_handler.WikiErrorResponse'
+ "500":
+ description: Internal Server Error
+ schema:
+ $ref: '#/definitions/internal_handler.WikiErrorResponse'
security:
- Bearer: []
summary: Rebuild wiki links
@@ -13115,6 +17641,14 @@ paths:
description: OK
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiStats'
+ "400":
+ description: Not a Wiki knowledge base, or no access
+ schema:
+ $ref: '#/definitions/internal_handler.WikiErrorResponse'
+ "500":
+ description: Internal Server Error
+ schema:
+ $ref: '#/definitions/internal_handler.WikiErrorResponse'
security:
- Bearer: []
summary: Get wiki statistics
@@ -13180,8 +17714,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"404":
description: 端点不存在
schema:
@@ -13323,8 +17856,14 @@ paths:
"200":
description: MCP服务列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse'
+ type: array
+ type: object
"400":
description: 请求参数错误
schema:
@@ -13356,8 +17895,12 @@ paths:
"200":
description: 创建的MCP服务
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -13385,8 +17928,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"500":
description: 服务器错误
schema:
@@ -13413,8 +17955,12 @@ paths:
"200":
description: MCP服务详情
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse'
+ type: object
"404":
description: 服务不存在
schema:
@@ -13447,8 +17993,12 @@ paths:
"200":
description: 更新后的MCP服务
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -13483,8 +18033,12 @@ paths:
"200":
description: 写入后的凭据状态
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialsResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -13645,8 +18199,12 @@ paths:
"200":
description: 与 oauth/status 相同
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_mcp.OAuthAuthorizationStatus'
+ type: object
"400":
description: 断言无效或被授权服务器拒绝
schema:
@@ -13758,8 +18316,14 @@ paths:
"200":
description: 资源列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPResource'
+ type: array
+ type: object
"500":
description: 服务器错误
schema:
@@ -13787,8 +18351,12 @@ paths:
"200":
description: 测试结果
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTestResult'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -13829,8 +18397,7 @@ paths:
"200":
description: 更新结果
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: 请求参数错误
schema:
@@ -13862,8 +18429,14 @@ paths:
"200":
description: 工具列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTool'
+ type: array
+ type: object
"500":
description: 服务器错误
schema:
@@ -13908,8 +18481,14 @@ paths:
"200":
description: One group per sandbox config
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.ConfigEnvGroup'
+ type: array
+ type: object
"401":
description: Unauthorized
schema:
@@ -13938,8 +18517,7 @@ paths:
"200":
description: Deleted
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"404":
description: Not set
schema:
@@ -13968,8 +18546,7 @@ paths:
"200":
description: Stored
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: Invalid request
schema:
@@ -13998,8 +18575,7 @@ paths:
"200":
description: Deleted
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"404":
description: Not set
schema:
@@ -14028,8 +18604,7 @@ paths:
"200":
description: Stored
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: Invalid request
schema:
@@ -14097,8 +18672,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: 拒绝邀请
@@ -14158,8 +18732,12 @@ paths:
"200":
description: 整理结果
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryConsolidationResult'
+ type: object
security:
- Bearer: []
summary: 立刻整理我的记忆
@@ -14184,8 +18762,7 @@ paths:
"200":
description: 文档列表
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListDocumentsResponse'
security:
- Bearer: []
summary: 列出常用资料
@@ -14206,8 +18783,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: 停止用某份文档做个性化检索
@@ -14222,8 +18798,7 @@ paths:
"200":
description: 记忆导出
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ExportResponse'
security:
- Bearer: []
summary: 导出我的记忆
@@ -14238,8 +18813,7 @@ paths:
"200":
description: 清空成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ClearResponse'
security:
- Bearer: []
summary: 清空我的记忆
@@ -14272,8 +18846,7 @@ paths:
"200":
description: 记忆列表
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListItemsResponse'
security:
- Bearer: []
summary: 列出我的记忆
@@ -14296,8 +18869,12 @@ paths:
"200":
description: 新增的记忆
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem'
+ type: object
security:
- Bearer: []
summary: 新增一条记忆
@@ -14318,8 +18895,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: 删除一条记忆
@@ -14347,8 +18923,12 @@ paths:
"200":
description: 更新后的记忆
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem'
+ type: object
security:
- Bearer: []
summary: 修改一条记忆
@@ -14369,8 +18949,12 @@ paths:
"200":
description: 确认成功
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem'
+ type: object
security:
- Bearer: []
summary: 确认一条推断出的记忆
@@ -14391,8 +18975,7 @@ paths:
"200":
description: 否决成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: 否决一条推断出的记忆
@@ -14407,8 +18990,12 @@ paths:
"200":
description: 记忆设置
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemorySettings'
+ type: object
security:
- Bearer: []
summary: 获取我的记忆设置
@@ -14431,8 +19018,12 @@ paths:
"200":
description: 更新后的设置
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemorySettings'
+ type: object
security:
- Bearer: []
summary: 更新我的记忆设置
@@ -14457,8 +19048,7 @@ paths:
"200":
description: 主题列表
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListTopicsResponse'
security:
- Bearer: []
summary: 列出正在观察的主题
@@ -14479,8 +19069,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: 停止跟踪一个主题
@@ -14501,8 +19090,12 @@ paths:
"200":
description: 新增的记忆
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryItem'
+ type: object
security:
- Bearer: []
summary: 立即记为长期关注
@@ -14530,8 +19123,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"500":
description: 服务器错误
schema:
@@ -14576,8 +19168,14 @@ paths:
"200":
description: 消息列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Message'
+ type: array
+ type: object
"400":
description: 请求参数错误
schema:
@@ -14599,8 +19197,12 @@ paths:
"200":
description: 统计信息
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryKBStats'
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -14625,8 +19227,12 @@ paths:
"200":
description: 搜索结果
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSearchResult'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -14648,8 +19254,14 @@ paths:
"200":
description: 模型列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse'
+ type: array
+ type: object
"400":
description: 请求参数错误
schema:
@@ -14677,8 +19289,12 @@ paths:
"201":
description: 创建的模型
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -14706,8 +19322,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 模型仍被知识库、智能体或长期记忆引用
schema:
@@ -14738,8 +19353,12 @@ paths:
"200":
description: 模型详情
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse'
+ type: object
"404":
description: 模型不存在
schema:
@@ -14772,8 +19391,12 @@ paths:
"200":
description: 更新后的模型
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse'
+ type: object
"404":
description: 模型不存在
schema:
@@ -14807,8 +19430,12 @@ paths:
"201":
description: 复制的模型
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.ModelResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -14876,8 +19503,14 @@ paths:
"200":
description: 厂商列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/internal_handler.ModelProviderDTO'
+ type: array
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -14893,8 +19526,7 @@ paths:
"200":
description: 凭证状态
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudStatusResult'
"500":
description: 服务器错误
schema:
@@ -14938,8 +19570,12 @@ paths:
"201":
description: Created
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse'
+ type: object
"400":
description: Bad Request
schema:
@@ -14962,8 +19598,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"403":
description: Forbidden
schema:
@@ -14987,8 +19622,12 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse'
+ type: object
"404":
description: Not Found
schema:
@@ -15020,8 +19659,12 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse'
+ type: object
"403":
description: Forbidden
schema:
@@ -15081,8 +19724,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: Bad Request
schema:
@@ -15137,8 +19779,12 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListJoinRequestsResponse'
+ type: object
"403":
description: Forbidden
schema:
@@ -15176,8 +19822,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"403":
description: Forbidden
schema:
@@ -15200,8 +19845,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"403":
description: Forbidden
schema:
@@ -15250,8 +19894,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"403":
description: Forbidden
schema:
@@ -15288,8 +19931,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"403":
description: Forbidden
schema:
@@ -15322,8 +19964,12 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationJoinRequest'
+ type: object
"400":
description: Bad Request
schema:
@@ -15352,8 +19998,14 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInviteCandidate'
+ type: array
+ type: object
security:
- Bearer: []
summary: Resolve a workspace ID for invitation
@@ -15378,8 +20030,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListOrganizationSharedAgentsResponse'
security:
- Bearer: []
summary: 获取空间内全部智能体(含我共享的)
@@ -15400,8 +20051,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListOrganizationSharedKnowledgeBasesResponse'
security:
- Bearer: []
summary: 获取空间内全部知识库(含我共享的、含智能体携带的)
@@ -15446,8 +20096,12 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse'
+ type: object
"404":
description: Not Found
schema:
@@ -15475,8 +20129,12 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse'
+ type: object
"403":
description: Forbidden
schema:
@@ -15504,8 +20162,12 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationJoinRequest'
+ type: object
"400":
description: Bad Request
schema:
@@ -15560,8 +20222,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SearchOrganizationsResponse'
security:
- Bearer: []
summary: 搜索可加入的空间
@@ -15607,8 +20268,12 @@ paths:
"201":
description: Created sandbox config
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.sandboxConfigResponse'
+ type: object
"400":
description: Invalid request or validation failure
schema:
@@ -15644,8 +20309,7 @@ paths:
"200":
description: Deletion success
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"401":
description: Unauthorized
schema:
@@ -15676,8 +20340,12 @@ paths:
"200":
description: Sandbox config
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.sandboxConfigResponse'
+ type: object
"401":
description: Unauthorized
schema:
@@ -15716,8 +20384,12 @@ paths:
"200":
description: Updated sandbox config
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.sandboxConfigResponse'
+ type: object
"400":
description: Invalid request or validation failure
schema:
@@ -15763,8 +20435,12 @@ paths:
"200":
description: Sandbox inventory
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.SandboxInventory'
+ type: object
"401":
description: Unauthorized
schema:
@@ -15791,8 +20467,14 @@ paths:
"200":
description: Installed skills
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/internal_handler.skillResponse'
+ type: array
+ type: object
"401":
description: Unauthorized
schema:
@@ -15925,8 +20607,12 @@ paths:
"200":
description: Installed skill
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.skillResponse'
+ type: object
"401":
description: Unauthorized
schema:
@@ -15971,8 +20657,12 @@ paths:
"200":
description: Updated skill
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.skillResponse'
+ type: object
"400":
description: Invalid request
schema:
@@ -16012,8 +20702,14 @@ paths:
"200":
description: Skill files
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileEntry'
+ type: array
+ type: object
"401":
description: Unauthorized
schema:
@@ -16054,8 +20750,12 @@ paths:
"200":
description: Skill file
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileContent'
+ type: object
"400":
description: Invalid path
schema:
@@ -16179,8 +20879,12 @@ paths:
"200":
description: Stopped skill
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.skillResponse'
+ type: object
"400":
description: Skill is not installing
schema:
@@ -16673,8 +21377,12 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet'
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -16707,13 +21415,21 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet'
+ type: object
"202":
description: Accepted
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet'
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -17031,10 +21747,9 @@ paths:
- text/event-stream
responses:
"200":
- description: 流式响应
+ description: SSE 事件流
schema:
- additionalProperties: true
- type: object
+ type: string
"404":
description: 会话或消息不存在
schema:
@@ -17054,8 +21769,7 @@ paths:
"200":
description: 智能体列表 + total
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListSharedAgentsResponse'
"500":
description: 服务器错误
schema:
@@ -17075,8 +21789,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListSharedKnowledgeBasesResponse'
security:
- Bearer: []
summary: 获取共享给我的知识库列表
@@ -17106,8 +21819,7 @@ paths:
"200":
description: Skills列表
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListSkillsResponse'
"403":
description: 无权使用该共享智能体
schema:
@@ -17166,8 +21878,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
summary: Delete a catalog skill
tags:
- Skills
@@ -17187,8 +21898,14 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileEntry'
+ type: array
+ type: object
summary: List files of a catalog skill
tags:
- Skills
@@ -17211,8 +21928,12 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.SkillFileContent'
+ type: object
summary: Read one file of a catalog skill
tags:
- Skills
@@ -17249,8 +21970,7 @@ paths:
"200":
description: List of storage backends and default_storage_backend_id
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListResponse'
"401":
description: Unauthorized
schema:
@@ -17281,8 +22001,12 @@ paths:
"201":
description: Created storage backend
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend'
+ type: object
"400":
description: Invalid request, validation, or connectivity test failure
schema:
@@ -17319,8 +22043,7 @@ paths:
"200":
description: Deletion success
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: Backend is default, bound, read-only, or legacy alias
schema:
@@ -17355,8 +22078,12 @@ paths:
"200":
description: Storage backend details
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend'
+ type: object
"401":
description: Unauthorized
schema:
@@ -17397,8 +22124,12 @@ paths:
"200":
description: Updated storage backend
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend'
+ type: object
"400":
description: Immutable field change, read-only backend, validation, or connectivity
failure
@@ -17436,8 +22167,7 @@ paths:
"200":
description: Default set successfully
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: Backend is not active
schema:
@@ -17474,8 +22204,7 @@ paths:
"200":
description: Connectivity test result (success, error)
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessErrorResponse'
"401":
description: Unauthorized
schema:
@@ -17511,8 +22240,7 @@ paths:
"200":
description: Connectivity test result (success, error)
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessErrorResponse'
"400":
description: Invalid request or validation error
schema:
@@ -17538,8 +22266,14 @@ paths:
"200":
description: List of allowed storage provider types
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ type: string
+ type: array
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -17556,8 +22290,14 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/internal_handler.tenantAPIKeyResponse'
+ type: array
+ type: object
security:
- Bearer: []
summary: List platform API keys
@@ -17581,8 +22321,12 @@ paths:
"201":
description: Created
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.tenantAPIKeyCreateResponse'
+ type: object
security:
- Bearer: []
summary: Create a platform API key
@@ -17603,8 +22347,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: Revoke a platform API key
@@ -17929,8 +22672,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.PurgeArchivedRuntimeTasksResponse'
summary: Purge all archived tasks in a queue
tags:
- System Admin
@@ -18024,8 +22766,7 @@ paths:
"200":
description: Reset acknowledged
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: Unknown key
schema:
@@ -18124,8 +22865,7 @@ paths:
"200":
description: '{ affected: int64, quota_bytes: int64 }'
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ApplyDefaultStorageQuotaToAllTenantsResponse'
"500":
description: DB write failed
schema:
@@ -18238,8 +22978,7 @@ paths:
"200":
description: Password reset successfully
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ResetUserPasswordResponse'
"400":
description: Invalid request, weak password, or self reset
schema:
@@ -18278,8 +23017,7 @@ paths:
"200":
description: Status updated
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SetUserStatusResponse'
"400":
description: Self-disable / last-admin guard
schema:
@@ -18300,10 +23038,9 @@ paths:
- application/json
responses:
"200":
- description: 标准 code/msg/data 包装,data 为 DeploymentCapabilitiesData
+ description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.GetDeploymentCapabilitiesResponse'
summary: 获取部署能力清单
tags:
- 系统
@@ -18349,8 +23086,7 @@ paths:
"200":
description: 解析引擎列表
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.ListParserEnginesResponse'
summary: 列出可用的文档解析引擎
tags:
- 系统
@@ -18441,8 +23177,12 @@ paths:
"200":
description: 空间列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.TenantListData'
+ type: object
"500":
description: 服务器错误
schema:
@@ -18502,8 +23242,7 @@ paths:
"200":
description: 删除成功
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -18529,8 +23268,12 @@ paths:
"200":
description: 空间详情
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -18567,8 +23310,12 @@ paths:
"200":
description: 更新后的空间
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -18595,8 +23342,12 @@ paths:
"200":
description: API principal 配置
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.apiPrincipalConfigResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -18632,8 +23383,12 @@ paths:
"200":
description: 更新后的配置
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.apiPrincipalConfigResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -18670,8 +23425,12 @@ paths:
"200":
description: 短期 JWT
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.apiPrincipalTestTokenResponse'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -18790,8 +23549,12 @@ paths:
"201":
description: Created
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInvitationResponse'
+ type: object
security:
- Bearer: []
summary: 发出空间邀请
@@ -18817,8 +23580,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: 撤销待接受邀请
@@ -18849,8 +23611,12 @@ paths:
"201":
description: Created
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TenantInvitationResponse'
+ type: object
security:
- Bearer: []
summary: 生成共享邀请链接
@@ -18871,8 +23637,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: 退出当前空间
@@ -18962,8 +23727,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: 移除空间成员
@@ -18996,8 +23760,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
security:
- Bearer: []
summary: 修改空间成员角色
@@ -19014,8 +23777,12 @@ paths:
"200":
description: 所有空间列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.TenantListData'
+ type: object
"403":
description: 权限不足
schema:
@@ -19099,8 +23866,12 @@ paths:
"200":
description: 提示词模板配置
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_config.PromptTemplatesConfig'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -19122,8 +23893,12 @@ paths:
"200":
description: 网络搜索配置
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig'
+ type: object
"400":
description: 请求参数错误
schema:
@@ -19156,6 +23931,8 @@ paths:
- default: 20
description: 每页数量
in: query
+ maximum: 100
+ minimum: 1
name: page_size
type: integer
produces:
@@ -19164,8 +23941,12 @@ paths:
"200":
description: 搜索结果
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/internal_handler.TenantSearchData'
+ type: object
"403":
description: 权限不足
schema:
@@ -19190,8 +23971,14 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UserResourceFavorite'
+ type: array
+ type: object
summary: List my favorites
tags:
- User
@@ -19207,8 +23994,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
summary: Star a resource
tags:
- User
@@ -19229,8 +24015,7 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
summary: Unstar a resource
tags:
- User
@@ -19244,8 +24029,14 @@ paths:
"200":
description: List of vector stores (env + DB)
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreResponse'
+ type: array
+ type: object
"401":
description: Unauthorized
schema:
@@ -19274,8 +24065,12 @@ paths:
"201":
description: Created vector store
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreResponse'
+ type: object
"400":
description: Invalid request or validation error
schema:
@@ -19310,8 +24105,7 @@ paths:
"200":
description: Deletion success
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"400":
description: Env store cannot be deleted
schema:
@@ -19348,8 +24142,12 @@ paths:
"200":
description: Vector store details
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreResponse'
+ type: object
"401":
description: Unauthorized
schema:
@@ -19428,8 +24226,7 @@ paths:
"200":
description: Connection test result (success, version)
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.TestStoreByIDResponse'
"401":
description: Unauthorized
schema:
@@ -19465,8 +24262,7 @@ paths:
"200":
description: Connection test result (success, version)
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.TestStoreRawResponse'
"400":
description: Invalid request
schema:
@@ -19490,10 +24286,16 @@ paths:
- application/json
responses:
"200":
- description: List of engine types with config schemas
+ description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VectorStoreTypeInfo'
+ type: array
+ type: object
summary: List vector store types
tags:
- VectorStore
@@ -19512,8 +24314,7 @@ paths:
"200":
description: 'success: true'
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessResponse'
"404":
description: Provider 不存在
schema:
@@ -19605,8 +24406,7 @@ paths:
"200":
description: 测试结果
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessErrorResponse'
"404":
description: Provider 不存在
schema:
@@ -19636,8 +24436,7 @@ paths:
"200":
description: 测试结果
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.SuccessErrorResponse'
"400":
description: 请求参数错误
schema:
@@ -19658,8 +24457,14 @@ paths:
"200":
description: provider 类型列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderTypeInfo'
+ type: array
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -19675,8 +24480,14 @@ paths:
"200":
description: provider 列表
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchProviderTypeInfo'
+ type: array
+ type: object
security:
- Bearer: []
- ApiKeyAuth: []
@@ -19761,8 +24572,7 @@ paths:
"200":
description: 'success: true'
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/internal_handler.MessageResponse'
"400":
description: 请求参数错误
schema:
@@ -19793,8 +24603,14 @@ paths:
"200":
description: OK
schema:
- additionalProperties: true
- type: object
+ allOf:
+ - $ref: '#/definitions/internal_handler.DataResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/internal_handler.WikiSearchHit'
+ type: array
+ type: object
"400":
description: Bad Request
schema:
diff --git a/internal/handler/audit_log.go b/internal/handler/audit_log.go
index 3f8a656b3..cf55ef80c 100644
--- a/internal/handler/audit_log.go
+++ b/internal/handler/audit_log.go
@@ -29,9 +29,10 @@ func NewAuditLogHandler(auditService interfaces.AuditLogService) *AuditLogHandle
// auditLogListResponse is the response envelope for ListTenantAuditLog. The
// cursor is the integer id of the last entry, or 0 if no more rows remain.
type auditLogListResponse struct {
- Success bool `json:"success"`
- Data []*types.AuditLog `json:"data"`
- NextCursor uint64 `json:"next_cursor"`
+ Success bool `json:"success"`
+ Data []*types.AuditLog `json:"data"`
+ // NextCursor is the id of the last entry on this page, 0 when it is empty.
+ NextCursor uint64 `json:"next_cursor"`
}
// ListTenantAuditLog godoc
@@ -112,16 +113,18 @@ func (h *AuditLogHandler) ListTenantAuditLog(c *gin.Context) {
// workspace actors or configuration history.
// @Summary 获取知识库活动记录
// @Description 返回知识库的重要变更与后台任务入口。仅知识库创建者或所属空间管理员可读,共享空间不可读。
+// @Description 按 id 倒序;把 next_cursor 作为 after_id 取下一页,返回空列表表示没有更多。
// @Tags 知识库
// @Produce json
// @Param id path string true "知识库ID"
// @Param after_id query int false "游标:返回 id 小于此值的记录"
-// @Param limit query int false "页大小,1-100,默认 50"
-// @Param action query string false "按 action 精确过滤"
-// @Param outcome query string false "按 outcome 精确过滤"
+// @Param limit query int false "页大小" minimum(1) maximum(100) default(50)
+// @Param action query string false "按 action 精确过滤,如 knowledge.deleted"
+// @Param outcome query string false "结果过滤" Enums(success,accepted,partial,failed,denied,canceled)
// @Param actor query string false "按 actor_user_id 精确过滤"
// @Success 200 {object} auditLogListResponse
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} errors.AppError "非创建者或管理员,或知识库来自其他空间"
+// @Failure 404 {object} errors.AppError "知识库不存在"
// @Security Bearer
// @Router /knowledge-bases/{id}/activity [get]
func (h *AuditLogHandler) ListKnowledgeBaseActivity(c *gin.Context) {
diff --git a/internal/handler/auth.go b/internal/handler/auth.go
index 9efeaed51..d17248d62 100644
--- a/internal/handler/auth.go
+++ b/internal/handler/auth.go
@@ -514,7 +514,7 @@ func urlQueryEscape(value string) string {
// @Tags 认证
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "登出成功"
+// @Success 200 {object} handler.MessageResponse "登出成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Router /auth/logout [post]
@@ -567,7 +567,7 @@ func (h *AuthHandler) Logout(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body object{refreshToken=string} true "刷新令牌"
-// @Success 200 {object} map[string]interface{} "新令牌"
+// @Success 200 {object} handler.RefreshTokenResponse "新令牌"
// @Failure 401 {object} errors.AppError "令牌无效"
// @Router /auth/refresh [post]
func (h *AuthHandler) RefreshToken(c *gin.Context) {
@@ -610,7 +610,7 @@ func (h *AuthHandler) RefreshToken(c *gin.Context) {
// @Tags 认证
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "用户信息"
+// @Success 200 {object} handler.DataResponse{data=handler.CurrentUserData} "用户信息"
// @Failure 401 {object} errors.AppError "未授权"
// @Security Bearer
// @Router /auth/me [get]
@@ -696,7 +696,7 @@ type updateMyPreferencesRequest struct {
// @Accept json
// @Produce json
// @Param request body updateMyPreferencesRequest true "Preferences patch"
-// @Success 200 {object} map[string]interface{} "更新后的偏好"
+// @Success 200 {object} handler.DataResponse{data=types.UserPreferences} "更新后的偏好"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 401 {object} errors.AppError "未授权"
// @Security Bearer
@@ -743,7 +743,7 @@ func (h *AuthHandler) UpdateMyPreferences(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body object{old_password=string,new_password=string} true "密码修改请求"
-// @Success 200 {object} map[string]interface{} "修改成功"
+// @Success 200 {object} handler.MessageResponse "修改成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Router /auth/change-password [post]
@@ -815,7 +815,7 @@ func (h *AuthHandler) ChangePassword(c *gin.Context) {
// @Tags 认证
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "认证配置"
+// @Success 200 {object} handler.GetAuthConfigResponse "认证配置"
// @Router /auth/config [get]
//
// GetAuthConfig is intentionally a no-auth endpoint: the frontend reads
@@ -987,7 +987,7 @@ func tenantNameOrEmpty(t *types.Tenant) string {
// @Tags 认证
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "令牌有效"
+// @Success 200 {object} handler.ValidateTokenResponse "令牌有效"
// @Failure 401 {object} errors.AppError "令牌无效"
// @Security Bearer
// @Router /auth/validate [get]
diff --git a/internal/handler/chunk.go b/internal/handler/chunk.go
index 162bc9523..2de6cbb24 100644
--- a/internal/handler/chunk.go
+++ b/internal/handler/chunk.go
@@ -44,7 +44,7 @@ func NewChunkHandler(service interfaces.ChunkService, kgService interfaces.Knowl
// @Accept json
// @Produce json
// @Param id path string true "分块ID"
-// @Success 200 {object} map[string]interface{} "分块详情"
+// @Success 200 {object} handler.DataResponse{data=types.Chunk} "分块详情"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "分块不存在"
// @Security Bearer
@@ -84,14 +84,17 @@ func (h *ChunkHandler) GetChunkByIDOnly(c *gin.Context) {
// ListKnowledgeChunks godoc
// @Summary 获取知识分块列表
-// @Description 获取指定知识下的所有分块列表,支持分页
+// @Description 获取指定知识下的所有分块列表,支持分页。chunk_type 可重复,缺省 text
+// @Description 取值 text, parent_text, image_ocr, image_caption, image_vector, summary, entity,
+// @Description relationship, faq, web_search, table_summary, table_column, wiki_page
// @Tags 分块管理
// @Accept json
// @Produce json
// @Param knowledge_id path string true "知识ID"
-// @Param page query int false "页码" default(1)
-// @Param page_size query int false "每页数量" default(10)
-// @Success 200 {object} map[string]interface{} "分块列表"
+// @Param page query int false "页码" default(1) minimum(1)
+// @Param page_size query int false "每页数量" default(10) minimum(1) maximum(100)
+// @Param chunk_type query []string false "分块类型,可重复,缺省 text" collectionFormat(multi)
+// @Success 200 {object} handler.PageResponse{data=[]types.Chunk} "分块列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -202,7 +205,7 @@ func (h *ChunkHandler) fetchChunkAndVerifyOwnership(c *gin.Context) (*types.Chun
// @Param knowledge_id path string true "知识ID"
// @Param id path string true "分块ID"
// @Param request body UpdateChunkRequest true "更新请求"
-// @Success 200 {object} map[string]interface{} "更新后的分块"
+// @Success 200 {object} handler.UpdateChunkResponse "更新后的分块"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "分块不存在"
// @Security Bearer
@@ -360,7 +363,7 @@ func (h *ChunkHandler) RegenerateGeneratedQuestions(c *gin.Context) {
// @Produce json
// @Param knowledge_id path string true "知识ID"
// @Param id path string true "分块ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.MessageResponse "删除成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "分块不存在"
// @Security Bearer
@@ -395,7 +398,7 @@ func (h *ChunkHandler) DeleteChunk(c *gin.Context) {
// @Accept json
// @Produce json
// @Param knowledge_id path string true "知识ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.MessageResponse "删除成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -431,7 +434,7 @@ func (h *ChunkHandler) DeleteChunksByKnowledgeID(c *gin.Context) {
// @Produce json
// @Param id path string true "分块ID"
// @Param request body object{question_id=string} true "问题ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.MessageResponse "删除成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "分块不存在"
// @Security Bearer
diff --git a/internal/handler/custom_agent.go b/internal/handler/custom_agent.go
index 04b8d28e6..28d59def6 100644
--- a/internal/handler/custom_agent.go
+++ b/internal/handler/custom_agent.go
@@ -87,7 +87,7 @@ type UpdateAgentRequest struct {
// @Accept json
// @Produce json
// @Param request body CreateAgentRequest true "智能体信息"
-// @Success 201 {object} map[string]interface{} "创建的智能体"
+// @Success 201 {object} handler.AgentWriteResponse "创建的智能体"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -180,7 +180,7 @@ func (h *CustomAgentHandler) CreateAgent(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "智能体ID"
-// @Success 200 {object} map[string]interface{} "智能体详情"
+// @Success 200 {object} handler.DataResponse{data=types.CustomAgent} "智能体详情"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "智能体不存在"
// @Security Bearer
@@ -230,7 +230,8 @@ func (h *CustomAgentHandler) GetAgent(c *gin.Context) {
// @Tags 智能体
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "智能体列表"
+// @Param creator query string false "创建者过滤,仅 mine 与 others 生效" Enums(mine, others)
+// @Success 200 {object} handler.ListAgentsResponse "智能体列表"
// @Failure 500 {object} errors.AppError "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -357,7 +358,7 @@ func enrichAgentCreatorNames(ctx context.Context, userSvc interfaces.UserService
// @Produce json
// @Param id path string true "智能体ID"
// @Param request body UpdateAgentRequest true "更新请求"
-// @Success 200 {object} map[string]interface{} "更新后的智能体"
+// @Success 200 {object} handler.AgentWriteResponse "更新后的智能体"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "无法修改内置智能体"
// @Security Bearer
@@ -484,7 +485,7 @@ func (h *CustomAgentHandler) UpdateAgent(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "智能体ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.MessageResponse "删除成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "无法删除内置智能体"
// @Failure 404 {object} errors.AppError "智能体不存在"
@@ -555,7 +556,7 @@ func (h *CustomAgentHandler) DeleteAgent(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "智能体ID"
-// @Success 201 {object} map[string]interface{} "复制成功"
+// @Success 201 {object} handler.DataResponse{data=types.CustomAgent} "复制成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "智能体不存在"
// @Security Bearer
@@ -630,7 +631,7 @@ func (h *CustomAgentHandler) CopyAgent(c *gin.Context) {
// @Tags 智能体
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "占位符定义"
+// @Success 200 {object} handler.DataResponse{data=handler.PlaceholderGroups} "占位符定义"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /agents/placeholders [get]
@@ -656,7 +657,7 @@ func (h *CustomAgentHandler) GetPlaceholders(c *gin.Context) {
// @Tags 智能体
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "预设列表"
+// @Success 200 {object} handler.DataResponse{data=[]types.AgentTypePresetEntry} "预设列表"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /agents/type-presets [get]
@@ -675,7 +676,7 @@ func (h *CustomAgentHandler) GetAgentTypePresets(c *gin.Context) {
// @Tags 智能体
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "工具目录"
+// @Success 200 {object} handler.DataResponse{data=tools.AgentToolCatalog} "工具目录"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /agents/tools [get]
@@ -697,7 +698,7 @@ func (h *CustomAgentHandler) GetAgentTools(c *gin.Context) {
// @Param knowledge_ids query string false "知识ID列表(逗号分隔),限定到具体文档"
// @Param tag_scopes query string false "带知识库归属的标签范围(JSON)"
// @Param limit query int false "返回数量上限(未传时使用智能体配置的开场问题数量,最大30)"
-// @Success 200 {object} map[string]interface{} "推荐问题列表"
+// @Success 200 {object} handler.DataResponse{data=handler.SuggestedQuestionsData} "推荐问题列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "智能体不存在"
// @Security Bearer
diff --git a/internal/handler/deployment_capabilities.go b/internal/handler/deployment_capabilities.go
index 65b1ada03..eed32ed22 100644
--- a/internal/handler/deployment_capabilities.go
+++ b/internal/handler/deployment_capabilities.go
@@ -132,7 +132,7 @@ func (h *SystemHandler) BindDeploymentCapabilities(data DeploymentCapabilitiesDa
// @Description 返回当前部署版本及实际注册的后端路由所对应的功能能力;仅 supported=false 表示入口应隐藏
// @Tags 系统
// @Produce json
-// @Success 200 {object} map[string]interface{} "标准 code/msg/data 包装,data 为 DeploymentCapabilitiesData"
+// @Success 200 {object} handler.GetDeploymentCapabilitiesResponse
// @Router /system/capabilities [get]
func (h *SystemHandler) GetDeploymentCapabilities(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
diff --git a/internal/handler/evaluation.go b/internal/handler/evaluation.go
index 62356e8d0..8dda6d9b1 100644
--- a/internal/handler/evaluation.go
+++ b/internal/handler/evaluation.go
@@ -36,7 +36,7 @@ type EvaluationRequest struct {
// @Accept json
// @Produce json
// @Param request body EvaluationRequest true "评估请求参数"
-// @Success 200 {object} map[string]interface{} "评估任务"
+// @Success 200 {object} handler.DataResponse{data=types.EvaluationDetail} "评估任务"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -99,7 +99,7 @@ type GetEvaluationRequest struct {
// @Accept json
// @Produce json
// @Param task_id query string true "评估任务ID"
-// @Success 200 {object} map[string]interface{} "评估结果"
+// @Success 200 {object} handler.DataResponse{data=types.EvaluationDetail} "评估结果"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/faq.go b/internal/handler/faq.go
index 24f6bc257..bcf9022b6 100644
--- a/internal/handler/faq.go
+++ b/internal/handler/faq.go
@@ -73,7 +73,7 @@ type updateLastFAQImportResultDisplayStatusRequest struct {
// @Param search_field query string false "搜索字段: standard_question(标准问题), similar_questions(相似问法), answers(答案), 默认搜索全部"
// @Param sort_order query string false "排序方式: asc(按更新时间正序), 默认按更新时间倒序"
// @Param is_enabled query bool false "启用状态筛选;不传时返回全部"
-// @Success 200 {object} map[string]interface{} "FAQ列表"
+// @Success 200 {object} handler.DataResponse{data=types.PageResult} "FAQ列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -152,7 +152,7 @@ func parseOptionalFAQEnabled(c *gin.Context) (*bool, error) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body types.FAQBatchUpsertPayload true "批量操作请求"
-// @Success 200 {object} map[string]interface{} "任务ID"
+// @Success 200 {object} handler.DataResponse{data=handler.TaskIDData} "任务ID"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -191,7 +191,7 @@ func (h *FAQHandler) UpsertEntries(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body types.FAQEntryPayload true "FAQ条目"
-// @Success 200 {object} map[string]interface{} "创建的FAQ条目"
+// @Success 200 {object} handler.DataResponse{data=types.FAQEntry} "创建的FAQ条目"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -229,7 +229,7 @@ func (h *FAQHandler) CreateEntry(c *gin.Context) {
// @Param id path string true "知识库ID"
// @Param entry_id path int true "FAQ条目ID(seq_id)"
// @Param request body types.FAQEntryPayload true "FAQ条目"
-// @Success 200 {object} map[string]interface{} "更新成功"
+// @Success 200 {object} handler.DataResponse{data=types.FAQEntry} "更新成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -272,7 +272,7 @@ func (h *FAQHandler) UpdateEntry(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body object true "标签更新请求"
-// @Success 200 {object} map[string]interface{} "更新成功"
+// @Success 200 {object} handler.SuccessResponse "更新成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -305,7 +305,7 @@ func (h *FAQHandler) UpdateEntryTagBatch(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body types.FAQEntryFieldsBatchUpdate true "字段更新请求"
-// @Success 200 {object} map[string]interface{} "更新成功"
+// @Success 200 {object} handler.SuccessResponse "更新成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -338,7 +338,7 @@ func (h *FAQHandler) UpdateEntryFieldsBatch(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body object{ids=[]int} true "要删除的FAQ ID列表(seq_id)"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.SuccessResponse "删除成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -373,7 +373,7 @@ func (h *FAQHandler) DeleteEntries(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body types.FAQSearchRequest true "搜索请求"
-// @Success 200 {object} map[string]interface{} "搜索结果"
+// @Success 200 {object} handler.DataResponse{data=[]types.FAQEntry} "搜索结果"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -463,7 +463,7 @@ func (h *FAQHandler) ExportEntries(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param entry_id path int true "FAQ条目ID(seq_id)"
-// @Success 200 {object} map[string]interface{} "FAQ条目详情"
+// @Success 200 {object} handler.DataResponse{data=types.FAQEntry} "FAQ条目详情"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "条目不存在"
// @Security Bearer
@@ -499,7 +499,7 @@ func (h *FAQHandler) GetEntry(c *gin.Context) {
// @Accept json
// @Produce json
// @Param task_id path string true "任务ID"
-// @Success 200 {object} map[string]interface{} "导入进度"
+// @Success 200 {object} handler.DataResponse{data=types.FAQImportProgress} "导入进度"
// @Failure 404 {object} errors.AppError "任务不存在"
// @Security Bearer
// @Security ApiKeyAuth
@@ -533,7 +533,7 @@ func (h *FAQHandler) GetImportProgress(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body updateLastFAQImportResultDisplayStatusRequest true "状态更新请求"
-// @Success 200 {object} map[string]interface{} "更新成功"
+// @Success 200 {object} handler.SuccessResponse "更新成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "知识库不存在或无导入记录"
// @Security Bearer
@@ -570,7 +570,7 @@ func (h *FAQHandler) UpdateLastImportResultDisplayStatus(c *gin.Context) {
// @Param id path string true "知识库ID"
// @Param entry_id path int true "FAQ条目ID(seq_id)"
// @Param request body addSimilarQuestionsRequest true "相似问列表"
-// @Success 200 {object} map[string]interface{} "更新后的FAQ条目"
+// @Success 200 {object} handler.DataResponse{data=types.FAQEntry} "更新后的FAQ条目"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "条目不存在"
// @Security Bearer
diff --git a/internal/handler/im.go b/internal/handler/im.go
index 33dc03658..16567d775 100644
--- a/internal/handler/im.go
+++ b/internal/handler/im.go
@@ -196,7 +196,7 @@ func (h *IMHandler) ListAllIMChannels(c *gin.Context) {
// @Produce json
// @Param id path string true "渠道 ID"
// @Param request body map[string]interface{} true "更新字段(含 locale)"
-// @Success 200 {object} map[string]interface{} "更新后的渠道"
+// @Success 200 {object} handler.UpdateIMChannelResponse "更新后的渠道"
// @Failure 400 {object} map[string]interface{} "请求参数错误"
// @Failure 404 {object} map[string]interface{} "渠道不存在"
// @Security Bearer
@@ -313,7 +313,7 @@ func normalizeIMLocale(locale string) (string, error) {
// @Tags IM 渠道
// @Produce json
// @Param id path string true "渠道 ID"
-// @Success 200 {object} map[string]interface{} "success: true"
+// @Success 200 {object} handler.SuccessResponse "success: true"
// @Failure 400 {object} map[string]interface{} "请求参数错误"
// @Failure 404 {object} map[string]interface{} "渠道不存在"
// @Security Bearer
@@ -348,7 +348,7 @@ func (h *IMHandler) DeleteIMChannel(c *gin.Context) {
// @Tags IM 渠道
// @Produce json
// @Param id path string true "渠道 ID"
-// @Success 200 {object} map[string]interface{} "更新后的渠道"
+// @Success 200 {object} handler.UpdateIMChannelResponse "更新后的渠道"
// @Failure 400 {object} map[string]interface{} "请求参数错误"
// @Failure 404 {object} map[string]interface{} "渠道不存在"
// @Security Bearer
diff --git a/internal/handler/initialization.go b/internal/handler/initialization.go
index cb4fad89a..91db96aa1 100644
--- a/internal/handler/initialization.go
+++ b/internal/handler/initialization.go
@@ -231,7 +231,7 @@ type InitializationRequest struct {
// @Produce json
// @Param kbId path string true "知识库ID"
// @Param request body KBModelConfigRequest true "配置请求"
-// @Success 200 {object} map[string]interface{} "更新成功"
+// @Success 200 {object} handler.MessageResponse "更新成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "知识库不存在"
// @Security Bearer
@@ -1279,7 +1279,7 @@ func (h *InitializationHandler) DownloadOllamaModel(c *gin.Context) {
// @Accept json
// @Produce json
// @Param taskId path string true "任务ID"
-// @Success 200 {object} map[string]interface{} "下载进度"
+// @Success 200 {object} handler.DataResponse{data=handler.DownloadTask} "下载进度"
// @Failure 404 {object} errors.AppError "任务不存在"
// @Security Bearer
// @Security ApiKeyAuth
@@ -1313,7 +1313,7 @@ func (h *InitializationHandler) GetDownloadProgress(c *gin.Context) {
// @Tags 初始化
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "任务列表"
+// @Success 200 {object} handler.DataResponse{data=[]handler.DownloadTask} "任务列表"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /initialization/ollama/download/tasks [get]
@@ -2587,7 +2587,7 @@ type TextRelationExtractionResponse struct {
// @Accept json
// @Produce json
// @Param request body TextRelationExtractionRequest true "提取请求"
-// @Success 200 {object} map[string]interface{} "提取结果"
+// @Success 200 {object} handler.DataResponse{data=handler.TextRelationExtractionResponse} "提取结果"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -2688,7 +2688,7 @@ type FabriTextResponse struct {
// @Accept json
// @Produce json
// @Param request body FabriTextRequest true "生成请求"
-// @Success 200 {object} map[string]interface{} "生成的文本"
+// @Success 200 {object} handler.DataResponse{data=handler.FabriTextResponse} "生成的文本"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -2765,7 +2765,7 @@ var tagOptions = []string{
// @Tags 初始化
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "生成的标签"
+// @Success 200 {object} handler.DataResponse{data=handler.FabriTagResponse} "生成的标签"
// @Router /initialization/extract/fabri-tag [post]
func (h *InitializationHandler) FabriTag(c *gin.Context) {
tagRandom := RandomSelect(tagOptions, rand.Intn(len(tagOptions)-1)+1)
diff --git a/internal/handler/knowledge.go b/internal/handler/knowledge.go
index 9ef245b3d..4ddd848ef 100644
--- a/internal/handler/knowledge.go
+++ b/internal/handler/knowledge.go
@@ -304,7 +304,7 @@ func (h *KnowledgeHandler) enqueueKnowledgeListReparse(
// @Param enable_multimodel formData bool false "启用多模态处理"
// @Param tag_ids formData string false "分类ID列表,逗号分隔"
// @Param process_config formData string false "处理配置JSON(KnowledgeProcessOverrides)"
-// @Success 200 {object} map[string]interface{} "创建的知识"
+// @Success 200 {object} handler.DataResponse{data=types.Knowledge} "创建的知识"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 409 {object} map[string]interface{} "文件重复"
// @Security Bearer
@@ -468,7 +468,7 @@ func (h *KnowledgeHandler) CreateKnowledgeFromFile(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body object{url=string,file_name=string,file_type=string,enable_multimodel=bool,title=string,tag_ids=[]string} true "URL请求"
-// @Success 201 {object} map[string]interface{} "创建的知识"
+// @Success 201 {object} handler.DataResponse{data=types.Knowledge} "创建的知识"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 409 {object} map[string]interface{} "URL重复"
// @Security Bearer
@@ -566,7 +566,7 @@ func (h *KnowledgeHandler) CreateKnowledgeFromURL(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body types.ManualKnowledgePayload true "手工知识内容"
-// @Success 200 {object} map[string]interface{} "创建的知识"
+// @Success 200 {object} handler.DataResponse{data=types.Knowledge} "创建的知识"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -624,9 +624,10 @@ func (h *KnowledgeHandler) CreateManualKnowledge(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "知识ID"
-// @Success 200 {object} map[string]interface{} "知识详情"
-// @Failure 400 {object} errors.AppError "请求参数错误"
-// @Failure 404 {object} errors.AppError "知识不存在"
+// @Success 200 {object} handler.DataResponse{data=types.Knowledge} "知识详情"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 403 {object} errors.AppError "无权访问所属知识库"
+// @Failure 404 {object} errors.AppError "知识不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge/{id} [get]
@@ -671,8 +672,10 @@ func (h *KnowledgeHandler) GetKnowledge(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "知识ID"
-// @Param attempt query int false "指定尝试号;省略=最新"
-// @Success 200 {object} map[string]interface{}
+// @Param attempt query int false "指定尝试号;省略或非正数=最新" minimum(1)
+// @Success 200 {object} handler.DataResponse{data=handler.KnowledgeSpansData}
+// @Failure 403 {object} errors.AppError "无权访问所属知识库"
+// @Failure 404 {object} errors.AppError "知识不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge/{id}/spans [get]
@@ -743,40 +746,67 @@ func (h *KnowledgeHandler) GetKnowledgeSpans(c *gin.Context) {
// they're still waiting in the queue.
tree, currentStageName, lastErr := buildSpanTree(knowledge.ID, currentAttempt, rows, knowledge.ParseStatus)
- resp := gin.H{
- "knowledge_id": knowledge.ID,
- "attempt": currentAttempt,
- "latest_attempt": latestAttempt,
- "parse_status": knowledge.ParseStatus,
- "current_attempt": currentAttempt,
- "current_stage": currentStageName,
- "trace": tree,
+ resp := KnowledgeSpansData{
+ KnowledgeID: knowledge.ID,
+ Attempt: currentAttempt,
+ LatestAttempt: latestAttempt,
+ ParseStatus: knowledge.ParseStatus,
+ CurrentAttempt: currentAttempt,
+ CurrentStage: currentStageName,
+ Trace: tree,
}
if isParseInFlight(knowledge.ParseStatus) {
last := spansLastActivity(knowledge.UpdatedAt, rows)
- resp["last_activity_at"] = last
+ resp.LastActivityAt = &last
if time.Since(last) >= stallHintAfter {
- if verdict := h.stallVerdicts(ctx, []string{knowledge.ID})[knowledge.ID]; verdict != "" {
- resp["stall_state"] = verdict
- }
+ resp.StallState = h.stallVerdicts(ctx, []string{knowledge.ID})[knowledge.ID]
}
}
- if lastError := knowledgeSpansLastError(
+ resp.LastError = knowledgeSpansLastError(
currentAttempt,
latestAttempt,
knowledge.ParseStatus,
knowledge.ErrorMessage,
knowledge.UpdatedAt,
lastErr,
- ); lastError != nil {
- resp["last_error"] = lastError
- }
+ )
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": resp,
})
}
+// KnowledgeSpansData is the data object of GET /knowledge/{id}/spans.
+type KnowledgeSpansData struct {
+ KnowledgeID string `json:"knowledge_id"`
+ // Attempt is the attempt the trace describes; equals CurrentAttempt.
+ Attempt int `json:"attempt"`
+ LatestAttempt int `json:"latest_attempt"`
+ ParseStatus string `json:"parse_status"`
+ CurrentAttempt int `json:"current_attempt"`
+ // CurrentStage is the stage running now, or the last one that ran.
+ CurrentStage string `json:"current_stage"`
+ Trace *types.SpanTreeNode `json:"trace"`
+ // LastActivityAt is set while the parse is in flight.
+ LastActivityAt *time.Time `json:"last_activity_at,omitempty"`
+ // StallState is types.StallStateQueued or types.StallStateStalled when an
+ // in-flight parse has gone quiet.
+ StallState string `json:"stall_state,omitempty"`
+ LastError *KnowledgeSpanError `json:"last_error,omitempty"`
+}
+
+// KnowledgeSpanError is the failure of a parse attempt. Name, ErrorCode and
+// ErrorMessage repeat Stage, Code and Message for older clients.
+type KnowledgeSpanError struct {
+ Stage string `json:"stage"`
+ Code string `json:"code"`
+ Message string `json:"message"`
+ Name string `json:"name"`
+ ErrorCode string `json:"error_code"`
+ ErrorMessage string `json:"error_message"`
+ FinishedAt *time.Time `json:"finished_at"`
+}
+
// knowledgeSpansLastError builds the last_error payload for GetKnowledgeSpans.
// Span failures win when present; otherwise a failed knowledge row without a
// matching span error (recovery / dead-letter paths) surfaces ErrorMessage.
@@ -785,16 +815,16 @@ func knowledgeSpansLastError(
parseStatus, knowledgeErrorMessage string,
knowledgeUpdatedAt time.Time,
spanFailure *types.KnowledgeProcessingSpan,
-) gin.H {
+) *KnowledgeSpanError {
if spanFailure != nil {
- return gin.H{
- "stage": spanFailure.Name,
- "code": spanFailure.ErrorCode,
- "message": spanFailure.ErrorMessage,
- "name": spanFailure.Name,
- "error_code": spanFailure.ErrorCode,
- "error_message": spanFailure.ErrorMessage,
- "finished_at": spanFailure.FinishedAt,
+ return &KnowledgeSpanError{
+ Stage: spanFailure.Name,
+ Code: spanFailure.ErrorCode,
+ Message: spanFailure.ErrorMessage,
+ Name: spanFailure.Name,
+ ErrorCode: spanFailure.ErrorCode,
+ ErrorMessage: spanFailure.ErrorMessage,
+ FinishedAt: spanFailure.FinishedAt,
}
}
if currentAttempt != latestAttempt || parseStatus != types.ParseStatusFailed || knowledgeErrorMessage == "" {
@@ -805,14 +835,14 @@ func knowledgeSpansLastError(
"Task interrupted due to application restart") {
errorCode = "SERVER_RESTART"
}
- return gin.H{
- "stage": "knowledge_processing",
- "code": errorCode,
- "message": knowledgeErrorMessage,
- "name": "knowledge_processing",
- "error_code": errorCode,
- "error_message": knowledgeErrorMessage,
- "finished_at": knowledgeUpdatedAt,
+ return &KnowledgeSpanError{
+ Stage: "knowledge_processing",
+ Code: errorCode,
+ Message: knowledgeErrorMessage,
+ Name: "knowledge_processing",
+ ErrorCode: errorCode,
+ ErrorMessage: knowledgeErrorMessage,
+ FinishedAt: &knowledgeUpdatedAt,
}
}
@@ -1004,22 +1034,24 @@ func buildSpanTree(knowledgeID string, attempt int, rows []types.KnowledgeProces
// @Tags 知识管理
// @Accept json
// @Produce json
+// @Description 不传 parse_status 时不返回删除中(deleting)的文档。
// @Param id path string true "知识库ID"
-// @Param page query int false "页码"
-// @Param page_size query int false "每页数量"
+// @Param page query int false "页码" minimum(1) default(1)
+// @Param page_size query int false "每页数量" minimum(1) maximum(1000) default(20)
// @Param tag_ids query string false "标签ID筛选,逗号分隔(OR语义)"
// @Param keyword query string false "关键词搜索"
// @Param file_type query string false "文件类型筛选"
-// @Param parse_status query string false "解析状态筛选 (pending/processing/completed/failed)"
+// @Param parse_status query string false "状态" Enums(pending,processing,finalizing,completed,failed,cancelled,deleting)
// @Param source query string false "来源/渠道筛选 (web/api/feishu/notion/yuque/wechat/...,或 manual/url 按 type 过滤)"
// @Param start_time query string false "更新时间起点,RFC3339 格式"
// @Param end_time query string false "更新时间终点,RFC3339 格式"
// @Param folder_path query string false "文件夹路径筛选,空字符串表示知识库根目录;不传该参数则不按文件夹过滤"
// @Param folder_recursive query bool false "为 true 时同时返回子文件夹内的文档"
-// @Param sort_by query string false "排序字段: updated_at/created_at/file_name,默认 created_at"
-// @Param sort_order query string false "排序方向: asc/desc,默认 desc"
-// @Success 200 {object} map[string]interface{} "知识列表"
-// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Param sort_by query string false "排序字段" Enums(created_at,updated_at,file_name) default(created_at)
+// @Param sort_order query string false "排序方向" Enums(asc, desc) default(desc)
+// @Success 200 {object} handler.PageResponse{data=[]types.Knowledge} "知识列表"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 403 {object} errors.AppError "无权访问知识库"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/{id}/knowledge [get]
@@ -1157,7 +1189,7 @@ func (h *KnowledgeHandler) ListKnowledge(c *gin.Context) {
// @Param knowledge_ids query string false "来源文档 ID 列表(逗号分隔,最多 50 个),仅返回这些文档的图片"
// @Param attr_filters query string false "属性筛选 JSON,同一属性多值 OR、属性间 AND"
// @Param attr_rules query string false "属性逐值裁决 JSON(off 隐藏 / on 强制显示,on 优先)"
-// @Success 200 {object} map[string]interface{} "图片资产分页列表"
+// @Success 200 {object} handler.PageResponse{data=[]types.ImageAsset} "图片资产分页列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -1334,7 +1366,7 @@ type imageListRequestBody struct {
// @Produce json
// @Param id path string true "知识库 ID"
// @Param body body imageListRequestBody false "筛选参数(与 GET /images 同名参数同义)"
-// @Success 200 {object} map[string]interface{} "图片资产分页列表"
+// @Success 200 {object} handler.PageResponse{data=[]types.ImageAsset} "图片资产分页列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -1495,7 +1527,7 @@ func (h *KnowledgeHandler) GetGalleryConfig(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "知识库ID"
-// @Success 200 {object} map[string]interface{} "目录树"
+// @Success 200 {object} handler.DataResponse{data=types.KnowledgeFolderTree} "目录树"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -1544,7 +1576,7 @@ type MoveKnowledgeToFolderRequest struct {
// @Accept json
// @Produce json
// @Param request body MoveKnowledgeToFolderRequest true "移动请求"
-// @Success 200 {object} map[string]interface{} "移动成功"
+// @Success 200 {object} handler.DataResponse{data=handler.FolderMoveData} "移动成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
@@ -1619,7 +1651,7 @@ type RenameKnowledgeFolderRequest struct {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body RenameKnowledgeFolderRequest true "重命名请求"
-// @Success 200 {object} map[string]interface{} "重命名成功"
+// @Success 200 {object} handler.DataResponse{data=handler.FolderMoveData} "重命名成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
@@ -1741,8 +1773,10 @@ func (h *KnowledgeHandler) requireKnowledgeInKB(
// @Accept json
// @Produce json
// @Param id path string true "知识ID"
-// @Success 200 {object} map[string]interface{} "任务已提交,返回 task_id"
-// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Success 200 {object} handler.DataMessageResponse{data=handler.TaskIDData} "任务已提交"
+// @Failure 400 {object} errors.AppError "请求参数错误或知识正在移动"
+// @Failure 403 {object} errors.AppError "需要编辑权限"
+// @Failure 404 {object} errors.AppError "知识不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge/{id} [delete]
@@ -1810,7 +1844,7 @@ type BatchDeleteKnowledgeRequest struct {
// @Accept json
// @Produce json
// @Param request body BatchDeleteKnowledgeRequest true "批量删除请求"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.SubmittedTaskResponse "删除成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
@@ -1904,7 +1938,7 @@ func (h *KnowledgeHandler) BatchDeleteKnowledge(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "知识库ID"
-// @Success 200 {object} map[string]interface{} "清空任务已提交"
+// @Success 200 {object} handler.SubmittedTaskResponse "清空任务已提交"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
@@ -2079,7 +2113,7 @@ type GetKnowledgeBatchRequest struct {
// @Param ids query []string true "知识ID列表"
// @Param kb_id query string false "可选,知识库ID(用于共享知识库时指定范围)"
// @Param agent_id query string false "可选,共享智能体ID(用于按智能体空间批量拉取文件详情)"
-// @Success 200 {object} map[string]interface{} "知识列表"
+// @Success 200 {object} handler.DataResponse{data=[]types.Knowledge} "知识列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -2298,7 +2332,7 @@ type UpdateKnowledgeRequest struct {
// @Produce json
// @Param id path string true "知识ID"
// @Param request body UpdateKnowledgeRequest true "更新字段(均可选)"
-// @Success 200 {object} map[string]interface{} "更新成功"
+// @Success 200 {object} handler.UpdateKnowledgeResponse "更新成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -2410,7 +2444,7 @@ func (h *KnowledgeHandler) RegenerateKnowledgeSummary(c *gin.Context) {
// @Produce json
// @Param id path string true "知识ID"
// @Param request body types.ManualKnowledgePayload true "手工知识内容"
-// @Success 200 {object} map[string]interface{} "更新后的知识"
+// @Success 200 {object} handler.DataResponse{data=types.Knowledge} "更新后的知识"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -2459,17 +2493,24 @@ func (h *KnowledgeHandler) UpdateManualKnowledge(c *gin.Context) {
})
}
+// ReparseKnowledgeRequest is the optional body of POST /knowledge/{id}/reparse.
+type ReparseKnowledgeRequest struct {
+ // ProcessConfig overrides the processing options stored at upload time.
+ ProcessConfig *types.KnowledgeProcessOverrides `json:"process_config"`
+}
+
// ReparseKnowledge godoc
// @Summary 重新解析知识
// @Description 删除知识中现有的文档内容并重新解析,使用异步任务方式处理
// @Tags 知识管理
// @Accept json
// @Produce json
-// @Param id path string true "知识ID"
-// @Param body body object false "可选的处理配置覆盖:{\"process_config\": KnowledgeProcessOverrides}"
-// @Success 200 {object} map[string]interface{} "重新解析任务已提交"
-// @Failure 400 {object} errors.AppError "请求参数错误"
-// @Failure 403 {object} errors.AppError "权限不足"
+// @Param id path string true "知识ID"
+// @Param body body ReparseKnowledgeRequest false "可选;不传则沿用上传时的处理配置"
+// @Success 200 {object} handler.DataMessageResponse{data=types.Knowledge} "重新解析任务已提交"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 403 {object} errors.AppError "权限不足"
+// @Failure 404 {object} errors.AppError "知识不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge/{id}/reparse [post]
@@ -2495,9 +2536,7 @@ func (h *KnowledgeHandler) ReparseKnowledge(c *gin.Context) {
// overrides stored at upload time.
var processOverrides *types.KnowledgeProcessOverrides
if c.Request.ContentLength != 0 {
- var req struct {
- ProcessConfig *types.KnowledgeProcessOverrides `json:"process_config"`
- }
+ var req ReparseKnowledgeRequest
if err := c.ShouldBindJSON(&req); err != nil {
logger.Error(ctx, "Failed to parse reparse request body", err)
c.Error(errors.NewBadRequestError("Invalid reparse request body").WithDetails(err.Error()))
@@ -2535,7 +2574,7 @@ func (h *KnowledgeHandler) ReparseKnowledge(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "知识ID"
-// @Success 200 {object} map[string]interface{} "取消已提交"
+// @Success 200 {object} handler.DataMessageResponse{data=types.Knowledge} "取消已提交"
// @Failure 400 {object} errors.AppError "状态不支持取消"
// @Failure 403 {object} errors.AppError "权限不足"
// @Failure 404 {object} errors.AppError "知识不存在"
@@ -2593,7 +2632,7 @@ type knowledgeTagBatchRequest struct {
// @Accept json
// @Produce json
// @Param request body object true "标签更新请求(updates 必填,kb_id 可选)"
-// @Success 200 {object} map[string]interface{} "更新成功"
+// @Success 200 {object} handler.SuccessResponse "更新成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -2670,7 +2709,7 @@ func (h *KnowledgeHandler) UpdateKnowledgeTagBatch(c *gin.Context) {
// @Param id path string true "知识ID"
// @Param chunk_id path string true "分块ID"
// @Param request body object{image_info=string} true "图像信息"
-// @Success 200 {object} map[string]interface{} "更新成功"
+// @Success 200 {object} handler.MessageResponse "更新成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -2740,7 +2779,7 @@ func (h *KnowledgeHandler) UpdateImageInfo(c *gin.Context) {
// @Param file_types query string false "Comma-separated file extensions to filter (e.g., csv,xlsx)"
// @Param agent_id query string false "Shared agent ID (search within agent's KB scope)"
// @Param recent query bool false "Return recent files when keyword is empty"
-// @Success 200 {object} map[string]interface{} "Search results"
+// @Success 200 {object} handler.KnowledgeSearchKnowledgeResponse "Search results"
// @Failure 400 {object} errors.AppError "Invalid request"
// @Security Bearer
// @Security ApiKeyAuth
@@ -3191,7 +3230,7 @@ type batchReparseKnowledgeRequest struct {
// @Accept json
// @Produce json
// @Param request body batchReparseKnowledgeRequest true "批量重解析请求"
-// @Success 200 {object} map[string]interface{} "任务已提交"
+// @Success 200 {object} handler.SubmittedTaskResponse "任务已提交"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
diff --git a/internal/handler/knowledge_spans_test.go b/internal/handler/knowledge_spans_test.go
index 2b882a033..5abdbd620 100644
--- a/internal/handler/knowledge_spans_test.go
+++ b/internal/handler/knowledge_spans_test.go
@@ -134,9 +134,9 @@ func TestKnowledgeSpansLastError_PrefersSpanFailure(t *testing.T) {
got := knowledgeSpansLastError(2, 2, types.ParseStatusFailed, "recovery blew up", now, spanFail)
a := assert.New(t)
- a.Equal(types.StageDocReader, got["name"])
- a.Equal("DOCREADER_TIMEOUT", got["error_code"])
- a.Equal("slow", got["error_message"])
+ a.Equal(types.StageDocReader, got.Name)
+ a.Equal("DOCREADER_TIMEOUT", got.ErrorCode)
+ a.Equal("slow", got.ErrorMessage)
}
func TestKnowledgeSpansLastError_RecoveryFallbackUsesKnowledgeMessage(t *testing.T) {
@@ -144,10 +144,10 @@ func TestKnowledgeSpansLastError_RecoveryFallbackUsesKnowledgeMessage(t *testing
got := knowledgeSpansLastError(2, 2, types.ParseStatusFailed, "wiki ingest timed out", now, nil)
a := assert.New(t)
a.NotNil(got)
- a.Equal("knowledge_processing", got["name"])
- a.Equal("UNKNOWN", got["error_code"])
- a.Equal("wiki ingest timed out", got["error_message"])
- a.Equal(now, got["finished_at"])
+ a.Equal("knowledge_processing", got.Name)
+ a.Equal("UNKNOWN", got.ErrorCode)
+ a.Equal("wiki ingest timed out", got.ErrorMessage)
+ a.Equal(&now, got.FinishedAt)
}
func TestKnowledgeSpansLastError_ClassifiesServerRestart(t *testing.T) {
@@ -156,8 +156,8 @@ func TestKnowledgeSpansLastError_ClassifiesServerRestart(t *testing.T) {
"Task interrupted due to application restart", now, nil)
a := assert.New(t)
a.NotNil(got)
- a.Equal("SERVER_RESTART", got["error_code"])
- a.Equal("SERVER_RESTART", got["code"])
+ a.Equal("SERVER_RESTART", got.ErrorCode)
+ a.Equal("SERVER_RESTART", got.Code)
}
func TestKnowledgeSpansLastError_SkipsRecoveryFallbackForHistoricalAttempt(t *testing.T) {
diff --git a/internal/handler/knowledgebase.go b/internal/handler/knowledgebase.go
index 7d097924c..13b621219 100644
--- a/internal/handler/knowledgebase.go
+++ b/internal/handler/knowledgebase.go
@@ -303,6 +303,52 @@ func (h *KnowledgeBaseHandler) resolveKBStoreView(
return view
}
+// KnowledgeBaseJSON is the encoding/json form of a knowledge base: the struct
+// fields plus the computed capabilities object added by MarshalJSON.
+// Doc-only; handlers still serialize *types.KnowledgeBase directly.
+type KnowledgeBaseJSON struct {
+ types.KnowledgeBase
+ Capabilities types.KBCapabilities `json:"capabilities"`
+}
+
+// KnowledgeBaseView is KnowledgeBaseJSON plus the optional vector-store
+// display fields buildKBResponse merges in. Shared responses omit
+// vector_store_id; owned responses include it via the embedded struct.
+type KnowledgeBaseView struct {
+ KnowledgeBaseJSON
+ VectorStoreName string `json:"vector_store_name,omitempty"`
+ VectorStoreSource string `json:"vector_store_source,omitempty"`
+ VectorStoreEngineType string `json:"vector_store_engine_type,omitempty"`
+ VectorStoreStatus string `json:"vector_store_status,omitempty"`
+ // MyPermission is the caller's role on a knowledge base shared from
+ // another workspace; GET /knowledge-bases/{id} sets it.
+ MyPermission string `json:"my_permission,omitempty" enums:"admin,editor,viewer"`
+}
+
+// HybridSearchResponse is the hybrid-search body. meta is set only when the
+// request enabled rerank.
+type HybridSearchResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data []*types.SearchResult `json:"data"`
+ Meta *types.RetrievalMeta `json:"meta,omitempty"`
+}
+
+// DuplicateKnowledgeBaseData is the data object of POST /knowledge-bases/{id}/duplicate.
+type DuplicateKnowledgeBaseData struct {
+ SourceID string `json:"source_id"`
+ TargetID string `json:"target_id"`
+ Message string `json:"message"`
+ KnowledgeBase KnowledgeBaseView `json:"knowledge_base"`
+}
+
+// ImageAttrSchemaData is the data object of GET /image-attrs/schema.
+type ImageAttrSchemaData struct {
+ Version string `json:"version"`
+ Prompt string `json:"prompt"`
+ Attributes []types.AttrSpec `json:"attributes"`
+ DefaultActions types.ImageActionsConfig `json:"default_actions"`
+}
+
// HybridSearch godoc
// @Summary 混合搜索
// @Description 底层召回:向量+关键词混合检索,默认不 rerank(可用 rerank 字段开启);一般检索请用 /knowledge-search。推荐 POST,GET 带 JSON 体仅兼容旧客户端。
@@ -312,8 +358,9 @@ func (h *KnowledgeBaseHandler) resolveKBStoreView(
// @Param id path string true "知识库ID"
// @Param request body types.SearchParams true "搜索参数"
// @Param resource_urls query string false "文件引用形式,public 返回可加载直链" Enums(handle, public) default(handle)
-// @Success 200 {object} map[string]interface{} "搜索结果"
-// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Success 200 {object} handler.HybridSearchResponse "搜索结果"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 404 {object} errors.AppError "知识库不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/{id}/hybrid-search [post]
@@ -408,8 +455,9 @@ func (h *KnowledgeBaseHandler) HybridSearch(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body types.KnowledgeBase true "知识库信息"
-// @Success 201 {object} map[string]interface{} "创建的知识库"
-// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Success 201 {object} handler.DataResponse{data=handler.KnowledgeBaseView} "创建的知识库"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 500 {object} errors.AppError "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases [post]
@@ -493,9 +541,10 @@ func (h *KnowledgeBaseHandler) validateAndGetKnowledgeBase(
// @Produce json
// @Param id path string true "知识库ID"
// @Param agent_id query string false "共享智能体 ID(用于校验智能体是否有权访问该知识库)"
-// @Success 200 {object} map[string]interface{} "知识库详情"
-// @Failure 400 {object} errors.AppError "请求参数错误"
-// @Failure 404 {object} errors.AppError "知识库不存在"
+// @Success 200 {object} handler.DataResponse{data=handler.KnowledgeBaseView} "知识库详情"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 403 {object} errors.AppError "无权访问知识库"
+// @Failure 404 {object} errors.AppError "知识库不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/{id} [get]
@@ -527,8 +576,10 @@ func (h *KnowledgeBaseHandler) GetKnowledgeBase(c *gin.Context) {
// @Accept json
// @Produce json
// @Param agent_id query string false "共享智能体 ID(传入时返回该智能体可用的知识库)"
-// @Success 200 {object} map[string]interface{} "知识库列表"
-// @Failure 500 {object} errors.AppError "服务器错误"
+// @Param creator query string false "按创建者过滤,仅 mine 与 others 生效" Enums(mine, others)
+// @Success 200 {object} handler.DataResponse{data=[]handler.KnowledgeBaseView} "知识库列表"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 500 {object} errors.AppError "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases [get]
@@ -701,8 +752,10 @@ func pickUserDisplayName(u *types.User) string {
// @Accept json
// @Produce json
// @Param id path string true "知识库ID"
-// @Success 200 {object} map[string]interface{} "更新后的知识库"
-// @Failure 404 {object} errors.AppError "知识库不存在"
+// @Success 200 {object} handler.DataResponse{data=handler.KnowledgeBaseView} "更新后的知识库"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 404 {object} errors.AppError "知识库不存在"
+// @Failure 500 {object} errors.AppError "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/{id}/pin [put]
@@ -751,8 +804,10 @@ type UpdateKnowledgeBaseRequest struct {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body UpdateKnowledgeBaseRequest true "更新请求"
-// @Success 200 {object} map[string]interface{} "更新后的知识库"
-// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Success 200 {object} handler.DataResponse{data=handler.KnowledgeBaseView} "更新后的知识库"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 403 {object} errors.AppError "无权限"
+// @Failure 404 {object} errors.AppError "知识库不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/{id} [put]
@@ -834,8 +889,10 @@ func (h *KnowledgeBaseHandler) UpdateKnowledgeBase(c *gin.Context) {
// @Tags 知识库
// @Produce json
// @Param id path string true "知识库ID"
-// @Success 200 {object} map[string]interface{} "生成的知识库画像"
-// @Failure 400 {object} errors.AppError "知识库类型不支持或未配置模型"
+// @Success 200 {object} handler.DataResponse{data=types.KnowledgeBaseProfile} "生成的知识库画像"
+// @Failure 400 {object} errors.AppError "知识库类型不支持或未配置模型"
+// @Failure 403 {object} errors.AppError "无权限"
+// @Failure 404 {object} errors.AppError "知识库不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/{id}/profile/generate [post]
@@ -883,8 +940,10 @@ const knowledgeBaseProfileRequestTimeout = 2 * time.Minute
// @Accept json
// @Produce json
// @Param id path string true "知识库ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
-// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Success 200 {object} handler.MessageResponse "删除成功"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 403 {object} errors.AppError "仅所有者可删除"
+// @Failure 404 {object} errors.AppError "知识库不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/{id} [delete]
@@ -952,8 +1011,10 @@ type DuplicateKnowledgeBaseResponse struct {
// @Accept json
// @Produce json
// @Param request body CopyKnowledgeBaseRequest true "复制请求"
-// @Success 200 {object} map[string]interface{} "任务ID"
-// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Success 200 {object} handler.DataResponse{data=handler.CopyKnowledgeBaseResponse} "任务ID"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 401 {object} errors.AppError "未认证"
+// @Failure 403 {object} errors.AppError "无权限"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/copy [post]
@@ -1104,8 +1165,10 @@ func (h *KnowledgeBaseHandler) CopyKnowledgeBase(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "源知识库 ID"
-// @Success 201 {object} map[string]interface{} "创建后的知识库副本"
-// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Success 201 {object} handler.DataResponse{data=handler.DuplicateKnowledgeBaseData} "创建后的知识库副本"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 403 {object} errors.AppError "无权限"
+// @Failure 404 {object} errors.AppError "知识库不存在"
// @Security Bearer
// @Router /knowledge-bases/{id}/duplicate [post]
func (h *KnowledgeBaseHandler) DuplicateKnowledgeBase(c *gin.Context) {
@@ -1170,8 +1233,9 @@ func (h *KnowledgeBaseHandler) DuplicateKnowledgeBase(c *gin.Context) {
// @Accept json
// @Produce json
// @Param task_id path string true "任务ID"
-// @Success 200 {object} map[string]interface{} "进度信息"
-// @Failure 404 {object} errors.AppError "任务不存在"
+// @Success 200 {object} handler.DataResponse{data=types.KBCloneProgress} "进度信息"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 404 {object} errors.AppError "任务不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/copy/progress/{task_id} [get]
@@ -1284,9 +1348,11 @@ func validateKnowledgeBasePromptInstructions(kb *types.KnowledgeBase) error {
// @Tags 知识库
// @Produce json
// @Param id path string true "源知识库 ID"
-// @Success 200 {object} map[string]interface{} "可移动目标列表"
-// @Failure 400 {object} errors.AppError "请求参数错误"
-// @Failure 404 {object} errors.AppError "知识库不存在"
+// @Success 200 {object} handler.DataResponse{data=[]types.KnowledgeBase} "可移动目标列表"
+// @Failure 400 {object} errors.AppError "请求参数错误"
+// @Failure 401 {object} errors.AppError "未认证"
+// @Failure 403 {object} errors.AppError "无权限"
+// @Failure 404 {object} errors.AppError "知识库不存在"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /knowledge-bases/{id}/move-targets [get]
@@ -1351,13 +1417,15 @@ func (h *KnowledgeBaseHandler) ListMoveTargets(c *gin.Context) {
})
}
-// GetImageAttrsSchema returns the canonical image-attribute registry for this
-// release. It is the single source of truth that drives the frontend attribute
-// panel — both the attributes and their display text (label, description, the
-// meaning of each value) — so adding an attribute later is a backend-only
-// change (one registry row) and the UI follows automatically. Read-only; the
-// registry is global, not per-KB, so it carries no KB id and only the Viewer
-// role is required.
+// GetImageAttrsSchema godoc
+// @Summary 获取图片属性字典
+// @Description 返回当前版本的图片属性注册表、提示词版本和默认动作。全局只读,不绑定知识库。
+// @Tags 知识库
+// @Produce json
+// @Success 200 {object} handler.DataResponse{data=handler.ImageAttrSchemaData}
+// @Security Bearer
+// @Security ApiKeyAuth
+// @Router /image-attrs/schema [get]
func (h *KnowledgeBaseHandler) GetImageAttrsSchema(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"success": true,
diff --git a/internal/handler/mcp_credentials.go b/internal/handler/mcp_credentials.go
index e9dbe8ba6..116ca3494 100644
--- a/internal/handler/mcp_credentials.go
+++ b/internal/handler/mcp_credentials.go
@@ -59,7 +59,7 @@ type mcpCredentialsPutRequest struct {
// @Produce json
// @Param id path string true "MCP 服务 ID"
// @Param request body map[string]interface{} true "{api_key?, token?, client_secret?: string}"
-// @Success 200 {object} map[string]interface{} "写入后的凭据状态"
+// @Success 200 {object} handler.DataResponse{data=dto.CredentialsResponse} "写入后的凭据状态"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "服务不存在"
// @Security Bearer
diff --git a/internal/handler/mcp_endpoint.go b/internal/handler/mcp_endpoint.go
index aea6f0786..d7c09b4ef 100644
--- a/internal/handler/mcp_endpoint.go
+++ b/internal/handler/mcp_endpoint.go
@@ -204,7 +204,7 @@ func (h *MCPEndpointHandler) UpdateMCPEndpoint(c *gin.Context) {
// @Tags MCP端点
// @Produce json
// @Param endpoint_id path string true "端点 ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.SuccessResponse "删除成功"
// @Failure 404 {object} map[string]interface{} "端点不存在"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/mcp_oauth.go b/internal/handler/mcp_oauth.go
index c15952117..e40a0d236 100644
--- a/internal/handler/mcp_oauth.go
+++ b/internal/handler/mcp_oauth.go
@@ -152,7 +152,7 @@ type mcpOAuthAssertionRequest struct {
// @Produce json
// @Param id path string true "MCP 服务 ID"
// @Param request body map[string]interface{} true "{assertion: string}"
-// @Success 200 {object} map[string]interface{} "与 oauth/status 相同"
+// @Success 200 {object} handler.DataResponse{data=mcp.OAuthAuthorizationStatus} "与 oauth/status 相同"
// @Failure 400 {object} errors.AppError "断言无效或被授权服务器拒绝"
// @Failure 404 {object} errors.AppError
// @Security Bearer
@@ -387,7 +387,7 @@ type resolveMCPOAuthBody struct {
// @Produce json
// @Param pending_id path string true "待授权 ID"
// @Param request body map[string]interface{} true "{service_id: string}"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Failure 400 {object} errors.AppError
// @Failure 409 {object} errors.AppError "用户尚未完成授权"
// @Security Bearer
@@ -496,7 +496,7 @@ func (h *MCPOAuthHandler) ResolveMCPOAuth(c *gin.Context) {
// @Tags MCP服务
// @Produce json
// @Param pending_id path string true "待授权 ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Failure 404 {object} errors.AppError
// @Security Bearer
// @Router /agent/mcp-oauth-resolutions/{pending_id}/cancel [post]
diff --git a/internal/handler/mcp_service.go b/internal/handler/mcp_service.go
index 9d455ed8e..148c30bbe 100644
--- a/internal/handler/mcp_service.go
+++ b/internal/handler/mcp_service.go
@@ -87,7 +87,7 @@ func (h *MCPServiceHandler) mcpServiceResponses(
// @Accept json
// @Produce json
// @Param request body types.MCPService true "MCP服务配置"
-// @Success 200 {object} map[string]interface{} "创建的MCP服务"
+// @Success 200 {object} handler.DataResponse{data=dto.MCPServiceResponse} "创建的MCP服务"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -146,7 +146,7 @@ func (h *MCPServiceHandler) CreateMCPService(c *gin.Context) {
// @Produce json
// @Param agent_id query string false "Agent ID; needs agent_source_tenant_id"
// @Param agent_source_tenant_id query int false "Shared agent source workspace"
-// @Success 200 {object} map[string]interface{} "MCP服务列表"
+// @Success 200 {object} handler.DataResponse{data=[]dto.MCPServiceResponse} "MCP服务列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "无权使用该共享智能体"
// @Security Bearer
@@ -238,7 +238,7 @@ func (h *MCPServiceHandler) listSharedAgentMCPServices(c *gin.Context, agent *ty
// @Accept json
// @Produce json
// @Param id path string true "MCP服务ID"
-// @Success 200 {object} map[string]interface{} "MCP服务详情"
+// @Success 200 {object} handler.DataResponse{data=dto.MCPServiceResponse} "MCP服务详情"
// @Failure 404 {object} errors.AppError "服务不存在"
// @Security Bearer
// @Security ApiKeyAuth
@@ -278,7 +278,7 @@ func (h *MCPServiceHandler) GetMCPService(c *gin.Context) {
// @Produce json
// @Param id path string true "MCP服务ID"
// @Param request body object true "更新字段"
-// @Success 200 {object} map[string]interface{} "更新后的MCP服务"
+// @Success 200 {object} handler.DataResponse{data=dto.MCPServiceResponse} "更新后的MCP服务"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -494,7 +494,7 @@ func (h *MCPServiceHandler) UpdateMCPService(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "MCP服务ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.MessageResponse "删除成功"
// @Failure 500 {object} errors.AppError "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -530,7 +530,7 @@ func (h *MCPServiceHandler) DeleteMCPService(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "MCP服务ID"
-// @Success 200 {object} map[string]interface{} "测试结果"
+// @Success 200 {object} handler.DataResponse{data=types.MCPTestResult} "测试结果"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -575,7 +575,7 @@ func (h *MCPServiceHandler) TestMCPService(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "MCP服务ID"
-// @Success 200 {object} map[string]interface{} "工具列表"
+// @Success 200 {object} handler.DataResponse{data=[]types.MCPTool} "工具列表"
// @Failure 500 {object} errors.AppError "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -611,7 +611,7 @@ func (h *MCPServiceHandler) GetMCPServiceTools(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "MCP服务ID"
-// @Success 200 {object} map[string]interface{} "资源列表"
+// @Success 200 {object} handler.DataResponse{data=[]types.MCPResource} "资源列表"
// @Failure 500 {object} errors.AppError "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -685,7 +685,7 @@ type setMCPToolApprovalBody struct {
// @Param id path string true "MCP 服务 ID"
// @Param tool_name path string true "工具名"
// @Param request body map[string]interface{} true "{require_approval?: bool, enabled?: bool}"
-// @Success 200 {object} map[string]interface{} "更新结果"
+// @Success 200 {object} handler.SuccessResponse "更新结果"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "MCP 服务或工具不存在"
// @Security Bearer
diff --git a/internal/handler/me_env_var.go b/internal/handler/me_env_var.go
index b2a36ae5f..4a636ddfa 100644
--- a/internal/handler/me_env_var.go
+++ b/internal/handler/me_env_var.go
@@ -69,7 +69,7 @@ func respondEnvVarError(c *gin.Context, err error) {
// @Description List every sandbox config of this workspace with the caller's own config-wide variables and the credentials its skills declared, each reporting whether it is unset, filled in workspace-wide, or filled in by the caller. Values are never returned.
// @Tags Me
// @Produce json
-// @Success 200 {object} map[string]interface{} "One group per sandbox config"
+// @Success 200 {object} handler.DataResponse{data=[]service.ConfigEnvGroup} "One group per sandbox config"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Security Bearer
// @Router /me/env-vars [get]
@@ -89,7 +89,7 @@ func (h *MeEnvVarHandler) List(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body meEnvVarRequest true "Skill, variable name and value"
-// @Success 200 {object} map[string]interface{} "Stored"
+// @Success 200 {object} handler.SuccessResponse "Stored"
// @Failure 400 {object} apperrors.AppError "Invalid request"
// @Security Bearer
// @Router /me/env-vars/skill [put]
@@ -112,7 +112,7 @@ func (h *MeEnvVarHandler) SetSkill(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body meEnvVarRequest true "Skill and variable name"
-// @Success 200 {object} map[string]interface{} "Deleted"
+// @Success 200 {object} handler.SuccessResponse "Deleted"
// @Failure 404 {object} apperrors.AppError "Not set"
// @Security Bearer
// @Router /me/env-vars/skill [delete]
@@ -135,7 +135,7 @@ func (h *MeEnvVarHandler) DeleteSkill(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body meEnvVarRequest true "Sandbox config, variable name and value"
-// @Success 200 {object} map[string]interface{} "Stored"
+// @Success 200 {object} handler.SuccessResponse "Stored"
// @Failure 400 {object} apperrors.AppError "Invalid request"
// @Security Bearer
// @Router /me/env-vars/sandbox [put]
@@ -160,7 +160,7 @@ func (h *MeEnvVarHandler) SetSandbox(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body meEnvVarRequest true "Sandbox config and variable name"
-// @Success 200 {object} map[string]interface{} "Deleted"
+// @Success 200 {object} handler.SuccessResponse "Deleted"
// @Failure 404 {object} apperrors.AppError "Not set"
// @Security Bearer
// @Router /me/env-vars/sandbox [delete]
diff --git a/internal/handler/memory.go b/internal/handler/memory.go
index 678cad00b..8ac369260 100644
--- a/internal/handler/memory.go
+++ b/internal/handler/memory.go
@@ -33,7 +33,7 @@ func NewMemoryHandler(memoryService interfaces.MemoryService) *MemoryHandler {
// @Description 返回合并后的记忆开关状态(空间级 + 个人级)与记忆条数
// @Tags 长期记忆
// @Produce json
-// @Success 200 {object} map[string]interface{} "记忆设置"
+// @Success 200 {object} handler.DataResponse{data=types.MemorySettings} "记忆设置"
// @Security Bearer
// @Router /memory/settings [get]
func (h *MemoryHandler) GetSettings(c *gin.Context) {
@@ -57,7 +57,7 @@ type updateMemorySettingsRequest struct {
// @Accept json
// @Produce json
// @Param request body object true "设置"
-// @Success 200 {object} map[string]interface{} "更新后的设置"
+// @Success 200 {object} handler.DataResponse{data=types.MemorySettings} "更新后的设置"
// @Security Bearer
// @Router /memory/settings [put]
func (h *MemoryHandler) UpdateSettings(c *gin.Context) {
@@ -91,7 +91,7 @@ func (h *MemoryHandler) UpdateSettings(c *gin.Context) {
// @Param status query string false "状态过滤" Enums(active, superseded, archived, pending)
// @Param limit query int false "每页条数" default(50)
// @Param offset query int false "偏移量"
-// @Success 200 {object} map[string]interface{} "记忆列表"
+// @Success 200 {object} handler.ListItemsResponse "记忆列表"
// @Security Bearer
// @Router /memory/items [get]
func (h *MemoryHandler) ListItems(c *gin.Context) {
@@ -145,7 +145,7 @@ func memoryListPaging(c *gin.Context) (limit, offset int) {
// @Produce json
// @Param limit query int false "每页条数" default(50)
// @Param offset query int false "偏移量"
-// @Success 200 {object} map[string]interface{} "主题列表"
+// @Success 200 {object} handler.ListTopicsResponse "主题列表"
// @Security Bearer
// @Router /memory/topics [get]
func (h *MemoryHandler) ListTopics(c *gin.Context) {
@@ -169,7 +169,7 @@ func (h *MemoryHandler) ListTopics(c *gin.Context) {
// @Tags 长期记忆
// @Produce json
// @Param id path string true "主题 ID"
-// @Success 200 {object} map[string]interface{} "新增的记忆"
+// @Success 200 {object} handler.DataResponse{data=types.MemoryItem} "新增的记忆"
// @Security Bearer
// @Router /memory/topics/{id}/promote [post]
func (h *MemoryHandler) PromoteTopic(c *gin.Context) {
@@ -188,7 +188,7 @@ func (h *MemoryHandler) PromoteTopic(c *gin.Context) {
// @Tags 长期记忆
// @Produce json
// @Param id path string true "主题 ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.SuccessResponse "删除成功"
// @Security Bearer
// @Router /memory/topics/{id} [delete]
func (h *MemoryHandler) DeleteTopic(c *gin.Context) {
@@ -207,7 +207,7 @@ func (h *MemoryHandler) DeleteTopic(c *gin.Context) {
// @Produce json
// @Param limit query int false "每页条数" default(50)
// @Param offset query int false "偏移量"
-// @Success 200 {object} map[string]interface{} "文档列表"
+// @Success 200 {object} handler.ListDocumentsResponse "文档列表"
// @Security Bearer
// @Router /memory/documents [get]
func (h *MemoryHandler) ListDocuments(c *gin.Context) {
@@ -231,7 +231,7 @@ func (h *MemoryHandler) ListDocuments(c *gin.Context) {
// @Tags 长期记忆
// @Produce json
// @Param id path string true "亲和度 ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.SuccessResponse "删除成功"
// @Security Bearer
// @Router /memory/documents/{id} [delete]
func (h *MemoryHandler) DeleteDocument(c *gin.Context) {
@@ -256,7 +256,7 @@ type createMemoryItemRequest struct {
// @Accept json
// @Produce json
// @Param request body object true "记忆内容"
-// @Success 200 {object} map[string]interface{} "新增的记忆"
+// @Success 200 {object} handler.DataResponse{data=types.MemoryItem} "新增的记忆"
// @Security Bearer
// @Router /memory/items [post]
func (h *MemoryHandler) CreateItem(c *gin.Context) {
@@ -287,7 +287,7 @@ type updateMemoryItemRequest struct {
// @Produce json
// @Param id path string true "记忆ID"
// @Param request body object true "记忆内容"
-// @Success 200 {object} map[string]interface{} "更新后的记忆"
+// @Success 200 {object} handler.DataResponse{data=types.MemoryItem} "更新后的记忆"
// @Security Bearer
// @Router /memory/items/{id} [put]
func (h *MemoryHandler) UpdateItem(c *gin.Context) {
@@ -311,7 +311,7 @@ func (h *MemoryHandler) UpdateItem(c *gin.Context) {
// @Tags 长期记忆
// @Produce json
// @Param id path string true "记忆ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.SuccessResponse "删除成功"
// @Security Bearer
// @Router /memory/items/{id} [delete]
func (h *MemoryHandler) DeleteItem(c *gin.Context) {
@@ -329,7 +329,7 @@ func (h *MemoryHandler) DeleteItem(c *gin.Context) {
// @Tags 长期记忆
// @Produce json
// @Param id path string true "记忆 ID"
-// @Success 200 {object} map[string]interface{} "确认成功"
+// @Success 200 {object} handler.DataResponse{data=types.MemoryItem} "确认成功"
// @Security Bearer
// @Router /memory/items/{id}/confirm [post]
//
@@ -351,7 +351,7 @@ func (h *MemoryHandler) ConfirmItem(c *gin.Context) {
// @Tags 长期记忆
// @Produce json
// @Param id path string true "记忆 ID"
-// @Success 200 {object} map[string]interface{} "否决成功"
+// @Success 200 {object} handler.SuccessResponse "否决成功"
// @Security Bearer
// @Router /memory/items/{id}/reject [post]
func (h *MemoryHandler) RejectItem(c *gin.Context) {
@@ -368,7 +368,7 @@ func (h *MemoryHandler) RejectItem(c *gin.Context) {
// @Description 永久删除当前用户的全部记忆
// @Tags 长期记忆
// @Produce json
-// @Success 200 {object} map[string]interface{} "清空成功"
+// @Success 200 {object} handler.ClearResponse "清空成功"
// @Security Bearer
// @Router /memory/items [delete]
func (h *MemoryHandler) Clear(c *gin.Context) {
@@ -386,7 +386,7 @@ func (h *MemoryHandler) Clear(c *gin.Context) {
// @Description 以 JSON 导出当前用户的全部记忆
// @Tags 长期记忆
// @Produce json
-// @Success 200 {object} map[string]interface{} "记忆导出"
+// @Success 200 {object} handler.ExportResponse "记忆导出"
// @Security Bearer
// @Router /memory/export [get]
func (h *MemoryHandler) Export(c *gin.Context) {
@@ -431,7 +431,7 @@ func (h *MemoryHandler) Export(c *gin.Context) {
// @Description 合并意思接近的条目、归档到期事项,不等待每日后台整理
// @Tags 长期记忆
// @Produce json
-// @Success 200 {object} map[string]interface{} "整理结果"
+// @Success 200 {object} handler.DataResponse{data=types.MemoryConsolidationResult} "整理结果"
// @Security Bearer
// @Router /memory/consolidate [post]
func (h *MemoryHandler) Consolidate(c *gin.Context) {
diff --git a/internal/handler/message.go b/internal/handler/message.go
index c6a405a24..5f2a8b18f 100644
--- a/internal/handler/message.go
+++ b/internal/handler/message.go
@@ -120,7 +120,7 @@ func (h *MessageHandler) resolveResourceRewriter(c *gin.Context) (*storageurl.Re
// @Param limit query int false "返回数量" default(20)
// @Param before_time query string false "在此时间之前的消息(RFC3339Nano格式)"
// @Param resource_urls query string false "文件引用形式,public 返回可加载直链" Enums(handle, public) default(handle)
-// @Success 200 {object} map[string]interface{} "消息列表"
+// @Success 200 {object} handler.DataResponse{data=[]types.Message} "消息列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -232,7 +232,7 @@ func (h *MessageHandler) LoadMessages(c *gin.Context) {
// @Produce json
// @Param session_id path string true "会话ID"
// @Param id path string true "消息ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.MessageResponse "删除成功"
// @Failure 500 {object} errors.AppError "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -286,7 +286,7 @@ func (h *MessageHandler) DeleteMessage(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body SearchMessagesRequest true "搜索请求"
-// @Success 200 {object} map[string]interface{} "搜索结果"
+// @Success 200 {object} handler.DataResponse{data=types.MessageSearchResult} "搜索结果"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -351,7 +351,7 @@ type SearchMessagesRequest struct {
// @Tags 消息
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "统计信息"
+// @Success 200 {object} handler.DataResponse{data=types.ChatHistoryKBStats} "统计信息"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /messages/chat-history-stats [get]
diff --git a/internal/handler/message_suggestion.go b/internal/handler/message_suggestion.go
index b195a65a4..4e7cc817d 100644
--- a/internal/handler/message_suggestion.go
+++ b/internal/handler/message_suggestion.go
@@ -7,6 +7,7 @@ import (
apperrors "github.com/Tencent/WeKnora/internal/errors"
"github.com/Tencent/WeKnora/internal/logger"
+ "github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
secutils "github.com/Tencent/WeKnora/internal/utils"
"github.com/gin-gonic/gin"
@@ -17,6 +18,9 @@ type MessageSuggestionHandler struct {
service interfaces.MessageSuggestionService
}
+// Keeps types imported so swag can resolve MessageSuggestionSet in comments.
+var _ types.MessageSuggestionSet
+
func NewMessageSuggestionHandler(service interfaces.MessageSuggestionService) *MessageSuggestionHandler {
return &MessageSuggestionHandler{service: service}
}
@@ -40,8 +44,8 @@ type SuggestionEventRequest struct {
// @Param session_id path string true "会话 ID"
// @Param message_id path string true "助手消息 ID"
// @Param request body EnsureMessageSuggestionsRequest false "生成选项"
-// @Success 200 {object} map[string]interface{}
-// @Success 202 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=types.MessageSuggestionSet}
+// @Success 202 {object} handler.DataResponse{data=types.MessageSuggestionSet}
// @Security Bearer
// @Security ApiKeyAuth
// @Router /sessions/{session_id}/messages/{message_id}/suggestions [post]
@@ -76,7 +80,7 @@ func (h *MessageSuggestionHandler) Ensure(c *gin.Context) {
// @Produce json
// @Param session_id path string true "会话 ID"
// @Param message_id path string true "助手消息 ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=types.MessageSuggestionSet}
// @Security Bearer
// @Security ApiKeyAuth
// @Router /sessions/{session_id}/messages/{message_id}/suggestions [get]
diff --git a/internal/handler/model.go b/internal/handler/model.go
index abf1ef9bf..4cac13e75 100644
--- a/internal/handler/model.go
+++ b/internal/handler/model.go
@@ -63,7 +63,7 @@ type CreateModelRequest struct {
// @Accept json
// @Produce json
// @Param request body CreateModelRequest true "模型信息"
-// @Success 201 {object} map[string]interface{} "创建的模型"
+// @Success 201 {object} handler.DataResponse{data=dto.ModelResponse} "创建的模型"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -146,7 +146,7 @@ type CopyModelRequest struct {
// @Produce json
// @Param id path string true "源模型ID"
// @Param request body CopyModelRequest true "副本展示名"
-// @Success 201 {object} map[string]interface{} "复制的模型"
+// @Success 201 {object} handler.DataResponse{data=dto.ModelResponse} "复制的模型"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "模型不存在"
// @Security Bearer
@@ -208,7 +208,7 @@ func (h *ModelHandler) CopyModel(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "模型ID"
-// @Success 200 {object} map[string]interface{} "模型详情"
+// @Success 200 {object} handler.DataResponse{data=dto.ModelResponse} "模型详情"
// @Failure 404 {object} errors.AppError "模型不存在"
// @Security Bearer
// @Security ApiKeyAuth
@@ -252,7 +252,7 @@ func (h *ModelHandler) GetModel(c *gin.Context) {
// @Tags 模型管理
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "模型列表"
+// @Success 200 {object} handler.DataResponse{data=[]dto.ModelResponse} "模型列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -741,7 +741,7 @@ type UpdateModelRequest struct {
// @Produce json
// @Param id path string true "模型ID"
// @Param request body UpdateModelRequest true "更新信息"
-// @Success 200 {object} map[string]interface{} "更新后的模型"
+// @Success 200 {object} handler.DataResponse{data=dto.ModelResponse} "更新后的模型"
// @Failure 404 {object} errors.AppError "模型不存在"
// @Security Bearer
// @Security ApiKeyAuth
@@ -874,7 +874,7 @@ func (h *ModelHandler) UpdateModel(c *gin.Context) {
// @Accept json
// @Produce json
// @Param id path string true "模型ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.MessageResponse "删除成功"
// @Failure 400 {object} errors.AppError "模型仍被知识库、智能体或长期记忆引用"
// @Failure 404 {object} errors.AppError "模型不存在"
// @Security Bearer
diff --git a/internal/handler/model_catalog.go b/internal/handler/model_catalog.go
index 996ae10b3..a94495c2d 100644
--- a/internal/handler/model_catalog.go
+++ b/internal/handler/model_catalog.go
@@ -190,7 +190,7 @@ func providerDTO(v *modelruntime.Provider, modelType types.ModelType, includeMod
// @Accept json
// @Produce json
// @Param model_type query string false "模型类型 (chat, embedding, rerank, vllm, asr)"
-// @Success 200 {object} map[string]interface{} "厂商列表"
+// @Success 200 {object} handler.DataResponse{data=[]handler.ModelProviderDTO} "厂商列表"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /models/providers [get]
diff --git a/internal/handler/organization.go b/internal/handler/organization.go
index 95f6f38d3..7a60f08d2 100644
--- a/internal/handler/organization.go
+++ b/internal/handler/organization.go
@@ -66,7 +66,7 @@ func NewOrganizationHandler(
// @Accept json
// @Produce json
// @Param request body types.CreateOrganizationRequest true "组织信息"
-// @Success 201 {object} map[string]interface{}
+// @Success 201 {object} handler.DataResponse{data=types.OrganizationResponse}
// @Failure 400 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations [post]
@@ -107,7 +107,7 @@ func (h *OrganizationHandler) CreateOrganization(c *gin.Context) {
// @Tags 组织管理
// @Produce json
// @Param id path string true "组织ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=types.OrganizationResponse}
// @Failure 404 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id} [get]
@@ -303,7 +303,7 @@ func (h *OrganizationHandler) buildResourceCountsByOrg(ctx context.Context, orgs
// @Produce json
// @Param id path string true "组织ID"
// @Param request body types.UpdateOrganizationRequest true "更新信息"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=types.OrganizationResponse}
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id} [put]
@@ -346,7 +346,7 @@ func (h *OrganizationHandler) UpdateOrganization(c *gin.Context) {
// @Description 删除组织(仅组织创建者可操作)
// @Tags 组织管理
// @Param id path string true "组织ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.MessageResponse
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id} [delete]
@@ -451,7 +451,7 @@ func (h *OrganizationHandler) ListMembers(c *gin.Context) {
// @Param id path string true "组织ID"
// @Param tenant_id path string true "成员空间ID"
// @Param request body types.UpdateMemberRoleRequest true "角色信息"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.MessageResponse
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/members/{tenant_id} [put]
@@ -492,7 +492,7 @@ func (h *OrganizationHandler) UpdateMemberRole(c *gin.Context) {
// @Tags 组织管理
// @Param id path string true "组织ID"
// @Param tenant_id path string true "成员空间ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.MessageResponse
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/members/{tenant_id} [delete]
@@ -618,7 +618,7 @@ func (h *OrganizationHandler) PreviewByInviteCode(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body types.JoinOrganizationRequest true "邀请码"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=types.OrganizationResponse}
// @Failure 404 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/join [post]
@@ -659,7 +659,7 @@ func (h *OrganizationHandler) JoinByInviteCode(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body types.SubmitJoinRequestRequest true "申请信息"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=types.OrganizationJoinRequest}
// @Failure 400 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/join-request [post]
@@ -732,7 +732,7 @@ func (h *OrganizationHandler) SubmitJoinRequest(c *gin.Context) {
// @Produce json
// @Param q query string false "搜索关键词(空间名称或描述)"
// @Param limit query int false "返回数量限制" default(20)
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SearchOrganizationsResponse
// @Security Bearer
// @Router /organizations/search [get]
func (h *OrganizationHandler) SearchOrganizations(c *gin.Context) {
@@ -765,7 +765,7 @@ func (h *OrganizationHandler) SearchOrganizations(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body types.JoinByOrganizationIDRequest true "空间 ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=types.OrganizationResponse}
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/join-by-id [post]
@@ -821,7 +821,7 @@ func (h *OrganizationHandler) JoinByOrganizationID(c *gin.Context) {
// @Produce json
// @Param id path string true "组织ID"
// @Param request body types.RequestRoleUpgradeRequest true "申请信息"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=types.OrganizationJoinRequest}
// @Failure 400 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/request-upgrade [post]
@@ -879,7 +879,7 @@ func (h *OrganizationHandler) RequestRoleUpgrade(c *gin.Context) {
// @Description 退出指定组织
// @Tags 组织管理
// @Param id path string true "组织ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.MessageResponse
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/leave [post]
@@ -925,7 +925,7 @@ func (h *OrganizationHandler) LeaveOrganization(c *gin.Context) {
// @Tags 组织管理
// @Produce json
// @Param id path string true "组织ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=types.ListJoinRequestsResponse}
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/join-requests [get]
@@ -995,7 +995,7 @@ func (h *OrganizationHandler) ListJoinRequests(c *gin.Context) {
// @Param id path string true "组织ID"
// @Param request_id path string true "申请ID"
// @Param request body types.ReviewJoinRequestRequest true "审核结果"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.MessageResponse
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/join-requests/{request_id}/review [put]
@@ -1056,7 +1056,7 @@ func (h *OrganizationHandler) ReviewJoinRequest(c *gin.Context) {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body types.ShareKnowledgeBaseRequest true "共享信息"
-// @Success 201 {object} map[string]interface{}
+// @Success 201 {object} handler.DataResponse{data=types.KnowledgeBaseShare}
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /knowledge-bases/{id}/shares [post]
@@ -1159,7 +1159,7 @@ func (h *OrganizationHandler) ListKBShares(c *gin.Context) {
// @Param id path string true "知识库ID"
// @Param share_id path string true "共享记录ID"
// @Param request body types.UpdateSharePermissionRequest true "权限信息"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.MessageResponse
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /knowledge-bases/{id}/shares/{share_id} [put]
@@ -1235,7 +1235,7 @@ func (h *OrganizationHandler) agentShareOnPath(c *gin.Context, shareID string) b
// @Tags 知识库共享
// @Param id path string true "知识库ID"
// @Param share_id path string true "共享记录ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.MessageResponse
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /knowledge-bases/{id}/shares/{share_id} [delete]
@@ -1345,7 +1345,7 @@ func (h *OrganizationHandler) ListOrgShares(c *gin.Context) {
// @Description 获取通过组织共享给当前用户的所有知识库
// @Tags 知识库共享
// @Produce json
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.ListSharedKnowledgeBasesResponse
// @Security Bearer
// @Router /shared-knowledge-bases [get]
func (h *OrganizationHandler) ListSharedKnowledgeBases(c *gin.Context) {
@@ -1467,7 +1467,7 @@ func (h *OrganizationHandler) ListAgentShares(c *gin.Context) {
// @Produce json
// @Param id path string true "智能体 ID"
// @Param share_id path string true "共享记录 ID"
-// @Success 200 {object} map[string]interface{} "success: true"
+// @Success 200 {object} handler.MessageResponse "success: true"
// @Failure 403 {object} apperrors.AppError "无权限"
// @Security Bearer
// @Security ApiKeyAuth
@@ -1571,7 +1571,7 @@ func (h *OrganizationHandler) ListOrgAgentShares(c *gin.Context) {
// @Description 返回所有共享给当前用户所在组织的智能体
// @Tags 组织
// @Produce json
-// @Success 200 {object} map[string]interface{} "智能体列表 + total"
+// @Success 200 {object} handler.ListSharedAgentsResponse "智能体列表 + total"
// @Failure 500 {object} apperrors.AppError "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -1718,7 +1718,7 @@ func (h *OrganizationHandler) listSpaceKnowledgeBasesInOrganization(ctx context.
// @Tags 组织管理
// @Produce json
// @Param id path string true "组织ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.ListOrganizationSharedKnowledgeBasesResponse
// @Security Bearer
// @Router /organizations/{id}/shared-knowledge-bases [get]
func (h *OrganizationHandler) ListOrganizationSharedKnowledgeBases(c *gin.Context) {
@@ -1768,7 +1768,7 @@ func (h *OrganizationHandler) ListOrganizationSharedKnowledgeBases(c *gin.Contex
// @Tags 组织管理
// @Produce json
// @Param id path string true "组织ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.ListOrganizationSharedAgentsResponse
// @Security Bearer
// @Router /organizations/{id}/shared-agents [get]
func (h *OrganizationHandler) ListOrganizationSharedAgents(c *gin.Context) {
@@ -1909,7 +1909,7 @@ func (h *OrganizationHandler) toOrgResponse(ctx context.Context, org *types.Orga
// @Produce json
// @Param id path string true "组织ID"
// @Param q query string true "Exact workspace ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=[]types.TenantInviteCandidate}
// @Security Bearer
// @Router /organizations/{id}/search-tenants [get]
func (h *OrganizationHandler) SearchTenantsForInvite(c *gin.Context) {
@@ -1983,7 +1983,7 @@ func (h *OrganizationHandler) SearchUsersForInvite(c *gin.Context) {
// @Produce json
// @Param id path string true "组织ID"
// @Param request body types.InviteMemberRequest true "邀请信息"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.MessageResponse
// @Failure 400 {object} apperrors.AppError
// @Failure 403 {object} apperrors.AppError
// @Security Bearer
diff --git a/internal/handler/sandbox_config.go b/internal/handler/sandbox_config.go
index fec0aa6ac..0c0243443 100644
--- a/internal/handler/sandbox_config.go
+++ b/internal/handler/sandbox_config.go
@@ -303,7 +303,7 @@ func (h *SandboxConfigHandler) SetWorkspacePolicy(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body sandboxConfigRequest true "Sandbox backend config"
-// @Success 201 {object} map[string]interface{} "Created sandbox config"
+// @Success 201 {object} handler.DataResponse{data=handler.sandboxConfigResponse} "Created sandbox config"
// @Failure 400 {object} apperrors.AppError "Invalid request or validation failure"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Security Bearer
@@ -337,7 +337,7 @@ func (h *SandboxConfigHandler) Create(c *gin.Context) {
// @Tags SandboxConfig
// @Produce json
// @Param id path string true "Sandbox config ID"
-// @Success 200 {object} map[string]interface{} "Sandbox config"
+// @Success 200 {object} handler.DataResponse{data=handler.sandboxConfigResponse} "Sandbox config"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Sandbox config not found"
// @Security Bearer
@@ -367,7 +367,7 @@ func (h *SandboxConfigHandler) Get(c *gin.Context) {
// @Produce json
// @Param id path string true "Sandbox config ID"
// @Param request body sandboxConfigRequest true "Updated sandbox config"
-// @Success 200 {object} map[string]interface{} "Updated sandbox config"
+// @Success 200 {object} handler.DataResponse{data=handler.sandboxConfigResponse} "Updated sandbox config"
// @Failure 400 {object} apperrors.AppError "Invalid request or validation failure"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Sandbox config not found"
@@ -412,7 +412,7 @@ func (h *SandboxConfigHandler) Update(c *gin.Context) {
// @Produce json
// @Param id path string true "Sandbox config ID"
// @Param force query bool false "Force delete when inventory is unverifiable"
-// @Success 200 {object} map[string]interface{} "Deletion success"
+// @Success 200 {object} handler.SuccessResponse "Deletion success"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 409 {object} map[string]interface{} "Live sandboxes or unverifiable inventory"
// @Security Bearer
@@ -439,7 +439,7 @@ func (h *SandboxConfigHandler) Delete(c *gin.Context) {
// @Tags SandboxConfig
// @Produce json
// @Param id path string true "Sandbox config ID"
-// @Success 200 {object} map[string]interface{} "Sandbox inventory"
+// @Success 200 {object} handler.DataResponse{data=service.SandboxInventory} "Sandbox inventory"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/sandbox_skill.go b/internal/handler/sandbox_skill.go
index 6d75f1cc9..b8775ee27 100644
--- a/internal/handler/sandbox_skill.go
+++ b/internal/handler/sandbox_skill.go
@@ -190,7 +190,7 @@ func respondSkillServiceError(c *gin.Context, err error) {
// @Tags SandboxConfig
// @Produce json
// @Param id path string true "Sandbox config ID"
-// @Success 200 {object} map[string]interface{} "Installed skills"
+// @Success 200 {object} handler.DataResponse{data=[]handler.skillResponse} "Installed skills"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Sandbox config not found"
// @Security Bearer
@@ -216,7 +216,7 @@ func (h *SandboxSkillHandler) List(c *gin.Context) {
// @Produce json
// @Param id path string true "Sandbox config ID"
// @Param skillId path string true "Skill ID"
-// @Success 200 {object} map[string]interface{} "Installed skill"
+// @Success 200 {object} handler.DataResponse{data=handler.skillResponse} "Installed skill"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Skill not found"
// @Security Bearer
@@ -238,7 +238,7 @@ func (h *SandboxSkillHandler) Get(c *gin.Context) {
// @Produce json
// @Param id path string true "Sandbox config ID"
// @Param skillId path string true "Skill ID"
-// @Success 200 {object} map[string]interface{} "Skill files"
+// @Success 200 {object} handler.DataResponse{data=[]service.SkillFileEntry} "Skill files"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Skill or files not found"
// @Security Bearer
@@ -263,7 +263,7 @@ func (h *SandboxSkillHandler) ListFiles(c *gin.Context) {
// @Param id path string true "Sandbox config ID"
// @Param skillId path string true "Skill ID"
// @Param path query string true "Skill-root-relative file path"
-// @Success 200 {object} map[string]interface{} "Skill file"
+// @Success 200 {object} handler.DataResponse{data=service.SkillFileContent} "Skill file"
// @Failure 400 {object} apperrors.AppError "Invalid path"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Skill or file not found"
@@ -429,7 +429,7 @@ func (h *SandboxSkillHandler) Reinstall(c *gin.Context) {
// @Produce json
// @Param id path string true "Sandbox config ID"
// @Param skillId path string true "Skill ID"
-// @Success 200 {object} map[string]interface{} "Stopped skill"
+// @Success 200 {object} handler.DataResponse{data=handler.skillResponse} "Stopped skill"
// @Failure 400 {object} apperrors.AppError "Skill is not installing"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Skill not found"
@@ -483,7 +483,7 @@ type skillPatchRequest struct {
// @Param id path string true "Sandbox config ID"
// @Param skillId path string true "Skill ID"
// @Param request body skillPatchRequest true "Fields to update"
-// @Success 200 {object} map[string]interface{} "Updated skill"
+// @Success 200 {object} handler.DataResponse{data=handler.skillResponse} "Updated skill"
// @Failure 400 {object} apperrors.AppError "Invalid request"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Skill not found"
diff --git a/internal/handler/session/qa.go b/internal/handler/session/qa.go
index 64e80cb22..48b981c19 100644
--- a/internal/handler/session/qa.go
+++ b/internal/handler/session/qa.go
@@ -1005,7 +1005,7 @@ func knowledgeSearchOptions(request *SearchKnowledgeRequest) (*types.KnowledgeSe
// @Param session_id path string true "会话ID"
// @Param request body CreateKnowledgeQARequest true "问答请求"
// @Param resource_urls query string false "文件引用形式,public 返回可加载直链" Enums(handle, public) default(handle)
-// @Success 200 {object} map[string]interface{} "问答结果(SSE流)"
+// @Success 200 {string} string "SSE 事件流"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -1035,7 +1035,7 @@ func (h *Handler) KnowledgeQA(c *gin.Context) {
// @Param session_id path string true "会话ID"
// @Param request body CreateKnowledgeQARequest true "问答请求"
// @Param resource_urls query string false "文件引用形式,public 返回可加载直链" Enums(handle, public) default(handle)
-// @Success 200 {object} map[string]interface{} "问答结果(SSE流)"
+// @Success 200 {string} string "SSE 事件流"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/session/stream.go b/internal/handler/session/stream.go
index 734d61831..c3a3c5df6 100644
--- a/internal/handler/session/stream.go
+++ b/internal/handler/session/stream.go
@@ -27,7 +27,7 @@ import (
// @Param session_id path string true "会话ID"
// @Param message_id query string true "消息ID"
// @Param resource_urls query string false "文件引用形式,public 返回可加载直链" Enums(handle, public) default(handle)
-// @Success 200 {object} map[string]interface{} "流式响应"
+// @Success 200 {string} string "SSE 事件流"
// @Failure 404 {object} errors.AppError "会话或消息不存在"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/skill_catalog.go b/internal/handler/skill_catalog.go
index ef10ed8f5..d3c0e0a98 100644
--- a/internal/handler/skill_catalog.go
+++ b/internal/handler/skill_catalog.go
@@ -171,7 +171,7 @@ func (h *SkillHandler) InstallCatalog(c *gin.Context) {
// @Description Refused while any sandbox still has an installation of this skill.
// @Tags Skills
// @Param id path string true "Catalog skill ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Router /skills/catalog/{id} [delete]
func (h *SkillHandler) DeleteCatalog(c *gin.Context) {
if h.catalog == nil {
@@ -193,7 +193,7 @@ func (h *SkillHandler) DeleteCatalog(c *gin.Context) {
// @Tags Skills
// @Produce json
// @Param id path string true "Catalog skill ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=[]service.SkillFileEntry}
// @Router /skills/catalog/{id}/files [get]
func (h *SkillHandler) ListCatalogFiles(c *gin.Context) {
if h.catalog == nil {
@@ -216,7 +216,7 @@ func (h *SkillHandler) ListCatalogFiles(c *gin.Context) {
// @Produce json
// @Param id path string true "Catalog skill ID"
// @Param path query string true "Skill-root-relative file path"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=service.SkillFileContent}
// @Router /skills/catalog/{id}/files/content [get]
func (h *SkillHandler) GetCatalogFile(c *gin.Context) {
if h.catalog == nil {
diff --git a/internal/handler/skill_handler.go b/internal/handler/skill_handler.go
index 381fb8f92..1567ac538 100644
--- a/internal/handler/skill_handler.go
+++ b/internal/handler/skill_handler.go
@@ -70,7 +70,7 @@ type SkillInfoResponse struct {
// @Param sandbox_config_id query string false "Sandbox config ID; ignored for a shared agent"
// @Param agent_id query string false "Agent ID; needs agent_source_tenant_id"
// @Param agent_source_tenant_id query int false "Shared agent source workspace"
-// @Success 200 {object} map[string]interface{} "Skills列表"
+// @Success 200 {object} handler.ListSkillsResponse "Skills列表"
// @Failure 403 {object} errors.AppError "无权使用该共享智能体"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/storagebackend.go b/internal/handler/storagebackend.go
index 0df782d62..ef0ffd175 100644
--- a/internal/handler/storagebackend.go
+++ b/internal/handler/storagebackend.go
@@ -46,7 +46,7 @@ func storageTenantID(c *gin.Context) uint64 { return c.GetUint64(types.TenantIDC
// @Description List all storage backend instances for the current workspace, with credentials masked. The workspace default backend id is returned alongside the list.
// @Tags StorageBackend
// @Produce json
-// @Success 200 {object} map[string]interface{} "List of storage backends and default_storage_backend_id"
+// @Success 200 {object} handler.ListResponse "List of storage backends and default_storage_backend_id"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Security Bearer
// @Security ApiKeyAuth
@@ -76,7 +76,7 @@ func (h *StorageBackendHandler) List(c *gin.Context) {
// @Tags StorageBackend
// @Produce json
// @Param id path string true "Storage backend ID"
-// @Success 200 {object} map[string]interface{} "Storage backend details"
+// @Success 200 {object} handler.DataResponse{data=types.StorageBackend} "Storage backend details"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Storage backend not found"
// @Security Bearer
@@ -102,7 +102,7 @@ func (h *StorageBackendHandler) Get(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body storageBackendRequest true "Storage backend configuration"
-// @Success 201 {object} map[string]interface{} "Created storage backend"
+// @Success 201 {object} handler.DataResponse{data=types.StorageBackend} "Created storage backend"
// @Failure 400 {object} apperrors.AppError "Invalid request, validation, or connectivity test failure"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 409 {object} apperrors.AppError "A storage backend with this name already exists"
@@ -131,7 +131,7 @@ func (h *StorageBackendHandler) Create(c *gin.Context) {
// @Produce json
// @Param id path string true "Storage backend ID"
// @Param request body storageBackendRequest true "Updated storage backend fields"
-// @Success 200 {object} map[string]interface{} "Updated storage backend"
+// @Success 200 {object} handler.DataResponse{data=types.StorageBackend} "Updated storage backend"
// @Failure 400 {object} apperrors.AppError "Immutable field change, read-only backend, validation, or connectivity failure"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Storage backend not found"
@@ -163,7 +163,7 @@ func (h *StorageBackendHandler) Update(c *gin.Context) {
// @Tags StorageBackend
// @Produce json
// @Param id path string true "Storage backend ID"
-// @Success 200 {object} map[string]interface{} "Deletion success"
+// @Success 200 {object} handler.SuccessResponse "Deletion success"
// @Failure 400 {object} apperrors.AppError "Backend is default, bound, read-only, or legacy alias"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Storage backend not found"
@@ -184,7 +184,7 @@ func (h *StorageBackendHandler) Delete(c *gin.Context) {
// @Tags StorageBackend
// @Produce json
// @Param id path string true "Storage backend ID"
-// @Success 200 {object} map[string]interface{} "Default set successfully"
+// @Success 200 {object} handler.SuccessResponse "Default set successfully"
// @Failure 400 {object} apperrors.AppError "Backend is not active"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Storage backend not found"
@@ -206,7 +206,7 @@ func (h *StorageBackendHandler) SetDefault(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body storageBackendRequest true "Storage backend configuration to test"
-// @Success 200 {object} map[string]interface{} "Connectivity test result (success, error)"
+// @Success 200 {object} handler.SuccessErrorResponse "Connectivity test result (success, error)"
// @Failure 400 {object} apperrors.AppError "Invalid request or validation error"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Security Bearer
@@ -236,7 +236,7 @@ func (h *StorageBackendHandler) TestRaw(c *gin.Context) {
// @Tags StorageBackend
// @Produce json
// @Param id path string true "Storage backend ID"
-// @Success 200 {object} map[string]interface{} "Connectivity test result (success, error)"
+// @Success 200 {object} handler.SuccessErrorResponse "Connectivity test result (success, error)"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} apperrors.AppError "Storage backend not found"
// @Security Bearer
@@ -264,7 +264,7 @@ func (h *StorageBackendHandler) TestByID(c *gin.Context) {
// @Description Return the storage provider types allowed by STORAGE_ALLOW_LIST for UI form generation (e.g. local, minio, cos, tos, s3, oss, ks3, obs).
// @Tags StorageBackend
// @Produce json
-// @Success 200 {object} map[string]interface{} "List of allowed storage provider types"
+// @Success 200 {object} handler.DataResponse{data=[]string} "List of allowed storage provider types"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /storage-backends/types [get]
diff --git a/internal/handler/swagger_bodies.go b/internal/handler/swagger_bodies.go
new file mode 100644
index 000000000..4d2494d69
--- /dev/null
+++ b/internal/handler/swagger_bodies.go
@@ -0,0 +1,314 @@
+package handler
+
+// Concrete response bodies for Swagger. Handlers still write these
+// shapes with gin.H; the structs exist so the documented JSON matches.
+
+import (
+ "github.com/Tencent/WeKnora/internal/handler/dto"
+ "github.com/Tencent/WeKnora/internal/im"
+ "github.com/Tencent/WeKnora/internal/types"
+)
+
+// RefreshTokenResponse is the JSON body written by this handler.
+type RefreshTokenResponse struct {
+ Success bool `json:"success" example:"true"`
+ Message string `json:"message"`
+ AccessToken string `json:"access_token"`
+ RefreshToken string `json:"refresh_token"`
+}
+
+// GetAuthConfigResponse is the JSON body written by this handler.
+type GetAuthConfigResponse struct {
+ Success bool `json:"success" example:"true"`
+ RegistrationMode string `json:"registration_mode"`
+ ComplexPasswordEnabled bool `json:"complex_password_enabled"`
+}
+
+// ValidateTokenResponse is the JSON body written by this handler.
+type ValidateTokenResponse struct {
+ Success bool `json:"success" example:"true"`
+ Message string `json:"message"`
+ User types.UserInfo `json:"user"`
+}
+
+// UpdateChunkResponse is the JSON body written by this handler.
+type UpdateChunkResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data types.Chunk `json:"data"`
+ SummaryStatus string `json:"summary_status"`
+ Description string `json:"description"`
+}
+
+// ListAgentsResponse is the JSON body written by this handler.
+type ListAgentsResponse struct {
+ Data []types.CustomAgent `json:"data"`
+ DisabledOwnAgentIDs []string `json:"disabled_own_agent_ids"`
+ Success bool `json:"success" example:"true"`
+}
+
+// GetDeploymentCapabilitiesResponse is the JSON body written by this handler.
+type GetDeploymentCapabilitiesResponse struct {
+ Code int `json:"code"`
+ Msg string `json:"msg"`
+ Data DeploymentCapabilitiesData `json:"data"`
+}
+
+// SuccessResponse is the JSON body written by this handler.
+type SuccessResponse struct {
+ Success bool `json:"success" example:"true"`
+}
+
+// UpdateIMChannelResponse is the JSON body written by this handler.
+type UpdateIMChannelResponse struct {
+ Data im.IMChannel `json:"data"`
+}
+
+// UpdateKnowledgeResponse is the JSON body written by this handler.
+type UpdateKnowledgeResponse struct {
+ Message string `json:"message"`
+ Data types.Knowledge `json:"data"`
+ Success bool `json:"success" example:"true"`
+}
+
+// KnowledgeSearchKnowledgeResponse is the JSON body written by this handler.
+type KnowledgeSearchKnowledgeResponse struct {
+ Total int `json:"total"`
+ Success bool `json:"success" example:"true"`
+ Data []types.Knowledge `json:"data"`
+ HasMore bool `json:"has_more"`
+}
+
+// ListItemsResponse is the JSON body written by this handler.
+type ListItemsResponse struct {
+ Total int `json:"total"`
+ Success bool `json:"success" example:"true"`
+ Data []types.MemoryItem `json:"data"`
+}
+
+// ListTopicsResponse is the JSON body written by this handler.
+type ListTopicsResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data []types.MemoryTopicView `json:"data"`
+ Total int `json:"total"`
+}
+
+// ListDocumentsResponse is the JSON body written by this handler.
+type ListDocumentsResponse struct {
+ Total int `json:"total"`
+ Success bool `json:"success" example:"true"`
+ Data []types.MemoryDocView `json:"data"`
+}
+
+// ClearResponse is the JSON body written by this handler.
+type ClearResponse struct {
+ Success bool `json:"success" example:"true"`
+ Removed int `json:"removed"`
+}
+
+// ExportResponse is the JSON body written by this handler.
+type ExportResponse struct {
+ Data []types.MemoryItem `json:"data"`
+ Success bool `json:"success" example:"true"`
+ Total int `json:"total"`
+ Truncated bool `json:"truncated"`
+}
+
+// SearchOrganizationsResponse is the JSON body written by this handler.
+type SearchOrganizationsResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data []types.SearchableOrganizationItem `json:"data"`
+ Total int `json:"total"`
+}
+
+// ListSharedKnowledgeBasesResponse is the JSON body written by this handler.
+type ListSharedKnowledgeBasesResponse struct {
+ Total int `json:"total"`
+ Success bool `json:"success" example:"true"`
+ Data []map[string]any `json:"data"`
+}
+
+// ListSharedAgentsResponse is the JSON body written by this handler.
+type ListSharedAgentsResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data []types.SharedAgentInfo `json:"data"`
+ Total int `json:"total"`
+}
+
+// ListOrganizationSharedKnowledgeBasesResponse is the JSON body written by this handler.
+type ListOrganizationSharedKnowledgeBasesResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data []map[string]any `json:"data"`
+ Total int `json:"total"`
+}
+
+// ListOrganizationSharedAgentsResponse is the JSON body written by this handler.
+type ListOrganizationSharedAgentsResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data []types.OrganizationSharedAgentItem `json:"data"`
+ Total int `json:"total"`
+}
+
+// ListSkillsResponse is the JSON body written by this handler.
+type ListSkillsResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data []SkillInfoResponse `json:"data"`
+ SkillsAvailable bool `json:"skills_available"`
+}
+
+// ListResponse is the JSON body written by this handler.
+type ListResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data []types.StorageBackend `json:"data"`
+ DefaultStorageBackendID string `json:"default_storage_backend_id"`
+}
+
+// SuccessErrorResponse is the JSON body written by this handler.
+type SuccessErrorResponse struct {
+ Success bool `json:"success" example:"true"`
+ Error string `json:"error,omitempty"`
+}
+
+// ListParserEnginesResponse is the JSON body written by this handler.
+type ListParserEnginesResponse struct {
+ DocreaderTransport string `json:"docreader_transport"`
+ Connected bool `json:"connected"`
+ Code int `json:"code"`
+ Msg string `json:"msg"`
+ Data []types.ParserEngineInfo `json:"data"`
+ DocreaderAddr string `json:"docreader_addr"`
+}
+
+// SetUserStatusResponse is the JSON body written by this handler.
+type SetUserStatusResponse struct {
+ User types.UserInfo `json:"user"`
+ IsActive bool `json:"is_active"`
+ Message string `json:"message"`
+}
+
+// ResetUserPasswordResponse is the JSON body written by this handler.
+type ResetUserPasswordResponse struct {
+ Message string `json:"message"`
+}
+
+// PurgeArchivedRuntimeTasksResponse is the JSON body written by this handler.
+type PurgeArchivedRuntimeTasksResponse struct {
+ Success bool `json:"success" example:"true"`
+ Deleted int `json:"deleted"`
+}
+
+// ApplyDefaultStorageQuotaToAllTenantsResponse is the JSON body written by this handler.
+type ApplyDefaultStorageQuotaToAllTenantsResponse struct {
+ Affected int `json:"affected"`
+ QuotaBytes int `json:"quota_bytes"`
+ QuotaGb int `json:"quota_gb"`
+}
+
+// TestStoreByIDResponse is the JSON body written by this handler.
+type TestStoreByIDResponse struct {
+ Error string `json:"error,omitempty"`
+ Version string `json:"version"`
+ Success bool `json:"success" example:"true"`
+}
+
+// TestStoreRawResponse is the JSON body written by this handler.
+type TestStoreRawResponse struct {
+ Success bool `json:"success" example:"true"`
+ Error string `json:"error,omitempty"`
+ Version string `json:"version"`
+}
+
+// AutoFixResponse is the JSON body written by this handler.
+type AutoFixResponse struct {
+ Fixed int `json:"fixed"`
+ Message string `json:"message"`
+}
+
+// FolderMoveData is the data object of a knowledge-folder move or rename.
+type FolderMoveData struct {
+ MovedCount int `json:"moved_count"`
+ FolderPath string `json:"folder_path"`
+}
+
+// SubmittedTaskData is the data object of an async knowledge batch task.
+// task_id is omitted when the knowledge base was already empty.
+type SubmittedTaskData struct {
+ TaskID string `json:"task_id,omitempty"`
+ DeletedCount int `json:"deleted_count,omitempty"`
+ ReparseCount int `json:"reparse_count,omitempty"`
+}
+
+// SubmittedTaskResponse is success, message, and SubmittedTaskData.
+type SubmittedTaskResponse struct {
+ Success bool `json:"success" example:"true"`
+ Message string `json:"message"`
+ Data SubmittedTaskData `json:"data"`
+}
+
+// TaskIDData is a task id payload.
+type TaskIDData struct {
+ TaskID string `json:"task_id"`
+}
+
+// AllowedToolsWarningsDoc mirrors allowedToolsWarnings for Swagger.
+type AllowedToolsWarningsDoc struct {
+ KeptUnknown []string `json:"kept_unknown,omitempty"`
+ Dropped []string `json:"dropped,omitempty"`
+}
+
+// AgentWriteResponse is the create/update agent body.
+// allowed_tools_warnings is present only when saving rewrote the tool list.
+type AgentWriteResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data types.CustomAgent `json:"data"`
+ AllowedToolsWarnings *AllowedToolsWarningsDoc `json:"allowed_tools_warnings,omitempty"`
+}
+
+// PlaceholderGroups is the data object of GET /agents/placeholders.
+type PlaceholderGroups struct {
+ All []types.PromptPlaceholder `json:"all"`
+ SystemPrompt []types.PromptPlaceholder `json:"system_prompt"`
+ AgentSystemPrompt []types.PromptPlaceholder `json:"agent_system_prompt"`
+ ContextTemplate []types.PromptPlaceholder `json:"context_template"`
+ RewriteSystemPrompt []types.PromptPlaceholder `json:"rewrite_system_prompt"`
+ RewritePrompt []types.PromptPlaceholder `json:"rewrite_prompt"`
+ FallbackPrompt []types.PromptPlaceholder `json:"fallback_prompt"`
+}
+
+// SuggestedQuestionsData is the data object of suggested questions.
+type SuggestedQuestionsData struct {
+ Questions []types.SuggestedQuestion `json:"questions"`
+}
+
+// PreferenceDefaults is the preference_defaults object on GET /auth/me.
+type PreferenceDefaults struct {
+ BrowserSearchInstructions string `json:"browser_search_instructions"`
+}
+
+// CurrentUserCapabilities is the capabilities object on GET /auth/me.
+type CurrentUserCapabilities struct {
+ CanCreateTenant bool `json:"can_create_tenant"`
+ AutoAcceptInvitation bool `json:"auto_accept_invitation"`
+}
+
+// CurrentUserData is the data object of GET /auth/me.
+type CurrentUserData struct {
+ User types.UserInfo `json:"user"`
+ PreferenceDefaults PreferenceDefaults `json:"preference_defaults"`
+ Tenant *dto.TenantResponse `json:"tenant"`
+ Memberships []types.Membership `json:"memberships"`
+ TenantRequired bool `json:"tenant_required"`
+ Capabilities CurrentUserCapabilities `json:"capabilities"`
+}
+
+// TenantListData is the data object of tenant list endpoints.
+type TenantListData struct {
+ Items []*dto.TenantResponse `json:"items"`
+}
+
+// TenantSearchData is the data object of GET /tenants/search.
+type TenantSearchData struct {
+ Items []*dto.TenantResponse `json:"items"`
+ Total int64 `json:"total"`
+ Page int `json:"page"`
+ PageSize int `json:"page_size"`
+}
diff --git a/internal/handler/swagger_response.go b/internal/handler/swagger_response.go
new file mode 100644
index 000000000..21b86419f
--- /dev/null
+++ b/internal/handler/swagger_response.go
@@ -0,0 +1,36 @@
+package handler
+
+// Response envelopes for Swagger annotations. Handlers write these shapes
+// with gin.H; the types only exist so the documented body matches. Compose
+// the payload in the annotation, e.g.
+//
+// @Success 200 {object} handler.DataResponse{data=types.Knowledge}
+// @Success 200 {object} handler.PageResponse{data=[]types.Knowledge}
+
+// DataResponse is the {"success": true, "data": ...} body.
+type DataResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data any `json:"data"`
+}
+
+// PageResponse is a page of a list with the total match count.
+type PageResponse struct {
+ Success bool `json:"success" example:"true"`
+ Data any `json:"data"`
+ Total int64 `json:"total"`
+ Page int `json:"page"`
+ PageSize int `json:"page_size"`
+}
+
+// DataMessageResponse is DataResponse with a human-readable message.
+type DataMessageResponse struct {
+ Success bool `json:"success" example:"true"`
+ Message string `json:"message"`
+ Data any `json:"data"`
+}
+
+// MessageResponse is the {"success": true, "message": ...} body.
+type MessageResponse struct {
+ Success bool `json:"success" example:"true"`
+ Message string `json:"message"`
+}
diff --git a/internal/handler/system.go b/internal/handler/system.go
index 36340f512..3d00bc158 100644
--- a/internal/handler/system.go
+++ b/internal/handler/system.go
@@ -112,7 +112,7 @@ type platformAPIKeyCreateRequest struct {
// @Description Lists non-workspace API keys. Full tokens are always masked. Human SystemAdmin only.
// @Tags System Admin
// @Produce json
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=[]handler.tenantAPIKeyResponse}
// @Security Bearer
// @Router /system/admin/api-keys [get]
func (h *SystemHandler) ListPlatformAPIKeys(c *gin.Context) {
@@ -137,7 +137,7 @@ func (h *SystemHandler) ListPlatformAPIKeys(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body platformAPIKeyCreateRequest true "Platform API key"
-// @Success 201 {object} map[string]interface{}
+// @Success 201 {object} handler.DataResponse{data=handler.tenantAPIKeyCreateResponse}
// @Security Bearer
// @Router /system/admin/api-keys [post]
func (h *SystemHandler) CreatePlatformAPIKey(c *gin.Context) {
@@ -189,7 +189,7 @@ func (h *SystemHandler) CreatePlatformAPIKey(c *gin.Context) {
// @Tags System Admin
// @Produce json
// @Param key_id path int true "API key ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Security Bearer
// @Router /system/admin/api-keys/{key_id} [delete]
func (h *SystemHandler) DeletePlatformAPIKey(c *gin.Context) {
@@ -398,7 +398,7 @@ func (h *SystemHandler) getDocReaderConnInfo() (addr, transport string) {
// @Summary 列出可用的文档解析引擎
// @Tags 系统
// @Produce json
-// @Success 200 {object} map[string]interface{} "解析引擎列表"
+// @Success 200 {object} handler.ListParserEnginesResponse "解析引擎列表"
// @Router /system/parser-engines [get]
func (h *SystemHandler) ListParserEngines(c *gin.Context) {
var overrides map[string]string
@@ -1598,7 +1598,7 @@ type SetUserStatusRequest struct {
// @Accept json
// @Produce json
// @Param request body SetUserStatusRequest true "Account status request"
-// @Success 200 {object} map[string]interface{} "Status updated"
+// @Success 200 {object} handler.SetUserStatusResponse "Status updated"
// @Failure 400 {object} map[string]interface{} "Self-disable / last-admin guard"
// @Failure 404 {object} map[string]interface{} "User not found"
// @Router /system/admin/users/status [post]
@@ -1651,7 +1651,7 @@ type ResetUserPasswordRequest struct {
// @Accept json
// @Produce json
// @Param request body ResetUserPasswordRequest true "Password reset request"
-// @Success 200 {object} map[string]interface{} "Password reset successfully"
+// @Success 200 {object} handler.ResetUserPasswordResponse "Password reset successfully"
// @Failure 400 {object} map[string]interface{} "Invalid request, weak password, or self reset"
// @Failure 403 {object} map[string]interface{} "Forbidden: not a system admin"
// @Failure 404 {object} map[string]interface{} "User not found"
@@ -2241,7 +2241,7 @@ func (h *SystemHandler) MutateRuntimeTask(c *gin.Context) {
// @Tags System Admin
// @Produce json
// @Param queue path string true "Queue name"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.PurgeArchivedRuntimeTasksResponse
// @Router /system/admin/runtime/queues/{queue}/archived [delete]
func (h *SystemHandler) PurgeArchivedRuntimeTasks(c *gin.Context) {
queue := c.Param("queue")
@@ -2425,7 +2425,7 @@ func (h *SystemHandler) UpdateSystemSetting(c *gin.Context) {
// @Description Idempotent — running twice with the same setting is a no-op.
// @Tags System Admin
// @Produce json
-// @Success 200 {object} map[string]interface{} "{ affected: int64, quota_bytes: int64 }"
+// @Success 200 {object} handler.ApplyDefaultStorageQuotaToAllTenantsResponse "{ affected: int64, quota_bytes: int64 }"
// @Failure 500 {object} map[string]interface{} "DB write failed"
// @Router /system/admin/tenants/apply-default-storage-quota [post]
func (h *SystemHandler) ApplyDefaultStorageQuotaToAllTenants(c *gin.Context) {
@@ -2488,7 +2488,7 @@ func (h *SystemHandler) ApplyDefaultStorageQuotaToAllTenants(c *gin.Context) {
// @Description that was never persisted returns 200.
// @Tags System Admin
// @Param key path string true "Setting key"
-// @Success 200 {object} map[string]interface{} "Reset acknowledged"
+// @Success 200 {object} handler.SuccessResponse "Reset acknowledged"
// @Failure 400 {object} map[string]interface{} "Unknown key"
// @Failure 500 {object} map[string]interface{} "DB write failed"
// @Router /system/admin/settings/{key} [delete]
diff --git a/internal/handler/tag.go b/internal/handler/tag.go
index 59b2a2b58..2c2eb3af1 100644
--- a/internal/handler/tag.go
+++ b/internal/handler/tag.go
@@ -79,7 +79,7 @@ func (h *TagHandler) getChunksBySeqIDs(ctx context.Context, tenantID uint64, seq
// @Param page query int false "页码"
// @Param page_size query int false "每页数量"
// @Param keyword query string false "关键词搜索"
-// @Success 200 {object} map[string]interface{} "标签列表"
+// @Success 200 {object} handler.DataResponse{data=types.PageResult} "标签列表"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -124,7 +124,7 @@ type createTagRequest struct {
// @Produce json
// @Param id path string true "知识库ID"
// @Param request body object{name=string,color=string,sort_order=int} true "标签信息"
-// @Success 200 {object} map[string]interface{} "创建的标签"
+// @Success 200 {object} handler.DataResponse{data=types.KnowledgeTag} "创建的标签"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -171,7 +171,7 @@ type updateTagRequest struct {
// @Param id path string true "知识库ID"
// @Param tag_id path string true "标签ID (UUID或seq_id)"
// @Param request body object true "标签更新信息"
-// @Success 200 {object} map[string]interface{} "更新后的标签"
+// @Success 200 {object} handler.DataResponse{data=types.KnowledgeTag} "更新后的标签"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -218,7 +218,7 @@ func (h *TagHandler) UpdateTag(c *gin.Context) {
// @Param force query bool false "强制删除"
// @Param content_only query bool false "仅删除内容,保留标签"
// @Param body body DeleteTagRequest false "删除选项"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.SuccessResponse "删除成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/tenant.go b/internal/handler/tenant.go
index 8f418eaa1..9c5e5276a 100644
--- a/internal/handler/tenant.go
+++ b/internal/handler/tenant.go
@@ -532,7 +532,7 @@ func (h *TenantHandler) autoCreateTenantAPIKey(ctx context.Context) bool {
// @Accept json
// @Produce json
// @Param id path int true "空间ID"
-// @Success 200 {object} map[string]interface{} "空间详情"
+// @Success 200 {object} handler.DataResponse{data=dto.TenantResponse} "空间详情"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 404 {object} errors.AppError "空间不存在"
// @Security Bearer
@@ -574,7 +574,7 @@ func (h *TenantHandler) GetTenant(c *gin.Context) {
// @Produce json
// @Param id path int true "空间ID"
// @Param request body types.Tenant true "空间信息"
-// @Success 200 {object} map[string]interface{} "更新后的空间"
+// @Success 200 {object} handler.DataResponse{data=dto.TenantResponse} "更新后的空间"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Router /tenants/{id} [put]
@@ -890,7 +890,7 @@ func apiPrincipalConfigForResponse(cfg *types.APIPrincipalConfig) apiPrincipalCo
// @Accept json
// @Produce json
// @Param id path int true "空间ID"
-// @Success 200 {object} map[string]interface{} "API principal 配置"
+// @Success 200 {object} handler.DataResponse{data=handler.apiPrincipalConfigResponse} "API principal 配置"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
@@ -925,7 +925,7 @@ func (h *TenantHandler) GetAPIPrincipalConfig(c *gin.Context) {
// @Produce json
// @Param id path int true "空间ID"
// @Param request body handler.apiPrincipalConfigRequest true "API principal 配置"
-// @Success 200 {object} map[string]interface{} "更新后的配置"
+// @Success 200 {object} handler.DataResponse{data=handler.apiPrincipalConfigResponse} "更新后的配置"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
@@ -1013,7 +1013,7 @@ func (h *TenantHandler) UpdateAPIPrincipalConfig(c *gin.Context) {
// @Produce json
// @Param id path int true "空间ID"
// @Param request body handler.apiPrincipalTestTokenRequest true "测试 Token 参数"
-// @Success 200 {object} map[string]interface{} "短期 JWT"
+// @Success 200 {object} handler.DataResponse{data=handler.apiPrincipalTestTokenResponse} "短期 JWT"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
@@ -1116,7 +1116,7 @@ func validateAPIPrincipalExternalUserID(id string) error {
// @Accept json
// @Produce json
// @Param id path int true "空间ID"
-// @Success 200 {object} map[string]interface{} "删除成功"
+// @Success 200 {object} handler.MessageResponse "删除成功"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Router /tenants/{id} [delete]
@@ -1158,7 +1158,7 @@ func (h *TenantHandler) DeleteTenant(c *gin.Context) {
// @Tags 空间管理
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "空间列表"
+// @Success 200 {object} handler.DataResponse{data=handler.TenantListData} "空间列表"
// @Failure 500 {object} errors.AppError "服务器错误"
// @Security Bearer
// @Router /tenants [get]
@@ -1185,7 +1185,7 @@ func (h *TenantHandler) ListTenants(c *gin.Context) {
// @Tags 空间管理
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "所有空间列表"
+// @Success 200 {object} handler.DataResponse{data=handler.TenantListData} "所有空间列表"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
// @Router /tenants/all [get]
@@ -1225,8 +1225,8 @@ func (h *TenantHandler) ListAllTenants(c *gin.Context) {
// @Param keyword query string false "搜索关键词"
// @Param tenant_id query int false "空间ID筛选"
// @Param page query int false "页码" default(1)
-// @Param page_size query int false "每页数量" default(20)
-// @Success 200 {object} map[string]interface{} "搜索结果"
+// @Param page_size query int false "每页数量" default(20) minimum(1) maximum(100)
+// @Success 200 {object} handler.DataResponse{data=handler.TenantSearchData} "搜索结果"
// @Failure 403 {object} errors.AppError "权限不足"
// @Security Bearer
// @Security ApiKeyAuth
@@ -1445,7 +1445,7 @@ func (h *TenantHandler) updateTenantWebSearchConfigInternal(c *gin.Context) {
// @Tags 空间管理
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "网络搜索配置"
+// @Success 200 {object} handler.DataResponse{data=types.WebSearchConfig} "网络搜索配置"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -1597,7 +1597,7 @@ func (h *TenantHandler) updateTenantStorageEngineConfigInternal(c *gin.Context)
// @Tags 空间管理
// @Accept json
// @Produce json
-// @Success 200 {object} map[string]interface{} "提示词模板配置"
+// @Success 200 {object} handler.DataResponse{data=config.PromptTemplatesConfig} "提示词模板配置"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/tenant_invitation.go b/internal/handler/tenant_invitation.go
index 6b705526f..aa7dced38 100644
--- a/internal/handler/tenant_invitation.go
+++ b/internal/handler/tenant_invitation.go
@@ -259,7 +259,7 @@ func (h *TenantInvitationHandler) ListTenantInvitations(c *gin.Context) {
// @Produce json
// @Param id path string true "空间 ID"
// @Param request body createInvitationRequest true "邀请请求"
-// @Success 201 {object} map[string]interface{}
+// @Success 201 {object} handler.DataResponse{data=types.TenantInvitationResponse}
// @Security Bearer
// @Router /tenants/{id}/invitations [post]
func (h *TenantInvitationHandler) CreateInvitation(c *gin.Context) {
@@ -390,7 +390,7 @@ func (h *TenantInvitationHandler) autoAcceptInvitationAndRespond(
// @Produce json
// @Param id path string true "空间 ID"
// @Param inv_id path string true "邀请 ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Security Bearer
// @Router /tenants/{id}/invitations/{inv_id} [delete]
func (h *TenantInvitationHandler) RevokeInvitation(c *gin.Context) {
@@ -667,7 +667,7 @@ func (h *TenantInvitationHandler) AcceptMyInvitationByToken(c *gin.Context) {
// @Tags 我的邀请
// @Produce json
// @Param inv_id path string true "邀请 ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Security Bearer
// @Router /me/invitations/{inv_id}/decline [post]
func (h *TenantInvitationHandler) DeclineMyInvitation(c *gin.Context) {
diff --git a/internal/handler/tenant_invite_link.go b/internal/handler/tenant_invite_link.go
index 2741b2d68..acefa2eb9 100644
--- a/internal/handler/tenant_invite_link.go
+++ b/internal/handler/tenant_invite_link.go
@@ -63,7 +63,7 @@ type createInviteLinkRequest struct {
// @Produce json
// @Param id path string true "空间 ID"
// @Param request body createInviteLinkRequest true "共享链接配置"
-// @Success 201 {object} map[string]interface{}
+// @Success 201 {object} handler.DataResponse{data=types.TenantInvitationResponse}
// @Security Bearer
// @Router /tenants/{id}/invite-links [post]
func (h *TenantInvitationHandler) CreateInviteLink(c *gin.Context) {
diff --git a/internal/handler/tenant_member.go b/internal/handler/tenant_member.go
index cfcf66037..576f8ecca 100644
--- a/internal/handler/tenant_member.go
+++ b/internal/handler/tenant_member.go
@@ -314,7 +314,7 @@ func addMemberAndRespond(
// @Param id path string true "空间 ID"
// @Param user_id path string true "用户 ID"
// @Param request body updateMemberRoleRequest true "目标角色"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Security Bearer
// @Router /tenants/{id}/members/{user_id} [put]
func (h *TenantMemberHandler) UpdateMemberRole(c *gin.Context) {
@@ -367,7 +367,7 @@ func (h *TenantMemberHandler) UpdateMemberRole(c *gin.Context) {
// @Produce json
// @Param id path string true "空间 ID"
// @Param user_id path string true "用户 ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Security Bearer
// @Router /tenants/{id}/members/{user_id} [delete]
func (h *TenantMemberHandler) RemoveMember(c *gin.Context) {
@@ -409,7 +409,7 @@ func (h *TenantMemberHandler) RemoveMember(c *gin.Context) {
// @Tags 空间成员
// @Produce json
// @Param id path string true "空间 ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Security Bearer
// @Router /tenants/{id}/leave [post]
func (h *TenantMemberHandler) LeaveTenant(c *gin.Context) {
diff --git a/internal/handler/user_resource_favorite.go b/internal/handler/user_resource_favorite.go
index 833606286..8a15bcde4 100644
--- a/internal/handler/user_resource_favorite.go
+++ b/internal/handler/user_resource_favorite.go
@@ -55,7 +55,7 @@ func favoriteContext(c *gin.Context) (string, uint64, bool) {
// @Description Lists this user's starred resources in the current workspace for a given type
// @Tags User
// @Param type query string true "Resource type (kb | agent)"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=[]types.UserResourceFavorite}
// @Router /user/favorites [get]
func (h *UserResourceFavoriteHandler) ListFavorites(c *gin.Context) {
ctx := c.Request.Context()
@@ -90,7 +90,7 @@ type AddFavoriteRequest struct {
// @Summary Star a resource
// @Tags User
// @Param body body AddFavoriteRequest true "Type + id"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Router /user/favorites [post]
func (h *UserResourceFavoriteHandler) AddFavorite(c *gin.Context) {
ctx := c.Request.Context()
@@ -120,7 +120,7 @@ func (h *UserResourceFavoriteHandler) AddFavorite(c *gin.Context) {
// @Tags User
// @Param type path string true "Resource type"
// @Param id path string true "Resource id"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.SuccessResponse
// @Router /user/favorites/{type}/{id} [delete]
func (h *UserResourceFavoriteHandler) RemoveFavorite(c *gin.Context) {
ctx := c.Request.Context()
diff --git a/internal/handler/vectorstore.go b/internal/handler/vectorstore.go
index a8e9c139a..0f68da96d 100644
--- a/internal/handler/vectorstore.go
+++ b/internal/handler/vectorstore.go
@@ -84,7 +84,7 @@ func envStoreReadonlyError() gin.H {
// @Accept json
// @Produce json
// @Param request body CreateStoreRequest true "Vector store configuration"
-// @Success 201 {object} map[string]interface{} "Created vector store"
+// @Success 201 {object} handler.DataResponse{data=types.VectorStoreResponse} "Created vector store"
// @Failure 400 {object} errors.AppError "Invalid request or validation error"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 409 {object} errors.AppError "Duplicate endpoint and index"
@@ -132,7 +132,7 @@ func (h *VectorStoreHandler) CreateStore(c *gin.Context) {
// @Description List all vector stores for the current workspace, including environment-configured and user-created stores
// @Tags VectorStore
// @Produce json
-// @Success 200 {object} map[string]interface{} "List of vector stores (env + DB)"
+// @Success 200 {object} handler.DataResponse{data=[]types.VectorStoreResponse} "List of vector stores (env + DB)"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Security Bearer
// @Security ApiKeyAuth
@@ -178,7 +178,7 @@ func (h *VectorStoreHandler) ListStores(c *gin.Context) {
// @Tags VectorStore
// @Produce json
// @Param id path string true "Vector store ID"
-// @Success 200 {object} map[string]interface{} "Vector store details"
+// @Success 200 {object} handler.DataResponse{data=types.VectorStoreResponse} "Vector store details"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} map[string]interface{} "Vector store not found"
// @Security Bearer
@@ -299,7 +299,7 @@ func (h *VectorStoreHandler) UpdateStore(c *gin.Context) {
// @Tags VectorStore
// @Produce json
// @Param id path string true "Vector store ID"
-// @Success 200 {object} map[string]interface{} "Deletion success"
+// @Success 200 {object} handler.SuccessResponse "Deletion success"
// @Failure 400 {object} map[string]interface{} "Env store cannot be deleted"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} map[string]interface{} "Vector store not found"
@@ -343,7 +343,7 @@ func (h *VectorStoreHandler) DeleteStore(c *gin.Context) {
// @Description Return supported engine types with connection and index field schemas for UI form generation
// @Tags VectorStore
// @Produce json
-// @Success 200 {object} map[string]interface{} "List of engine types with config schemas"
+// @Success 200 {object} handler.DataResponse{data=[]types.VectorStoreTypeInfo}
// @Router /vector-stores/types [get]
func (h *VectorStoreHandler) ListStoreTypes(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
@@ -358,7 +358,7 @@ func (h *VectorStoreHandler) ListStoreTypes(c *gin.Context) {
// @Tags VectorStore
// @Produce json
// @Param id path string true "Vector store ID"
-// @Success 200 {object} map[string]interface{} "Connection test result (success, version)"
+// @Success 200 {object} handler.TestStoreByIDResponse "Connection test result (success, version)"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Failure 404 {object} map[string]interface{} "Vector store not found"
// @Security Bearer
@@ -423,7 +423,7 @@ func (h *VectorStoreHandler) TestStoreByID(c *gin.Context) {
// @Accept json
// @Produce json
// @Param request body TestStoreRequest true "Engine type and connection config"
-// @Success 200 {object} map[string]interface{} "Connection test result (success, version)"
+// @Success 200 {object} handler.TestStoreRawResponse "Connection test result (success, version)"
// @Failure 400 {object} errors.AppError "Invalid request"
// @Failure 401 {object} map[string]interface{} "Unauthorized"
// @Security Bearer
diff --git a/internal/handler/web_search.go b/internal/handler/web_search.go
index 1c7a5009f..f52134bf3 100644
--- a/internal/handler/web_search.go
+++ b/internal/handler/web_search.go
@@ -22,7 +22,7 @@ func NewWebSearchHandler() *WebSearchHandler {
// @Description 返回所有已注册的网络搜索 provider(含元数据)
// @Tags 网络搜索
// @Produce json
-// @Success 200 {object} map[string]interface{} "provider 列表"
+// @Success 200 {object} handler.DataResponse{data=[]types.WebSearchProviderTypeInfo} "provider 列表"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /web-search/providers [get]
diff --git a/internal/handler/web_search_provider.go b/internal/handler/web_search_provider.go
index c57137191..e72ca474b 100644
--- a/internal/handler/web_search_provider.go
+++ b/internal/handler/web_search_provider.go
@@ -277,7 +277,7 @@ func (h *WebSearchProviderHandler) UpdateProvider(c *gin.Context) {
// @Tags 网络搜索
// @Produce json
// @Param id path string true "Provider ID"
-// @Success 200 {object} map[string]interface{} "success: true"
+// @Success 200 {object} handler.SuccessResponse "success: true"
// @Failure 404 {object} map[string]interface{} "Provider 不存在"
// @Security Bearer
// @Security ApiKeyAuth
@@ -315,7 +315,7 @@ func (h *WebSearchProviderHandler) DeleteProvider(c *gin.Context) {
// @Description 返回 UI 表单需要的 provider 类型及参数定义
// @Tags 网络搜索
// @Produce json
-// @Success 200 {object} map[string]interface{} "provider 类型列表"
+// @Success 200 {object} handler.DataResponse{data=[]types.WebSearchProviderTypeInfo} "provider 类型列表"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /web-search-providers/types [get]
@@ -334,7 +334,7 @@ func (h *WebSearchProviderHandler) ListProviderTypes(c *gin.Context) {
// @Tags 网络搜索
// @Produce json
// @Param id path string true "Provider ID"
-// @Success 200 {object} map[string]interface{} "测试结果"
+// @Success 200 {object} handler.SuccessErrorResponse "测试结果"
// @Failure 404 {object} map[string]interface{} "Provider 不存在"
// @Security Bearer
// @Security ApiKeyAuth
@@ -379,7 +379,7 @@ type TestProviderRequest struct {
// @Accept json
// @Produce json
// @Param request body handler.TestProviderRequest true "{provider, parameters}"
-// @Success 200 {object} map[string]interface{} "测试结果"
+// @Success 200 {object} handler.SuccessErrorResponse "测试结果"
// @Failure 400 {object} map[string]interface{} "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/weknoracloud.go b/internal/handler/weknoracloud.go
index fb66a2d31..e8777cda1 100644
--- a/internal/handler/weknoracloud.go
+++ b/internal/handler/weknoracloud.go
@@ -3,10 +3,14 @@ package handler
import (
"net/http"
+ "github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"github.com/gin-gonic/gin"
)
+// Keeps types imported so swag can resolve WeKnoraCloudStatusResult.
+var _ types.WeKnoraCloudStatusResult
+
// WeKnoraCloudHandler 处理 WeKnoraCloud 凭证管理
type WeKnoraCloudHandler struct {
svc interfaces.WeKnoraCloudService
@@ -32,7 +36,7 @@ type weKnoraCloudCredentialsRequest struct {
// @Accept json
// @Produce json
// @Param request body map[string]interface{} true "{app_id, app_secret}"
-// @Success 200 {object} map[string]interface{} "success: true"
+// @Success 200 {object} handler.MessageResponse "success: true"
// @Failure 400 {object} map[string]interface{} "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
@@ -60,7 +64,7 @@ func (h *WeKnoraCloudHandler) SaveCredentials(c *gin.Context) {
// @Description 检查当前空间的 WeKnoraCloud 凭证是否完好;needs_reinit=true 表示需要重新保存
// @Tags WeKnoraCloud
// @Produce json
-// @Success 200 {object} map[string]interface{} "凭证状态"
+// @Success 200 {object} types.WeKnoraCloudStatusResult "凭证状态"
// @Failure 500 {object} map[string]interface{} "服务器错误"
// @Security Bearer
// @Security ApiKeyAuth
diff --git a/internal/handler/wiki_page.go b/internal/handler/wiki_page.go
index 602d6050a..e4274e011 100644
--- a/internal/handler/wiki_page.go
+++ b/internal/handler/wiki_page.go
@@ -895,6 +895,17 @@ func (h *WikiPageHandler) GetGraph(c *gin.Context) {
c.JSON(http.StatusOK, graph)
}
+// WikiMessageResponse is the {"message": ...} body Wiki maintenance endpoints
+// write on success.
+type WikiMessageResponse struct {
+ Message string `json:"message"`
+}
+
+// WikiErrorResponse is the {"error": ...} body Wiki endpoints write on failure.
+type WikiErrorResponse struct {
+ Error string `json:"error"`
+}
+
// GetStats godoc
// @Summary Get wiki statistics
// @Description Returns aggregate statistics about the wiki
@@ -902,6 +913,8 @@ func (h *WikiPageHandler) GetGraph(c *gin.Context) {
// @Produce json
// @Param kb_id path string true "Knowledge base ID"
// @Success 200 {object} types.WikiStats
+// @Failure 400 {object} handler.WikiErrorResponse "Not a Wiki knowledge base, or no access"
+// @Failure 500 {object} handler.WikiErrorResponse
// @Security Bearer
// @Router /knowledgebase/{kb_id}/wiki/stats [get]
func (h *WikiPageHandler) GetStats(c *gin.Context) {
@@ -927,8 +940,10 @@ func (h *WikiPageHandler) GetStats(c *gin.Context) {
// @Produce json
// @Param kb_id path string true "Knowledge base ID"
// @Param slug query string false "Filter by page slug"
-// @Param status query string false "Filter by status (pending, ignored, resolved)"
-// @Success 200 {array} types.WikiPageIssue
+// @Param status query string false "Filter by status" Enums(pending, ignored, resolved)
+// @Success 200 {array} types.WikiPageIssue
+// @Failure 400 {object} handler.WikiErrorResponse "Not a Wiki knowledge base, or no access"
+// @Failure 500 {object} handler.WikiErrorResponse
// @Security Bearer
// @Router /knowledgebase/{kb_id}/wiki/issues [get]
func (h *WikiPageHandler) ListIssues(c *gin.Context) {
@@ -1065,7 +1080,7 @@ type WikiSearchHit struct {
// @Accept json
// @Produce json
// @Param request body SearchWikiRequest true "Wiki search request"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.DataResponse{data=[]handler.WikiSearchHit}
// @Failure 400 {object} errors.AppError
// @Security Bearer
// @Security ApiKeyAuth
@@ -1153,8 +1168,11 @@ func mergeWikiSearchKBIDs(ids []string, single string) []string {
// @Summary Rebuild wiki links
// @Description Re-parse all pages and rebuild bidirectional link references
// @Tags Wiki
+// @Produce json
// @Param kb_id path string true "Knowledge base ID"
-// @Success 200 {object} map[string]string
+// @Success 200 {object} handler.WikiMessageResponse
+// @Failure 400 {object} handler.WikiErrorResponse "Not a Wiki knowledge base, or no access"
+// @Failure 500 {object} handler.WikiErrorResponse
// @Security Bearer
// @Router /knowledgebase/{kb_id}/wiki/rebuild-links [post]
func (h *WikiPageHandler) RebuildLinks(c *gin.Context) {
@@ -1179,6 +1197,8 @@ func (h *WikiPageHandler) RebuildLinks(c *gin.Context) {
// @Produce json
// @Param kb_id path string true "Knowledge base ID"
// @Success 200 {object} service.WikiLintReport
+// @Failure 400 {object} handler.WikiErrorResponse "Not a Wiki knowledge base, or no access"
+// @Failure 500 {object} handler.WikiErrorResponse
// @Security Bearer
// @Router /knowledgebase/{kb_id}/wiki/lint [get]
func (h *WikiPageHandler) Lint(c *gin.Context) {
@@ -1203,7 +1223,7 @@ func (h *WikiPageHandler) Lint(c *gin.Context) {
// @Tags Wiki
// @Produce json
// @Param kb_id path string true "Knowledge base ID"
-// @Success 200 {object} map[string]interface{}
+// @Success 200 {object} handler.AutoFixResponse
// @Security Bearer
// @Router /knowledgebase/{kb_id}/wiki/auto-fix [post]
func (h *WikiPageHandler) AutoFix(c *gin.Context) {
diff --git a/internal/types/chunk.go b/internal/types/chunk.go
index ccb902e87..3c33a58fc 100644
--- a/internal/types/chunk.go
+++ b/internal/types/chunk.go
@@ -176,9 +176,9 @@ type Chunk struct {
// 父 Chunk ID,用于关联图片 Chunk 和原始文本 Chunk
ParentChunkID string `json:"parent_chunk_id" gorm:"type:varchar(36);index"`
// 关系 Chunk ID,用于关联关系 Chunk 和原始文本 Chunk
- RelationChunks JSON `json:"relation_chunks" gorm:"type:json"`
+ RelationChunks JSON `json:"relation_chunks" gorm:"type:json" swaggertype:"array,string"`
// 间接关系 Chunk ID,用于关联间接关系 Chunk 和原始文本 Chunk
- IndirectRelationChunks JSON `json:"indirect_relation_chunks" gorm:"type:json"`
+ IndirectRelationChunks JSON `json:"indirect_relation_chunks" gorm:"type:json" swaggertype:"array,string"`
// Metadata 存储 chunk 级别的扩展信息,例如 FAQ 元数据
Metadata JSON `json:"metadata" gorm:"type:json"`
// ContentHash 存储内容的 hash 值,用于快速匹配(主要用于 FAQ)
diff --git a/internal/types/embed_channel.go b/internal/types/embed_channel.go
index 4e8f493c6..bcd16df0a 100644
--- a/internal/types/embed_channel.go
+++ b/internal/types/embed_channel.go
@@ -17,7 +17,7 @@ type EmbedChannel struct {
Name string `json:"name" gorm:"type:varchar(255);not null;default:''"`
Enabled bool `json:"enabled" gorm:"not null;default:true"`
PublishToken string `json:"-" gorm:"type:varchar(64);not null;default:''"`
- AllowedOrigins JSON `json:"allowed_origins" gorm:"type:jsonb;not null;default:'[]'"`
+ AllowedOrigins JSON `json:"allowed_origins" gorm:"type:jsonb;not null;default:'[]'" swaggertype:"array,string"`
WelcomeMessage string `json:"welcome_message" gorm:"type:text;not null;default:''"`
RateLimitPerMinute int `json:"rate_limit_per_minute" gorm:"not null;default:30"`
RateLimitPerDay int `json:"rate_limit_per_day" gorm:"not null;default:10000"`
diff --git a/internal/types/temporary_document.go b/internal/types/temporary_document.go
index e97d76987..78251983a 100644
--- a/internal/types/temporary_document.go
+++ b/internal/types/temporary_document.go
@@ -37,7 +37,7 @@ type TemporaryDocument struct {
Status string `json:"status" gorm:"type:varchar(16);not null;index"`
Content string `json:"-" gorm:"type:text"`
Chunks JSON `json:"-" gorm:"type:jsonb;not null;default:'[]'"`
- ImageRefs JSON `json:"image_refs,omitempty" gorm:"type:jsonb;not null;default:'[]'"`
+ ImageRefs JSON `json:"image_refs,omitempty" gorm:"type:jsonb;not null;default:'[]'" swaggertype:"array,object"`
Metadata JSON `json:"metadata,omitempty" gorm:"type:jsonb;not null;default:'{}'"`
ProcessingOptions JSON `json:"-" gorm:"type:jsonb;not null;default:'{}'"`
TokenCount int `json:"token_count" gorm:"not null;default:0"`
diff --git a/website-docs/06-development/01-dev-guide.md b/website-docs/06-development/01-dev-guide.md
index 634e9c50e..dcfcbbaa3 100644
--- a/website-docs/06-development/01-dev-guide.md
+++ b/website-docs/06-development/01-dev-guide.md
@@ -137,7 +137,7 @@ make package-mac-app # 打 macOS .app(scripts/package-mac-app.sh)
| `fmt` | `go fmt ./...` |
| `lint` | `golangci-lint run` |
| `deps` | `go mod download` |
-| `docs` | `swag init -g ./cmd/server/main.go -o ./docs --parseDependency --parseInternal` 生成 Swagger 文档 |
+| `docs` | `swag init`(参数见 Makefile,含 `--overridesFile ./docs/swag.overrides`)生成 Swagger 文档 |
| `install-swagger` | 安装 `swag` CLI |
### Docker 镜像与服务管理 {#_3-2-docker-镜像与服务管理}