diff --git a/.golangci.yml b/.golangci.yml index 86a59075..14b8656c 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 616c5962..69c328ad 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 5c5bd210..45ed7276 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": { @@ -174,8 +172,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "type": "object", - "additionalProperties": true + "$ref": "#/definitions/internal_handler.SuccessResponse" } }, "404": { @@ -187,6 +184,69 @@ const docTemplate = `{ } } }, + "/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": "交互不存在", + "schema": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError" + } + } + } + } + }, "/agent/tool-approvals/{pending_id}": { "post": { "security": [ @@ -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,8 +10259,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": { @@ -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,8 +19881,22 @@ 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": { @@ -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,6 +21269,119 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_config.PromptTemplate": { + "type": "object", + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_config.PromptTemplatesConfig": { + "type": "object", + "properties": { + "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": { @@ -19324,6 +21481,360 @@ const docTemplate = `{ "ErrModelInUse" ] }, + "github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata": { + "type": "object", + "properties": { + "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" + }, + "auth_server_metadata_url": { + "type": "string" + }, + "auth_type": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthType" + }, + "client_id": { + "type": "string" + }, + "custom_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "github_com_Tencent_WeKnora_internal_handler_dto.MCPCatalogSummary": { + "type": "object", + "properties": { + "stale": { + "type": "boolean" + }, + "synced_at": { + "type": "string" + }, + "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" + }, + "auth_config": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPAuthConfigResponse" + }, + "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" + } + ] + }, + "created_at": { + "type": "string" + }, + "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": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata" + } + }, + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "env_vars": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars" + }, + "headers": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders" + }, + "id": { + "type": "string" + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_handler_dto.ModelParametersDTO": { + "type": "object", + "properties": { + "app_id": { + "type": "string" + }, + "base_url": { + "type": "string" + }, + "context_window": { + "type": "integer" + }, + "custom_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "embedding_parameters": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters" + }, + "extra_config": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "interface_type": { + "type": "string" + }, + "max_concurrency": { + "type": "integer" + }, + "max_output_tokens": { + "type": "integer" + }, + "parameter_size": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "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" + }, + "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" + } + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse": { + "type": "object", + "properties": { + "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" + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_im.IMChannel": { + "type": "object", + "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" + }, + "id": { + "type": "string" + }, + "knowledge_base_id": { + "type": "string" + }, + "locale": { + "type": "string" + }, + "mode": { + "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_infrastructure_chunker.DocProfile": { "type": "object", "properties": { @@ -19420,6 +21931,23 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_mcp.OAuthAuthorizationStatus": { + "type": "object", + "properties": { + "authorized": { + "type": "boolean" + }, + "expires_at": { + "type": "string" + }, + "refresh_available": { + "type": "boolean" + }, + "state": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_models.ModelCost": { "type": "object", "properties": { @@ -19455,10 +21983,7 @@ const docTemplate = `{ }, "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" - } + "type": "object" }, "context_window": { "type": "integer" @@ -19586,6 +22111,192 @@ const docTemplate = `{ } } }, + "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": { + "hint": { + "description": "Hint is rendered under the input, for a warning the label cannot carry.", + "type": "string" + }, + "hints": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "label": { + "type": "string" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "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_models_providers.ExtraField": { + "type": "object", + "properties": { + "default": { + "type": "string" + }, + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "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.ModelType" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption" + } + }, + "placeholder": { + "type": "string" + }, + "placeholders": { + "description": "Placeholders carries localized variants of Placeholder.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_models_runtime.Capabilities": { + "type": "object", + "properties": { + "api": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API" + }, + "cataloged": { + "type": "boolean" + }, + "context_window": { + "type": "integer" + }, + "input": { + "type": "array", + "items": { + "type": "string" + } + }, + "max_output_tokens": { + "type": "integer" + }, + "max_tokens_field": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "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.APIKeyScopeType": { + "type": "string", + "enum": [ + "tenant", + "platform" + ], + "x-enum-varnames": [ + "APIKeyScopeTenant", + "APIKeyScopePlatform" + ] + }, "github_com_Tencent_WeKnora_internal_types.APIPrincipalMode": { "type": "string", "enum": [ @@ -19684,6 +22395,102 @@ const docTemplate = `{ } } }, + "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" + } + }, + "any_of": { + "description": "AnyOf: KB must expose at least ONE of these capability flags.", + "type": "array", + "items": { + "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" + } + }, + "faq_priority_enabled": { + "type": "boolean" + }, + "kb_selection_mode": { + "description": "KBSelectionMode presets the KB picker mode: \"all\" | \"selected\" | \"none\".\nWhen empty, the user's current value stays untouched.", + "type": "string" + }, + "max_iterations": { + "type": "integer" + }, + "retain_retrieval_history": { + "type": "boolean" + }, + "supported_file_types": { + "type": "array", + "items": { + "type": "string" + } + }, + "system_prompt_id": { + "type": "string" + }, + "temperature": { + "type": "number" + }, + "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" + }, + "i18n": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n" + } + }, + "id": { + "type": "string" + }, + "kb_filter": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypeKBFilter" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "label": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": { "type": "string", "enum": [ @@ -19695,6 +22502,77 @@ const docTemplate = `{ "AnswerStrategyRandom" ] }, + "github_com_Tencent_WeKnora_internal_types.AttrSpec": { + "type": "object", + "properties": { + "consumers": { + "description": "downstream steps that read this attribute", + "type": "array", + "items": { + "type": "string" + } + }, + "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": { + "description": "extent | presence", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AttrType" + } + ] + }, + "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" + }, + "label": { + "description": "short on-screen name", + "type": "string" + }, + "value": { + "description": "raw machine value, never localized", + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.AuditAction": { "type": "string", "enum": [ @@ -19842,10 +22720,7 @@ const docTemplate = `{ "type": "string" }, "details": { - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "id": { "type": "integer" @@ -19962,6 +22837,325 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.ChatHistoryKBStats": { + "type": "object", + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.ChatManage": { + "type": "object", + "properties": { + "chat_model_id": { + "description": "Chat model parameters", + "type": "string" + }, + "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" + }, + "disable_keywords_match": { + "type": "boolean" + }, + "disable_vector_match": { + "description": "DisableVectorMatch / DisableKeywordsMatch turn off one recall path for\nevery 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": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.History" + } + }, + "intent": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QueryIntent" + }, + "keyword_threshold": { + "type": "number" + }, + "knowledge_base_ids": { + "description": "Knowledge base retrieval parameters", + "type": "array", + "items": { + "type": "string" + } + }, + "knowledge_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "max_rounds": { + "type": "integer" + }, + "query": { + "type": "string" + }, + "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" + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.Chunk": { + "type": "object", + "properties": { + "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" + }, + "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": { + "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" + } + }, + "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" + }, + "last_editor_id": { + "description": "LastEditorID records the actor that produced the current revision.", + "type": "string" + }, + "metadata": { + "description": "Metadata 存储 chunk 级别的扩展信息,例如 FAQ 元数据", + "type": "object" + }, + "next_chunk_id": { + "description": "Next chunk ID", + "type": "string" + }, + "parent_chunk_id": { + "description": "父 Chunk ID,用于关联图片 Chunk 和原始文本 Chunk", + "type": "string" + }, + "pre_chunk_id": { + "description": "Previous chunk ID", + "type": "string" + }, + "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.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": { @@ -20241,6 +23435,61 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.CustomAgent": { + "type": "object", + "properties": { + "avatar": { + "description": "Avatar/Icon of the agent (emoji or icon name)", + "type": "string" + }, + "config": { + "description": "Agent configuration", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig" + } + ] + }, + "created_at": { + "description": "Timestamps", + "type": "string" + }, + "created_by": { + "description": "Created by user ID", + "type": "string" + }, + "creator_name": { + "description": "CreatorName 由 list handler 在返回前批量回填,作用同 KnowledgeBase.CreatorName:\n让前端列表卡片区分「我创建」与「同空间其他成员创建」。不落库,内建 agent / 老数据\n仍可能为空。", + "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)\nFor built-in agents, this is 'builtin-quick-answer' or 'builtin-smart-reasoning'\nFor 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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": { "type": "object", "properties": { @@ -20528,10 +23777,7 @@ const docTemplate = `{ "properties": { "config": { "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "conflict_strategy": { "description": "Conflict resolution strategy: overwrite or skip", @@ -20567,17 +23813,11 @@ const docTemplate = `{ }, "last_sync_cursor": { "description": "Cursor or state for incremental sync (connector-specific)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "last_sync_result": { "description": "Summary of last sync result", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "latest_sync_log": { "description": "Latest sync log (not stored in DB, populated on query)", @@ -20731,6 +23971,103 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.EvaluationDetail": { + "type": "object", + "properties": { + "metric": { + "description": "Evaluation metrics", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MetricResult" + } + ] + }, + "params": { + "description": "Evaluation parameters", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatManage" + } + ] + }, + "task": { + "description": "Evaluation task info", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationTask" + } + ] + } + } + }, + "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": { + "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": { + "description": "Current task status", + "allOf": [ + { + "$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.ExtractConfig": { "type": "object", "properties": { @@ -20807,6 +24144,81 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.FAQEntry": { + "type": "object", + "properties": { + "answer_strategy": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy" + }, + "answers": { + "type": "array", + "items": { + "type": "string" + } + }, + "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\nCould be the standard question or one of the similar questions", + "type": "string" + }, + "negative_questions": { + "type": "array", + "items": { + "type": "string" + } + }, + "score": { + "type": "number" + }, + "similar_questions": { + "type": "array", + "items": { + "type": "string" + } + }, + "standard_question": { + "type": "string" + }, + "tag_id": { + "type": "integer" + }, + "tag_name": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": { "type": "object", "properties": { @@ -20895,6 +24307,229 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.FAQFailedEntry": { + "type": "object", + "properties": { + "answer_all": { + "description": "是否全部回复", + "type": "boolean" + }, + "answers": { + "description": "答案", + "type": "array", + "items": { + "type": "string" + } + }, + "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": "反例问题", + "type": "array", + "items": { + "type": "string" + } + }, + "reason": { + "description": "失败原因", + "type": "string" + }, + "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" + }, + "tag_name": { + "description": "分类", + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.FAQImportProgress": { + "type": "object", + "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": "失败条目详情(少量时直接返回)", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQFailedEntry" + } + }, + "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": "合并详情", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQMergeDetail" + } + }, + "merge_entry_indices": { + "description": "需要合并的条目索引(内部使用,用于重试时跳过识别)", + "type": "array", + "items": { + "type": "integer" + } + }, + "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": { + "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": [ + "FAQImportStatusPending", + "FAQImportStatusProcessing", + "FAQImportStatusCompleted", + "FAQImportStatusFailed" + ] + }, "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": { "type": "string", "enum": [ @@ -20906,6 +24541,31 @@ const docTemplate = `{ "FAQIndexModeQuestionAnswer" ] }, + "github_com_Tencent_WeKnora_internal_types.FAQMergeDetail": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": { "type": "string", "enum": [ @@ -20952,6 +24612,50 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.FAQSuccessEntry": { + "type": "object", + "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" + } + } + }, + "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": { @@ -21009,6 +24713,35 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.GenerationMetrics": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.GraphNode": { "type": "object", "properties": { @@ -21043,6 +24776,30 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.History": { + "type": "object", + "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", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult" + } + }, + "query": { + "description": "User query text", + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ImageActionsConfig": { "type": "object", "properties": { @@ -21051,6 +24808,68 @@ const docTemplate = `{ } } }, + "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": {} + }, + "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\nimage_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\ntext (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: \"\u003cchunkID\u003e#\u003cindex-in-array\u003e\".", + "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\n(document), resolved from KnowledgeID. Empty when the item no longer\nexists (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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ImageAttrCondition": { "type": "object", "properties": { @@ -21221,6 +25040,10 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.JSONMap": { + "type": "object", + "additionalProperties": {} + }, "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": { "type": "object", "required": [ @@ -21258,6 +25081,141 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.JoinRequestResponse": { + "type": "object", + "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" + } + } + }, + "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": { + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.KBCloneProgress": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus": { "type": "string", "enum": [ @@ -21296,6 +25254,154 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.Knowledge": { + "type": "object", + "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\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" + }, + "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\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" + }, + "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\nrow, 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\n(summary + question + graph chunks). Only meaningful while\nParseStatus == \"finalizing\"; defaults to 0 in any terminal state.", + "type": "integer" + }, + "processed_at": { + "description": "Processed time of the knowledge", + "type": "string" + }, + "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" + } + ] + }, + "source": { + "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)", + "type": "string" + }, + "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" + }, + "storage_size": { + "description": "Storage size of the knowledge", + "type": "integer" + }, + "summary_status": { + "description": "Summary status for async summary generation", + "type": "string" + }, + "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" + } + }, + "tenant_id": { + "description": "Workspace ID", + "type": "integer" + }, + "title": { + "description": "Title of the knowledge", + "type": "string" + }, + "type": { + "description": "Type of the knowledge", + "type": "string" + }, + "updated_at": { + "description": "Last updated time of the knowledge", + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": { "type": "object", "properties": { @@ -21688,6 +25794,66 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare": { + "type": "object", + "properties": { + "created_at": { + "description": "Creation time", + "type": "string" + }, + "deleted_at": { + "description": "Deletion time (soft delete)", + "allOf": [ + { + "$ref": "#/definitions/gorm.DeletedAt" + } + ] + }, + "id": { + "description": "Unique identifier", + "type": "string" + }, + "knowledge_base": { + "description": "Associations (not stored in database)", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase" + } + ] + }, + "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": { + "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.KnowledgeBaseShareResponse": { "type": "object", "properties": { @@ -21744,6 +25910,54 @@ const docTemplate = `{ } } }, + "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" + } + }, + "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" + } + } + }, + "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" + } + }, + "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" + }, + "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.KnowledgeMoveProgress": { "type": "object", "properties": { @@ -21852,6 +26066,85 @@ const docTemplate = `{ } } }, + "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": "string" + } + }, + "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" + }, + "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": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestResponse" + } + }, + "total": { + "type": "integer" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": { "type": "object", "properties": { @@ -22053,6 +26346,23 @@ const docTemplate = `{ "type": "string" } }, + "github_com_Tencent_WeKnora_internal_types.MCPResource": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uri": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.MCPService": { "type": "object", "properties": { @@ -22138,6 +26448,55 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.MCPTestResult": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "message": { + "type": "string" + }, + "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": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPResource" + } + }, + "success": { + "type": "boolean" + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTool" + } + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MCPTool": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.MCPTransportType": { "type": "string", "enum": [ @@ -22310,6 +26669,181 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.MemoryConsolidationResult": { + "type": "object", + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MemoryDocView": { + "type": "object", + "properties": { + "hits": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "knowledge_base_id": { + "type": "string" + }, + "knowledge_id": { + "type": "string" + }, + "last_used_at": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MemoryItem": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "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" + }, + "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\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" + }, + "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": "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" + }, + "updated_at": { + "type": "string" + }, + "use_count": { + "type": "integer" + }, + "valid_from": { + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MemorySettings": { + "type": "object", + "properties": { + "effective": { + "description": "Effective is what actually happens: WorkspaceEnabled \u0026\u0026 UserEnabled.", + "type": "boolean" + }, + "item_count": { + "description": "ItemCount is how many active memories the caller currently has.", + "type": "integer" + }, + "max_items": { + "description": "MaxItems is the capacity cap after which the lowest ranked are archived.", + "type": "integer" + }, + "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" + }, + "workspace_enabled": { + "description": "WorkspaceEnabled is the admin switch on the workspace.", + "type": "boolean" + }, + "write_mode": { + "description": "WriteMode is the workspace write mode.", + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MemoryTopicView": { + "type": "object", + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "hits": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "last_seen_at": { + "type": "string" + }, + "threshold": { + "type": "integer" + }, + "topic": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.MentionedItem": { "type": "object", "properties": { @@ -22438,6 +26972,14 @@ const docTemplate = `{ "description": "ModelID is the requested/effective chat model binding captured for this\nturn. It is useful for reproducibility and suggestion generation.", "type": "string" }, + "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" @@ -22446,6 +26988,10 @@ const docTemplate = `{ "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": [ @@ -22580,6 +27126,147 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem": { + "type": "object", + "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\u0026A 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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MessageSearchResult": { + "type": "object", + "properties": { + "items": { + "description": "List of merged Q\u0026A pairs", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem" + } + }, + "total": { + "description": "Total number of results", + "type": "integer" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet": { + "type": "object", + "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": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestionItem" + } + }, + "session_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "suppression_reason": { + "type": "string" + }, + "tenant_id": { + "type": "integer" + }, + "updated_at": { + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MetricResult": { + "type": "object", + "properties": { + "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.MinIOEngineConfig": { "type": "object", "properties": { @@ -22798,6 +27485,29 @@ const docTemplate = `{ } } }, + "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": [ @@ -22942,6 +27652,186 @@ const docTemplate = `{ "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": "Creation time", + "type": "string" + }, + "deleted_at": { + "description": "Deletion time (soft delete)", + "allOf": [ + { + "$ref": "#/definitions/gorm.DeletedAt" + } + ] + }, + "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": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationTenantMember" + } + }, + "name": { + "description": "Name of the organization", + "type": "string" + }, + "owner": { + "description": "Associations (not stored in database)", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User" + } + ] + }, + "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\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.OrganizationJoinRequest": { + "type": "object", + "properties": { + "created_at": { + "description": "Creation time", + "type": "string" + }, + "id": { + "description": "Unique identifier", + "type": "string" + }, + "message": { + "description": "Optional message from the requester", + "type": "string" + }, + "organization": { + "description": "Associations (not stored in database)", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Organization" + } + ] + }, + "organization_id": { + "description": "Organization ID", + "type": "string" + }, + "prev_role": { + "description": "Previous role before upgrade (only for upgrade requests)", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + } + ] + }, + "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" + }, + "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": { + "description": "Status of the request", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestStatus" + } + ] + }, + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": { "type": "object", "properties": { @@ -23051,6 +27941,104 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.OrganizationSharedAgentItem": { + "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" + }, + "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\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.OrganizationTenantMember": { + "type": "object", + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.PageResult": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": { "type": "object", "properties": { @@ -23161,6 +28149,29 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.ParserEngineInfo": { + "type": "object", + "properties": { + "available": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "fileTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "unavailableReason": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": { "type": "object", "properties": { @@ -23179,6 +28190,29 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.PendingPromptView": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "request": { + "type": "object" + }, + "tool_call_id": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.PromptCacheStatus": { "type": "string", "enum": [ @@ -23194,15 +28228,54 @@ const docTemplate = `{ "PromptCacheStatusHit" ] }, + "github_com_Tencent_WeKnora_internal_types.PromptPlaceholder": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ProviderMetadata": { "type": "object", "additionalProperties": { - "type": "array", - "items": { - "type": "integer" - } + "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": { @@ -23358,6 +28431,53 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.RerankDiagnostics": { + "type": "object", + "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\nimage; ImagesKept the pictorial image hits kept over a text reranker's\nrejection 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\napplied after degradation.", + "type": "number" + }, + "top_score": { + "description": "TopScore is the best rerank model score among the candidates.", + "type": "number" + } + } + }, "github_com_Tencent_WeKnora_internal_types.RerankOptions": { "type": "object", "properties": { @@ -23379,6 +28499,31 @@ const docTemplate = `{ } } }, + "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": { @@ -23489,6 +28634,43 @@ const docTemplate = `{ } } }, + "github_com_Tencent_WeKnora_internal_types.RetrievalMeta": { + "type": "object", + "properties": { + "rerank": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankDiagnostics" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.RetrievalMetrics": { + "type": "object", + "properties": { + "map": { + "description": "Mean Average Precision", + "type": "number" + }, + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": { "type": "object", "properties": { @@ -23878,10 +29060,7 @@ const docTemplate = `{ }, "chunk_metadata": { "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "chunk_type": { "description": "Chunk 类型", @@ -23993,6 +29172,43 @@ const docTemplate = `{ } } }, + "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": { @@ -24137,6 +29353,46 @@ const docTemplate = `{ } } }, + "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": { @@ -24241,6 +29497,68 @@ const docTemplate = `{ } } }, + "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": { @@ -24261,6 +29579,44 @@ const docTemplate = `{ } } }, + "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": { @@ -24417,6 +29773,27 @@ const docTemplate = `{ } } }, + "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": { @@ -24428,6 +29805,90 @@ const docTemplate = `{ } } }, + "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": { @@ -24477,10 +29938,7 @@ const docTemplate = `{ }, "result": { "description": "Detailed sync result (JSON-encoded)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "started_at": { "description": "Sync start time", @@ -24545,10 +30003,7 @@ const docTemplate = `{ "type": "string" }, "value": { - "type": "array", - "items": { - "type": "integer" - } + "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.", @@ -24710,6 +30165,108 @@ const docTemplate = `{ } } }, + "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": [ @@ -24884,10 +30441,7 @@ const docTemplate = `{ "github_com_Tencent_WeKnora_internal_types.ToolCallMetadata": { "type": "object", "additionalProperties": { - "type": "array", - "items": { - "type": "integer" - } + "type": "object" } }, "github_com_Tencent_WeKnora_internal_types.ToolCallTarget": { @@ -25139,6 +30693,26 @@ const docTemplate = `{ } } }, + "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": { @@ -25174,6 +30748,128 @@ const docTemplate = `{ } } }, + "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": { @@ -25214,6 +30910,23 @@ const docTemplate = `{ } } }, + "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": { @@ -25266,6 +30979,55 @@ const docTemplate = `{ } } }, + "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": { @@ -25380,6 +31142,54 @@ const docTemplate = `{ "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": { @@ -25795,10 +31605,7 @@ const docTemplate = `{ }, "page_metadata": { "description": "Arbitrary metadata (tags, categories, dates, etc.)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "page_type": { "description": "Page type: summary, entity, concept, index, synthesis, comparison", @@ -25939,10 +31746,7 @@ const docTemplate = `{ }, "page_metadata": { "description": "Arbitrary metadata (tags, categories, dates, etc.)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "page_type": { "description": "Page type: summary, entity, concept, index, synthesis, comparison", @@ -26262,6 +32066,63 @@ const docTemplate = `{ } } }, + "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": [ @@ -26296,6 +32157,18 @@ const docTemplate = `{ } } }, + "internal_handler.ClearResponse": { + "type": "object", + "properties": { + "removed": { + "type": "integer" + }, + "success": { + "type": "boolean", + "example": true + } + } + }, "internal_handler.CopyKnowledgeBaseRequest": { "type": "object", "required": [ @@ -26313,6 +32186,23 @@ const docTemplate = `{ } } }, + "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": [ @@ -26407,6 +32297,66 @@ const docTemplate = `{ } } }, + "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": { @@ -26419,6 +32369,75 @@ const docTemplate = `{ } } }, + "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": { @@ -26448,6 +32467,38 @@ const docTemplate = `{ } } }, + "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": [ @@ -26465,6 +32516,54 @@ const docTemplate = `{ } } }, + "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": { @@ -26532,6 +32631,44 @@ const docTemplate = `{ } } }, + "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": [ @@ -26889,6 +33026,346 @@ const docTemplate = `{ } } }, + "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": { @@ -26909,6 +33386,178 @@ const docTemplate = `{ } } }, + "internal_handler.ListDocumentsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryDocView" + } + }, + "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" + } + }, + "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" + } + }, + "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.ListParserEnginesResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "connected": { + "type": "boolean" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineInfo" + } + }, + "docreader_addr": { + "type": "string" + }, + "docreader_transport": { + "type": "string" + }, + "msg": { + "type": "string" + } + } + }, + "internal_handler.ListResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend" + } + }, + "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": {} + } + }, + "success": { + "type": "boolean", + "example": true + }, + "total": { + "type": "integer" + } + } + }, + "internal_handler.ListSkillsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/internal_handler.SkillInfoResponse" + } + }, + "skills_available": { + "type": "boolean" + }, + "success": { + "type": "boolean", + "example": true + } + } + }, "internal_handler.ListSystemAdminsResponse": { "type": "object", "properties": { @@ -26923,6 +33572,163 @@ const docTemplate = `{ } } }, + "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" + }, + "success": { + "type": "boolean", + "example": true + } + } + }, + "internal_handler.ModelCatalogEntryDTO": { + "type": "object", + "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": { + "type": "array", + "items": { + "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.ModelProviderDTO": { + "type": "object", + "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\ntypes that do not take a plain API key (signed rerank APIs).", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.CredentialLabel" + } + }, + "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" + } + } + }, "internal_handler.ModelTestRequest": { "type": "object", "required": [ @@ -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": { @@ -27194,6 +34074,50 @@ const docTemplate = `{ } } }, + "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.RefreshTokenResponse": { + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "message": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "success": { + "type": "boolean", + "example": true + } + } + }, "internal_handler.RemoteModelCheckRequest": { "type": "object", "required": [ @@ -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": { @@ -27781,6 +34954,69 @@ const docTemplate = `{ } } }, + "internal_handler.ValidateTokenResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "success": { + "type": "boolean", + "example": true + }, + "user": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo" + } + } + }, + "internal_handler.WikiErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "internal_handler.WikiMessageResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "internal_handler.WikiSearchHit": { + "type": "object", + "properties": { + "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" + } + } + }, "internal_handler.acceptInvitationByTokenRequest": { "type": "object", "required": [ @@ -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 00000000..6975fc01 --- /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 44208bad..cc06001a 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": { @@ -167,8 +165,7 @@ "200": { "description": "OK", "schema": { - "type": "object", - "additionalProperties": true + "$ref": "#/definitions/internal_handler.SuccessResponse" } }, "404": { @@ -180,6 +177,69 @@ } } }, + "/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": "交互不存在", + "schema": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError" + } + } + } + } + }, "/agent/tool-approvals/{pending_id}": { "post": { "security": [ @@ -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,8 +10252,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": { @@ -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,8 +19874,22 @@ "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": { @@ -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,6 +21262,119 @@ } } }, + "github_com_Tencent_WeKnora_internal_config.PromptTemplate": { + "type": "object", + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_config.PromptTemplatesConfig": { + "type": "object", + "properties": { + "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": { @@ -19317,6 +21474,360 @@ "ErrModelInUse" ] }, + "github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata": { + "type": "object", + "properties": { + "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" + }, + "auth_server_metadata_url": { + "type": "string" + }, + "auth_type": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthType" + }, + "client_id": { + "type": "string" + }, + "custom_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "github_com_Tencent_WeKnora_internal_handler_dto.MCPCatalogSummary": { + "type": "object", + "properties": { + "stale": { + "type": "boolean" + }, + "synced_at": { + "type": "string" + }, + "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" + }, + "auth_config": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.MCPAuthConfigResponse" + }, + "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" + } + ] + }, + "created_at": { + "type": "string" + }, + "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": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata" + } + }, + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "env_vars": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars" + }, + "headers": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders" + }, + "id": { + "type": "string" + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_handler_dto.ModelParametersDTO": { + "type": "object", + "properties": { + "app_id": { + "type": "string" + }, + "base_url": { + "type": "string" + }, + "context_window": { + "type": "integer" + }, + "custom_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "embedding_parameters": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters" + }, + "extra_config": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "interface_type": { + "type": "string" + }, + "max_concurrency": { + "type": "integer" + }, + "max_output_tokens": { + "type": "integer" + }, + "parameter_size": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "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" + }, + "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" + } + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_handler_dto.TenantResponse": { + "type": "object", + "properties": { + "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" + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_im.IMChannel": { + "type": "object", + "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" + }, + "id": { + "type": "string" + }, + "knowledge_base_id": { + "type": "string" + }, + "locale": { + "type": "string" + }, + "mode": { + "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_infrastructure_chunker.DocProfile": { "type": "object", "properties": { @@ -19413,6 +21924,23 @@ } } }, + "github_com_Tencent_WeKnora_internal_mcp.OAuthAuthorizationStatus": { + "type": "object", + "properties": { + "authorized": { + "type": "boolean" + }, + "expires_at": { + "type": "string" + }, + "refresh_available": { + "type": "boolean" + }, + "state": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_models.ModelCost": { "type": "object", "properties": { @@ -19448,10 +21976,7 @@ }, "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" - } + "type": "object" }, "context_window": { "type": "integer" @@ -19579,6 +22104,192 @@ } } }, + "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": { + "hint": { + "description": "Hint is rendered under the input, for a warning the label cannot carry.", + "type": "string" + }, + "hints": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "label": { + "type": "string" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "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_models_providers.ExtraField": { + "type": "object", + "properties": { + "default": { + "type": "string" + }, + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "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.ModelType" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption" + } + }, + "placeholder": { + "type": "string" + }, + "placeholders": { + "description": "Placeholders carries localized variants of Placeholder.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_models_providers.ExtraFieldOption": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_models_runtime.Capabilities": { + "type": "object", + "properties": { + "api": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_api.API" + }, + "cataloged": { + "type": "boolean" + }, + "context_window": { + "type": "integer" + }, + "input": { + "type": "array", + "items": { + "type": "string" + } + }, + "max_output_tokens": { + "type": "integer" + }, + "max_tokens_field": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "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.APIKeyScopeType": { + "type": "string", + "enum": [ + "tenant", + "platform" + ], + "x-enum-varnames": [ + "APIKeyScopeTenant", + "APIKeyScopePlatform" + ] + }, "github_com_Tencent_WeKnora_internal_types.APIPrincipalMode": { "type": "string", "enum": [ @@ -19677,6 +22388,102 @@ } } }, + "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" + } + }, + "any_of": { + "description": "AnyOf: KB must expose at least ONE of these capability flags.", + "type": "array", + "items": { + "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" + } + }, + "faq_priority_enabled": { + "type": "boolean" + }, + "kb_selection_mode": { + "description": "KBSelectionMode presets the KB picker mode: \"all\" | \"selected\" | \"none\".\nWhen empty, the user's current value stays untouched.", + "type": "string" + }, + "max_iterations": { + "type": "integer" + }, + "retain_retrieval_history": { + "type": "boolean" + }, + "supported_file_types": { + "type": "array", + "items": { + "type": "string" + } + }, + "system_prompt_id": { + "type": "string" + }, + "temperature": { + "type": "number" + }, + "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" + }, + "i18n": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n" + } + }, + "id": { + "type": "string" + }, + "kb_filter": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentTypeKBFilter" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.AgentTypePresetI18n": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "label": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": { "type": "string", "enum": [ @@ -19688,6 +22495,77 @@ "AnswerStrategyRandom" ] }, + "github_com_Tencent_WeKnora_internal_types.AttrSpec": { + "type": "object", + "properties": { + "consumers": { + "description": "downstream steps that read this attribute", + "type": "array", + "items": { + "type": "string" + } + }, + "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": { + "description": "extent | presence", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AttrType" + } + ] + }, + "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" + }, + "label": { + "description": "short on-screen name", + "type": "string" + }, + "value": { + "description": "raw machine value, never localized", + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.AuditAction": { "type": "string", "enum": [ @@ -19835,10 +22713,7 @@ "type": "string" }, "details": { - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "id": { "type": "integer" @@ -19955,6 +22830,325 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.ChatHistoryKBStats": { + "type": "object", + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.ChatManage": { + "type": "object", + "properties": { + "chat_model_id": { + "description": "Chat model parameters", + "type": "string" + }, + "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" + }, + "disable_keywords_match": { + "type": "boolean" + }, + "disable_vector_match": { + "description": "DisableVectorMatch / DisableKeywordsMatch turn off one recall path for\nevery 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": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.History" + } + }, + "intent": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QueryIntent" + }, + "keyword_threshold": { + "type": "number" + }, + "knowledge_base_ids": { + "description": "Knowledge base retrieval parameters", + "type": "array", + "items": { + "type": "string" + } + }, + "knowledge_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "max_rounds": { + "type": "integer" + }, + "query": { + "type": "string" + }, + "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" + }, + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.Chunk": { + "type": "object", + "properties": { + "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" + }, + "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": { + "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" + } + }, + "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" + }, + "last_editor_id": { + "description": "LastEditorID records the actor that produced the current revision.", + "type": "string" + }, + "metadata": { + "description": "Metadata 存储 chunk 级别的扩展信息,例如 FAQ 元数据", + "type": "object" + }, + "next_chunk_id": { + "description": "Next chunk ID", + "type": "string" + }, + "parent_chunk_id": { + "description": "父 Chunk ID,用于关联图片 Chunk 和原始文本 Chunk", + "type": "string" + }, + "pre_chunk_id": { + "description": "Previous chunk ID", + "type": "string" + }, + "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.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": { @@ -20234,6 +23428,61 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.CustomAgent": { + "type": "object", + "properties": { + "avatar": { + "description": "Avatar/Icon of the agent (emoji or icon name)", + "type": "string" + }, + "config": { + "description": "Agent configuration", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig" + } + ] + }, + "created_at": { + "description": "Timestamps", + "type": "string" + }, + "created_by": { + "description": "Created by user ID", + "type": "string" + }, + "creator_name": { + "description": "CreatorName 由 list handler 在返回前批量回填,作用同 KnowledgeBase.CreatorName:\n让前端列表卡片区分「我创建」与「同空间其他成员创建」。不落库,内建 agent / 老数据\n仍可能为空。", + "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)\nFor built-in agents, this is 'builtin-quick-answer' or 'builtin-smart-reasoning'\nFor 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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": { "type": "object", "properties": { @@ -20521,10 +23770,7 @@ "properties": { "config": { "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "conflict_strategy": { "description": "Conflict resolution strategy: overwrite or skip", @@ -20560,17 +23806,11 @@ }, "last_sync_cursor": { "description": "Cursor or state for incremental sync (connector-specific)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "last_sync_result": { "description": "Summary of last sync result", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "latest_sync_log": { "description": "Latest sync log (not stored in DB, populated on query)", @@ -20724,6 +23964,103 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.EvaluationDetail": { + "type": "object", + "properties": { + "metric": { + "description": "Evaluation metrics", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MetricResult" + } + ] + }, + "params": { + "description": "Evaluation parameters", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatManage" + } + ] + }, + "task": { + "description": "Evaluation task info", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EvaluationTask" + } + ] + } + } + }, + "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": { + "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": { + "description": "Current task status", + "allOf": [ + { + "$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.ExtractConfig": { "type": "object", "properties": { @@ -20800,6 +24137,81 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.FAQEntry": { + "type": "object", + "properties": { + "answer_strategy": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy" + }, + "answers": { + "type": "array", + "items": { + "type": "string" + } + }, + "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\nCould be the standard question or one of the similar questions", + "type": "string" + }, + "negative_questions": { + "type": "array", + "items": { + "type": "string" + } + }, + "score": { + "type": "number" + }, + "similar_questions": { + "type": "array", + "items": { + "type": "string" + } + }, + "standard_question": { + "type": "string" + }, + "tag_id": { + "type": "integer" + }, + "tag_name": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": { "type": "object", "properties": { @@ -20888,6 +24300,229 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.FAQFailedEntry": { + "type": "object", + "properties": { + "answer_all": { + "description": "是否全部回复", + "type": "boolean" + }, + "answers": { + "description": "答案", + "type": "array", + "items": { + "type": "string" + } + }, + "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": "反例问题", + "type": "array", + "items": { + "type": "string" + } + }, + "reason": { + "description": "失败原因", + "type": "string" + }, + "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" + }, + "tag_name": { + "description": "分类", + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.FAQImportProgress": { + "type": "object", + "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": "失败条目详情(少量时直接返回)", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQFailedEntry" + } + }, + "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": "合并详情", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQMergeDetail" + } + }, + "merge_entry_indices": { + "description": "需要合并的条目索引(内部使用,用于重试时跳过识别)", + "type": "array", + "items": { + "type": "integer" + } + }, + "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": { + "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": [ + "FAQImportStatusPending", + "FAQImportStatusProcessing", + "FAQImportStatusCompleted", + "FAQImportStatusFailed" + ] + }, "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": { "type": "string", "enum": [ @@ -20899,6 +24534,31 @@ "FAQIndexModeQuestionAnswer" ] }, + "github_com_Tencent_WeKnora_internal_types.FAQMergeDetail": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": { "type": "string", "enum": [ @@ -20945,6 +24605,50 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.FAQSuccessEntry": { + "type": "object", + "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" + } + } + }, + "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": { @@ -21002,6 +24706,35 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.GenerationMetrics": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.GraphNode": { "type": "object", "properties": { @@ -21036,6 +24769,30 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.History": { + "type": "object", + "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", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult" + } + }, + "query": { + "description": "User query text", + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ImageActionsConfig": { "type": "object", "properties": { @@ -21044,6 +24801,68 @@ } } }, + "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": {} + }, + "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\nimage_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\ntext (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: \"\u003cchunkID\u003e#\u003cindex-in-array\u003e\".", + "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\n(document), resolved from KnowledgeID. Empty when the item no longer\nexists (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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ImageAttrCondition": { "type": "object", "properties": { @@ -21214,6 +25033,10 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.JSONMap": { + "type": "object", + "additionalProperties": {} + }, "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": { "type": "object", "required": [ @@ -21251,6 +25074,141 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.JoinRequestResponse": { + "type": "object", + "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" + } + } + }, + "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": { + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.KBCloneProgress": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.KBCloneTaskStatus": { "type": "string", "enum": [ @@ -21289,6 +25247,154 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.Knowledge": { + "type": "object", + "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\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" + }, + "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\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" + }, + "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\nrow, 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\n(summary + question + graph chunks). Only meaningful while\nParseStatus == \"finalizing\"; defaults to 0 in any terminal state.", + "type": "integer" + }, + "processed_at": { + "description": "Processed time of the knowledge", + "type": "string" + }, + "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" + } + ] + }, + "source": { + "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)", + "type": "string" + }, + "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" + }, + "storage_size": { + "description": "Storage size of the knowledge", + "type": "integer" + }, + "summary_status": { + "description": "Summary status for async summary generation", + "type": "string" + }, + "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" + } + }, + "tenant_id": { + "description": "Workspace ID", + "type": "integer" + }, + "title": { + "description": "Title of the knowledge", + "type": "string" + }, + "type": { + "description": "Type of the knowledge", + "type": "string" + }, + "updated_at": { + "description": "Last updated time of the knowledge", + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": { "type": "object", "properties": { @@ -21681,6 +25787,66 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShare": { + "type": "object", + "properties": { + "created_at": { + "description": "Creation time", + "type": "string" + }, + "deleted_at": { + "description": "Deletion time (soft delete)", + "allOf": [ + { + "$ref": "#/definitions/gorm.DeletedAt" + } + ] + }, + "id": { + "description": "Unique identifier", + "type": "string" + }, + "knowledge_base": { + "description": "Associations (not stored in database)", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase" + } + ] + }, + "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": { + "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.KnowledgeBaseShareResponse": { "type": "object", "properties": { @@ -21737,6 +25903,54 @@ } } }, + "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" + } + }, + "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" + } + } + }, + "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" + } + }, + "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" + }, + "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.KnowledgeMoveProgress": { "type": "object", "properties": { @@ -21845,6 +26059,85 @@ } } }, + "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": "string" + } + }, + "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" + }, + "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": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestResponse" + } + }, + "total": { + "type": "integer" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": { "type": "object", "properties": { @@ -22046,6 +26339,23 @@ "type": "string" } }, + "github_com_Tencent_WeKnora_internal_types.MCPResource": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uri": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.MCPService": { "type": "object", "properties": { @@ -22131,6 +26441,55 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.MCPTestResult": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "message": { + "type": "string" + }, + "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": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPResource" + } + }, + "success": { + "type": "boolean" + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTool" + } + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MCPTool": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.MCPTransportType": { "type": "string", "enum": [ @@ -22303,6 +26662,181 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.MemoryConsolidationResult": { + "type": "object", + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MemoryDocView": { + "type": "object", + "properties": { + "hits": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "knowledge_base_id": { + "type": "string" + }, + "knowledge_id": { + "type": "string" + }, + "last_used_at": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MemoryItem": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "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" + }, + "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\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" + }, + "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": "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" + }, + "updated_at": { + "type": "string" + }, + "use_count": { + "type": "integer" + }, + "valid_from": { + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MemorySettings": { + "type": "object", + "properties": { + "effective": { + "description": "Effective is what actually happens: WorkspaceEnabled \u0026\u0026 UserEnabled.", + "type": "boolean" + }, + "item_count": { + "description": "ItemCount is how many active memories the caller currently has.", + "type": "integer" + }, + "max_items": { + "description": "MaxItems is the capacity cap after which the lowest ranked are archived.", + "type": "integer" + }, + "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" + }, + "workspace_enabled": { + "description": "WorkspaceEnabled is the admin switch on the workspace.", + "type": "boolean" + }, + "write_mode": { + "description": "WriteMode is the workspace write mode.", + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MemoryTopicView": { + "type": "object", + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "hits": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "last_seen_at": { + "type": "string" + }, + "threshold": { + "type": "integer" + }, + "topic": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.MentionedItem": { "type": "object", "properties": { @@ -22431,6 +26965,14 @@ "description": "ModelID is the requested/effective chat model binding captured for this\nturn. It is useful for reproducibility and suggestion generation.", "type": "string" }, + "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" @@ -22439,6 +26981,10 @@ "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": [ @@ -22573,6 +27119,147 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem": { + "type": "object", + "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\u0026A 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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MessageSearchResult": { + "type": "object", + "properties": { + "items": { + "description": "List of merged Q\u0026A pairs", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageSearchGroupItem" + } + }, + "total": { + "description": "Total number of results", + "type": "integer" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MessageSuggestionSet": { + "type": "object", + "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": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestionItem" + } + }, + "session_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "suppression_reason": { + "type": "string" + }, + "tenant_id": { + "type": "integer" + }, + "updated_at": { + "type": "string" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.MetricResult": { + "type": "object", + "properties": { + "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.MinIOEngineConfig": { "type": "object", "properties": { @@ -22791,6 +27478,29 @@ } } }, + "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": [ @@ -22935,6 +27645,186 @@ "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": "Creation time", + "type": "string" + }, + "deleted_at": { + "description": "Deletion time (soft delete)", + "allOf": [ + { + "$ref": "#/definitions/gorm.DeletedAt" + } + ] + }, + "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": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationTenantMember" + } + }, + "name": { + "description": "Name of the organization", + "type": "string" + }, + "owner": { + "description": "Associations (not stored in database)", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User" + } + ] + }, + "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\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.OrganizationJoinRequest": { + "type": "object", + "properties": { + "created_at": { + "description": "Creation time", + "type": "string" + }, + "id": { + "description": "Unique identifier", + "type": "string" + }, + "message": { + "description": "Optional message from the requester", + "type": "string" + }, + "organization": { + "description": "Associations (not stored in database)", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Organization" + } + ] + }, + "organization_id": { + "description": "Organization ID", + "type": "string" + }, + "prev_role": { + "description": "Previous role before upgrade (only for upgrade requests)", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole" + } + ] + }, + "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" + }, + "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": { + "description": "Status of the request", + "allOf": [ + { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinRequestStatus" + } + ] + }, + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": { "type": "object", "properties": { @@ -23044,6 +27934,104 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.OrganizationSharedAgentItem": { + "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" + }, + "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\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.OrganizationTenantMember": { + "type": "object", + "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" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.PageResult": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": { "type": "object", "properties": { @@ -23154,6 +28142,29 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.ParserEngineInfo": { + "type": "object", + "properties": { + "available": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "fileTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "unavailableReason": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": { "type": "object", "properties": { @@ -23172,6 +28183,29 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.PendingPromptView": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "request": { + "type": "object" + }, + "tool_call_id": { + "type": "string" + } + } + }, "github_com_Tencent_WeKnora_internal_types.PromptCacheStatus": { "type": "string", "enum": [ @@ -23187,15 +28221,54 @@ "PromptCacheStatusHit" ] }, + "github_com_Tencent_WeKnora_internal_types.PromptPlaceholder": { + "type": "object", + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.ProviderMetadata": { "type": "object", "additionalProperties": { - "type": "array", - "items": { - "type": "integer" - } + "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": { @@ -23351,6 +28424,53 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.RerankDiagnostics": { + "type": "object", + "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\nimage; ImagesKept the pictorial image hits kept over a text reranker's\nrejection 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\napplied after degradation.", + "type": "number" + }, + "top_score": { + "description": "TopScore is the best rerank model score among the candidates.", + "type": "number" + } + } + }, "github_com_Tencent_WeKnora_internal_types.RerankOptions": { "type": "object", "properties": { @@ -23372,6 +28492,31 @@ } } }, + "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": { @@ -23482,6 +28627,43 @@ } } }, + "github_com_Tencent_WeKnora_internal_types.RetrievalMeta": { + "type": "object", + "properties": { + "rerank": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RerankDiagnostics" + } + } + }, + "github_com_Tencent_WeKnora_internal_types.RetrievalMetrics": { + "type": "object", + "properties": { + "map": { + "description": "Mean Average Precision", + "type": "number" + }, + "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" + } + } + }, "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": { "type": "object", "properties": { @@ -23871,10 +29053,7 @@ }, "chunk_metadata": { "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "chunk_type": { "description": "Chunk 类型", @@ -23986,6 +29165,43 @@ } } }, + "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": { @@ -24130,6 +29346,46 @@ } } }, + "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": { @@ -24234,6 +29490,68 @@ } } }, + "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": { @@ -24254,6 +29572,44 @@ } } }, + "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": { @@ -24410,6 +29766,27 @@ } } }, + "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": { @@ -24421,6 +29798,90 @@ } } }, + "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": { @@ -24470,10 +29931,7 @@ }, "result": { "description": "Detailed sync result (JSON-encoded)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "started_at": { "description": "Sync start time", @@ -24538,10 +29996,7 @@ "type": "string" }, "value": { - "type": "array", - "items": { - "type": "integer" - } + "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.", @@ -24703,6 +30158,108 @@ } } }, + "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": [ @@ -24877,10 +30434,7 @@ "github_com_Tencent_WeKnora_internal_types.ToolCallMetadata": { "type": "object", "additionalProperties": { - "type": "array", - "items": { - "type": "integer" - } + "type": "object" } }, "github_com_Tencent_WeKnora_internal_types.ToolCallTarget": { @@ -25132,6 +30686,26 @@ } } }, + "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": { @@ -25167,6 +30741,128 @@ } } }, + "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": { @@ -25207,6 +30903,23 @@ } } }, + "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": { @@ -25259,6 +30972,55 @@ } } }, + "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": { @@ -25373,6 +31135,54 @@ "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": { @@ -25788,10 +31598,7 @@ }, "page_metadata": { "description": "Arbitrary metadata (tags, categories, dates, etc.)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "page_type": { "description": "Page type: summary, entity, concept, index, synthesis, comparison", @@ -25932,10 +31739,7 @@ }, "page_metadata": { "description": "Arbitrary metadata (tags, categories, dates, etc.)", - "type": "array", - "items": { - "type": "integer" - } + "type": "object" }, "page_type": { "description": "Page type: summary, entity, concept, index, synthesis, comparison", @@ -26255,6 +32059,63 @@ } } }, + "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": [ @@ -26289,6 +32150,18 @@ } } }, + "internal_handler.ClearResponse": { + "type": "object", + "properties": { + "removed": { + "type": "integer" + }, + "success": { + "type": "boolean", + "example": true + } + } + }, "internal_handler.CopyKnowledgeBaseRequest": { "type": "object", "required": [ @@ -26306,6 +32179,23 @@ } } }, + "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": [ @@ -26400,6 +32290,66 @@ } } }, + "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": { @@ -26412,6 +32362,75 @@ } } }, + "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": { @@ -26441,6 +32460,38 @@ } } }, + "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": [ @@ -26458,6 +32509,54 @@ } } }, + "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": { @@ -26525,6 +32624,44 @@ } } }, + "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": [ @@ -26882,6 +33019,346 @@ } } }, + "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": { @@ -26902,6 +33379,178 @@ } } }, + "internal_handler.ListDocumentsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MemoryDocView" + } + }, + "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" + } + }, + "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" + } + }, + "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.ListParserEnginesResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "connected": { + "type": "boolean" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineInfo" + } + }, + "docreader_addr": { + "type": "string" + }, + "docreader_transport": { + "type": "string" + }, + "msg": { + "type": "string" + } + } + }, + "internal_handler.ListResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageBackend" + } + }, + "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": {} + } + }, + "success": { + "type": "boolean", + "example": true + }, + "total": { + "type": "integer" + } + } + }, + "internal_handler.ListSkillsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/internal_handler.SkillInfoResponse" + } + }, + "skills_available": { + "type": "boolean" + }, + "success": { + "type": "boolean", + "example": true + } + } + }, "internal_handler.ListSystemAdminsResponse": { "type": "object", "properties": { @@ -26916,6 +33565,163 @@ } } }, + "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" + }, + "success": { + "type": "boolean", + "example": true + } + } + }, + "internal_handler.ModelCatalogEntryDTO": { + "type": "object", + "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": { + "type": "array", + "items": { + "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.ModelProviderDTO": { + "type": "object", + "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\ntypes that do not take a plain API key (signed rerank APIs).", + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_providers.CredentialLabel" + } + }, + "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" + } + } + }, "internal_handler.ModelTestRequest": { "type": "object", "required": [ @@ -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": { @@ -27187,6 +34067,50 @@ } } }, + "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.RefreshTokenResponse": { + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "message": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "success": { + "type": "boolean", + "example": true + } + } + }, "internal_handler.RemoteModelCheckRequest": { "type": "object", "required": [ @@ -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": { @@ -27774,6 +34947,69 @@ } } }, + "internal_handler.ValidateTokenResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "success": { + "type": "boolean", + "example": true + }, + "user": { + "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UserInfo" + } + } + }, + "internal_handler.WikiErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "internal_handler.WikiMessageResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "internal_handler.WikiSearchHit": { + "type": "object", + "properties": { + "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" + } + } + }, "internal_handler.acceptInvitationByTokenRequest": { "type": "object", "required": [ @@ -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 23f40490..e1d87832 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,6 +464,249 @@ definitions: - ErrVectorStoreBindingInvalid - ErrVectorStoreUnavailable - ErrModelInUse + github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata: + properties: + configured: + type: boolean + type: object + github_com_Tencent_WeKnora_internal_handler_dto.CredentialsResponse: + properties: + fields: + additionalProperties: + $ref: '#/definitions/github_com_Tencent_WeKnora_internal_handler_dto.CredentialFieldMetadata' + type: object + type: object + github_com_Tencent_WeKnora_internal_handler_dto.MCPAuthConfigResponse: + properties: + api_key_header: + type: string + 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_handler_dto.MCPCatalogSummary: + properties: + stale: + type: boolean + synced_at: + type: string + tool_count: + type: integer + type: object + github_com_Tencent_WeKnora_internal_handler_dto.MCPServiceResponse: + properties: + 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: |- + 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: |- + 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 + env_vars: + $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars' + headers: + $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders' + id: + type: string + 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: 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 + parameter_size: + type: string + provider: + type: string + 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_runtime.Capabilities' + description: |- + 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: |- + 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_handler_dto.TenantResponse: + properties: + 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 + 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_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 + id: + type: string + knowledge_base_id: + type: string + locale: + type: string + mode: + type: string + name: + type: string + output_mode: + type: string + platform: + type: string + session_mode: + type: string + tenant_id: + type: integer + updated_at: + type: string + type: object github_com_Tencent_WeKnora_internal_infrastructure_chunker.DocProfile: properties: all_caps_short_line_count: @@ -296,6 +773,17 @@ definitions: 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: @@ -324,9 +812,7 @@ definitions: 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 + type: object context_window: type: integer cost: @@ -426,6 +912,139 @@ definitions: 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 @@ -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: @@ -750,6 +1482,252 @@ definitions: This is set internally when the feature is first enabled; users should not set this directly. type: string type: object + github_com_Tencent_WeKnora_internal_types.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 + last_editor_id: + description: LastEditorID records the actor that produced the current revision. + type: string + metadata: + description: Metadata 存储 chunk 级别的扩展信息,例如 FAQ 元数据 + type: object + next_chunk_id: + description: Next chunk ID + type: string + parent_chunk_id: + description: 父 Chunk ID,用于关联图片 Chunk 和原始文本 Chunk + type: string + pre_chunk_id: + description: Previous chunk ID + type: string + 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: |- + 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 + 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: @@ -1598,6 +2731,168 @@ definitions: 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: + $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSuccessEntry' + type: array + 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: 验证通过的条目索引(用于重试时跳过验证) + 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: "#".' + 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: @@ -1888,6 +3330,103 @@ definitions: 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 @@ -1915,6 +3454,134 @@ definitions: 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.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 + 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 + storage_size: + description: Storage size of the knowledge + type: integer + summary_status: + description: Summary status for async summary generation + type: string + 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 + type: + description: Type of the knowledge + type: string + updated_at: + description: Last updated time of the knowledge + type: string + type: object github_com_Tencent_WeKnora_internal_types.KnowledgeBase: properties: asr_config: @@ -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 @@ -2724,6 +4576,142 @@ definitions: 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: |- + 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 + updated_at: + type: string + use_count: + type: integer + valid_from: + type: string + 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 is the capacity cap after which the lowest ranked are + archived. + type: integer + user_enabled: + description: |- + 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 + workspace_enabled: + description: WorkspaceEnabled is the admin switch on the workspace. + type: boolean + write_mode: + 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: properties: id: @@ -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 @@ -4622,6 +7271,87 @@ definitions: - $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 + tenant_name: + type: string + type: object github_com_Tencent_WeKnora_internal_types.TenantRole: enum: - owner @@ -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: @@ -6329,6 +9463,268 @@ definitions: 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 + vector_store_source: + type: string + vector_store_status: + type: string + vlm_config: + 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: has_more: @@ -6342,6 +9738,121 @@ definitions: $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: @@ -6351,6 +9862,115 @@ definitions: 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 + icon: + description: 'Icon is a data: URI (image/svg+xml;base64) ready for .' + type: string + label: + type: string + labels: + additionalProperties: + type: string + type: object + modelTypes: + items: + type: string + type: array + 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: apiKey: @@ -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: @@ -6964,6 +10824,47 @@ definitions: 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 + type: object internal_handler.acceptInvitationByTokenRequest: properties: token: @@ -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 3f8a656b..cf55ef80 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 9efeaed5..d17248d6 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 162bc952..2de6cbb2 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 04b8d28e..28d59def 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 65b1ada0..eed32ed2 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 62356e8d..8dda6d9b 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 24f6bc25..bcf9022b 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 33dc0365..16567d77 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 cb4fad89..91db96aa 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 9ef245b3..4ddd848e 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 2b882a03..5abdbd62 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 7d097924..13b62121 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 e9dbe8ba..116ca349 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 aea6f078..d7c09b4e 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 c1595211..e40a0d23 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 9d455ed8..148c30bb 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 b2a36ae5..4a636ddf 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 678cad00..8ac36926 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 c6a405a2..5f2a8b18 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 b195a65a..4e7cc817 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 abf1ef9b..4cac13e7 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 996ae10b..a94495c2 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 95f6f38d..7a60f08d 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 fec0aa6a..0c024344 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 6d75f1cc..b8775ee2 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 64e80cb2..48b981c1 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 734d6183..c3a3c5df 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 ef10ed8f..d3c0e0a9 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 381fb8f9..1567ac53 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 0df782d6..ef0ffd17 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 00000000..4d2494d6 --- /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 00000000..21b86419 --- /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 36340f51..3d00bc15 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 59b2a2b5..2c2eb3af 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 8f418eaa..9c5e5276 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 6b705526..aa7dced3 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 2741b2d6..acefa2eb 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 cfcf6603..576f8ecc 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 83360628..8a15bcde 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 a8e9c139..0f68da96 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 1c7a5009..f52134bf 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 c5713719..e72ca474 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 fb66a2d3..e8777cda 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 602d6050..e4274e01 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 ccb902e8..3c33a58f 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 4e8f493c..bcd16df0 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 e97d7698..78251983 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 634e9c50..dcfcbbaa 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-镜像与服务管理}