Skip to content

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

fix(swagger): resolve interface documentation generation error and regenerate docs

ChenRussell48cf6aeaea6c
diff --git a/docs/docs.go b/docs/docs.go
index 819434e0f..fbcbdfb9e 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -19,14 +19,17 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
- "/auth/change-password": {
- "post": {
+ "/agents": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "修改当前用户的登录密码",
+ "description": "获取当前租户的所有智能体(包括内置智能体)",
"consumes": [
"application/json"
],
@@ -34,48 +37,35 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "认证"
- ],
- "summary": "修改密码",
- "parameters": [
- {
- "description": "密码修改请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "new_password": {
- "type": "string"
- },
- "old_password": {
- "type": "string"
- }
- }
- }
- }
+ "智能体"
],
+ "summary": "获取智能体列表",
"responses": {
"200": {
- "description": "修改成功",
+ "description": "智能体列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/auth/login": {
+ },
"post": {
- "description": "用户登录并获取访问令牌",
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "创建新的自定义智能体",
"consumes": [
"application/json"
],
@@ -83,29 +73,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "认证"
+ "智能体"
],
- "summary": "用户登录",
+ "summary": "创建智能体",
"parameters": [
{
- "description": "登录请求参数",
+ "description": "智能体信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest"
+ "$ref": "#/definitions/internal_handler.CreateAgentRequest"
}
}
],
"responses": {
- "200": {
- "description": "OK",
+ "201": {
+ "description": "创建的智能体",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
+ "type": "object",
+ "additionalProperties": true
}
},
- "401": {
- "description": "认证失败",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -113,14 +104,17 @@ const docTemplate = `{
}
}
},
- "/auth/logout": {
- "post": {
+ "/agents/placeholders": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "撤销当前访问令牌并登出",
+ "description": "获取所有可用的提示词占位符定义,按字段类型分组",
"consumes": [
"application/json"
],
@@ -128,64 +122,31 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "认证"
+ "智能体"
],
- "summary": "用户登出",
+ "summary": "获取占位符定义",
"responses": {
"200": {
- "description": "登出成功",
+ "description": "占位符定义",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/auth/me": {
+ "/agents/{id}": {
"get": {
"security": [
{
"Bearer": []
- }
- ],
- "description": "获取当前登录用户的详细信息",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "认证"
- ],
- "summary": "获取当前用户信息",
- "responses": {
- "200": {
- "description": "用户信息",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
},
- "401": {
- "description": "未授权",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
+ {
+ "ApiKeyAuth": []
}
- }
- }
- },
- "/auth/refresh": {
- "post": {
- "description": "使用刷新令牌获取新的访问令牌",
+ ],
+ "description": "根据ID获取智能体详情",
"consumes": [
"application/json"
],
@@ -193,45 +154,50 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "认证"
+ "智能体"
],
- "summary": "刷新令牌",
+ "summary": "获取智能体详情",
"parameters": [
{
- "description": "刷新令牌",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "refreshToken": {
- "type": "string"
- }
- }
- }
+ "type": "string",
+ "description": "智能体ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "新令牌",
+ "description": "智能体详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "令牌无效",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "智能体不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/auth/register": {
- "post": {
- "description": "注册新用户账号",
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新智能体的名称、描述和配置",
"consumes": [
"application/json"
],
@@ -239,25 +205,33 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "认证"
+ "智能体"
],
- "summary": "用户注册",
+ "summary": "更新智能体",
"parameters": [
{
- "description": "注册请求参数",
+ "type": "string",
+ "description": "智能体ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest"
+ "$ref": "#/definitions/internal_handler.UpdateAgentRequest"
}
}
],
"responses": {
- "201": {
- "description": "Created",
+ "200": {
+ "description": "更新后的智能体",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse"
+ "type": "object",
+ "additionalProperties": true
}
},
"400": {
@@ -267,22 +241,23 @@ const docTemplate = `{
}
},
"403": {
- "description": "注册功能已禁用",
+ "description": "无法修改内置智能体",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/auth/validate": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "验证访问令牌是否有效",
+ "description": "删除指定的智能体",
"consumes": [
"application/json"
],
@@ -290,19 +265,40 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "认证"
+ "智能体"
+ ],
+ "summary": "删除智能体",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "智能体ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "验证令牌",
"responses": {
"200": {
- "description": "令牌有效",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "令牌无效",
+ "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"
}
@@ -310,8 +306,8 @@ const docTemplate = `{
}
}
},
- "/chunks/by-id/{id}": {
- "get": {
+ "/agents/{id}/copy": {
+ "post": {
"security": [
{
"Bearer": []
@@ -320,7 +316,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "仅通过分块ID获取分块详情(不需要knowledge_id)",
+ "description": "复制指定的智能体",
"consumes": [
"application/json"
],
@@ -328,21 +324,21 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "分块管理"
+ "智能体"
],
- "summary": "通过ID获取分块",
+ "summary": "复制智能体",
"parameters": [
{
"type": "string",
- "description": "分块ID",
+ "description": "智能体ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
- "200": {
- "description": "分块详情",
+ "201": {
+ "description": "复制成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -355,7 +351,7 @@ const docTemplate = `{
}
},
"404": {
- "description": "分块不存在",
+ "description": "智能体不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -363,17 +359,14 @@ const docTemplate = `{
}
}
},
- "/chunks/by-id/{id}/questions": {
- "delete": {
+ "/auth/change-password": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除分块中生成的问题",
+ "description": "修改当前用户的登录密码",
"consumes": [
"application/json"
],
@@ -381,26 +374,22 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "分块管理"
+ "认证"
],
- "summary": "删除生成的问题",
+ "summary": "修改密码",
"parameters": [
{
- "type": "string",
- "description": "分块ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "问题ID",
+ "description": "密码修改请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
- "question_id": {
+ "new_password": {
+ "type": "string"
+ },
+ "old_password": {
"type": "string"
}
}
@@ -409,7 +398,7 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "修改成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -420,19 +409,1650 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "404": {
- "description": "分块不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/chunks/{knowledge_id}": {
- "get": {
- "security": [
+ "/auth/login": {
+ "post": {
+ "description": "用户登录并获取访问令牌",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "用户登录",
+ "parameters": [
+ {
+ "description": "登录请求参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
+ }
+ },
+ "401": {
+ "description": "认证失败",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/logout": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "撤销当前访问令牌并登出",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "用户登出",
+ "responses": {
+ "200": {
+ "description": "登出成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/me": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "获取当前登录用户的详细信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "获取当前用户信息",
+ "responses": {
+ "200": {
+ "description": "用户信息",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "未授权",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/refresh": {
+ "post": {
+ "description": "使用刷新令牌获取新的访问令牌",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "刷新令牌",
+ "parameters": [
+ {
+ "description": "刷新令牌",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "refreshToken": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "新令牌",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "令牌无效",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/register": {
+ "post": {
+ "description": "注册新用户账号",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "用户注册",
+ "parameters": [
+ {
+ "description": "注册请求参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Created",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse"
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "注册功能已禁用",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/validate": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "验证访问令牌是否有效",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "验证令牌",
+ "responses": {
+ "200": {
+ "description": "令牌有效",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "令牌无效",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/chunks/by-id/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "仅通过分块ID获取分块详情(不需要knowledge_id);支持共享知识库下的分块访问",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "通过ID获取分块",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "分块详情",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/chunks/by-id/{id}/questions": {
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除分块中生成的问题",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "删除生成的问题",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "问题ID",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "question_id": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/chunks/{knowledge_id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取指定知识下的所有分块列表,支持分页",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "获取知识分块列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "default": 1,
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 10,
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "分块列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定知识下的所有分块",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "删除知识下所有分块",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/chunks/{knowledge_id}/{id}": {
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新指定分块的内容和属性",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "更新分块",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.UpdateChunkRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的分块",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定的分块",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "删除分块",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/evaluation/": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据任务ID获取评估结果",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "评估"
+ ],
+ "summary": "获取评估结果",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "评估任务ID",
+ "name": "task_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "评估结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "对知识库进行评估测试",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "评估"
+ ],
+ "summary": "执行评估",
+ "parameters": [
+ {
+ "description": "评估请求参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.EvaluationRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "评估任务",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/faq/import/progress/{task_id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取FAQ导入任务的进度",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "FAQ管理"
+ ],
+ "summary": "获取FAQ导入进度",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "任务ID",
+ "name": "task_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "导入进度",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/extract/relations": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "从文本中提取实体和关系",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "提取文本关系",
+ "parameters": [
+ {
+ "description": "提取请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "提取结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/fabri/tag": {
+ "get": {
+ "description": "随机生成一组标签",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "生成随机标签",
+ "responses": {
+ "200": {
+ "description": "生成的标签",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/fabri/text": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据标签生成示例文本",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "生成示例文本",
+ "parameters": [
+ {
+ "description": "生成请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.FabriTextRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "生成的文本",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/kb/{kbId}": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据知识库ID执行完整配置更新",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "初始化知识库配置",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "初始化请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "初始化成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/kb/{kbId}/config": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据知识库ID获取当前配置信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "获取知识库配置",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "配置信息",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据知识库ID更新模型和分块配置",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "更新知识库配置",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "配置请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.KBModelConfigRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/models/embedding/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "测试Embedding接口是否可用并返回向量维度",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "测试Embedding模型",
+ "parameters": [
+ {
+ "description": "Embedding测试请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "测试结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/models/remote/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查远程API模型连接是否正常",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查远程模型",
+ "parameters": [
+ {
+ "description": "模型检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/models/rerank/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查Rerank模型连接和功能是否正常",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Rerank模型",
+ "parameters": [
+ {
+ "description": "Rerank检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/multimodal/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "上传图片测试多模态处理功能",
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "测试多模态功能",
+ "parameters": [
+ {
+ "type": "file",
+ "description": "测试图片",
+ "name": "image",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM模型名称",
+ "name": "vlm_model",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM Base URL",
+ "name": "vlm_base_url",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM API Key",
+ "name": "vlm_api_key",
+ "in": "formData"
+ },
+ {
+ "type": "string",
+ "description": "VLM接口类型",
+ "name": "vlm_interface_type",
+ "in": "formData"
+ },
+ {
+ "type": "string",
+ "description": "存储类型(cos/minio)",
+ "name": "storage_type",
+ "in": "formData",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "测试结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/download/tasks": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "列出所有Ollama模型下载任务",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "列出下载任务",
+ "responses": {
+ "200": {
+ "description": "任务列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/download/{taskId}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取Ollama模型下载任务的进度",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "获取下载进度",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "任务ID",
+ "name": "taskId",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "下载进度",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/models": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "列出已安装的Ollama模型",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "列出Ollama模型",
+ "responses": {
+ "200": {
+ "description": "模型列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/models/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查指定的Ollama模型是否已安装",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Ollama模型状态",
+ "parameters": [
+ {
+ "description": "模型名称列表",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "models": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "模型状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/models/download": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "异步下载指定的Ollama模型",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "下载Ollama模型",
+ "parameters": [
+ {
+ "description": "模型名称",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "modelName": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "下载任务信息",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/status": {
+ "get": {
+ "description": "检查Ollama服务是否可用",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Ollama服务状态",
+ "responses": {
+ "200": {
+ "description": "Ollama状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "获取知识库列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "共享智能体 ID(传入时返回该智能体可用的知识库)",
+ "name": "agent_id",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "知识库列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "创建新的知识库",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "创建知识库",
+ "parameters": [
+ {
+ "description": "知识库信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "创建的知识库",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases/copy": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "将一个知识库的内容复制到另一个知识库(异步任务)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "复制知识库",
+ "parameters": [
+ {
+ "description": "复制请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "任务ID",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases/copy/progress/{task_id}": {
+ "get": {
+ "security": [
{
"Bearer": []
},
@@ -440,7 +2060,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取指定知识下的所有分块列表,支持分页",
+ "description": "获取知识库复制任务的进度",
"consumes": [
"application/json"
],
@@ -448,35 +2068,134 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "分块管理"
+ "知识库"
],
- "summary": "获取知识分块列表",
+ "summary": "获取知识库复制进度",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
+ "description": "任务ID",
+ "name": "task_id",
"in": "path",
"required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "进度信息",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
},
{
- "type": "integer",
- "default": 1,
- "description": "页码",
- "name": "page",
- "in": "query"
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据ID获取知识库详情。当使用共享智能体时,可传 agent_id 以校验该智能体是否有权访问该知识库。",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "获取知识库详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
},
{
- "type": "integer",
- "default": 10,
- "description": "每页数量",
- "name": "page_size",
+ "type": "string",
+ "description": "共享智能体 ID(用于校验智能体是否有权访问该知识库)",
+ "name": "agent_id",
"in": "query"
}
],
"responses": {
"200": {
- "description": "分块列表",
+ "description": "知识库详情",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新知识库的名称、描述和配置",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "更新知识库",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.UpdateKnowledgeBaseRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的知识库",
"schema": {
"type": "object",
"additionalProperties": true
@@ -495,33 +2214,116 @@ const docTemplate = `{
{
"Bearer": []
},
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "删除指定知识下的所有分块",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "分块管理"
- ],
- "summary": "删除知识下所有分块",
- "parameters": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定的知识库及其所有内容",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "删除知识库",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases/{id}/faq/entries": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取知识库下的FAQ条目列表,支持分页和筛选",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "FAQ管理"
+ ],
+ "summary": "获取FAQ条目列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "标签ID筛选(seq_id)",
+ "name": "tag_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "搜索字段: standard_question(标准问题), similar_questions(相似问法), answers(答案), 默认搜索全部",
+ "name": "search_field",
+ "in": "query"
+ },
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
- "in": "path",
- "required": true
+ "description": "排序方式: asc(按更新时间正序), 默认按更新时间倒序",
+ "name": "sort_order",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "FAQ列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -534,10 +2336,8 @@ const docTemplate = `{
}
}
}
- }
- },
- "/chunks/{knowledge_id}/{id}": {
- "put": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -546,7 +2346,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新指定分块的内容和属性",
+ "description": "异步批量更新或插入FAQ条目。支持 dry_run 模式(设置 dry_run=true),异步验证不实际导入。\ndry_run 模式是异步操作,返回 task_id,通过 /faq/import/progress/{task_id} 查询进度和结果。\n验证内容包括:1) 条目基本格式 2) 重复问题(批次内和知识库已有) 3) 内容安全检查。",
"consumes": [
"application/json"
],
@@ -554,37 +2354,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "分块管理"
+ "FAQ管理"
],
- "summary": "更新分块",
+ "summary": "批量更新/插入FAQ条目",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "分块ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "更新请求",
+ "description": "批量操作请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateChunkRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload"
}
}
],
"responses": {
"200": {
- "description": "更新后的分块",
+ "description": "任务ID",
"schema": {
"type": "object",
"additionalProperties": true
@@ -595,12 +2388,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "404": {
- "description": "分块不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
},
@@ -613,7 +2400,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "删除指定的分块",
+ "description": "批量删除指定的FAQ条目",
"consumes": [
"application/json"
],
@@ -621,23 +2408,33 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "分块管理"
+ "FAQ管理"
],
- "summary": "删除分块",
+ "summary": "批量删除FAQ条目",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
+ "description": "知识库ID",
+ "name": "id",
"in": "path",
"required": true
},
{
- "type": "string",
- "description": "分块ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "要删除的FAQ ID列表(seq_id)",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ }
}
],
"responses": {
@@ -653,17 +2450,11 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "404": {
- "description": "分块不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/evaluation/": {
+ "/knowledge-bases/{id}/faq/entries/export": {
"get": {
"security": [
{
@@ -673,32 +2464,31 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据任务ID获取评估结果",
+ "description": "将所有FAQ条目导出为CSV文件",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/csv"
],
"tags": [
- "评估"
+ "FAQ管理"
],
- "summary": "获取评估结果",
+ "summary": "导出FAQ条目",
"parameters": [
{
"type": "string",
- "description": "评估任务ID",
- "name": "task_id",
- "in": "query",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "评估结果",
+ "description": "CSV文件",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
@@ -708,8 +2498,10 @@ const docTemplate = `{
}
}
}
- },
- "post": {
+ }
+ },
+ "/knowledge-bases/{id}/faq/entries/fields": {
+ "put": {
"security": [
{
"Bearer": []
@@ -718,7 +2510,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "对知识库进行评估测试",
+ "description": "批量更新FAQ条目的多个字段(is_enabled, is_recommended, tag_id)",
"consumes": [
"application/json"
],
@@ -726,23 +2518,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "评估"
+ "FAQ管理"
],
- "summary": "执行评估",
+ "summary": "批量更新FAQ字段",
"parameters": [
{
- "description": "评估请求参数",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "字段更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.EvaluationRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate"
}
}
],
"responses": {
"200": {
- "description": "评估任务",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -757,8 +2556,8 @@ const docTemplate = `{
}
}
},
- "/faq/import/progress/{task_id}": {
- "get": {
+ "/knowledge-bases/{id}/faq/entries/tags": {
+ "put": {
"security": [
{
"Bearer": []
@@ -767,7 +2566,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取FAQ导入任务的进度",
+ "description": "批量更新FAQ条目的标签",
"consumes": [
"application/json"
],
@@ -777,26 +2576,35 @@ const docTemplate = `{
"tags": [
"FAQ管理"
],
- "summary": "获取FAQ导入进度",
+ "summary": "批量更新FAQ标签",
"parameters": [
{
"type": "string",
- "description": "任务ID",
- "name": "task_id",
+ "description": "知识库ID",
+ "name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "标签更新请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "导入进度",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -804,8 +2612,8 @@ const docTemplate = `{
}
}
},
- "/initialization/extract/relations": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries/{entry_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -814,7 +2622,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "从文本中提取实体和关系",
+ "description": "根据ID获取单个FAQ条目的详情",
"consumes": [
"application/json"
],
@@ -822,23 +2630,28 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "提取文本关系",
+ "summary": "获取FAQ条目详情",
"parameters": [
{
- "description": "提取请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
- }
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "提取结果",
+ "description": "FAQ条目详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -849,36 +2662,16 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- }
- }
- }
- },
- "/initialization/fabri/tag": {
- "get": {
- "description": "随机生成一组标签",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "初始化"
- ],
- "summary": "生成随机标签",
- "responses": {
- "200": {
- "description": "生成的标签",
+ },
+ "404": {
+ "description": "条目不存在",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/initialization/fabri/text": {
- "post": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -887,7 +2680,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据标签生成示例文本",
+ "description": "更新指定的FAQ条目",
"consumes": [
"application/json"
],
@@ -895,23 +2688,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "生成示例文本",
+ "summary": "更新FAQ条目",
"parameters": [
{
- "description": "生成请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "FAQ条目",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.FabriTextRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
}
}
],
"responses": {
"200": {
- "description": "生成的文本",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -926,7 +2733,7 @@ const docTemplate = `{
}
}
},
- "/initialization/kb/{kbId}": {
+ "/knowledge-bases/{id}/faq/entries/{entry_id}/similar-questions": {
"post": {
"security": [
{
@@ -936,7 +2743,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID执行完整配置更新",
+ "description": "向指定的FAQ条目添加相似问题",
"consumes": [
"application/json"
],
@@ -944,30 +2751,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "初始化知识库配置",
+ "summary": "添加相似问",
"parameters": [
{
"type": "string",
"description": "知识库ID",
- "name": "kbId",
+ "name": "id",
"in": "path",
"required": true
},
{
- "description": "初始化请求",
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "相似问列表",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.addSimilarQuestionsRequest"
}
}
],
"responses": {
"200": {
- "description": "初始化成功",
+ "description": "更新后的FAQ条目",
"schema": {
"type": "object",
"additionalProperties": true
@@ -978,12 +2792,18 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "条目不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/initialization/kb/{kbId}/config": {
- "get": {
+ "/knowledge-bases/{id}/faq/entry": {
+ "post": {
"security": [
{
"Bearer": []
@@ -992,7 +2812,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID获取当前配置信息",
+ "description": "同步创建单个FAQ条目",
"consumes": [
"application/json"
],
@@ -1000,34 +2820,45 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "获取知识库配置",
+ "summary": "创建单个FAQ条目",
"parameters": [
{
"type": "string",
"description": "知识库ID",
- "name": "kbId",
+ "name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "FAQ条目",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ }
}
],
"responses": {
"200": {
- "description": "配置信息",
+ "description": "创建的FAQ条目",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "知识库不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/knowledge-bases/{id}/faq/import/last-result/display": {
"put": {
"security": [
{
@@ -1037,7 +2868,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID更新模型和分块配置",
+ "description": "更新FAQ知识库导入结果统计卡片的显示或隐藏状态",
"consumes": [
"application/json"
],
@@ -1045,24 +2876,24 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "更新知识库配置",
+ "summary": "更新FAQ最后一次导入结果显示状态",
"parameters": [
{
"type": "string",
"description": "知识库ID",
- "name": "kbId",
+ "name": "id",
"in": "path",
"required": true
},
{
- "description": "配置请求",
+ "description": "状态更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.KBModelConfigRequest"
+ "$ref": "#/definitions/internal_handler.updateLastFAQImportResultDisplayStatusRequest"
}
}
],
@@ -1081,7 +2912,7 @@ const docTemplate = `{
}
},
"404": {
- "description": "知识库不存在",
+ "description": "知识库不存在或无导入记录",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -1089,7 +2920,7 @@ const docTemplate = `{
}
}
},
- "/initialization/models/embedding/test": {
+ "/knowledge-bases/{id}/faq/search": {
"post": {
"security": [
{
@@ -1099,7 +2930,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "测试Embedding接口是否可用并返回向量维度",
+ "description": "使用混合搜索在FAQ中搜索,支持两级优先级标签召回:first_priority_tag_ids优先级最高,second_priority_tag_ids次之",
"consumes": [
"application/json"
],
@@ -1107,23 +2938,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "测试Embedding模型",
+ "summary": "搜索FAQ",
"parameters": [
{
- "description": "Embedding测试请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "搜索请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest"
}
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1138,8 +2976,8 @@ const docTemplate = `{
}
}
},
- "/initialization/models/remote/check": {
- "post": {
+ "/knowledge-bases/{id}/hybrid-search": {
+ "get": {
"security": [
{
"Bearer": []
@@ -1148,7 +2986,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "检查远程API模型连接是否正常",
+ "description": "在知识库中执行向量和关键词混合搜索",
"consumes": [
"application/json"
],
@@ -1156,23 +2994,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "知识库"
],
- "summary": "检查远程模型",
+ "summary": "混合搜索",
"parameters": [
{
- "description": "模型检查请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "搜索参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1187,8 +3032,8 @@ const docTemplate = `{
}
}
},
- "/initialization/models/rerank/check": {
- "post": {
+ "/knowledge-bases/{id}/knowledge": {
+ "get": {
"security": [
{
"Bearer": []
@@ -1197,7 +3042,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "检查Rerank模型连接和功能是否正常",
+ "description": "获取知识库下的知识列表,支持分页和筛选",
"consumes": [
"application/json"
],
@@ -1205,23 +3050,51 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "知识管理"
],
- "summary": "检查Rerank模型",
+ "summary": "获取知识列表",
"parameters": [
{
- "description": "Rerank检查请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "标签ID筛选",
+ "name": "tag_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "文件类型筛选",
+ "name": "file_type",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "知识列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1236,7 +3109,7 @@ const docTemplate = `{
}
}
},
- "/initialization/multimodal/test": {
+ "/knowledge-bases/{id}/knowledge/file": {
"post": {
"security": [
{
@@ -1246,7 +3119,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "上传图片测试多模态处理功能",
+ "description": "上传文件并创建知识条目",
"consumes": [
"multipart/form-data"
],
@@ -1254,54 +3127,46 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "知识管理"
],
- "summary": "测试多模态功能",
+ "summary": "从文件创建知识",
"parameters": [
- {
- "type": "file",
- "description": "测试图片",
- "name": "image",
- "in": "formData",
- "required": true
- },
{
"type": "string",
- "description": "VLM模型名称",
- "name": "vlm_model",
- "in": "formData",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
"required": true
},
{
- "type": "string",
- "description": "VLM Base URL",
- "name": "vlm_base_url",
+ "type": "file",
+ "description": "上传的文件",
+ "name": "file",
"in": "formData",
"required": true
},
{
"type": "string",
- "description": "VLM API Key",
- "name": "vlm_api_key",
+ "description": "自定义文件名",
+ "name": "fileName",
"in": "formData"
},
{
"type": "string",
- "description": "VLM接口类型",
- "name": "vlm_interface_type",
+ "description": "元数据JSON",
+ "name": "metadata",
"in": "formData"
},
{
- "type": "string",
- "description": "存储类型(cos/minio)",
- "name": "storage_type",
- "in": "formData",
- "required": true
+ "type": "boolean",
+ "description": "启用多模态处理",
+ "name": "enable_multimodel",
+ "in": "formData"
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1312,12 +3177,19 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "409": {
+ "description": "文件重复",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
}
}
},
- "/initialization/ollama/download/tasks": {
- "get": {
+ "/knowledge-bases/{id}/knowledge/manual": {
+ "post": {
"security": [
{
"Bearer": []
@@ -1326,7 +3198,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "列出所有Ollama模型下载任务",
+ "description": "手工录入Markdown格式的知识内容",
"consumes": [
"application/json"
],
@@ -1334,22 +3206,46 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "知识管理"
+ ],
+ "summary": "手工创建知识",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "手工知识内容",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ }
+ }
],
- "summary": "列出下载任务",
"responses": {
"200": {
- "description": "任务列表",
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/initialization/ollama/download/{taskId}": {
- "get": {
+ "/knowledge-bases/{id}/knowledge/url": {
+ "post": {
"security": [
{
"Bearer": []
@@ -1358,7 +3254,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取Ollama模型下载任务的进度",
+ "description": "从指定URL抓取内容并创建知识条目。当提供 file_name/file_type 或 URL 路径含已知文件扩展名时,自动切换为文件下载模式",
"consumes": [
"application/json"
],
@@ -1366,84 +3262,111 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "知识管理"
],
- "summary": "获取下载进度",
+ "summary": "从URL创建知识",
"parameters": [
{
"type": "string",
- "description": "任务ID",
- "name": "taskId",
+ "description": "知识库ID",
+ "name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "URL请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "enable_multimodel": {
+ "type": "boolean"
+ },
+ "file_name": {
+ "type": "string"
+ },
+ "file_type": {
+ "type": "string"
+ },
+ "tag_id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ }
}
],
"responses": {
- "200": {
- "description": "下载进度",
+ "201": {
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "409": {
+ "description": "URL重复",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
}
}
},
- "/initialization/ollama/models": {
+ "/knowledge-bases/{id}/shares": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "列出已安装的Ollama模型",
- "consumes": [
- "application/json"
- ],
+ "description": "获取知识库的所有共享记录",
"produces": [
"application/json"
],
"tags": [
- "初始化"
+ "知识库共享"
+ ],
+ "summary": "获取知识库的共享列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "列出Ollama模型",
"responses": {
"200": {
- "description": "模型列表",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "500": {
- "description": "服务器错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
}
}
}
- }
- },
- "/initialization/ollama/models/check": {
+ },
"post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "检查指定的Ollama模型是否已安装",
+ "description": "将知识库共享到指定组织",
"consumes": [
"application/json"
],
@@ -1451,38 +3374,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "知识库共享"
],
- "summary": "检查Ollama模型状态",
+ "summary": "共享知识库到组织",
"parameters": [
{
- "description": "模型名称列表",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "共享信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "models": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest"
}
}
],
"responses": {
- "200": {
- "description": "模型状态",
+ "201": {
+ "description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -1490,17 +3412,14 @@ const docTemplate = `{
}
}
},
- "/initialization/ollama/models/download": {
- "post": {
+ "/knowledge-bases/{id}/shares/{share_id}": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "异步下载指定的Ollama模型",
+ "description": "更新知识库共享的权限级别",
"consumes": [
"application/json"
],
@@ -1508,67 +3427,95 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "知识库共享"
],
- "summary": "下载Ollama模型",
+ "summary": "更新共享权限",
"parameters": [
{
- "description": "模型名称",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "共享记录ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "权限信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "modelName": {
- "type": "string"
- }
- }
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest"
}
}
],
"responses": {
"200": {
- "description": "下载任务信息",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/initialization/ollama/status": {
- "get": {
- "description": "检查Ollama服务是否可用",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "取消知识库的共享",
"tags": [
- "初始化"
+ "知识库共享"
+ ],
+ "summary": "取消共享",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "共享记录ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "检查Ollama服务状态",
"responses": {
"200": {
- "description": "Ollama状态",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/knowledge-bases": {
+ "/knowledge-bases/{id}/tags": {
"get": {
"security": [
{
@@ -1578,7 +3525,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有知识库",
+ "description": "获取知识库下的所有标签及统计信息",
"consumes": [
"application/json"
],
@@ -1586,19 +3533,46 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "标签管理"
+ ],
+ "summary": "获取标签列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ }
],
- "summary": "获取知识库列表",
"responses": {
"200": {
- "description": "知识库列表",
+ "description": "标签列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -1614,7 +3588,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "创建新的知识库",
+ "description": "在知识库下创建新标签",
"consumes": [
"application/json"
],
@@ -1622,23 +3596,41 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "标签管理"
],
- "summary": "创建知识库",
+ "summary": "创建标签",
"parameters": [
{
- "description": "知识库信息",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "标签信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ }
+ }
}
}
],
"responses": {
- "201": {
- "description": "创建的知识库",
+ "200": {
+ "description": "创建的标签",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1653,8 +3645,8 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/copy": {
- "post": {
+ "/knowledge-bases/{id}/tags/{tag_id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -1663,7 +3655,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "将一个知识库的内容复制到另一个知识库(异步任务)",
+ "description": "更新标签信息",
"consumes": [
"application/json"
],
@@ -1671,23 +3663,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "标签管理"
],
- "summary": "复制知识库",
+ "summary": "更新标签",
"parameters": [
{
- "description": "复制请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "标签ID (UUID或seq_id)",
+ "name": "tag_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "标签更新信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseRequest"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "任务ID",
+ "description": "更新后的标签",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1700,10 +3706,8 @@ const docTemplate = `{
}
}
}
- }
- },
- "/knowledge-bases/copy/progress/{task_id}": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -1712,7 +3716,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取知识库复制任务的进度",
+ "description": "删除标签,可使用force=true强制删除被引用的标签,content_only=true仅删除标签下的内容而保留标签本身",
"consumes": [
"application/json"
],
@@ -1720,28 +3724,55 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "标签管理"
],
- "summary": "获取知识库复制进度",
+ "summary": "删除标签",
"parameters": [
{
"type": "string",
- "description": "任务ID",
- "name": "task_id",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "标签ID (UUID或seq_id)",
+ "name": "tag_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "boolean",
+ "description": "强制删除",
+ "name": "force",
+ "in": "query"
+ },
+ {
+ "type": "boolean",
+ "description": "仅删除内容,保留标签",
+ "name": "content_only",
+ "in": "query"
+ },
+ {
+ "description": "删除选项",
+ "name": "body",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.DeleteTagRequest"
+ }
}
],
"responses": {
"200": {
- "description": "进度信息",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -1749,7 +3780,7 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}": {
+ "/knowledge/batch": {
"get": {
"security": [
{
@@ -1759,7 +3790,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据ID获取知识库详情",
+ "description": "根据ID列表批量获取知识条目。可选 kb_id:指定时按该知识库校验权限并用于共享知识库的租户解析;可选 agent_id:使用共享智能体时传此参数,后端按智能体所属租户查询(用于刷新后恢复共享知识库下的文件)",
"consumes": [
"application/json"
],
@@ -1767,21 +3798,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "知识管理"
],
- "summary": "获取知识库详情",
+ "summary": "批量获取知识",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "description": "知识ID列表",
+ "name": "ids",
+ "in": "query",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "可选,知识库ID(用于共享知识库时指定范围)",
+ "name": "kb_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "可选,共享智能体ID(用于按智能体租户批量拉取文件详情)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "知识库详情",
+ "description": "知识列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1792,15 +3839,11 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "404": {
- "description": "知识库不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
- },
+ }
+ },
+ "/knowledge/image/{id}/{chunk_id}": {
"put": {
"security": [
{
@@ -1810,7 +3853,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新知识库的名称、描述和配置",
+ "description": "更新知识分块的图像信息",
"consumes": [
"application/json"
],
@@ -1818,30 +3861,42 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "知识管理"
],
- "summary": "更新知识库",
+ "summary": "更新图像信息",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "更新请求",
+ "type": "string",
+ "description": "分块ID",
+ "name": "chunk_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "图像信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateKnowledgeBaseRequest"
+ "type": "object",
+ "properties": {
+ "image_info": {
+ "type": "string"
+ }
+ }
}
}
],
"responses": {
"200": {
- "description": "更新后的知识库",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1854,8 +3909,10 @@ const docTemplate = `{
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge/manual/{id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -1864,7 +3921,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "删除指定的知识库及其所有内容",
+ "description": "更新手工录入的Markdown知识内容",
"consumes": [
"application/json"
],
@@ -1872,21 +3929,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "知识管理"
],
- "summary": "删除知识库",
+ "summary": "更新手工知识",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "手工知识内容",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ }
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "更新后的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1901,7 +3967,7 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}/faq/entries": {
+ "/knowledge/search": {
"get": {
"security": [
{
@@ -1911,7 +3977,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的FAQ条目列表,支持分页和筛选",
+ "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
"consumes": [
"application/json"
],
@@ -1919,71 +3985,60 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "Knowledge"
],
- "summary": "获取FAQ条目列表",
+ "summary": "Search knowledge",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "页码",
- "name": "page",
+ "description": "Keyword to search",
+ "name": "keyword",
"in": "query"
},
{
"type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "string",
- "description": "标签ID筛选",
- "name": "tag_id",
+ "description": "Offset for pagination",
+ "name": "offset",
"in": "query"
},
{
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
+ "type": "integer",
+ "description": "Limit for pagination (default 20)",
+ "name": "limit",
"in": "query"
},
{
"type": "string",
- "description": "搜索字段: standard_question(标准问题), similar_questions(相似问法), answers(答案), 默认搜索全部",
- "name": "search_field",
+ "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
+ "name": "file_types",
"in": "query"
},
{
"type": "string",
- "description": "排序方式: asc(按更新时间正序), 默认按更新时间倒序",
- "name": "sort_order",
+ "description": "Shared agent ID (search within agent's KB scope)",
+ "name": "agent_id",
"in": "query"
}
],
"responses": {
"200": {
- "description": "FAQ列表",
+ "description": "Search results",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Invalid request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/knowledge/tags": {
+ "put": {
"security": [
{
"Bearer": []
@@ -1992,7 +4047,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "异步批量更新或插入FAQ条目",
+ "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
"consumes": [
"application/json"
],
@@ -2000,30 +4055,23 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "批量更新/插入FAQ条目",
+ "summary": "批量更新知识标签",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "批量操作请求",
+ "description": "标签更新请求(updates 必填,kb_id 可选)",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "任务ID",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2036,8 +4084,10 @@ const docTemplate = `{
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2046,7 +4096,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "批量删除指定的FAQ条目",
+ "description": "根据ID获取知识条目详情",
"consumes": [
"application/json"
],
@@ -2054,38 +4104,21 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "批量删除FAQ条目",
+ "summary": "获取知识详情",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "要删除的FAQ ID列表",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- }
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "知识详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2096,12 +4129,16 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "知识不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entries/export": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -2110,31 +4147,41 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "将所有FAQ条目导出为CSV文件",
+ "description": "更新知识条目信息",
"consumes": [
"application/json"
],
"produces": [
- "text/csv"
+ "application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "导出FAQ条目",
+ "summary": "更新知识",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "知识信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
}
],
"responses": {
"200": {
- "description": "CSV文件",
+ "description": "更新成功",
"schema": {
- "type": "file"
+ "type": "object",
+ "additionalProperties": true
}
},
"400": {
@@ -2144,10 +4191,8 @@ const docTemplate = `{
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entries/fields": {
- "put": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2156,7 +4201,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "批量更新FAQ条目的多个字段(is_enabled, is_recommended, tag_id)",
+ "description": "根据ID删除知识条目",
"consumes": [
"application/json"
],
@@ -2164,30 +4209,21 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "批量更新FAQ字段",
+ "summary": "删除知识",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "字段更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2202,8 +4238,8 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}/faq/entries/tags": {
- "put": {
+ "/knowledge/{id}/download": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2212,41 +4248,31 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "批量更新FAQ条目的标签",
+ "description": "下载知识条目关联的原始文件",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "application/octet-stream"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "批量更新FAQ标签",
+ "summary": "下载知识文件",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "标签更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "文件内容",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
@@ -2258,8 +4284,8 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}/faq/entries/{entry_id}": {
- "get": {
+ "/knowledge/{id}/reparse": {
+ "post": {
"security": [
{
"Bearer": []
@@ -2268,7 +4294,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据ID获取单个FAQ条目的详情",
+ "description": "删除知识中现有的文档内容并重新解析,使用异步任务方式处理",
"consumes": [
"application/json"
],
@@ -2276,28 +4302,21 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "获取FAQ条目详情",
+ "summary": "重新解析知识",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "type": "string",
- "description": "FAQ条目ID",
- "name": "entry_id",
- "in": "path",
- "required": true
}
],
"responses": {
"200": {
- "description": "FAQ条目详情",
+ "description": "重新解析任务已提交",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2309,15 +4328,17 @@ const docTemplate = `{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
- "404": {
- "description": "条目不存在",
+ "403": {
+ "description": "权限不足",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/mcp-services": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2326,7 +4347,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新指定的FAQ条目",
+ "description": "获取当前租户的所有MCP服务",
"consumes": [
"application/json"
],
@@ -2334,37 +4355,12 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
- ],
- "summary": "更新FAQ条目",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "FAQ条目ID",
- "name": "entry_id",
- "in": "path",
- "required": true
- },
- {
- "description": "FAQ条目",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
- }
- }
+ "MCP服务"
],
+ "summary": "获取MCP服务列表",
"responses": {
"200": {
- "description": "更新成功",
+ "description": "MCP服务列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2377,9 +4373,7 @@ const docTemplate = `{
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entry": {
+ },
"post": {
"security": [
{
@@ -2389,7 +4383,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "同步创建单个FAQ条目",
+ "description": "创建新的MCP服务配置",
"consumes": [
"application/json"
],
@@ -2397,30 +4391,23 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "MCP服务"
],
- "summary": "创建单个FAQ条目",
+ "summary": "创建MCP服务",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "FAQ条目",
+ "description": "MCP服务配置",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService"
}
}
],
"responses": {
"200": {
- "description": "创建的FAQ条目",
+ "description": "创建的MCP服务",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2435,8 +4422,8 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}/faq/search": {
- "post": {
+ "/mcp-services/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2445,7 +4432,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "使用混合搜索在FAQ中搜索",
+ "description": "根据ID获取MCP服务详情",
"consumes": [
"application/json"
],
@@ -2453,46 +4440,35 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "MCP服务"
],
- "summary": "搜索FAQ",
+ "summary": "获取MCP服务详情",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "搜索请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest"
- }
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "MCP服务详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "服务不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/hybrid-search": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -2501,7 +4477,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "在知识库中执行向量和关键词混合搜索",
+ "description": "更新MCP服务配置",
"consumes": [
"application/json"
],
@@ -2509,30 +4485,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "MCP服务"
],
- "summary": "混合搜索",
+ "summary": "更新MCP服务",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "搜索参数",
+ "description": "更新字段",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "更新后的MCP服务",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2545,10 +4521,8 @@ const docTemplate = `{
}
}
}
- }
- },
- "/knowledge-bases/{id}/knowledge": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2557,7 +4531,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的知识列表,支持分页和筛选",
+ "description": "删除指定的MCP服务",
"consumes": [
"application/json"
],
@@ -2565,58 +4539,28 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "MCP服务"
],
- "summary": "获取知识列表",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "string",
- "description": "标签ID筛选",
- "name": "tag_id",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
- "in": "query"
- },
+ "summary": "删除MCP服务",
+ "parameters": [
{
"type": "string",
- "description": "文件类型筛选",
- "name": "file_type",
- "in": "query"
+ "description": "MCP服务ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "知识列表",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -2624,8 +4568,8 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}/knowledge/file": {
- "post": {
+ "/mcp-services/{id}/resources": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2634,76 +4578,44 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "上传文件并创建知识条目",
+ "description": "获取MCP服务提供的资源列表",
"consumes": [
- "multipart/form-data"
+ "application/json"
],
"produces": [
"application/json"
],
"tags": [
- "知识管理"
+ "MCP服务"
],
- "summary": "从文件创建知识",
+ "summary": "获取MCP服务资源列表",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "type": "file",
- "description": "上传的文件",
- "name": "file",
- "in": "formData",
- "required": true
- },
- {
- "type": "string",
- "description": "自定义文件名",
- "name": "fileName",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "元数据JSON",
- "name": "metadata",
- "in": "formData"
- },
- {
- "type": "boolean",
- "description": "启用多模态处理",
- "name": "enable_multimodel",
- "in": "formData"
}
],
"responses": {
"200": {
- "description": "创建的知识",
+ "description": "资源列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "409": {
- "description": "文件重复",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
}
}
}
},
- "/knowledge-bases/{id}/knowledge/manual": {
+ "/mcp-services/{id}/test": {
"post": {
"security": [
{
@@ -2713,7 +4625,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "手工录入Markdown格式的知识内容",
+ "description": "测试MCP服务是否可以正常连接",
"consumes": [
"application/json"
],
@@ -2721,30 +4633,21 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "MCP服务"
],
- "summary": "手工创建知识",
+ "summary": "测试MCP服务连接",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "手工知识内容",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
- }
}
],
"responses": {
"200": {
- "description": "创建的知识",
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2759,8 +4662,8 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}/knowledge/url": {
- "post": {
+ "/mcp-services/{id}/tools": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2769,7 +4672,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "从指定URL抓取内容并创建知识条目",
+ "description": "获取MCP服务提供的工具列表",
"consumes": [
"application/json"
],
@@ -2777,63 +4680,36 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "MCP服务"
],
- "summary": "从URL创建知识",
+ "summary": "获取MCP服务工具列表",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "URL请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "enable_multimodel": {
- "type": "boolean"
- },
- "title": {
- "type": "string"
- },
- "url": {
- "type": "string"
- }
- }
- }
}
],
"responses": {
- "201": {
- "description": "创建的知识",
+ "200": {
+ "description": "工具列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "409": {
- "description": "URL重复",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
}
}
}
},
- "/knowledge-bases/{id}/tags": {
+ "/messages/{session_id}/load": {
"get": {
"security": [
{
@@ -2843,7 +4719,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的所有标签及统计信息",
+ "description": "加载会话的消息历史,支持分页和时间筛选",
"consumes": [
"application/json"
],
@@ -2851,39 +4727,34 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "标签管理"
+ "消息"
],
- "summary": "获取标签列表",
+ "summary": "加载消息历史",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
+ "description": "会话ID",
+ "name": "session_id",
"in": "path",
"required": true
},
{
"type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
+ "default": 20,
+ "description": "返回数量",
+ "name": "limit",
"in": "query"
},
{
"type": "string",
- "description": "关键词搜索",
- "name": "keyword",
+ "description": "在此时间之前的消息(RFC3339Nano格式)",
+ "name": "before_time",
"in": "query"
}
],
"responses": {
"200": {
- "description": "标签列表",
+ "description": "消息列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2896,8 +4767,10 @@ const docTemplate = `{
}
}
}
- },
- "post": {
+ }
+ },
+ "/messages/{session_id}/{id}": {
+ "delete": {
"security": [
{
"Bearer": []
@@ -2906,7 +4779,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "在知识库下创建新标签",
+ "description": "从会话中删除指定消息",
"consumes": [
"application/json"
],
@@ -2914,48 +4787,35 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "标签管理"
+ "消息"
],
- "summary": "创建标签",
+ "summary": "删除消息",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
+ "description": "会话ID",
+ "name": "session_id",
"in": "path",
"required": true
},
{
- "description": "标签信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "color": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "sort_order": {
- "type": "integer"
- }
- }
- }
+ "type": "string",
+ "description": "消息ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "创建的标签",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -2963,8 +4823,8 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}/tags/{tag_id}": {
- "put": {
+ "/models": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2973,7 +4833,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新标签信息",
+ "description": "获取当前租户的所有模型",
"consumes": [
"application/json"
],
@@ -2981,37 +4841,59 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "标签管理"
+ "模型管理"
],
- "summary": "更新标签",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
+ "summary": "获取模型列表",
+ "responses": {
+ "200": {
+ "description": "模型列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
},
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
{
- "type": "string",
- "description": "标签ID",
- "name": "tag_id",
- "in": "path",
- "required": true
+ "Bearer": []
},
{
- "description": "标签更新信息",
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "创建新的模型配置",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "模型管理"
+ ],
+ "summary": "创建模型",
+ "parameters": [
+ {
+ "description": "模型信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.CreateModelRequest"
}
}
],
"responses": {
- "200": {
- "description": "更新后的标签",
+ "201": {
+ "description": "创建的模型",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3024,8 +4906,10 @@ const docTemplate = `{
}
}
}
- },
- "delete": {
+ }
+ },
+ "/models/providers": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3034,7 +4918,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "删除标签,可使用force=true强制删除被引用的标签,content_only=true仅删除标签下的内容而保留标签本身",
+ "description": "根据模型类型获取支持的厂商列表及配置信息",
"consumes": [
"application/json"
],
@@ -3042,55 +4926,29 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "标签管理"
+ "模型管理"
],
- "summary": "删除标签",
+ "summary": "获取模型厂商列表",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "标签ID",
- "name": "tag_id",
- "in": "path",
- "required": true
- },
- {
- "type": "boolean",
- "description": "强制删除",
- "name": "force",
- "in": "query"
- },
- {
- "type": "boolean",
- "description": "仅删除内容,保留标签",
- "name": "content_only",
+ "description": "模型类型 (chat, embedding, rerank, vllm)",
+ "name": "model_type",
"in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "厂商列表",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/knowledge/batch": {
+ "/models/{id}": {
"get": {
"security": [
{
@@ -3100,7 +4958,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据ID列表批量获取知识条目",
+ "description": "根据ID获取模型详情",
"consumes": [
"application/json"
],
@@ -3108,40 +4966,34 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "模型管理"
],
- "summary": "批量获取知识",
+ "summary": "获取模型详情",
"parameters": [
{
- "type": "array",
- "items": {
- "type": "string"
- },
- "collectionFormat": "csv",
- "description": "知识ID列表",
- "name": "ids",
- "in": "query",
+ "type": "string",
+ "description": "模型ID",
+ "name": "id",
+ "in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "知识列表",
+ "description": "模型详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge/image/{id}/{chunk_id}": {
+ },
"put": {
"security": [
{
@@ -3151,7 +5003,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新知识分块的图像信息",
+ "description": "更新模型配置信息",
"consumes": [
"application/json"
],
@@ -3159,58 +5011,44 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "模型管理"
],
- "summary": "更新图像信息",
+ "summary": "更新模型",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
},
{
- "type": "string",
- "description": "分块ID",
- "name": "chunk_id",
- "in": "path",
- "required": true
- },
- {
- "description": "图像信息",
+ "description": "更新信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "image_info": {
- "type": "string"
- }
- }
+ "$ref": "#/definitions/internal_handler.UpdateModelRequest"
}
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "更新后的模型",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge/manual/{id}": {
- "put": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -3219,7 +5057,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新手工录入的Markdown知识内容",
+ "description": "删除指定的模型",
"consumes": [
"application/json"
],
@@ -3227,37 +5065,28 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "模型管理"
],
- "summary": "更新手工知识",
+ "summary": "删除模型",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "手工知识内容",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
- }
}
],
"responses": {
"200": {
- "description": "更新后的知识",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3265,17 +5094,37 @@ const docTemplate = `{
}
}
},
- "/knowledge/search": {
+ "/organizations": {
"get": {
"security": [
{
"Bearer": []
- },
+ }
+ ],
+ "description": "获取当前用户所属的所有组织,并附带各空间内知识库/智能体数量",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织管理"
+ ],
+ "summary": "获取我的组织列表",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse"
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
{
- "ApiKeyAuth": []
+ "Bearer": []
}
],
- "description": "Search knowledge files by keyword across all knowledge bases",
+ "description": "创建新的组织,创建者自动成为管理员",
"consumes": [
"application/json"
],
@@ -3283,39 +5132,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "Knowledge"
+ "组织管理"
],
- "summary": "Search knowledge",
+ "summary": "创建组织",
"parameters": [
{
- "type": "string",
- "description": "Keyword to search",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Offset for pagination",
- "name": "offset",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Limit for pagination (default 20)",
- "name": "limit",
- "in": "query"
+ "description": "组织信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest"
+ }
}
],
"responses": {
- "200": {
- "description": "Search results",
+ "201": {
+ "description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Invalid request",
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3323,17 +5163,14 @@ const docTemplate = `{
}
}
},
- "/knowledge/tags": {
- "put": {
+ "/organizations/join": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "批量更新知识条目的标签",
+ "description": "使用邀请码加入组织",
"consumes": [
"application/json"
],
@@ -3341,30 +5178,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "批量更新知识标签",
+ "summary": "通过邀请码加入组织",
"parameters": [
{
- "description": "标签更新请求",
+ "description": "邀请码",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest"
}
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3372,17 +5209,14 @@ const docTemplate = `{
}
}
},
- "/knowledge/{id}": {
- "get": {
+ "/organizations/join-by-id": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取知识条目详情",
+ "description": "加入已开放可被搜索的空间,无需邀请码",
"consumes": [
"application/json"
],
@@ -3390,50 +5224,45 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "获取知识详情",
+ "summary": "通过空间 ID 加入(可搜索空间)",
"parameters": [
{
- "type": "string",
- "description": "知识ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "空间 ID",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest"
+ }
}
],
"responses": {
"200": {
- "description": "知识详情",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
- },
- "404": {
- "description": "知识不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/organizations/join-request": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新知识条目信息",
+ "description": "对需要审核的组织提交加入申请",
"consumes": [
"application/json"
],
@@ -3441,82 +5270,71 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "更新知识",
+ "summary": "提交加入申请",
"parameters": [
{
- "type": "string",
- "description": "知识ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "知识信息",
+ "description": "申请信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest"
}
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/organizations/preview/{code}": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID删除知识条目",
- "consumes": [
- "application/json"
- ],
+ "description": "通过邀请码获取组织基本信息(不加入)",
"produces": [
"application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "删除知识",
+ "summary": "通过邀请码预览组织",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "id",
+ "description": "邀请码",
+ "name": "code",
"in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3524,99 +5342,94 @@ const docTemplate = `{
}
}
},
- "/knowledge/{id}/download": {
+ "/organizations/search": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "下载知识条目关联的原始文件",
- "consumes": [
- "application/json"
- ],
+ "description": "搜索已开放可被搜索的空间,用于发现并加入",
"produces": [
- "application/octet-stream"
+ "application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "下载知识文件",
+ "summary": "搜索可加入的空间",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "搜索关键词(空间名称或描述)",
+ "name": "q",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 20,
+ "description": "返回数量限制",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "文件内容",
- "schema": {
- "type": "file"
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/mcp-services": {
+ "/organizations/{id}": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有MCP服务",
- "consumes": [
- "application/json"
- ],
+ "description": "根据ID获取组织详情",
"produces": [
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
+ ],
+ "summary": "获取组织详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "获取MCP服务列表",
"responses": {
"200": {
- "description": "MCP服务列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "post": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "创建新的MCP服务配置",
+ "description": "更新组织信息(需要管理员权限)",
"consumes": [
"application/json"
],
@@ -3624,62 +5437,58 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "创建MCP服务",
+ "summary": "更新组织",
"parameters": [
{
- "description": "MCP服务配置",
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest"
}
}
],
"responses": {
"200": {
- "description": "创建的MCP服务",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/mcp-services/{id}": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取MCP服务详情",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "删除组织(仅组织创建者可操作)",
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "获取MCP服务详情",
+ "summary": "删除组织",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -3687,30 +5496,29 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "MCP服务详情",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "服务不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/organizations/{id}/invite": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新MCP服务配置",
+ "description": "管理员直接添加用户为组织成员",
"consumes": [
"application/json"
],
@@ -3718,67 +5526,69 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "更新MCP服务",
+ "summary": "邀请成员",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "更新字段",
+ "description": "邀请信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.InviteMemberRequest"
}
}
],
"responses": {
"200": {
- "description": "更新后的MCP服务",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Bad Request",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/organizations/{id}/invite-code": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除指定的MCP服务",
- "consumes": [
- "application/json"
- ],
+ "description": "生成新的组织邀请码(需要管理员权限)",
"produces": [
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "删除MCP服务",
+ "summary": "生成邀请码",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -3786,14 +5596,14 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3801,31 +5611,25 @@ const docTemplate = `{
}
}
},
- "/mcp-services/{id}/resources": {
+ "/organizations/{id}/join-requests": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取MCP服务提供的资源列表",
- "consumes": [
- "application/json"
- ],
+ "description": "获取组织的待审核加入申请(仅管理员)",
"produces": [
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "获取MCP服务资源列表",
+ "summary": "获取待审核加入申请列表",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -3833,14 +5637,14 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "资源列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3848,17 +5652,14 @@ const docTemplate = `{
}
}
},
- "/mcp-services/{id}/test": {
- "post": {
+ "/organizations/{id}/join-requests/{request_id}/review": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "测试MCP服务是否可以正常连接",
+ "description": "通过或拒绝加入申请(仅管理员)",
"consumes": [
"application/json"
],
@@ -3866,28 +5667,44 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "测试MCP服务连接",
+ "summary": "审核加入申请",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "申请ID",
+ "name": "request_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "审核结果",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest"
+ }
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3895,31 +5712,22 @@ const docTemplate = `{
}
}
},
- "/mcp-services/{id}/tools": {
- "get": {
+ "/organizations/{id}/leave": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取MCP服务提供的工具列表",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "退出指定组织",
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "获取MCP服务工具列表",
+ "summary": "退出组织",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -3927,32 +5735,63 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "工具列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/organizations/{id}/members": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "获取组织的所有成员",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织管理"
+ ],
+ "summary": "获取组织成员列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListMembersResponse"
}
}
}
}
},
- "/messages/{session_id}/load": {
- "get": {
+ "/organizations/{id}/members/{user_id}": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "加载会话的消息历史,支持分页和时间筛选",
+ "description": "更新组织成员的角色(需要管理员权限)",
"consumes": [
"application/json"
],
@@ -3960,95 +5799,87 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "消息"
+ "组织管理"
],
- "summary": "加载消息历史",
+ "summary": "更新成员角色",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
},
{
- "type": "integer",
- "default": 20,
- "description": "返回数量",
- "name": "limit",
- "in": "query"
+ "type": "string",
+ "description": "用户ID",
+ "name": "user_id",
+ "in": "path",
+ "required": true
},
{
- "type": "string",
- "description": "在此时间之前的消息(RFC3339Nano格式)",
- "name": "before_time",
- "in": "query"
+ "description": "角色信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest"
+ }
}
],
"responses": {
"200": {
- "description": "消息列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/messages/{session_id}/{id}": {
+ },
"delete": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "从会话中删除指定消息",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "从组织中移除成员(需要管理员权限)",
"tags": [
- "消息"
+ "组织管理"
],
- "summary": "删除消息",
+ "summary": "移除成员",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
},
{
"type": "string",
- "description": "消息ID",
- "name": "id",
+ "description": "用户ID",
+ "name": "user_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4056,17 +5887,14 @@ const docTemplate = `{
}
}
},
- "/models": {
- "get": {
+ "/organizations/{id}/request-upgrade": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有模型",
+ "description": "现有成员申请更高权限",
"consumes": [
"application/json"
],
@@ -4074,66 +5902,92 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
+ ],
+ "summary": "申请权限升级",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "申请信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest"
+ }
+ }
],
- "summary": "获取模型列表",
"responses": {
"200": {
- "description": "模型列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/organizations/{id}/search-users": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "创建新的模型配置",
- "consumes": [
- "application/json"
- ],
+ "description": "搜索用户(排除已有成员)用于邀请加入组织",
"produces": [
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
],
- "summary": "创建模型",
+ "summary": "搜索可邀请的用户",
"parameters": [
{
- "description": "模型信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler.CreateModelRequest"
- }
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "搜索关键词(用户名或邮箱)",
+ "name": "q",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "default": 10,
+ "description": "返回数量限制",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
- "201": {
- "description": "创建的模型",
+ "200": {
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4141,31 +5995,25 @@ const docTemplate = `{
}
}
},
- "/models/{id}": {
+ "/organizations/{id}/shared-agents": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取模型详情",
- "consumes": [
- "application/json"
- ],
+ "description": "获取指定空间下所有共享智能体,包含他人共享的与我共享的,用于列表页空间视角",
"produces": [
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
],
- "summary": "获取模型详情",
+ "summary": "获取空间内全部智能体(含我共享的)",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -4173,98 +6021,69 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "模型详情",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "404": {
- "description": "模型不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
- },
- "put": {
+ }
+ },
+ "/organizations/{id}/shared-knowledge-bases": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新模型配置信息",
- "consumes": [
- "application/json"
- ],
+ "description": "获取指定空间下所有共享知识库,包含直接共享的与通过共享智能体可见的,用于列表页空间视角",
"produces": [
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
],
- "summary": "更新模型",
+ "summary": "获取空间内全部知识库(含我共享的、含智能体携带的)",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "更新信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler.UpdateModelRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新后的模型",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "404": {
- "description": "模型不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
- },
- "delete": {
+ }
+ },
+ "/organizations/{id}/shares": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除指定的模型",
- "consumes": [
- "application/json"
- ],
+ "description": "获取共享到指定组织的所有知识库",
"produces": [
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
],
- "summary": "删除模型",
+ "summary": "获取组织的共享知识库列表",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -4272,16 +6091,9 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "删除成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "404": {
- "description": "模型不存在",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
}
}
}
@@ -4347,7 +6159,56 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "创建新的对话会话",
+ "description": "创建新的对话会话",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "会话"
+ ],
+ "summary": "创建会话",
+ "parameters": [
+ {
+ "description": "会话创建请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.CreateSessionRequest"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "创建的会话",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/sessions/batch": {
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据ID列表批量删除对话会话",
"consumes": [
"application/json"
],
@@ -4357,21 +6218,21 @@ const docTemplate = `{
"tags": [
"会话"
],
- "summary": "创建会话",
+ "summary": "批量删除会话",
"parameters": [
{
- "description": "会话创建请求",
+ "description": "批量删除请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.CreateSessionRequest"
+ "$ref": "#/definitions/internal_handler_session.batchDeleteRequest"
}
}
],
"responses": {
- "201": {
- "description": "创建的会话",
+ "200": {
+ "description": "删除结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4859,6 +6720,70 @@ const docTemplate = `{
}
}
},
+ "/shared-knowledge-bases": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "获取通过组织共享给当前用户的所有知识库",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库共享"
+ ],
+ "summary": "获取共享给我的知识库列表",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/skills": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取所有预装的Agent Skills元数据",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Skills"
+ ],
+ "summary": "获取预装Skills列表",
+ "responses": {
+ "200": {
+ "description": "Skills列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/system/info": {
"get": {
"description": "获取系统版本、构建信息和引擎配置",
@@ -4882,6 +6807,43 @@ const docTemplate = `{
}
}
},
+ "/system/minio/buckets": {
+ "get": {
+ "description": "获取所有 MinIO 存储桶及其访问权限",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "系统"
+ ],
+ "summary": "列出 MinIO 存储桶",
+ "responses": {
+ "200": {
+ "description": "存储桶列表",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.ListMinioBucketsResponse"
+ }
+ },
+ "400": {
+ "description": "MinIO 未启用",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
"/tenants": {
"get": {
"security": [
@@ -5072,6 +7034,44 @@ const docTemplate = `{
}
}
},
+ "/tenants/kv/prompt-templates": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取系统配置的提示词模板列表",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "获取提示词模板",
+ "responses": {
+ "200": {
+ "description": "提示词模板配置",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/tenants/kv/web-search-config": {
"get": {
"security": [
@@ -5519,6 +7519,13 @@ const docTemplate = `{
"github_com_Tencent_WeKnora_internal_types.AgentConfig": {
"type": "object",
"properties": {
+ "allowed_skills": {
+ "description": "Skill names whitelist (empty = allow all)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"allowed_tools": {
"description": "List of allowed tool names",
"type": "array",
@@ -5526,6 +7533,10 @@ const docTemplate = `{
"type": "string"
}
},
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
"knowledge_bases": {
"description": "Accessible knowledge base IDs",
"type": "array",
@@ -5544,22 +7555,60 @@ const docTemplate = `{
"description": "Maximum number of ReAct iterations",
"type": "integer"
},
+ "mcp_selection_mode": {
+ "description": "MCP service selection",
+ "type": "string"
+ },
+ "mcp_services": {
+ "description": "Selected MCP service IDs (when mode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "multi_turn_enabled": {
+ "description": "Whether multi-turn conversation is enabled",
+ "type": "boolean"
+ },
"reflection_enabled": {
"description": "Whether to enable reflection",
"type": "boolean"
},
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
+ "type": "boolean"
+ },
+ "skill_dirs": {
+ "description": "Directories to search for skills",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skills_enabled": {
+ "description": "Skills configuration (Progressive Disclosure pattern)",
+ "type": "boolean"
+ },
+ "system_prompt": {
+ "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
+ "type": "string"
+ },
"system_prompt_web_disabled": {
- "description": "Custom prompt when web search is disabled",
+ "description": "Deprecated: Custom prompt when web search is disabled",
"type": "string"
},
"system_prompt_web_enabled": {
- "description": "Custom prompt when web search is enabled",
+ "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
"type": "string"
},
"temperature": {
"description": "LLM temperature for agent",
"type": "number"
},
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
+ },
"use_custom_system_prompt": {
"description": "Whether to use custom system prompt instead of default",
"type": "boolean"
@@ -5647,101 +7696,297 @@ const docTemplate = `{
"github_com_Tencent_WeKnora_internal_types.ContextConfig": {
"type": "object",
"properties": {
- "compression_strategy": {
- "description": "Compression strategy: \"sliding_window\" or \"smart\"",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
- }
- ]
+ "compression_strategy": {
+ "description": "Compression strategy: \"sliding_window\" or \"smart\"",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
+ }
+ ]
+ },
+ "max_tokens": {
+ "description": "Maximum tokens allowed in LLM context",
+ "type": "integer"
+ },
+ "recent_message_count": {
+ "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "type": "integer"
+ },
+ "summarize_threshold": {
+ "description": "Summarize threshold: number of messages before summarization",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ConversationConfig": {
+ "type": "object",
+ "properties": {
+ "context_template": {
+ "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "type": "string"
+ },
+ "embedding_top_k": {
+ "type": "integer"
+ },
+ "enable_query_expansion": {
+ "type": "boolean"
+ },
+ "enable_rewrite": {
+ "type": "boolean"
+ },
+ "fallback_prompt": {
+ "type": "string"
+ },
+ "fallback_response": {
+ "type": "string"
+ },
+ "fallback_strategy": {
+ "description": "Fallback strategy",
+ "type": "string"
+ },
+ "keyword_threshold": {
+ "type": "number"
+ },
+ "max_completion_tokens": {
+ "description": "MaxTokens is the maximum number of tokens to generate",
+ "type": "integer"
+ },
+ "max_rounds": {
+ "description": "Retrieval \u0026 strategy parameters",
+ "type": "integer"
+ },
+ "prompt": {
+ "description": "Prompt is the system prompt for normal mode",
+ "type": "string"
+ },
+ "rerank_model_id": {
+ "type": "string"
+ },
+ "rerank_threshold": {
+ "type": "number"
+ },
+ "rerank_top_k": {
+ "type": "integer"
+ },
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompts",
+ "type": "string"
+ },
+ "rewrite_prompt_user": {
+ "type": "string"
+ },
+ "summary_model_id": {
+ "description": "Model configuration",
+ "type": "string"
+ },
+ "temperature": {
+ "description": "Temperature controls the randomness of the model output",
+ "type": "number"
+ },
+ "vector_threshold": {
+ "type": "number"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "max_tokens": {
- "description": "Maximum tokens allowed in LLM context",
- "type": "integer"
+ "description": {
+ "type": "string",
+ "maxLength": 1000
},
- "recent_message_count": {
- "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "invite_code_validity_days": {
+ "description": "optional: 0=never, 1, 7, 30; default 7",
"type": "integer"
},
- "summarize_threshold": {
- "description": "Summarize threshold: number of messages before summarization",
+ "member_limit": {
+ "description": "optional: max members; 0=unlimited; default 50",
"type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ConversationConfig": {
+ "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
"type": "object",
"properties": {
+ "agent_mode": {
+ "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
+ "type": "string"
+ },
+ "allowed_tools": {
+ "description": "Allowed tools (only for agent type)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"context_template": {
- "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "description": "Context template for normal mode (how to format retrieved chunks)",
"type": "string"
},
"embedding_top_k": {
+ "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
"type": "integer"
},
"enable_query_expansion": {
+ "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
"type": "boolean"
},
"enable_rewrite": {
+ "description": "Whether to enable query rewrite for multi-turn conversations",
"type": "boolean"
},
"fallback_prompt": {
+ "description": "Fallback prompt (when FallbackStrategy is \"model\")",
"type": "string"
},
"fallback_response": {
+ "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
"type": "string"
},
"fallback_strategy": {
- "description": "Fallback strategy",
+ "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
+ "type": "string"
+ },
+ "faq_direct_answer_threshold": {
+ "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
+ "type": "number"
+ },
+ "faq_priority_enabled": {
+ "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "type": "boolean"
+ },
+ "faq_score_boost": {
+ "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
+ "type": "number"
+ },
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
+ "kb_selection_mode": {
+ "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
"type": "string"
},
"keyword_threshold": {
+ "description": "Keyword retrieval threshold",
"type": "number"
},
+ "knowledge_bases": {
+ "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"max_completion_tokens": {
- "description": "MaxTokens is the maximum number of tokens to generate",
+ "description": "Maximum completion tokens (only for normal mode)",
"type": "integer"
},
- "max_rounds": {
- "description": "Retrieval \u0026 strategy parameters",
+ "max_iterations": {
+ "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
"type": "integer"
},
- "prompt": {
+ "mcp_selection_mode": {
+ "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
+ "type": "string"
+ },
+ "mcp_services": {
+ "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "model_id": {
+ "description": "===== Model Settings =====\nModel ID to use for conversations",
"type": "string"
},
+ "multi_turn_enabled": {
+ "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
+ "type": "boolean"
+ },
+ "reflection_enabled": {
+ "description": "Whether reflection is enabled (only for agent type)",
+ "type": "boolean"
+ },
"rerank_model_id": {
+ "description": "ReRank model ID for retrieval",
"type": "string"
},
"rerank_threshold": {
+ "description": "Rerank threshold",
"type": "number"
},
"rerank_top_k": {
+ "description": "Rerank top K",
"type": "integer"
},
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
+ "type": "boolean"
+ },
"rewrite_prompt_system": {
- "description": "Rewrite prompts",
+ "description": "Rewrite prompt system message",
"type": "string"
},
"rewrite_prompt_user": {
+ "description": "Rewrite prompt user message template",
"type": "string"
},
- "summary_model_id": {
- "description": "Model configuration",
+ "selected_skills": {
+ "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skills_selection_mode": {
+ "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
+ "type": "string"
+ },
+ "supported_file_types": {
+ "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "system_prompt": {
+ "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
"type": "string"
},
"temperature": {
- "description": "Temperature controls the randomness of the model output",
+ "description": "Temperature for LLM (0-1)",
"type": "number"
},
- "use_custom_context_template": {
- "type": "boolean"
- },
- "use_custom_system_prompt": {
- "description": "Prompt is the system prompt for normal mode",
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
"type": "boolean"
},
"vector_threshold": {
+ "description": "Vector retrieval threshold",
"type": "number"
+ },
+ "web_search_enabled": {
+ "description": "===== Web Search Settings =====\nWhether web search is enabled",
+ "type": "boolean"
+ },
+ "web_search_max_results": {
+ "description": "Maximum web search results",
+ "type": "integer"
}
}
},
@@ -5791,6 +8036,10 @@ const docTemplate = `{
"entries"
],
"properties": {
+ "dry_run": {
+ "description": "仅验证,不实际导入",
+ "type": "boolean"
+ },
"entries": {
"type": "array",
"items": {
@@ -5806,6 +8055,10 @@ const docTemplate = `{
"append",
"replace"
]
+ },
+ "task_id": {
+ "description": "可选,如果不传则自动生成UUID",
+ "type": "string"
}
}
},
@@ -5824,18 +8077,25 @@ const docTemplate = `{
"type": "object",
"properties": {
"by_id": {
- "description": "ByID 按条目ID更新,key为条目ID",
+ "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
}
},
"by_tag": {
- "description": "ByTag 按Tag批量更新,key为TagID(空字符串表示未分类)",
+ "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
}
+ },
+ "exclude_ids": {
+ "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
}
}
},
@@ -5849,7 +8109,7 @@ const docTemplate = `{
"type": "boolean"
},
"tag_id": {
- "type": "string"
+ "type": "integer"
}
}
},
@@ -5869,6 +8129,10 @@ const docTemplate = `{
"type": "string"
}
},
+ "id": {
+ "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "type": "integer"
+ },
"is_enabled": {
"type": "boolean"
},
@@ -5891,7 +8155,7 @@ const docTemplate = `{
"type": "string"
},
"tag_id": {
- "type": "string"
+ "type": "integer"
},
"tag_name": {
"type": "string"
@@ -5926,36 +8190,35 @@ const docTemplate = `{
"query_text"
],
"properties": {
+ "first_priority_tag_ids": {
+ "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
"match_count": {
"type": "integer"
},
+ "only_recommended": {
+ "description": "是否仅返回推荐的条目",
+ "type": "boolean"
+ },
"query_text": {
"type": "string"
},
+ "second_priority_tag_ids": {
+ "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
"vector_threshold": {
"type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.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.GraphNode": {
"type": "object",
"properties": {
@@ -5999,6 +8262,64 @@ const docTemplate = `{
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
+ "type": "object",
+ "required": [
+ "role",
+ "user_id"
+ ],
+ "properties": {
+ "role": {
+ "description": "Role to assign: admin/editor/viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ },
+ "user_id": {
+ "description": "User ID to invite",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
+ "type": "object",
+ "required": [
+ "organization_id"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message for join request",
+ "type": "string",
+ "maxLength": 500
+ },
+ "organization_id": {
+ "type": "string"
+ },
+ "role": {
+ "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
+ ],
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.Knowledge": {
"type": "object",
"properties": {
@@ -6062,6 +8383,13 @@ const docTemplate = `{
"description": "Knowledge base name (not stored in database, populated on query)",
"type": "string"
},
+ "last_faq_import_result": {
+ "description": "Last FAQ import result (for FAQ type knowledge only)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
"metadata": {
"description": "Metadata of the knowledge",
"type": "array",
@@ -6210,6 +8538,10 @@ const docTemplate = `{
}
]
},
+ "share_count": {
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "type": "integer"
+ },
"summary_model_id": {
"description": "Summary model ID",
"type": "string"
@@ -6226,42 +8558,148 @@ const docTemplate = `{
"description": "Last updated time of the knowledge base",
"type": "string"
},
- "vlm_config": {
- "description": "VLM config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
- }
- ]
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
+ "type": "object",
+ "properties": {
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
+ },
+ "faq_config": {
+ "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
+ },
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
+ "type": "object",
+ "properties": {
+ "chunk_count": {
+ "type": "integer"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "knowledge_base_name": {
+ "type": "string"
+ },
+ "knowledge_base_type": {
+ "type": "string"
+ },
+ "knowledge_count": {
+ "type": "integer"
+ },
+ "my_permission": {
+ "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
+ "type": "string"
+ },
+ "my_role_in_org": {
+ "description": "Current user's role in this organization (admin/editor/viewer)",
+ "type": "string"
+ },
+ "organization_id": {
+ "type": "string"
+ },
+ "organization_name": {
+ "type": "string"
+ },
+ "permission": {
+ "description": "Share permission (what the space was granted: viewer/editor)",
+ "type": "string"
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "shared_by_user_id": {
+ "type": "string"
+ },
+ "shared_by_username": {
+ "type": "string"
+ },
+ "source_tenant_id": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
+ "type": "object",
+ "properties": {
+ "members": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
+ }
+ },
+ "total": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
"type": "object",
"properties": {
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
+ "organizations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
},
- "faq_config": {
- "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "resource_counts": {
+ "description": "各空间内知识库/智能体数量,供列表侧栏展示",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
}
]
},
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
- }
- ]
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
+ "type": "object",
+ "properties": {
+ "shares": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
+ }
+ },
+ "total": {
+ "type": "integer"
}
}
},
@@ -6459,6 +8897,9 @@ const docTemplate = `{
"status": {
"type": "string"
},
+ "tag_id": {
+ "type": "string"
+ },
"title": {
"type": "string"
}
@@ -6475,9 +8916,11 @@ const docTemplate = `{
5,
6,
7,
- 8
+ 8,
+ 9
],
"x-enum-comments": {
+ "MatchTypeDataAnalysis": "数据分析匹配类型",
"MatchTypeDirectLoad": "直接加载匹配类型",
"MatchTypeParentChunk": "父Chunk匹配类型",
"MatchTypeRelationChunk": "关系Chunk匹配类型",
@@ -6492,7 +8935,8 @@ const docTemplate = `{
"关系Chunk匹配类型",
"",
"网络搜索匹配类型",
- "直接加载匹配类型"
+ "直接加载匹配类型",
+ "数据分析匹配类型"
],
"x-enum-varnames": [
"MatchTypeEmbedding",
@@ -6503,7 +8947,8 @@ const docTemplate = `{
"MatchTypeRelationChunk",
"MatchTypeGraph",
"MatchTypeWebSearch",
- "MatchTypeDirectLoad"
+ "MatchTypeDirectLoad",
+ "MatchTypeDataAnalysis"
]
},
"github_com_Tencent_WeKnora_internal_types.MentionedItem": {
@@ -6603,12 +9048,23 @@ const docTemplate = `{
"embedding_parameters": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
},
+ "extra_config": {
+ "description": "Provider-specific configuration",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
"interface_type": {
"type": "string"
},
"parameter_size": {
"description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
"type": "string"
+ },
+ "provider": {
+ "description": "Provider identifier: openai, aliyun, zhipu, generic",
+ "type": "string"
}
}
},
@@ -6617,22 +9073,66 @@ const docTemplate = `{
"enum": [
"local",
"remote",
- "aliyun"
+ "aliyun",
+ "zhipu",
+ "volcengine",
+ "deepseek",
+ "hunyuan",
+ "minimax",
+ "openai",
+ "gemini",
+ "mimo",
+ "siliconflow",
+ "jina",
+ "openrouter"
],
"x-enum-comments": {
"ModelSourceAliyun": "Aliyun DashScope model",
+ "ModelSourceDeepseek": "Deepseek model",
+ "ModelSourceGemini": "Gemini model",
+ "ModelSourceHunyuan": "Hunyuan model",
+ "ModelSourceJina": "Jina AI model",
"ModelSourceLocal": "Local model",
- "ModelSourceRemote": "Remote model"
+ "ModelSourceMimo": "Mimo model",
+ "ModelSourceMinimax": "Minimax mode",
+ "ModelSourceOpenAI": "OpenAI model",
+ "ModelSourceOpenRouter": "OpenRouter model",
+ "ModelSourceRemote": "Remote model",
+ "ModelSourceSiliconFlow": "SiliconFlow model",
+ "ModelSourceVolcengine": "Volcengine model",
+ "ModelSourceZhipu": "Zhipu model"
},
"x-enum-descriptions": [
"Local model",
"Remote model",
- "Aliyun DashScope model"
+ "Aliyun DashScope model",
+ "Zhipu model",
+ "Volcengine model",
+ "Deepseek model",
+ "Hunyuan model",
+ "Minimax mode",
+ "OpenAI model",
+ "Gemini model",
+ "Mimo model",
+ "SiliconFlow model",
+ "Jina AI model",
+ "OpenRouter model"
],
"x-enum-varnames": [
"ModelSourceLocal",
"ModelSourceRemote",
- "ModelSourceAliyun"
+ "ModelSourceAliyun",
+ "ModelSourceZhipu",
+ "ModelSourceVolcengine",
+ "ModelSourceDeepseek",
+ "ModelSourceHunyuan",
+ "ModelSourceMinimax",
+ "ModelSourceOpenAI",
+ "ModelSourceGemini",
+ "ModelSourceMimo",
+ "ModelSourceSiliconFlow",
+ "ModelSourceJina",
+ "ModelSourceOpenRouter"
]
},
"github_com_Tencent_WeKnora_internal_types.ModelType": {
@@ -6662,6 +9162,118 @@ const docTemplate = `{
"ModelTypeVLLM"
]
},
+ "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "OrgRoleAdmin",
+ "OrgRoleEditor",
+ "OrgRoleViewer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "joined_at": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "user_id": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
+ "type": "object",
+ "properties": {
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
+ "type": "integer"
+ },
+ "avatar": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "has_pending_upgrade": {
+ "description": "当前用户是否有待处理的权限升级申请",
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "invite_code": {
+ "type": "string"
+ },
+ "invite_code_expires_at": {
+ "type": "string"
+ },
+ "invite_code_validity_days": {
+ "type": "integer"
+ },
+ "is_owner": {
+ "type": "boolean"
+ },
+ "member_count": {
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "0 = unlimited",
+ "type": "integer"
+ },
+ "my_role": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "owner_id": {
+ "type": "string"
+ },
+ "pending_join_request_count": {
+ "description": "待审批加入申请数(仅管理员可见)",
+ "type": "integer"
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "type": "boolean"
+ },
+ "share_count": {
+ "description": "共享到该组织的知识库数量",
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
"type": "object",
"properties": {
@@ -6713,6 +9325,54 @@ const docTemplate = `{
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
+ "type": "object",
+ "required": [
+ "requested_role"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message explaining the reason",
+ "type": "string",
+ "maxLength": 500
+ },
+ "requested_role": {
+ "description": "The role user wants to upgrade to",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
+ "type": "object",
+ "properties": {
+ "agents": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "knowledge_bases": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
"type": "object",
"properties": {
@@ -6785,6 +9445,26 @@ const docTemplate = `{
"WebSearchRetrieverType"
]
},
+ "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
+ "type": "object",
+ "properties": {
+ "approved": {
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "role": {
+ "description": "Optional: role to assign when approving; overrides applicant's requested role",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.SearchParams": {
"type": "object",
"properties": {
@@ -6806,9 +9486,19 @@ const docTemplate = `{
"match_count": {
"type": "integer"
},
+ "only_recommended": {
+ "type": "boolean"
+ },
"query_text": {
"type": "string"
},
+ "tag_ids": {
+ "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"vector_threshold": {
"type": "number"
}
@@ -6872,6 +9562,10 @@ const docTemplate = `{
}
]
},
+ "matched_content": {
+ "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "type": "string"
+ },
"metadata": {
"description": "Metadata",
"type": "object",
@@ -6907,22 +9601,6 @@ const docTemplate = `{
"github_com_Tencent_WeKnora_internal_types.Session": {
"type": "object",
"properties": {
- "agent_config": {
- "description": "Agent 配置(会话级别,仅存储enabled和knowledge_bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SessionAgentConfig"
- }
- ]
- },
- "context_config": {
- "description": "上下文管理配置(可选)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
- }
- ]
- },
"created_at": {
"type": "string"
},
@@ -6933,65 +9611,9 @@ const docTemplate = `{
"description": "Description",
"type": "string"
},
- "embedding_top_k": {
- "description": "向量召回TopK",
- "type": "integer"
- },
- "enable_rewrite": {
- "description": "多轮改写开关",
- "type": "boolean"
- },
- "fallback_response": {
- "description": "固定回复内容",
- "type": "string"
- },
- "fallback_strategy": {
- "description": "兜底策略",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy"
- }
- ]
- },
- "id": {
- "description": "ID",
- "type": "string"
- },
- "keyword_threshold": {
- "description": "关键词召回阈值",
- "type": "number"
- },
- "knowledge_base_id": {
- "description": "Strategy configuration",
- "type": "string"
- },
- "max_rounds": {
- "description": "多轮保持轮数",
- "type": "integer"
- },
- "rerank_model_id": {
- "description": "排序模型ID",
- "type": "string"
- },
- "rerank_threshold": {
- "description": "排序阈值",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "排序TopK",
- "type": "integer"
- },
- "summary_model_id": {
- "description": "总结模型ID",
- "type": "string"
- },
- "summary_parameters": {
- "description": "总结模型参数",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig"
- }
- ]
+ "id": {
+ "description": "ID",
+ "type": "string"
},
"tenant_id": {
"description": "Tenant ID",
@@ -7003,37 +9625,21 @@ const docTemplate = `{
},
"updated_at": {
"type": "string"
- },
- "vector_threshold": {
- "description": "向量召回阈值",
- "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SessionAgentConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
"type": "object",
+ "required": [
+ "organization_id",
+ "permission"
+ ],
"properties": {
- "agent_mode_enabled": {
- "description": "Whether agent mode is enabled for this session",
- "type": "boolean"
- },
- "knowledge_bases": {
- "description": "Accessible knowledge base IDs for this session",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "description": "Accessible knowledge IDs (individual documents) for this session",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "organization_id": {
+ "type": "string"
},
- "web_search_enabled": {
- "description": "Whether web search is enabled for this session",
- "type": "boolean"
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
}
},
@@ -7070,56 +9676,28 @@ const docTemplate = `{
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SummaryConfig": {
+ "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
"type": "object",
+ "required": [
+ "invite_code"
+ ],
"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"
- },
- "repeat_penalty": {
- "description": "Repeat penalty",
- "type": "number"
- },
- "seed": {
- "description": "Seed",
- "type": "integer"
- },
- "temperature": {
- "description": "Temperature",
- "type": "number"
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
},
- "top_k": {
- "description": "TopK",
- "type": "integer"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "top_p": {
- "description": "TopP",
- "type": "number"
+ "role": {
+ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
@@ -7127,7 +9705,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"agent_config": {
- "description": "Global Agent configuration for this tenant (default for all sessions)",
+ "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
"allOf": [
{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig"
@@ -7151,7 +9729,7 @@ const docTemplate = `{
]
},
"conversation_config": {
- "description": "Global Conversation configuration for this tenant (default for normal mode sessions)",
+ "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
"allOf": [
{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig"
@@ -7272,6 +9850,62 @@ const docTemplate = `{
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 1000
+ },
+ "invite_code_validity_days": {
+ "description": "0=never, 1, 7, 30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "max members; 0=unlimited",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "description": "open for search so others can discover and join",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
+ "type": "object",
+ "required": [
+ "permission"
+ ],
+ "properties": {
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.User": {
"type": "object",
"properties": {
@@ -7427,6 +10061,29 @@ const docTemplate = `{
},
"target_id": {
"type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ },
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
}
}
},
@@ -7456,6 +10113,18 @@ const docTemplate = `{
}
}
},
+ "internal_handler.DeleteTagRequest": {
+ "type": "object",
+ "properties": {
+ "exclude_ids": {
+ "description": "Chunk seq_ids to exclude from deletion",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
"internal_handler.EvaluationRequest": {
"type": "object",
"properties": {
@@ -7665,6 +10334,32 @@ const docTemplate = `{
}
}
},
+ "internal_handler.ListMinioBucketsResponse": {
+ "type": "object",
+ "properties": {
+ "buckets": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.MinioBucketInfo"
+ }
+ }
+ }
+ },
+ "internal_handler.MinioBucketInfo": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "policy": {
+ "description": "\"public\", \"private\", \"custom\"",
+ "type": "string"
+ }
+ }
+ },
"internal_handler.RemoteModelCheckRequest": {
"type": "object",
"required": [
@@ -7704,6 +10399,23 @@ const docTemplate = `{
}
}
},
+ "internal_handler.UpdateAgentRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ },
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.UpdateChunkRequest": {
"type": "object",
"properties": {
@@ -7771,6 +10483,36 @@ const docTemplate = `{
}
}
},
+ "internal_handler.addSimilarQuestionsRequest": {
+ "type": "object",
+ "required": [
+ "similar_questions"
+ ],
+ "properties": {
+ "similar_questions": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.updateLastFAQImportResultDisplayStatusRequest": {
+ "type": "object",
+ "required": [
+ "display_status"
+ ],
+ "properties": {
+ "display_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "close"
+ ]
+ }
+ }
+ },
"internal_handler_session.CreateKnowledgeQARequest": {
"type": "object",
"required": [
@@ -7781,6 +10523,18 @@ const docTemplate = `{
"description": "Whether agent mode is enabled for this request",
"type": "boolean"
},
+ "agent_id": {
+ "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
+ "type": "string"
+ },
+ "disable_title": {
+ "description": "Whether to disable auto title generation",
+ "type": "boolean"
+ },
+ "enable_memory": {
+ "description": "Whether memory feature is enabled for this request",
+ "type": "boolean"
+ },
"knowledge_base_ids": {
"description": "Selected knowledge base ID for this request",
"type": "array",
@@ -7819,25 +10573,13 @@ const docTemplate = `{
"internal_handler_session.CreateSessionRequest": {
"type": "object",
"properties": {
- "agent_config": {
- "description": "Agent configuration (optional, session-level config only: enabled and knowledge_bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SessionAgentConfig"
- }
- ]
- },
- "knowledge_base_id": {
- "description": "ID of the associated knowledge base (optional, can be set/changed during queries)",
+ "description": {
+ "description": "Description for the session (optional)",
"type": "string"
},
- "session_strategy": {
- "description": "Session strategy configuration",
- "allOf": [
- {
- "$ref": "#/definitions/internal_handler_session.SessionStrategy"
- }
- ]
+ "title": {
+ "description": "Title for the session (optional)",
+ "type": "string"
}
}
},
@@ -7905,79 +10647,29 @@ const docTemplate = `{
}
}
},
- "internal_handler_session.SessionStrategy": {
+ "internal_handler_session.StopSessionRequest": {
"type": "object",
+ "required": [
+ "message_id"
+ ],
"properties": {
- "embedding_top_k": {
- "description": "Number of top results to retrieve from vector search",
- "type": "integer"
- },
- "enable_rewrite": {
- "description": "Whether to enable query rewrite for multi-round conversations",
- "type": "boolean"
- },
- "fallback_response": {
- "description": "Fixed response content for fallback",
- "type": "string"
- },
- "fallback_strategy": {
- "description": "Strategy to use when no relevant knowledge is found",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy"
- }
- ]
- },
- "keyword_threshold": {
- "description": "Threshold for keyword-based retrieval",
- "type": "number"
- },
- "max_rounds": {
- "description": "Maximum number of conversation rounds to maintain",
- "type": "integer"
- },
- "no_match_prefix": {
- "description": "Prefix for responses when no match is found",
- "type": "string"
- },
- "rerank_model_id": {
- "description": "ID of the model used for reranking results",
- "type": "string"
- },
- "rerank_threshold": {
- "description": "Threshold for reranking results",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "Number of top results after reranking",
- "type": "integer"
- },
- "summary_model_id": {
- "description": "ID of the model used for summarization",
+ "message_id": {
"type": "string"
- },
- "summary_parameters": {
- "description": "Parameters for the summary model",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig"
- }
- ]
- },
- "vector_threshold": {
- "description": "Threshold for vector-based retrieval",
- "type": "number"
}
}
},
- "internal_handler_session.StopSessionRequest": {
+ "internal_handler_session.batchDeleteRequest": {
"type": "object",
"required": [
- "message_id"
+ "ids"
],
"properties": {
- "message_id": {
- "type": "string"
+ "ids": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
}
}
}
diff --git a/docs/swagger.json b/docs/swagger.json
index 6fd8f2b9a..0f4171daa 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -12,14 +12,17 @@
},
"basePath": "/api/v1",
"paths": {
- "/auth/change-password": {
- "post": {
+ "/agents": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "修改当前用户的登录密码",
+ "description": "获取当前租户的所有智能体(包括内置智能体)",
"consumes": [
"application/json"
],
@@ -27,48 +30,35 @@
"application/json"
],
"tags": [
- "认证"
- ],
- "summary": "修改密码",
- "parameters": [
- {
- "description": "密码修改请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "new_password": {
- "type": "string"
- },
- "old_password": {
- "type": "string"
- }
- }
- }
- }
+ "智能体"
],
+ "summary": "获取智能体列表",
"responses": {
"200": {
- "description": "修改成功",
+ "description": "智能体列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/auth/login": {
+ },
"post": {
- "description": "用户登录并获取访问令牌",
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "创建新的自定义智能体",
"consumes": [
"application/json"
],
@@ -76,29 +66,30 @@
"application/json"
],
"tags": [
- "认证"
+ "智能体"
],
- "summary": "用户登录",
+ "summary": "创建智能体",
"parameters": [
{
- "description": "登录请求参数",
+ "description": "智能体信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest"
+ "$ref": "#/definitions/internal_handler.CreateAgentRequest"
}
}
],
"responses": {
- "200": {
- "description": "OK",
+ "201": {
+ "description": "创建的智能体",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
+ "type": "object",
+ "additionalProperties": true
}
},
- "401": {
- "description": "认证失败",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -106,14 +97,17 @@
}
}
},
- "/auth/logout": {
- "post": {
+ "/agents/placeholders": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "撤销当前访问令牌并登出",
+ "description": "获取所有可用的提示词占位符定义,按字段类型分组",
"consumes": [
"application/json"
],
@@ -121,64 +115,31 @@
"application/json"
],
"tags": [
- "认证"
+ "智能体"
],
- "summary": "用户登出",
+ "summary": "获取占位符定义",
"responses": {
"200": {
- "description": "登出成功",
+ "description": "占位符定义",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/auth/me": {
+ "/agents/{id}": {
"get": {
"security": [
{
"Bearer": []
- }
- ],
- "description": "获取当前登录用户的详细信息",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "认证"
- ],
- "summary": "获取当前用户信息",
- "responses": {
- "200": {
- "description": "用户信息",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
},
- "401": {
- "description": "未授权",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
+ {
+ "ApiKeyAuth": []
}
- }
- }
- },
- "/auth/refresh": {
- "post": {
- "description": "使用刷新令牌获取新的访问令牌",
+ ],
+ "description": "根据ID获取智能体详情",
"consumes": [
"application/json"
],
@@ -186,45 +147,50 @@
"application/json"
],
"tags": [
- "认证"
+ "智能体"
],
- "summary": "刷新令牌",
+ "summary": "获取智能体详情",
"parameters": [
{
- "description": "刷新令牌",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "refreshToken": {
- "type": "string"
- }
- }
- }
+ "type": "string",
+ "description": "智能体ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "新令牌",
+ "description": "智能体详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "令牌无效",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "智能体不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/auth/register": {
- "post": {
- "description": "注册新用户账号",
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新智能体的名称、描述和配置",
"consumes": [
"application/json"
],
@@ -232,25 +198,33 @@
"application/json"
],
"tags": [
- "认证"
+ "智能体"
],
- "summary": "用户注册",
+ "summary": "更新智能体",
"parameters": [
{
- "description": "注册请求参数",
+ "type": "string",
+ "description": "智能体ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest"
+ "$ref": "#/definitions/internal_handler.UpdateAgentRequest"
}
}
],
"responses": {
- "201": {
- "description": "Created",
+ "200": {
+ "description": "更新后的智能体",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse"
+ "type": "object",
+ "additionalProperties": true
}
},
"400": {
@@ -260,22 +234,23 @@
}
},
"403": {
- "description": "注册功能已禁用",
+ "description": "无法修改内置智能体",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/auth/validate": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "验证访问令牌是否有效",
+ "description": "删除指定的智能体",
"consumes": [
"application/json"
],
@@ -283,19 +258,40 @@
"application/json"
],
"tags": [
- "认证"
+ "智能体"
+ ],
+ "summary": "删除智能体",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "智能体ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "验证令牌",
"responses": {
"200": {
- "description": "令牌有效",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "令牌无效",
+ "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"
}
@@ -303,8 +299,8 @@
}
}
},
- "/chunks/by-id/{id}": {
- "get": {
+ "/agents/{id}/copy": {
+ "post": {
"security": [
{
"Bearer": []
@@ -313,7 +309,7 @@
"ApiKeyAuth": []
}
],
- "description": "仅通过分块ID获取分块详情(不需要knowledge_id)",
+ "description": "复制指定的智能体",
"consumes": [
"application/json"
],
@@ -321,21 +317,21 @@
"application/json"
],
"tags": [
- "分块管理"
+ "智能体"
],
- "summary": "通过ID获取分块",
+ "summary": "复制智能体",
"parameters": [
{
"type": "string",
- "description": "分块ID",
+ "description": "智能体ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
- "200": {
- "description": "分块详情",
+ "201": {
+ "description": "复制成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -348,7 +344,7 @@
}
},
"404": {
- "description": "分块不存在",
+ "description": "智能体不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -356,17 +352,14 @@
}
}
},
- "/chunks/by-id/{id}/questions": {
- "delete": {
+ "/auth/change-password": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除分块中生成的问题",
+ "description": "修改当前用户的登录密码",
"consumes": [
"application/json"
],
@@ -374,26 +367,22 @@
"application/json"
],
"tags": [
- "分块管理"
+ "认证"
],
- "summary": "删除生成的问题",
+ "summary": "修改密码",
"parameters": [
{
- "type": "string",
- "description": "分块ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "问题ID",
+ "description": "密码修改请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
- "question_id": {
+ "new_password": {
+ "type": "string"
+ },
+ "old_password": {
"type": "string"
}
}
@@ -402,7 +391,7 @@
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "修改成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -413,19 +402,1650 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "404": {
- "description": "分块不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/chunks/{knowledge_id}": {
- "get": {
- "security": [
+ "/auth/login": {
+ "post": {
+ "description": "用户登录并获取访问令牌",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "用户登录",
+ "parameters": [
+ {
+ "description": "登录请求参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
+ }
+ },
+ "401": {
+ "description": "认证失败",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/logout": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "撤销当前访问令牌并登出",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "用户登出",
+ "responses": {
+ "200": {
+ "description": "登出成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/me": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "获取当前登录用户的详细信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "获取当前用户信息",
+ "responses": {
+ "200": {
+ "description": "用户信息",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "未授权",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/refresh": {
+ "post": {
+ "description": "使用刷新令牌获取新的访问令牌",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "刷新令牌",
+ "parameters": [
+ {
+ "description": "刷新令牌",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "refreshToken": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "新令牌",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "令牌无效",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/register": {
+ "post": {
+ "description": "注册新用户账号",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "用户注册",
+ "parameters": [
+ {
+ "description": "注册请求参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Created",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse"
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "注册功能已禁用",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/validate": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "验证访问令牌是否有效",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "验证令牌",
+ "responses": {
+ "200": {
+ "description": "令牌有效",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "令牌无效",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/chunks/by-id/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "仅通过分块ID获取分块详情(不需要knowledge_id);支持共享知识库下的分块访问",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "通过ID获取分块",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "分块详情",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/chunks/by-id/{id}/questions": {
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除分块中生成的问题",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "删除生成的问题",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "问题ID",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "question_id": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/chunks/{knowledge_id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取指定知识下的所有分块列表,支持分页",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "获取知识分块列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "default": 1,
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 10,
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "分块列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定知识下的所有分块",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "删除知识下所有分块",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/chunks/{knowledge_id}/{id}": {
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新指定分块的内容和属性",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "更新分块",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.UpdateChunkRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的分块",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定的分块",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "分块管理"
+ ],
+ "summary": "删除分块",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/evaluation/": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据任务ID获取评估结果",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "评估"
+ ],
+ "summary": "获取评估结果",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "评估任务ID",
+ "name": "task_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "评估结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "对知识库进行评估测试",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "评估"
+ ],
+ "summary": "执行评估",
+ "parameters": [
+ {
+ "description": "评估请求参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.EvaluationRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "评估任务",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/faq/import/progress/{task_id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取FAQ导入任务的进度",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "FAQ管理"
+ ],
+ "summary": "获取FAQ导入进度",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "任务ID",
+ "name": "task_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "导入进度",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/extract/relations": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "从文本中提取实体和关系",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "提取文本关系",
+ "parameters": [
+ {
+ "description": "提取请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "提取结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/fabri/tag": {
+ "get": {
+ "description": "随机生成一组标签",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "生成随机标签",
+ "responses": {
+ "200": {
+ "description": "生成的标签",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/fabri/text": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据标签生成示例文本",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "生成示例文本",
+ "parameters": [
+ {
+ "description": "生成请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.FabriTextRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "生成的文本",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/kb/{kbId}": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据知识库ID执行完整配置更新",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "初始化知识库配置",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "初始化请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "初始化成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/kb/{kbId}/config": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据知识库ID获取当前配置信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "获取知识库配置",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "配置信息",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据知识库ID更新模型和分块配置",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "更新知识库配置",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "配置请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.KBModelConfigRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/models/embedding/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "测试Embedding接口是否可用并返回向量维度",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "测试Embedding模型",
+ "parameters": [
+ {
+ "description": "Embedding测试请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "测试结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/models/remote/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查远程API模型连接是否正常",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查远程模型",
+ "parameters": [
+ {
+ "description": "模型检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/models/rerank/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查Rerank模型连接和功能是否正常",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Rerank模型",
+ "parameters": [
+ {
+ "description": "Rerank检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "检查结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/multimodal/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "上传图片测试多模态处理功能",
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "测试多模态功能",
+ "parameters": [
+ {
+ "type": "file",
+ "description": "测试图片",
+ "name": "image",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM模型名称",
+ "name": "vlm_model",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM Base URL",
+ "name": "vlm_base_url",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM API Key",
+ "name": "vlm_api_key",
+ "in": "formData"
+ },
+ {
+ "type": "string",
+ "description": "VLM接口类型",
+ "name": "vlm_interface_type",
+ "in": "formData"
+ },
+ {
+ "type": "string",
+ "description": "存储类型(cos/minio)",
+ "name": "storage_type",
+ "in": "formData",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "测试结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/download/tasks": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "列出所有Ollama模型下载任务",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "列出下载任务",
+ "responses": {
+ "200": {
+ "description": "任务列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/download/{taskId}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取Ollama模型下载任务的进度",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "获取下载进度",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "任务ID",
+ "name": "taskId",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "下载进度",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/models": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "列出已安装的Ollama模型",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "列出Ollama模型",
+ "responses": {
+ "200": {
+ "description": "模型列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/models/check": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "检查指定的Ollama模型是否已安装",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Ollama模型状态",
+ "parameters": [
+ {
+ "description": "模型名称列表",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "models": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "模型状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/models/download": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "异步下载指定的Ollama模型",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "下载Ollama模型",
+ "parameters": [
+ {
+ "description": "模型名称",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "modelName": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "下载任务信息",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/initialization/ollama/status": {
+ "get": {
+ "description": "检查Ollama服务是否可用",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Ollama服务状态",
+ "responses": {
+ "200": {
+ "description": "Ollama状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "获取知识库列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "共享智能体 ID(传入时返回该智能体可用的知识库)",
+ "name": "agent_id",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "知识库列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "创建新的知识库",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "创建知识库",
+ "parameters": [
+ {
+ "description": "知识库信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "创建的知识库",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases/copy": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "将一个知识库的内容复制到另一个知识库(异步任务)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "复制知识库",
+ "parameters": [
+ {
+ "description": "复制请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "任务ID",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases/copy/progress/{task_id}": {
+ "get": {
+ "security": [
{
"Bearer": []
},
@@ -433,7 +2053,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取指定知识下的所有分块列表,支持分页",
+ "description": "获取知识库复制任务的进度",
"consumes": [
"application/json"
],
@@ -441,35 +2061,134 @@
"application/json"
],
"tags": [
- "分块管理"
+ "知识库"
],
- "summary": "获取知识分块列表",
+ "summary": "获取知识库复制进度",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
+ "description": "任务ID",
+ "name": "task_id",
"in": "path",
"required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "进度信息",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "任务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
},
{
- "type": "integer",
- "default": 1,
- "description": "页码",
- "name": "page",
- "in": "query"
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据ID获取知识库详情。当使用共享智能体时,可传 agent_id 以校验该智能体是否有权访问该知识库。",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "获取知识库详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
},
{
- "type": "integer",
- "default": 10,
- "description": "每页数量",
- "name": "page_size",
+ "type": "string",
+ "description": "共享智能体 ID(用于校验智能体是否有权访问该知识库)",
+ "name": "agent_id",
"in": "query"
}
],
"responses": {
"200": {
- "description": "分块列表",
+ "description": "知识库详情",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新知识库的名称、描述和配置",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "更新知识库",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.UpdateKnowledgeBaseRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的知识库",
"schema": {
"type": "object",
"additionalProperties": true
@@ -488,33 +2207,116 @@
{
"Bearer": []
},
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "删除指定知识下的所有分块",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "分块管理"
- ],
- "summary": "删除知识下所有分块",
- "parameters": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定的知识库及其所有内容",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库"
+ ],
+ "summary": "删除知识库",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases/{id}/faq/entries": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取知识库下的FAQ条目列表,支持分页和筛选",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "FAQ管理"
+ ],
+ "summary": "获取FAQ条目列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "标签ID筛选(seq_id)",
+ "name": "tag_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "搜索字段: standard_question(标准问题), similar_questions(相似问法), answers(答案), 默认搜索全部",
+ "name": "search_field",
+ "in": "query"
+ },
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
- "in": "path",
- "required": true
+ "description": "排序方式: asc(按更新时间正序), 默认按更新时间倒序",
+ "name": "sort_order",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "FAQ列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -527,10 +2329,8 @@
}
}
}
- }
- },
- "/chunks/{knowledge_id}/{id}": {
- "put": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -539,7 +2339,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新指定分块的内容和属性",
+ "description": "异步批量更新或插入FAQ条目。支持 dry_run 模式(设置 dry_run=true),异步验证不实际导入。\ndry_run 模式是异步操作,返回 task_id,通过 /faq/import/progress/{task_id} 查询进度和结果。\n验证内容包括:1) 条目基本格式 2) 重复问题(批次内和知识库已有) 3) 内容安全检查。",
"consumes": [
"application/json"
],
@@ -547,37 +2347,30 @@
"application/json"
],
"tags": [
- "分块管理"
+ "FAQ管理"
],
- "summary": "更新分块",
+ "summary": "批量更新/插入FAQ条目",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "分块ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "更新请求",
+ "description": "批量操作请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateChunkRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload"
}
}
],
"responses": {
"200": {
- "description": "更新后的分块",
+ "description": "任务ID",
"schema": {
"type": "object",
"additionalProperties": true
@@ -588,12 +2381,6 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "404": {
- "description": "分块不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
},
@@ -606,7 +2393,7 @@
"ApiKeyAuth": []
}
],
- "description": "删除指定的分块",
+ "description": "批量删除指定的FAQ条目",
"consumes": [
"application/json"
],
@@ -614,23 +2401,33 @@
"application/json"
],
"tags": [
- "分块管理"
+ "FAQ管理"
],
- "summary": "删除分块",
+ "summary": "批量删除FAQ条目",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
+ "description": "知识库ID",
+ "name": "id",
"in": "path",
"required": true
},
{
- "type": "string",
- "description": "分块ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "要删除的FAQ ID列表(seq_id)",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ }
}
],
"responses": {
@@ -646,17 +2443,11 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "404": {
- "description": "分块不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/evaluation/": {
+ "/knowledge-bases/{id}/faq/entries/export": {
"get": {
"security": [
{
@@ -666,32 +2457,31 @@
"ApiKeyAuth": []
}
],
- "description": "根据任务ID获取评估结果",
+ "description": "将所有FAQ条目导出为CSV文件",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/csv"
],
"tags": [
- "评估"
+ "FAQ管理"
],
- "summary": "获取评估结果",
+ "summary": "导出FAQ条目",
"parameters": [
{
"type": "string",
- "description": "评估任务ID",
- "name": "task_id",
- "in": "query",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "评估结果",
+ "description": "CSV文件",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
@@ -701,8 +2491,10 @@
}
}
}
- },
- "post": {
+ }
+ },
+ "/knowledge-bases/{id}/faq/entries/fields": {
+ "put": {
"security": [
{
"Bearer": []
@@ -711,7 +2503,7 @@
"ApiKeyAuth": []
}
],
- "description": "对知识库进行评估测试",
+ "description": "批量更新FAQ条目的多个字段(is_enabled, is_recommended, tag_id)",
"consumes": [
"application/json"
],
@@ -719,23 +2511,30 @@
"application/json"
],
"tags": [
- "评估"
+ "FAQ管理"
],
- "summary": "执行评估",
+ "summary": "批量更新FAQ字段",
"parameters": [
{
- "description": "评估请求参数",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "字段更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.EvaluationRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate"
}
}
],
"responses": {
"200": {
- "description": "评估任务",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -750,8 +2549,8 @@
}
}
},
- "/faq/import/progress/{task_id}": {
- "get": {
+ "/knowledge-bases/{id}/faq/entries/tags": {
+ "put": {
"security": [
{
"Bearer": []
@@ -760,7 +2559,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取FAQ导入任务的进度",
+ "description": "批量更新FAQ条目的标签",
"consumes": [
"application/json"
],
@@ -770,26 +2569,35 @@
"tags": [
"FAQ管理"
],
- "summary": "获取FAQ导入进度",
+ "summary": "批量更新FAQ标签",
"parameters": [
{
"type": "string",
- "description": "任务ID",
- "name": "task_id",
+ "description": "知识库ID",
+ "name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "标签更新请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "导入进度",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -797,8 +2605,8 @@
}
}
},
- "/initialization/extract/relations": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries/{entry_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -807,7 +2615,7 @@
"ApiKeyAuth": []
}
],
- "description": "从文本中提取实体和关系",
+ "description": "根据ID获取单个FAQ条目的详情",
"consumes": [
"application/json"
],
@@ -815,23 +2623,28 @@
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "提取文本关系",
+ "summary": "获取FAQ条目详情",
"parameters": [
{
- "description": "提取请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
- }
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "提取结果",
+ "description": "FAQ条目详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -842,36 +2655,16 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- }
- }
- }
- },
- "/initialization/fabri/tag": {
- "get": {
- "description": "随机生成一组标签",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "初始化"
- ],
- "summary": "生成随机标签",
- "responses": {
- "200": {
- "description": "生成的标签",
+ },
+ "404": {
+ "description": "条目不存在",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/initialization/fabri/text": {
- "post": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -880,7 +2673,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据标签生成示例文本",
+ "description": "更新指定的FAQ条目",
"consumes": [
"application/json"
],
@@ -888,23 +2681,37 @@
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "生成示例文本",
+ "summary": "更新FAQ条目",
"parameters": [
{
- "description": "生成请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "FAQ条目",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.FabriTextRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
}
}
],
"responses": {
"200": {
- "description": "生成的文本",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -919,7 +2726,7 @@
}
}
},
- "/initialization/kb/{kbId}": {
+ "/knowledge-bases/{id}/faq/entries/{entry_id}/similar-questions": {
"post": {
"security": [
{
@@ -929,7 +2736,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID执行完整配置更新",
+ "description": "向指定的FAQ条目添加相似问题",
"consumes": [
"application/json"
],
@@ -937,30 +2744,37 @@
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "初始化知识库配置",
+ "summary": "添加相似问",
"parameters": [
{
"type": "string",
"description": "知识库ID",
- "name": "kbId",
+ "name": "id",
"in": "path",
"required": true
},
{
- "description": "初始化请求",
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "相似问列表",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.addSimilarQuestionsRequest"
}
}
],
"responses": {
"200": {
- "description": "初始化成功",
+ "description": "更新后的FAQ条目",
"schema": {
"type": "object",
"additionalProperties": true
@@ -971,12 +2785,18 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "条目不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/initialization/kb/{kbId}/config": {
- "get": {
+ "/knowledge-bases/{id}/faq/entry": {
+ "post": {
"security": [
{
"Bearer": []
@@ -985,7 +2805,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID获取当前配置信息",
+ "description": "同步创建单个FAQ条目",
"consumes": [
"application/json"
],
@@ -993,34 +2813,45 @@
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "获取知识库配置",
+ "summary": "创建单个FAQ条目",
"parameters": [
{
"type": "string",
"description": "知识库ID",
- "name": "kbId",
+ "name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "FAQ条目",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ }
}
],
"responses": {
"200": {
- "description": "配置信息",
+ "description": "创建的FAQ条目",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "知识库不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/knowledge-bases/{id}/faq/import/last-result/display": {
"put": {
"security": [
{
@@ -1030,7 +2861,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID更新模型和分块配置",
+ "description": "更新FAQ知识库导入结果统计卡片的显示或隐藏状态",
"consumes": [
"application/json"
],
@@ -1038,24 +2869,24 @@
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "更新知识库配置",
+ "summary": "更新FAQ最后一次导入结果显示状态",
"parameters": [
{
"type": "string",
"description": "知识库ID",
- "name": "kbId",
+ "name": "id",
"in": "path",
"required": true
},
{
- "description": "配置请求",
+ "description": "状态更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.KBModelConfigRequest"
+ "$ref": "#/definitions/internal_handler.updateLastFAQImportResultDisplayStatusRequest"
}
}
],
@@ -1074,7 +2905,7 @@
}
},
"404": {
- "description": "知识库不存在",
+ "description": "知识库不存在或无导入记录",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -1082,7 +2913,7 @@
}
}
},
- "/initialization/models/embedding/test": {
+ "/knowledge-bases/{id}/faq/search": {
"post": {
"security": [
{
@@ -1092,7 +2923,7 @@
"ApiKeyAuth": []
}
],
- "description": "测试Embedding接口是否可用并返回向量维度",
+ "description": "使用混合搜索在FAQ中搜索,支持两级优先级标签召回:first_priority_tag_ids优先级最高,second_priority_tag_ids次之",
"consumes": [
"application/json"
],
@@ -1100,23 +2931,30 @@
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
],
- "summary": "测试Embedding模型",
+ "summary": "搜索FAQ",
"parameters": [
{
- "description": "Embedding测试请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "搜索请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest"
}
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1131,8 +2969,8 @@
}
}
},
- "/initialization/models/remote/check": {
- "post": {
+ "/knowledge-bases/{id}/hybrid-search": {
+ "get": {
"security": [
{
"Bearer": []
@@ -1141,7 +2979,7 @@
"ApiKeyAuth": []
}
],
- "description": "检查远程API模型连接是否正常",
+ "description": "在知识库中执行向量和关键词混合搜索",
"consumes": [
"application/json"
],
@@ -1149,23 +2987,30 @@
"application/json"
],
"tags": [
- "初始化"
+ "知识库"
],
- "summary": "检查远程模型",
+ "summary": "混合搜索",
"parameters": [
{
- "description": "模型检查请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "搜索参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1180,8 +3025,8 @@
}
}
},
- "/initialization/models/rerank/check": {
- "post": {
+ "/knowledge-bases/{id}/knowledge": {
+ "get": {
"security": [
{
"Bearer": []
@@ -1190,7 +3035,7 @@
"ApiKeyAuth": []
}
],
- "description": "检查Rerank模型连接和功能是否正常",
+ "description": "获取知识库下的知识列表,支持分页和筛选",
"consumes": [
"application/json"
],
@@ -1198,23 +3043,51 @@
"application/json"
],
"tags": [
- "初始化"
+ "知识管理"
],
- "summary": "检查Rerank模型",
+ "summary": "获取知识列表",
"parameters": [
{
- "description": "Rerank检查请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "标签ID筛选",
+ "name": "tag_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "文件类型筛选",
+ "name": "file_type",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "知识列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1229,7 +3102,7 @@
}
}
},
- "/initialization/multimodal/test": {
+ "/knowledge-bases/{id}/knowledge/file": {
"post": {
"security": [
{
@@ -1239,7 +3112,7 @@
"ApiKeyAuth": []
}
],
- "description": "上传图片测试多模态处理功能",
+ "description": "上传文件并创建知识条目",
"consumes": [
"multipart/form-data"
],
@@ -1247,54 +3120,46 @@
"application/json"
],
"tags": [
- "初始化"
+ "知识管理"
],
- "summary": "测试多模态功能",
+ "summary": "从文件创建知识",
"parameters": [
- {
- "type": "file",
- "description": "测试图片",
- "name": "image",
- "in": "formData",
- "required": true
- },
{
"type": "string",
- "description": "VLM模型名称",
- "name": "vlm_model",
- "in": "formData",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
"required": true
},
{
- "type": "string",
- "description": "VLM Base URL",
- "name": "vlm_base_url",
+ "type": "file",
+ "description": "上传的文件",
+ "name": "file",
"in": "formData",
"required": true
},
{
"type": "string",
- "description": "VLM API Key",
- "name": "vlm_api_key",
+ "description": "自定义文件名",
+ "name": "fileName",
"in": "formData"
},
{
"type": "string",
- "description": "VLM接口类型",
- "name": "vlm_interface_type",
+ "description": "元数据JSON",
+ "name": "metadata",
"in": "formData"
},
{
- "type": "string",
- "description": "存储类型(cos/minio)",
- "name": "storage_type",
- "in": "formData",
- "required": true
+ "type": "boolean",
+ "description": "启用多模态处理",
+ "name": "enable_multimodel",
+ "in": "formData"
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1305,12 +3170,19 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "409": {
+ "description": "文件重复",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
}
}
},
- "/initialization/ollama/download/tasks": {
- "get": {
+ "/knowledge-bases/{id}/knowledge/manual": {
+ "post": {
"security": [
{
"Bearer": []
@@ -1319,7 +3191,7 @@
"ApiKeyAuth": []
}
],
- "description": "列出所有Ollama模型下载任务",
+ "description": "手工录入Markdown格式的知识内容",
"consumes": [
"application/json"
],
@@ -1327,22 +3199,46 @@
"application/json"
],
"tags": [
- "初始化"
+ "知识管理"
+ ],
+ "summary": "手工创建知识",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "手工知识内容",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ }
+ }
],
- "summary": "列出下载任务",
"responses": {
"200": {
- "description": "任务列表",
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/initialization/ollama/download/{taskId}": {
- "get": {
+ "/knowledge-bases/{id}/knowledge/url": {
+ "post": {
"security": [
{
"Bearer": []
@@ -1351,7 +3247,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取Ollama模型下载任务的进度",
+ "description": "从指定URL抓取内容并创建知识条目。当提供 file_name/file_type 或 URL 路径含已知文件扩展名时,自动切换为文件下载模式",
"consumes": [
"application/json"
],
@@ -1359,84 +3255,111 @@
"application/json"
],
"tags": [
- "初始化"
+ "知识管理"
],
- "summary": "获取下载进度",
+ "summary": "从URL创建知识",
"parameters": [
{
"type": "string",
- "description": "任务ID",
- "name": "taskId",
+ "description": "知识库ID",
+ "name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "URL请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "enable_multimodel": {
+ "type": "boolean"
+ },
+ "file_name": {
+ "type": "string"
+ },
+ "file_type": {
+ "type": "string"
+ },
+ "tag_id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ }
}
],
"responses": {
- "200": {
- "description": "下载进度",
+ "201": {
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "409": {
+ "description": "URL重复",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
}
}
},
- "/initialization/ollama/models": {
+ "/knowledge-bases/{id}/shares": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "列出已安装的Ollama模型",
- "consumes": [
- "application/json"
- ],
+ "description": "获取知识库的所有共享记录",
"produces": [
"application/json"
],
"tags": [
- "初始化"
+ "知识库共享"
+ ],
+ "summary": "获取知识库的共享列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "列出Ollama模型",
"responses": {
"200": {
- "description": "模型列表",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "500": {
- "description": "服务器错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
}
}
}
- }
- },
- "/initialization/ollama/models/check": {
+ },
"post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "检查指定的Ollama模型是否已安装",
+ "description": "将知识库共享到指定组织",
"consumes": [
"application/json"
],
@@ -1444,38 +3367,37 @@
"application/json"
],
"tags": [
- "初始化"
+ "知识库共享"
],
- "summary": "检查Ollama模型状态",
+ "summary": "共享知识库到组织",
"parameters": [
{
- "description": "模型名称列表",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "共享信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "models": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest"
}
}
],
"responses": {
- "200": {
- "description": "模型状态",
+ "201": {
+ "description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -1483,17 +3405,14 @@
}
}
},
- "/initialization/ollama/models/download": {
- "post": {
+ "/knowledge-bases/{id}/shares/{share_id}": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "异步下载指定的Ollama模型",
+ "description": "更新知识库共享的权限级别",
"consumes": [
"application/json"
],
@@ -1501,67 +3420,95 @@
"application/json"
],
"tags": [
- "初始化"
+ "知识库共享"
],
- "summary": "下载Ollama模型",
+ "summary": "更新共享权限",
"parameters": [
{
- "description": "模型名称",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "共享记录ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "权限信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "modelName": {
- "type": "string"
- }
- }
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest"
}
}
],
"responses": {
"200": {
- "description": "下载任务信息",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/initialization/ollama/status": {
- "get": {
- "description": "检查Ollama服务是否可用",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "取消知识库的共享",
"tags": [
- "初始化"
+ "知识库共享"
+ ],
+ "summary": "取消共享",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "共享记录ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "检查Ollama服务状态",
"responses": {
"200": {
- "description": "Ollama状态",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/knowledge-bases": {
+ "/knowledge-bases/{id}/tags": {
"get": {
"security": [
{
@@ -1571,7 +3518,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有知识库",
+ "description": "获取知识库下的所有标签及统计信息",
"consumes": [
"application/json"
],
@@ -1579,19 +3526,46 @@
"application/json"
],
"tags": [
- "知识库"
+ "标签管理"
+ ],
+ "summary": "获取标签列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ }
],
- "summary": "获取知识库列表",
"responses": {
"200": {
- "description": "知识库列表",
+ "description": "标签列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -1607,7 +3581,7 @@
"ApiKeyAuth": []
}
],
- "description": "创建新的知识库",
+ "description": "在知识库下创建新标签",
"consumes": [
"application/json"
],
@@ -1615,23 +3589,41 @@
"application/json"
],
"tags": [
- "知识库"
+ "标签管理"
],
- "summary": "创建知识库",
+ "summary": "创建标签",
"parameters": [
{
- "description": "知识库信息",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "标签信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ }
+ }
}
}
],
"responses": {
- "201": {
- "description": "创建的知识库",
+ "200": {
+ "description": "创建的标签",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1646,8 +3638,8 @@
}
}
},
- "/knowledge-bases/copy": {
- "post": {
+ "/knowledge-bases/{id}/tags/{tag_id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -1656,7 +3648,7 @@
"ApiKeyAuth": []
}
],
- "description": "将一个知识库的内容复制到另一个知识库(异步任务)",
+ "description": "更新标签信息",
"consumes": [
"application/json"
],
@@ -1664,23 +3656,37 @@
"application/json"
],
"tags": [
- "知识库"
+ "标签管理"
],
- "summary": "复制知识库",
+ "summary": "更新标签",
"parameters": [
{
- "description": "复制请求",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "标签ID (UUID或seq_id)",
+ "name": "tag_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "标签更新信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseRequest"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "任务ID",
+ "description": "更新后的标签",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1693,10 +3699,8 @@
}
}
}
- }
- },
- "/knowledge-bases/copy/progress/{task_id}": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -1705,7 +3709,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取知识库复制任务的进度",
+ "description": "删除标签,可使用force=true强制删除被引用的标签,content_only=true仅删除标签下的内容而保留标签本身",
"consumes": [
"application/json"
],
@@ -1713,28 +3717,55 @@
"application/json"
],
"tags": [
- "知识库"
+ "标签管理"
],
- "summary": "获取知识库复制进度",
+ "summary": "删除标签",
"parameters": [
{
"type": "string",
- "description": "任务ID",
- "name": "task_id",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "标签ID (UUID或seq_id)",
+ "name": "tag_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "boolean",
+ "description": "强制删除",
+ "name": "force",
+ "in": "query"
+ },
+ {
+ "type": "boolean",
+ "description": "仅删除内容,保留标签",
+ "name": "content_only",
+ "in": "query"
+ },
+ {
+ "description": "删除选项",
+ "name": "body",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.DeleteTagRequest"
+ }
}
],
"responses": {
"200": {
- "description": "进度信息",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -1742,7 +3773,7 @@
}
}
},
- "/knowledge-bases/{id}": {
+ "/knowledge/batch": {
"get": {
"security": [
{
@@ -1752,7 +3783,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据ID获取知识库详情",
+ "description": "根据ID列表批量获取知识条目。可选 kb_id:指定时按该知识库校验权限并用于共享知识库的租户解析;可选 agent_id:使用共享智能体时传此参数,后端按智能体所属租户查询(用于刷新后恢复共享知识库下的文件)",
"consumes": [
"application/json"
],
@@ -1760,21 +3791,37 @@
"application/json"
],
"tags": [
- "知识库"
+ "知识管理"
],
- "summary": "获取知识库详情",
+ "summary": "批量获取知识",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "description": "知识ID列表",
+ "name": "ids",
+ "in": "query",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "可选,知识库ID(用于共享知识库时指定范围)",
+ "name": "kb_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "可选,共享智能体ID(用于按智能体租户批量拉取文件详情)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "知识库详情",
+ "description": "知识列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1785,15 +3832,11 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "404": {
- "description": "知识库不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
- },
+ }
+ },
+ "/knowledge/image/{id}/{chunk_id}": {
"put": {
"security": [
{
@@ -1803,7 +3846,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新知识库的名称、描述和配置",
+ "description": "更新知识分块的图像信息",
"consumes": [
"application/json"
],
@@ -1811,30 +3854,42 @@
"application/json"
],
"tags": [
- "知识库"
+ "知识管理"
],
- "summary": "更新知识库",
+ "summary": "更新图像信息",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "更新请求",
+ "type": "string",
+ "description": "分块ID",
+ "name": "chunk_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "图像信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler.UpdateKnowledgeBaseRequest"
+ "type": "object",
+ "properties": {
+ "image_info": {
+ "type": "string"
+ }
+ }
}
}
],
"responses": {
"200": {
- "description": "更新后的知识库",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1847,8 +3902,10 @@
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge/manual/{id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -1857,7 +3914,7 @@
"ApiKeyAuth": []
}
],
- "description": "删除指定的知识库及其所有内容",
+ "description": "更新手工录入的Markdown知识内容",
"consumes": [
"application/json"
],
@@ -1865,21 +3922,30 @@
"application/json"
],
"tags": [
- "知识库"
+ "知识管理"
],
- "summary": "删除知识库",
+ "summary": "更新手工知识",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "手工知识内容",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ }
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "更新后的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1894,7 +3960,7 @@
}
}
},
- "/knowledge-bases/{id}/faq/entries": {
+ "/knowledge/search": {
"get": {
"security": [
{
@@ -1904,7 +3970,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的FAQ条目列表,支持分页和筛选",
+ "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
"consumes": [
"application/json"
],
@@ -1912,71 +3978,60 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "Knowledge"
],
- "summary": "获取FAQ条目列表",
+ "summary": "Search knowledge",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "页码",
- "name": "page",
+ "description": "Keyword to search",
+ "name": "keyword",
"in": "query"
},
{
"type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "string",
- "description": "标签ID筛选",
- "name": "tag_id",
+ "description": "Offset for pagination",
+ "name": "offset",
"in": "query"
},
{
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
+ "type": "integer",
+ "description": "Limit for pagination (default 20)",
+ "name": "limit",
"in": "query"
},
{
"type": "string",
- "description": "搜索字段: standard_question(标准问题), similar_questions(相似问法), answers(答案), 默认搜索全部",
- "name": "search_field",
+ "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
+ "name": "file_types",
"in": "query"
},
{
"type": "string",
- "description": "排序方式: asc(按更新时间正序), 默认按更新时间倒序",
- "name": "sort_order",
+ "description": "Shared agent ID (search within agent's KB scope)",
+ "name": "agent_id",
"in": "query"
}
],
"responses": {
"200": {
- "description": "FAQ列表",
+ "description": "Search results",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Invalid request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/knowledge/tags": {
+ "put": {
"security": [
{
"Bearer": []
@@ -1985,7 +4040,7 @@
"ApiKeyAuth": []
}
],
- "description": "异步批量更新或插入FAQ条目",
+ "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
"consumes": [
"application/json"
],
@@ -1993,30 +4048,23 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "批量更新/插入FAQ条目",
+ "summary": "批量更新知识标签",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "批量操作请求",
+ "description": "标签更新请求(updates 必填,kb_id 可选)",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "任务ID",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2029,8 +4077,10 @@
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2039,7 +4089,7 @@
"ApiKeyAuth": []
}
],
- "description": "批量删除指定的FAQ条目",
+ "description": "根据ID获取知识条目详情",
"consumes": [
"application/json"
],
@@ -2047,38 +4097,21 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "批量删除FAQ条目",
+ "summary": "获取知识详情",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "要删除的FAQ ID列表",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- }
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "知识详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2089,12 +4122,16 @@
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ },
+ "404": {
+ "description": "知识不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entries/export": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -2103,31 +4140,41 @@
"ApiKeyAuth": []
}
],
- "description": "将所有FAQ条目导出为CSV文件",
+ "description": "更新知识条目信息",
"consumes": [
"application/json"
],
"produces": [
- "text/csv"
+ "application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "导出FAQ条目",
+ "summary": "更新知识",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "知识信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
}
],
"responses": {
"200": {
- "description": "CSV文件",
+ "description": "更新成功",
"schema": {
- "type": "file"
+ "type": "object",
+ "additionalProperties": true
}
},
"400": {
@@ -2137,10 +4184,8 @@
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entries/fields": {
- "put": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2149,7 +4194,7 @@
"ApiKeyAuth": []
}
],
- "description": "批量更新FAQ条目的多个字段(is_enabled, is_recommended, tag_id)",
+ "description": "根据ID删除知识条目",
"consumes": [
"application/json"
],
@@ -2157,30 +4202,21 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "批量更新FAQ字段",
+ "summary": "删除知识",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "字段更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2195,8 +4231,8 @@
}
}
},
- "/knowledge-bases/{id}/faq/entries/tags": {
- "put": {
+ "/knowledge/{id}/download": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2205,41 +4241,31 @@
"ApiKeyAuth": []
}
],
- "description": "批量更新FAQ条目的标签",
+ "description": "下载知识条目关联的原始文件",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "application/octet-stream"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "批量更新FAQ标签",
+ "summary": "下载知识文件",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "标签更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "文件内容",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
@@ -2251,8 +4277,8 @@
}
}
},
- "/knowledge-bases/{id}/faq/entries/{entry_id}": {
- "get": {
+ "/knowledge/{id}/reparse": {
+ "post": {
"security": [
{
"Bearer": []
@@ -2261,7 +4287,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据ID获取单个FAQ条目的详情",
+ "description": "删除知识中现有的文档内容并重新解析,使用异步任务方式处理",
"consumes": [
"application/json"
],
@@ -2269,28 +4295,21 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识管理"
],
- "summary": "获取FAQ条目详情",
+ "summary": "重新解析知识",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "type": "string",
- "description": "FAQ条目ID",
- "name": "entry_id",
- "in": "path",
- "required": true
}
],
"responses": {
"200": {
- "description": "FAQ条目详情",
+ "description": "重新解析任务已提交",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2302,15 +4321,17 @@
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
- "404": {
- "description": "条目不存在",
+ "403": {
+ "description": "权限不足",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/mcp-services": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2319,7 +4340,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新指定的FAQ条目",
+ "description": "获取当前租户的所有MCP服务",
"consumes": [
"application/json"
],
@@ -2327,37 +4348,12 @@
"application/json"
],
"tags": [
- "FAQ管理"
- ],
- "summary": "更新FAQ条目",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "FAQ条目ID",
- "name": "entry_id",
- "in": "path",
- "required": true
- },
- {
- "description": "FAQ条目",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
- }
- }
+ "MCP服务"
],
+ "summary": "获取MCP服务列表",
"responses": {
"200": {
- "description": "更新成功",
+ "description": "MCP服务列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2370,9 +4366,7 @@
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entry": {
+ },
"post": {
"security": [
{
@@ -2382,7 +4376,7 @@
"ApiKeyAuth": []
}
],
- "description": "同步创建单个FAQ条目",
+ "description": "创建新的MCP服务配置",
"consumes": [
"application/json"
],
@@ -2390,30 +4384,23 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "MCP服务"
],
- "summary": "创建单个FAQ条目",
+ "summary": "创建MCP服务",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "FAQ条目",
+ "description": "MCP服务配置",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService"
}
}
],
"responses": {
"200": {
- "description": "创建的FAQ条目",
+ "description": "创建的MCP服务",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2428,8 +4415,8 @@
}
}
},
- "/knowledge-bases/{id}/faq/search": {
- "post": {
+ "/mcp-services/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2438,7 +4425,7 @@
"ApiKeyAuth": []
}
],
- "description": "使用混合搜索在FAQ中搜索",
+ "description": "根据ID获取MCP服务详情",
"consumes": [
"application/json"
],
@@ -2446,46 +4433,35 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "MCP服务"
],
- "summary": "搜索FAQ",
+ "summary": "获取MCP服务详情",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "搜索请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest"
- }
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "MCP服务详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "服务不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/hybrid-search": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -2494,7 +4470,7 @@
"ApiKeyAuth": []
}
],
- "description": "在知识库中执行向量和关键词混合搜索",
+ "description": "更新MCP服务配置",
"consumes": [
"application/json"
],
@@ -2502,30 +4478,30 @@
"application/json"
],
"tags": [
- "知识库"
+ "MCP服务"
],
- "summary": "混合搜索",
+ "summary": "更新MCP服务",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "搜索参数",
+ "description": "更新字段",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "更新后的MCP服务",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2538,10 +4514,8 @@
}
}
}
- }
- },
- "/knowledge-bases/{id}/knowledge": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2550,7 +4524,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的知识列表,支持分页和筛选",
+ "description": "删除指定的MCP服务",
"consumes": [
"application/json"
],
@@ -2558,58 +4532,28 @@
"application/json"
],
"tags": [
- "知识管理"
+ "MCP服务"
],
- "summary": "获取知识列表",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "string",
- "description": "标签ID筛选",
- "name": "tag_id",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
- "in": "query"
- },
+ "summary": "删除MCP服务",
+ "parameters": [
{
"type": "string",
- "description": "文件类型筛选",
- "name": "file_type",
- "in": "query"
+ "description": "MCP服务ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "知识列表",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -2617,8 +4561,8 @@
}
}
},
- "/knowledge-bases/{id}/knowledge/file": {
- "post": {
+ "/mcp-services/{id}/resources": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2627,76 +4571,44 @@
"ApiKeyAuth": []
}
],
- "description": "上传文件并创建知识条目",
+ "description": "获取MCP服务提供的资源列表",
"consumes": [
- "multipart/form-data"
+ "application/json"
],
"produces": [
"application/json"
],
"tags": [
- "知识管理"
+ "MCP服务"
],
- "summary": "从文件创建知识",
+ "summary": "获取MCP服务资源列表",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "type": "file",
- "description": "上传的文件",
- "name": "file",
- "in": "formData",
- "required": true
- },
- {
- "type": "string",
- "description": "自定义文件名",
- "name": "fileName",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "元数据JSON",
- "name": "metadata",
- "in": "formData"
- },
- {
- "type": "boolean",
- "description": "启用多模态处理",
- "name": "enable_multimodel",
- "in": "formData"
}
],
"responses": {
"200": {
- "description": "创建的知识",
+ "description": "资源列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "409": {
- "description": "文件重复",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
}
}
}
},
- "/knowledge-bases/{id}/knowledge/manual": {
+ "/mcp-services/{id}/test": {
"post": {
"security": [
{
@@ -2706,7 +4618,7 @@
"ApiKeyAuth": []
}
],
- "description": "手工录入Markdown格式的知识内容",
+ "description": "测试MCP服务是否可以正常连接",
"consumes": [
"application/json"
],
@@ -2714,30 +4626,21 @@
"application/json"
],
"tags": [
- "知识管理"
+ "MCP服务"
],
- "summary": "手工创建知识",
+ "summary": "测试MCP服务连接",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "手工知识内容",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
- }
}
],
"responses": {
"200": {
- "description": "创建的知识",
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2752,8 +4655,8 @@
}
}
},
- "/knowledge-bases/{id}/knowledge/url": {
- "post": {
+ "/mcp-services/{id}/tools": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2762,7 +4665,7 @@
"ApiKeyAuth": []
}
],
- "description": "从指定URL抓取内容并创建知识条目",
+ "description": "获取MCP服务提供的工具列表",
"consumes": [
"application/json"
],
@@ -2770,63 +4673,36 @@
"application/json"
],
"tags": [
- "知识管理"
+ "MCP服务"
],
- "summary": "从URL创建知识",
+ "summary": "获取MCP服务工具列表",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "URL请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "enable_multimodel": {
- "type": "boolean"
- },
- "title": {
- "type": "string"
- },
- "url": {
- "type": "string"
- }
- }
- }
}
],
"responses": {
- "201": {
- "description": "创建的知识",
+ "200": {
+ "description": "工具列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
- },
- "409": {
- "description": "URL重复",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
}
}
}
},
- "/knowledge-bases/{id}/tags": {
+ "/messages/{session_id}/load": {
"get": {
"security": [
{
@@ -2836,7 +4712,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的所有标签及统计信息",
+ "description": "加载会话的消息历史,支持分页和时间筛选",
"consumes": [
"application/json"
],
@@ -2844,39 +4720,34 @@
"application/json"
],
"tags": [
- "标签管理"
+ "消息"
],
- "summary": "获取标签列表",
+ "summary": "加载消息历史",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
+ "description": "会话ID",
+ "name": "session_id",
"in": "path",
"required": true
},
{
"type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
+ "default": 20,
+ "description": "返回数量",
+ "name": "limit",
"in": "query"
},
{
"type": "string",
- "description": "关键词搜索",
- "name": "keyword",
+ "description": "在此时间之前的消息(RFC3339Nano格式)",
+ "name": "before_time",
"in": "query"
}
],
"responses": {
"200": {
- "description": "标签列表",
+ "description": "消息列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2889,8 +4760,10 @@
}
}
}
- },
- "post": {
+ }
+ },
+ "/messages/{session_id}/{id}": {
+ "delete": {
"security": [
{
"Bearer": []
@@ -2899,7 +4772,7 @@
"ApiKeyAuth": []
}
],
- "description": "在知识库下创建新标签",
+ "description": "从会话中删除指定消息",
"consumes": [
"application/json"
],
@@ -2907,48 +4780,35 @@
"application/json"
],
"tags": [
- "标签管理"
+ "消息"
],
- "summary": "创建标签",
+ "summary": "删除消息",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
+ "description": "会话ID",
+ "name": "session_id",
"in": "path",
"required": true
},
{
- "description": "标签信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "color": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "sort_order": {
- "type": "integer"
- }
- }
- }
+ "type": "string",
+ "description": "消息ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "创建的标签",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -2956,8 +4816,8 @@
}
}
},
- "/knowledge-bases/{id}/tags/{tag_id}": {
- "put": {
+ "/models": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2966,7 +4826,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新标签信息",
+ "description": "获取当前租户的所有模型",
"consumes": [
"application/json"
],
@@ -2974,37 +4834,59 @@
"application/json"
],
"tags": [
- "标签管理"
+ "模型管理"
],
- "summary": "更新标签",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
+ "summary": "获取模型列表",
+ "responses": {
+ "200": {
+ "description": "模型列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
},
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
{
- "type": "string",
- "description": "标签ID",
- "name": "tag_id",
- "in": "path",
- "required": true
+ "Bearer": []
},
{
- "description": "标签更新信息",
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "创建新的模型配置",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "模型管理"
+ ],
+ "summary": "创建模型",
+ "parameters": [
+ {
+ "description": "模型信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.CreateModelRequest"
}
}
],
"responses": {
- "200": {
- "description": "更新后的标签",
+ "201": {
+ "description": "创建的模型",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3017,8 +4899,10 @@
}
}
}
- },
- "delete": {
+ }
+ },
+ "/models/providers": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3027,7 +4911,7 @@
"ApiKeyAuth": []
}
],
- "description": "删除标签,可使用force=true强制删除被引用的标签,content_only=true仅删除标签下的内容而保留标签本身",
+ "description": "根据模型类型获取支持的厂商列表及配置信息",
"consumes": [
"application/json"
],
@@ -3035,55 +4919,29 @@
"application/json"
],
"tags": [
- "标签管理"
+ "模型管理"
],
- "summary": "删除标签",
+ "summary": "获取模型厂商列表",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "标签ID",
- "name": "tag_id",
- "in": "path",
- "required": true
- },
- {
- "type": "boolean",
- "description": "强制删除",
- "name": "force",
- "in": "query"
- },
- {
- "type": "boolean",
- "description": "仅删除内容,保留标签",
- "name": "content_only",
+ "description": "模型类型 (chat, embedding, rerank, vllm)",
+ "name": "model_type",
"in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "厂商列表",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/knowledge/batch": {
+ "/models/{id}": {
"get": {
"security": [
{
@@ -3093,7 +4951,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据ID列表批量获取知识条目",
+ "description": "根据ID获取模型详情",
"consumes": [
"application/json"
],
@@ -3101,40 +4959,34 @@
"application/json"
],
"tags": [
- "知识管理"
+ "模型管理"
],
- "summary": "批量获取知识",
+ "summary": "获取模型详情",
"parameters": [
{
- "type": "array",
- "items": {
- "type": "string"
- },
- "collectionFormat": "csv",
- "description": "知识ID列表",
- "name": "ids",
- "in": "query",
+ "type": "string",
+ "description": "模型ID",
+ "name": "id",
+ "in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "知识列表",
+ "description": "模型详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge/image/{id}/{chunk_id}": {
+ },
"put": {
"security": [
{
@@ -3144,7 +4996,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新知识分块的图像信息",
+ "description": "更新模型配置信息",
"consumes": [
"application/json"
],
@@ -3152,58 +5004,44 @@
"application/json"
],
"tags": [
- "知识管理"
+ "模型管理"
],
- "summary": "更新图像信息",
+ "summary": "更新模型",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
},
{
- "type": "string",
- "description": "分块ID",
- "name": "chunk_id",
- "in": "path",
- "required": true
- },
- {
- "description": "图像信息",
+ "description": "更新信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "image_info": {
- "type": "string"
- }
- }
+ "$ref": "#/definitions/internal_handler.UpdateModelRequest"
}
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "更新后的模型",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge/manual/{id}": {
- "put": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -3212,7 +5050,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新手工录入的Markdown知识内容",
+ "description": "删除指定的模型",
"consumes": [
"application/json"
],
@@ -3220,37 +5058,28 @@
"application/json"
],
"tags": [
- "知识管理"
+ "模型管理"
],
- "summary": "更新手工知识",
+ "summary": "删除模型",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "手工知识内容",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
- }
}
],
"responses": {
"200": {
- "description": "更新后的知识",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3258,17 +5087,37 @@
}
}
},
- "/knowledge/search": {
+ "/organizations": {
"get": {
"security": [
{
"Bearer": []
- },
+ }
+ ],
+ "description": "获取当前用户所属的所有组织,并附带各空间内知识库/智能体数量",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织管理"
+ ],
+ "summary": "获取我的组织列表",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse"
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
{
- "ApiKeyAuth": []
+ "Bearer": []
}
],
- "description": "Search knowledge files by keyword across all knowledge bases",
+ "description": "创建新的组织,创建者自动成为管理员",
"consumes": [
"application/json"
],
@@ -3276,39 +5125,30 @@
"application/json"
],
"tags": [
- "Knowledge"
+ "组织管理"
],
- "summary": "Search knowledge",
+ "summary": "创建组织",
"parameters": [
{
- "type": "string",
- "description": "Keyword to search",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Offset for pagination",
- "name": "offset",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Limit for pagination (default 20)",
- "name": "limit",
- "in": "query"
+ "description": "组织信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest"
+ }
}
],
"responses": {
- "200": {
- "description": "Search results",
+ "201": {
+ "description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Invalid request",
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3316,17 +5156,14 @@
}
}
},
- "/knowledge/tags": {
- "put": {
+ "/organizations/join": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "批量更新知识条目的标签",
+ "description": "使用邀请码加入组织",
"consumes": [
"application/json"
],
@@ -3334,30 +5171,30 @@
"application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "批量更新知识标签",
+ "summary": "通过邀请码加入组织",
"parameters": [
{
- "description": "标签更新请求",
+ "description": "邀请码",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest"
}
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3365,17 +5202,14 @@
}
}
},
- "/knowledge/{id}": {
- "get": {
+ "/organizations/join-by-id": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取知识条目详情",
+ "description": "加入已开放可被搜索的空间,无需邀请码",
"consumes": [
"application/json"
],
@@ -3383,50 +5217,45 @@
"application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "获取知识详情",
+ "summary": "通过空间 ID 加入(可搜索空间)",
"parameters": [
{
- "type": "string",
- "description": "知识ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "空间 ID",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest"
+ }
}
],
"responses": {
"200": {
- "description": "知识详情",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
- },
- "404": {
- "description": "知识不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/organizations/join-request": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新知识条目信息",
+ "description": "对需要审核的组织提交加入申请",
"consumes": [
"application/json"
],
@@ -3434,82 +5263,71 @@
"application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "更新知识",
+ "summary": "提交加入申请",
"parameters": [
{
- "type": "string",
- "description": "知识ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "知识信息",
+ "description": "申请信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest"
}
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/organizations/preview/{code}": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID删除知识条目",
- "consumes": [
- "application/json"
- ],
+ "description": "通过邀请码获取组织基本信息(不加入)",
"produces": [
"application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "删除知识",
+ "summary": "通过邀请码预览组织",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "id",
+ "description": "邀请码",
+ "name": "code",
"in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3517,99 +5335,94 @@
}
}
},
- "/knowledge/{id}/download": {
+ "/organizations/search": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "下载知识条目关联的原始文件",
- "consumes": [
- "application/json"
- ],
+ "description": "搜索已开放可被搜索的空间,用于发现并加入",
"produces": [
- "application/octet-stream"
+ "application/json"
],
"tags": [
- "知识管理"
+ "组织管理"
],
- "summary": "下载知识文件",
+ "summary": "搜索可加入的空间",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "搜索关键词(空间名称或描述)",
+ "name": "q",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 20,
+ "description": "返回数量限制",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "文件内容",
- "schema": {
- "type": "file"
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/mcp-services": {
+ "/organizations/{id}": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有MCP服务",
- "consumes": [
- "application/json"
- ],
+ "description": "根据ID获取组织详情",
"produces": [
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
+ ],
+ "summary": "获取组织详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "获取MCP服务列表",
"responses": {
"200": {
- "description": "MCP服务列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "post": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "创建新的MCP服务配置",
+ "description": "更新组织信息(需要管理员权限)",
"consumes": [
"application/json"
],
@@ -3617,62 +5430,58 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "创建MCP服务",
+ "summary": "更新组织",
"parameters": [
{
- "description": "MCP服务配置",
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest"
}
}
],
"responses": {
"200": {
- "description": "创建的MCP服务",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/mcp-services/{id}": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取MCP服务详情",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "删除组织(仅组织创建者可操作)",
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "获取MCP服务详情",
+ "summary": "删除组织",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -3680,30 +5489,29 @@
],
"responses": {
"200": {
- "description": "MCP服务详情",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "服务不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/organizations/{id}/invite": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新MCP服务配置",
+ "description": "管理员直接添加用户为组织成员",
"consumes": [
"application/json"
],
@@ -3711,67 +5519,69 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "更新MCP服务",
+ "summary": "邀请成员",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "更新字段",
+ "description": "邀请信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.InviteMemberRequest"
}
}
],
"responses": {
"200": {
- "description": "更新后的MCP服务",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Bad Request",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/organizations/{id}/invite-code": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除指定的MCP服务",
- "consumes": [
- "application/json"
- ],
+ "description": "生成新的组织邀请码(需要管理员权限)",
"produces": [
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "删除MCP服务",
+ "summary": "生成邀请码",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -3779,14 +5589,14 @@
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3794,31 +5604,25 @@
}
}
},
- "/mcp-services/{id}/resources": {
+ "/organizations/{id}/join-requests": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取MCP服务提供的资源列表",
- "consumes": [
- "application/json"
- ],
+ "description": "获取组织的待审核加入申请(仅管理员)",
"produces": [
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "获取MCP服务资源列表",
+ "summary": "获取待审核加入申请列表",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -3826,14 +5630,14 @@
],
"responses": {
"200": {
- "description": "资源列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3841,17 +5645,14 @@
}
}
},
- "/mcp-services/{id}/test": {
- "post": {
+ "/organizations/{id}/join-requests/{request_id}/review": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "测试MCP服务是否可以正常连接",
+ "description": "通过或拒绝加入申请(仅管理员)",
"consumes": [
"application/json"
],
@@ -3859,28 +5660,44 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "测试MCP服务连接",
+ "summary": "审核加入申请",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "申请ID",
+ "name": "request_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "审核结果",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest"
+ }
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -3888,31 +5705,22 @@
}
}
},
- "/mcp-services/{id}/tools": {
- "get": {
+ "/organizations/{id}/leave": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取MCP服务提供的工具列表",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "退出指定组织",
"tags": [
- "MCP服务"
+ "组织管理"
],
- "summary": "获取MCP服务工具列表",
+ "summary": "退出组织",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -3920,32 +5728,63 @@
],
"responses": {
"200": {
- "description": "工具列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/organizations/{id}/members": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "获取组织的所有成员",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织管理"
+ ],
+ "summary": "获取组织成员列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListMembersResponse"
}
}
}
}
},
- "/messages/{session_id}/load": {
- "get": {
+ "/organizations/{id}/members/{user_id}": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "加载会话的消息历史,支持分页和时间筛选",
+ "description": "更新组织成员的角色(需要管理员权限)",
"consumes": [
"application/json"
],
@@ -3953,95 +5792,87 @@
"application/json"
],
"tags": [
- "消息"
+ "组织管理"
],
- "summary": "加载消息历史",
+ "summary": "更新成员角色",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
},
{
- "type": "integer",
- "default": 20,
- "description": "返回数量",
- "name": "limit",
- "in": "query"
+ "type": "string",
+ "description": "用户ID",
+ "name": "user_id",
+ "in": "path",
+ "required": true
},
{
- "type": "string",
- "description": "在此时间之前的消息(RFC3339Nano格式)",
- "name": "before_time",
- "in": "query"
+ "description": "角色信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest"
+ }
}
],
"responses": {
"200": {
- "description": "消息列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/messages/{session_id}/{id}": {
+ },
"delete": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "从会话中删除指定消息",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "从组织中移除成员(需要管理员权限)",
"tags": [
- "消息"
+ "组织管理"
],
- "summary": "删除消息",
+ "summary": "移除成员",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
},
{
"type": "string",
- "description": "消息ID",
- "name": "id",
+ "description": "用户ID",
+ "name": "user_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4049,17 +5880,14 @@
}
}
},
- "/models": {
- "get": {
+ "/organizations/{id}/request-upgrade": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有模型",
+ "description": "现有成员申请更高权限",
"consumes": [
"application/json"
],
@@ -4067,66 +5895,92 @@
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
+ ],
+ "summary": "申请权限升级",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "申请信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest"
+ }
+ }
],
- "summary": "获取模型列表",
"responses": {
"200": {
- "description": "模型列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/organizations/{id}/search-users": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "创建新的模型配置",
- "consumes": [
- "application/json"
- ],
+ "description": "搜索用户(排除已有成员)用于邀请加入组织",
"produces": [
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
],
- "summary": "创建模型",
+ "summary": "搜索可邀请的用户",
"parameters": [
{
- "description": "模型信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler.CreateModelRequest"
- }
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "搜索关键词(用户名或邮箱)",
+ "name": "q",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "default": 10,
+ "description": "返回数量限制",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
- "201": {
- "description": "创建的模型",
+ "200": {
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4134,31 +5988,25 @@
}
}
},
- "/models/{id}": {
+ "/organizations/{id}/shared-agents": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取模型详情",
- "consumes": [
- "application/json"
- ],
+ "description": "获取指定空间下所有共享智能体,包含他人共享的与我共享的,用于列表页空间视角",
"produces": [
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
],
- "summary": "获取模型详情",
+ "summary": "获取空间内全部智能体(含我共享的)",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -4166,98 +6014,69 @@
],
"responses": {
"200": {
- "description": "模型详情",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "404": {
- "description": "模型不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
- },
- "put": {
+ }
+ },
+ "/organizations/{id}/shared-knowledge-bases": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新模型配置信息",
- "consumes": [
- "application/json"
- ],
+ "description": "获取指定空间下所有共享知识库,包含直接共享的与通过共享智能体可见的,用于列表页空间视角",
"produces": [
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
],
- "summary": "更新模型",
+ "summary": "获取空间内全部知识库(含我共享的、含智能体携带的)",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "更新信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/internal_handler.UpdateModelRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新后的模型",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "404": {
- "description": "模型不存在",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
- },
- "delete": {
+ }
+ },
+ "/organizations/{id}/shares": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除指定的模型",
- "consumes": [
- "application/json"
- ],
+ "description": "获取共享到指定组织的所有知识库",
"produces": [
"application/json"
],
"tags": [
- "模型管理"
+ "组织管理"
],
- "summary": "删除模型",
+ "summary": "获取组织的共享知识库列表",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -4265,16 +6084,9 @@
],
"responses": {
"200": {
- "description": "删除成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "404": {
- "description": "模型不存在",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
}
}
}
@@ -4340,7 +6152,56 @@
"ApiKeyAuth": []
}
],
- "description": "创建新的对话会话",
+ "description": "创建新的对话会话",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "会话"
+ ],
+ "summary": "创建会话",
+ "parameters": [
+ {
+ "description": "会话创建请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.CreateSessionRequest"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "创建的会话",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/sessions/batch": {
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据ID列表批量删除对话会话",
"consumes": [
"application/json"
],
@@ -4350,21 +6211,21 @@
"tags": [
"会话"
],
- "summary": "创建会话",
+ "summary": "批量删除会话",
"parameters": [
{
- "description": "会话创建请求",
+ "description": "批量删除请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/internal_handler_session.CreateSessionRequest"
+ "$ref": "#/definitions/internal_handler_session.batchDeleteRequest"
}
}
],
"responses": {
- "201": {
- "description": "创建的会话",
+ "200": {
+ "description": "删除结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4852,6 +6713,70 @@
}
}
},
+ "/shared-knowledge-bases": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "获取通过组织共享给当前用户的所有知识库",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "知识库共享"
+ ],
+ "summary": "获取共享给我的知识库列表",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/skills": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取所有预装的Agent Skills元数据",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Skills"
+ ],
+ "summary": "获取预装Skills列表",
+ "responses": {
+ "200": {
+ "description": "Skills列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/system/info": {
"get": {
"description": "获取系统版本、构建信息和引擎配置",
@@ -4875,6 +6800,43 @@
}
}
},
+ "/system/minio/buckets": {
+ "get": {
+ "description": "获取所有 MinIO 存储桶及其访问权限",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "系统"
+ ],
+ "summary": "列出 MinIO 存储桶",
+ "responses": {
+ "200": {
+ "description": "存储桶列表",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.ListMinioBucketsResponse"
+ }
+ },
+ "400": {
+ "description": "MinIO 未启用",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
"/tenants": {
"get": {
"security": [
@@ -5065,6 +7027,44 @@
}
}
},
+ "/tenants/kv/prompt-templates": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取系统配置的提示词模板列表",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "获取提示词模板",
+ "responses": {
+ "200": {
+ "description": "提示词模板配置",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
"/tenants/kv/web-search-config": {
"get": {
"security": [
@@ -5512,6 +7512,13 @@
"github_com_Tencent_WeKnora_internal_types.AgentConfig": {
"type": "object",
"properties": {
+ "allowed_skills": {
+ "description": "Skill names whitelist (empty = allow all)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"allowed_tools": {
"description": "List of allowed tool names",
"type": "array",
@@ -5519,6 +7526,10 @@
"type": "string"
}
},
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
"knowledge_bases": {
"description": "Accessible knowledge base IDs",
"type": "array",
@@ -5537,22 +7548,60 @@
"description": "Maximum number of ReAct iterations",
"type": "integer"
},
+ "mcp_selection_mode": {
+ "description": "MCP service selection",
+ "type": "string"
+ },
+ "mcp_services": {
+ "description": "Selected MCP service IDs (when mode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "multi_turn_enabled": {
+ "description": "Whether multi-turn conversation is enabled",
+ "type": "boolean"
+ },
"reflection_enabled": {
"description": "Whether to enable reflection",
"type": "boolean"
},
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
+ "type": "boolean"
+ },
+ "skill_dirs": {
+ "description": "Directories to search for skills",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skills_enabled": {
+ "description": "Skills configuration (Progressive Disclosure pattern)",
+ "type": "boolean"
+ },
+ "system_prompt": {
+ "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
+ "type": "string"
+ },
"system_prompt_web_disabled": {
- "description": "Custom prompt when web search is disabled",
+ "description": "Deprecated: Custom prompt when web search is disabled",
"type": "string"
},
"system_prompt_web_enabled": {
- "description": "Custom prompt when web search is enabled",
+ "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
"type": "string"
},
"temperature": {
"description": "LLM temperature for agent",
"type": "number"
},
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
+ },
"use_custom_system_prompt": {
"description": "Whether to use custom system prompt instead of default",
"type": "boolean"
@@ -5640,101 +7689,297 @@
"github_com_Tencent_WeKnora_internal_types.ContextConfig": {
"type": "object",
"properties": {
- "compression_strategy": {
- "description": "Compression strategy: \"sliding_window\" or \"smart\"",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
- }
- ]
+ "compression_strategy": {
+ "description": "Compression strategy: \"sliding_window\" or \"smart\"",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
+ }
+ ]
+ },
+ "max_tokens": {
+ "description": "Maximum tokens allowed in LLM context",
+ "type": "integer"
+ },
+ "recent_message_count": {
+ "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "type": "integer"
+ },
+ "summarize_threshold": {
+ "description": "Summarize threshold: number of messages before summarization",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ConversationConfig": {
+ "type": "object",
+ "properties": {
+ "context_template": {
+ "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "type": "string"
+ },
+ "embedding_top_k": {
+ "type": "integer"
+ },
+ "enable_query_expansion": {
+ "type": "boolean"
+ },
+ "enable_rewrite": {
+ "type": "boolean"
+ },
+ "fallback_prompt": {
+ "type": "string"
+ },
+ "fallback_response": {
+ "type": "string"
+ },
+ "fallback_strategy": {
+ "description": "Fallback strategy",
+ "type": "string"
+ },
+ "keyword_threshold": {
+ "type": "number"
+ },
+ "max_completion_tokens": {
+ "description": "MaxTokens is the maximum number of tokens to generate",
+ "type": "integer"
+ },
+ "max_rounds": {
+ "description": "Retrieval \u0026 strategy parameters",
+ "type": "integer"
+ },
+ "prompt": {
+ "description": "Prompt is the system prompt for normal mode",
+ "type": "string"
+ },
+ "rerank_model_id": {
+ "type": "string"
+ },
+ "rerank_threshold": {
+ "type": "number"
+ },
+ "rerank_top_k": {
+ "type": "integer"
+ },
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompts",
+ "type": "string"
+ },
+ "rewrite_prompt_user": {
+ "type": "string"
+ },
+ "summary_model_id": {
+ "description": "Model configuration",
+ "type": "string"
+ },
+ "temperature": {
+ "description": "Temperature controls the randomness of the model output",
+ "type": "number"
+ },
+ "vector_threshold": {
+ "type": "number"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "max_tokens": {
- "description": "Maximum tokens allowed in LLM context",
- "type": "integer"
+ "description": {
+ "type": "string",
+ "maxLength": 1000
},
- "recent_message_count": {
- "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "invite_code_validity_days": {
+ "description": "optional: 0=never, 1, 7, 30; default 7",
"type": "integer"
},
- "summarize_threshold": {
- "description": "Summarize threshold: number of messages before summarization",
+ "member_limit": {
+ "description": "optional: max members; 0=unlimited; default 50",
"type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
}
}
},
- "github_com_Tencent_WeKnora_internal_types.ConversationConfig": {
+ "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
"type": "object",
"properties": {
+ "agent_mode": {
+ "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
+ "type": "string"
+ },
+ "allowed_tools": {
+ "description": "Allowed tools (only for agent type)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"context_template": {
- "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "description": "Context template for normal mode (how to format retrieved chunks)",
"type": "string"
},
"embedding_top_k": {
+ "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
"type": "integer"
},
"enable_query_expansion": {
+ "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
"type": "boolean"
},
"enable_rewrite": {
+ "description": "Whether to enable query rewrite for multi-turn conversations",
"type": "boolean"
},
"fallback_prompt": {
+ "description": "Fallback prompt (when FallbackStrategy is \"model\")",
"type": "string"
},
"fallback_response": {
+ "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
"type": "string"
},
"fallback_strategy": {
- "description": "Fallback strategy",
+ "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
+ "type": "string"
+ },
+ "faq_direct_answer_threshold": {
+ "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
+ "type": "number"
+ },
+ "faq_priority_enabled": {
+ "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "type": "boolean"
+ },
+ "faq_score_boost": {
+ "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
+ "type": "number"
+ },
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
+ "kb_selection_mode": {
+ "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
"type": "string"
},
"keyword_threshold": {
+ "description": "Keyword retrieval threshold",
"type": "number"
},
+ "knowledge_bases": {
+ "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"max_completion_tokens": {
- "description": "MaxTokens is the maximum number of tokens to generate",
+ "description": "Maximum completion tokens (only for normal mode)",
"type": "integer"
},
- "max_rounds": {
- "description": "Retrieval \u0026 strategy parameters",
+ "max_iterations": {
+ "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
"type": "integer"
},
- "prompt": {
+ "mcp_selection_mode": {
+ "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
+ "type": "string"
+ },
+ "mcp_services": {
+ "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "model_id": {
+ "description": "===== Model Settings =====\nModel ID to use for conversations",
"type": "string"
},
+ "multi_turn_enabled": {
+ "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
+ "type": "boolean"
+ },
+ "reflection_enabled": {
+ "description": "Whether reflection is enabled (only for agent type)",
+ "type": "boolean"
+ },
"rerank_model_id": {
+ "description": "ReRank model ID for retrieval",
"type": "string"
},
"rerank_threshold": {
+ "description": "Rerank threshold",
"type": "number"
},
"rerank_top_k": {
+ "description": "Rerank top K",
"type": "integer"
},
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
+ "type": "boolean"
+ },
"rewrite_prompt_system": {
- "description": "Rewrite prompts",
+ "description": "Rewrite prompt system message",
"type": "string"
},
"rewrite_prompt_user": {
+ "description": "Rewrite prompt user message template",
"type": "string"
},
- "summary_model_id": {
- "description": "Model configuration",
+ "selected_skills": {
+ "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skills_selection_mode": {
+ "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
+ "type": "string"
+ },
+ "supported_file_types": {
+ "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "system_prompt": {
+ "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
"type": "string"
},
"temperature": {
- "description": "Temperature controls the randomness of the model output",
+ "description": "Temperature for LLM (0-1)",
"type": "number"
},
- "use_custom_context_template": {
- "type": "boolean"
- },
- "use_custom_system_prompt": {
- "description": "Prompt is the system prompt for normal mode",
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
"type": "boolean"
},
"vector_threshold": {
+ "description": "Vector retrieval threshold",
"type": "number"
+ },
+ "web_search_enabled": {
+ "description": "===== Web Search Settings =====\nWhether web search is enabled",
+ "type": "boolean"
+ },
+ "web_search_max_results": {
+ "description": "Maximum web search results",
+ "type": "integer"
}
}
},
@@ -5784,6 +8029,10 @@
"entries"
],
"properties": {
+ "dry_run": {
+ "description": "仅验证,不实际导入",
+ "type": "boolean"
+ },
"entries": {
"type": "array",
"items": {
@@ -5799,6 +8048,10 @@
"append",
"replace"
]
+ },
+ "task_id": {
+ "description": "可选,如果不传则自动生成UUID",
+ "type": "string"
}
}
},
@@ -5817,18 +8070,25 @@
"type": "object",
"properties": {
"by_id": {
- "description": "ByID 按条目ID更新,key为条目ID",
+ "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
}
},
"by_tag": {
- "description": "ByTag 按Tag批量更新,key为TagID(空字符串表示未分类)",
+ "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
}
+ },
+ "exclude_ids": {
+ "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
}
}
},
@@ -5842,7 +8102,7 @@
"type": "boolean"
},
"tag_id": {
- "type": "string"
+ "type": "integer"
}
}
},
@@ -5862,6 +8122,10 @@
"type": "string"
}
},
+ "id": {
+ "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "type": "integer"
+ },
"is_enabled": {
"type": "boolean"
},
@@ -5884,7 +8148,7 @@
"type": "string"
},
"tag_id": {
- "type": "string"
+ "type": "integer"
},
"tag_name": {
"type": "string"
@@ -5919,36 +8183,35 @@
"query_text"
],
"properties": {
+ "first_priority_tag_ids": {
+ "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
"match_count": {
"type": "integer"
},
+ "only_recommended": {
+ "description": "是否仅返回推荐的条目",
+ "type": "boolean"
+ },
"query_text": {
"type": "string"
},
+ "second_priority_tag_ids": {
+ "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
"vector_threshold": {
"type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.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.GraphNode": {
"type": "object",
"properties": {
@@ -5992,6 +8255,64 @@
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
+ "type": "object",
+ "required": [
+ "role",
+ "user_id"
+ ],
+ "properties": {
+ "role": {
+ "description": "Role to assign: admin/editor/viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ },
+ "user_id": {
+ "description": "User ID to invite",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
+ "type": "object",
+ "required": [
+ "organization_id"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message for join request",
+ "type": "string",
+ "maxLength": 500
+ },
+ "organization_id": {
+ "type": "string"
+ },
+ "role": {
+ "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
+ ],
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.Knowledge": {
"type": "object",
"properties": {
@@ -6055,6 +8376,13 @@
"description": "Knowledge base name (not stored in database, populated on query)",
"type": "string"
},
+ "last_faq_import_result": {
+ "description": "Last FAQ import result (for FAQ type knowledge only)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
"metadata": {
"description": "Metadata of the knowledge",
"type": "array",
@@ -6203,6 +8531,10 @@
}
]
},
+ "share_count": {
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
+ "type": "integer"
+ },
"summary_model_id": {
"description": "Summary model ID",
"type": "string"
@@ -6219,42 +8551,148 @@
"description": "Last updated time of the knowledge base",
"type": "string"
},
- "vlm_config": {
- "description": "VLM config",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
- }
- ]
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
+ "type": "object",
+ "properties": {
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
+ },
+ "faq_config": {
+ "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
+ },
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
+ "type": "object",
+ "properties": {
+ "chunk_count": {
+ "type": "integer"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "knowledge_base_name": {
+ "type": "string"
+ },
+ "knowledge_base_type": {
+ "type": "string"
+ },
+ "knowledge_count": {
+ "type": "integer"
+ },
+ "my_permission": {
+ "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
+ "type": "string"
+ },
+ "my_role_in_org": {
+ "description": "Current user's role in this organization (admin/editor/viewer)",
+ "type": "string"
+ },
+ "organization_id": {
+ "type": "string"
+ },
+ "organization_name": {
+ "type": "string"
+ },
+ "permission": {
+ "description": "Share permission (what the space was granted: viewer/editor)",
+ "type": "string"
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "shared_by_user_id": {
+ "type": "string"
+ },
+ "shared_by_username": {
+ "type": "string"
+ },
+ "source_tenant_id": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
+ "type": "object",
+ "properties": {
+ "members": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
+ }
+ },
+ "total": {
+ "type": "integer"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
"type": "object",
"properties": {
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
- }
- ]
+ "organizations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
+ }
},
- "faq_config": {
- "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "resource_counts": {
+ "description": "各空间内知识库/智能体数量,供列表侧栏展示",
"allOf": [
{
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
}
]
},
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
- }
- ]
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
+ "type": "object",
+ "properties": {
+ "shares": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
+ }
+ },
+ "total": {
+ "type": "integer"
}
}
},
@@ -6452,6 +8890,9 @@
"status": {
"type": "string"
},
+ "tag_id": {
+ "type": "string"
+ },
"title": {
"type": "string"
}
@@ -6468,9 +8909,11 @@
5,
6,
7,
- 8
+ 8,
+ 9
],
"x-enum-comments": {
+ "MatchTypeDataAnalysis": "数据分析匹配类型",
"MatchTypeDirectLoad": "直接加载匹配类型",
"MatchTypeParentChunk": "父Chunk匹配类型",
"MatchTypeRelationChunk": "关系Chunk匹配类型",
@@ -6485,7 +8928,8 @@
"关系Chunk匹配类型",
"",
"网络搜索匹配类型",
- "直接加载匹配类型"
+ "直接加载匹配类型",
+ "数据分析匹配类型"
],
"x-enum-varnames": [
"MatchTypeEmbedding",
@@ -6496,7 +8940,8 @@
"MatchTypeRelationChunk",
"MatchTypeGraph",
"MatchTypeWebSearch",
- "MatchTypeDirectLoad"
+ "MatchTypeDirectLoad",
+ "MatchTypeDataAnalysis"
]
},
"github_com_Tencent_WeKnora_internal_types.MentionedItem": {
@@ -6596,12 +9041,23 @@
"embedding_parameters": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
},
+ "extra_config": {
+ "description": "Provider-specific configuration",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
"interface_type": {
"type": "string"
},
"parameter_size": {
"description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
"type": "string"
+ },
+ "provider": {
+ "description": "Provider identifier: openai, aliyun, zhipu, generic",
+ "type": "string"
}
}
},
@@ -6610,22 +9066,66 @@
"enum": [
"local",
"remote",
- "aliyun"
+ "aliyun",
+ "zhipu",
+ "volcengine",
+ "deepseek",
+ "hunyuan",
+ "minimax",
+ "openai",
+ "gemini",
+ "mimo",
+ "siliconflow",
+ "jina",
+ "openrouter"
],
"x-enum-comments": {
"ModelSourceAliyun": "Aliyun DashScope model",
+ "ModelSourceDeepseek": "Deepseek model",
+ "ModelSourceGemini": "Gemini model",
+ "ModelSourceHunyuan": "Hunyuan model",
+ "ModelSourceJina": "Jina AI model",
"ModelSourceLocal": "Local model",
- "ModelSourceRemote": "Remote model"
+ "ModelSourceMimo": "Mimo model",
+ "ModelSourceMinimax": "Minimax mode",
+ "ModelSourceOpenAI": "OpenAI model",
+ "ModelSourceOpenRouter": "OpenRouter model",
+ "ModelSourceRemote": "Remote model",
+ "ModelSourceSiliconFlow": "SiliconFlow model",
+ "ModelSourceVolcengine": "Volcengine model",
+ "ModelSourceZhipu": "Zhipu model"
},
"x-enum-descriptions": [
"Local model",
"Remote model",
- "Aliyun DashScope model"
+ "Aliyun DashScope model",
+ "Zhipu model",
+ "Volcengine model",
+ "Deepseek model",
+ "Hunyuan model",
+ "Minimax mode",
+ "OpenAI model",
+ "Gemini model",
+ "Mimo model",
+ "SiliconFlow model",
+ "Jina AI model",
+ "OpenRouter model"
],
"x-enum-varnames": [
"ModelSourceLocal",
"ModelSourceRemote",
- "ModelSourceAliyun"
+ "ModelSourceAliyun",
+ "ModelSourceZhipu",
+ "ModelSourceVolcengine",
+ "ModelSourceDeepseek",
+ "ModelSourceHunyuan",
+ "ModelSourceMinimax",
+ "ModelSourceOpenAI",
+ "ModelSourceGemini",
+ "ModelSourceMimo",
+ "ModelSourceSiliconFlow",
+ "ModelSourceJina",
+ "ModelSourceOpenRouter"
]
},
"github_com_Tencent_WeKnora_internal_types.ModelType": {
@@ -6655,6 +9155,118 @@
"ModelTypeVLLM"
]
},
+ "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "OrgRoleAdmin",
+ "OrgRoleEditor",
+ "OrgRoleViewer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "joined_at": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ },
+ "tenant_id": {
+ "type": "integer"
+ },
+ "user_id": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
+ "type": "object",
+ "properties": {
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
+ "type": "integer"
+ },
+ "avatar": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "has_pending_upgrade": {
+ "description": "当前用户是否有待处理的权限升级申请",
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "invite_code": {
+ "type": "string"
+ },
+ "invite_code_expires_at": {
+ "type": "string"
+ },
+ "invite_code_validity_days": {
+ "type": "integer"
+ },
+ "is_owner": {
+ "type": "boolean"
+ },
+ "member_count": {
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "0 = unlimited",
+ "type": "integer"
+ },
+ "my_role": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "owner_id": {
+ "type": "string"
+ },
+ "pending_join_request_count": {
+ "description": "待审批加入申请数(仅管理员可见)",
+ "type": "integer"
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "type": "boolean"
+ },
+ "share_count": {
+ "description": "共享到该组织的知识库数量",
+ "type": "integer"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
"type": "object",
"properties": {
@@ -6706,6 +9318,54 @@
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
+ "type": "object",
+ "required": [
+ "requested_role"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message explaining the reason",
+ "type": "string",
+ "maxLength": 500
+ },
+ "requested_role": {
+ "description": "The role user wants to upgrade to",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
+ "type": "object",
+ "properties": {
+ "agents": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "knowledge_bases": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
"type": "object",
"properties": {
@@ -6778,6 +9438,26 @@
"WebSearchRetrieverType"
]
},
+ "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
+ "type": "object",
+ "properties": {
+ "approved": {
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "role": {
+ "description": "Optional: role to assign when approving; overrides applicant's requested role",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.SearchParams": {
"type": "object",
"properties": {
@@ -6799,9 +9479,19 @@
"match_count": {
"type": "integer"
},
+ "only_recommended": {
+ "type": "boolean"
+ },
"query_text": {
"type": "string"
},
+ "tag_ids": {
+ "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"vector_threshold": {
"type": "number"
}
@@ -6865,6 +9555,10 @@
}
]
},
+ "matched_content": {
+ "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "type": "string"
+ },
"metadata": {
"description": "Metadata",
"type": "object",
@@ -6900,22 +9594,6 @@
"github_com_Tencent_WeKnora_internal_types.Session": {
"type": "object",
"properties": {
- "agent_config": {
- "description": "Agent 配置(会话级别,仅存储enabled和knowledge_bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SessionAgentConfig"
- }
- ]
- },
- "context_config": {
- "description": "上下文管理配置(可选)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
- }
- ]
- },
"created_at": {
"type": "string"
},
@@ -6926,65 +9604,9 @@
"description": "Description",
"type": "string"
},
- "embedding_top_k": {
- "description": "向量召回TopK",
- "type": "integer"
- },
- "enable_rewrite": {
- "description": "多轮改写开关",
- "type": "boolean"
- },
- "fallback_response": {
- "description": "固定回复内容",
- "type": "string"
- },
- "fallback_strategy": {
- "description": "兜底策略",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy"
- }
- ]
- },
- "id": {
- "description": "ID",
- "type": "string"
- },
- "keyword_threshold": {
- "description": "关键词召回阈值",
- "type": "number"
- },
- "knowledge_base_id": {
- "description": "Strategy configuration",
- "type": "string"
- },
- "max_rounds": {
- "description": "多轮保持轮数",
- "type": "integer"
- },
- "rerank_model_id": {
- "description": "排序模型ID",
- "type": "string"
- },
- "rerank_threshold": {
- "description": "排序阈值",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "排序TopK",
- "type": "integer"
- },
- "summary_model_id": {
- "description": "总结模型ID",
- "type": "string"
- },
- "summary_parameters": {
- "description": "总结模型参数",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig"
- }
- ]
+ "id": {
+ "description": "ID",
+ "type": "string"
},
"tenant_id": {
"description": "Tenant ID",
@@ -6996,37 +9618,21 @@
},
"updated_at": {
"type": "string"
- },
- "vector_threshold": {
- "description": "向量召回阈值",
- "type": "number"
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SessionAgentConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
"type": "object",
+ "required": [
+ "organization_id",
+ "permission"
+ ],
"properties": {
- "agent_mode_enabled": {
- "description": "Whether agent mode is enabled for this session",
- "type": "boolean"
- },
- "knowledge_bases": {
- "description": "Accessible knowledge base IDs for this session",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "description": "Accessible knowledge IDs (individual documents) for this session",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "organization_id": {
+ "type": "string"
},
- "web_search_enabled": {
- "description": "Whether web search is enabled for this session",
- "type": "boolean"
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
}
},
@@ -7063,56 +9669,28 @@
}
}
},
- "github_com_Tencent_WeKnora_internal_types.SummaryConfig": {
+ "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
"type": "object",
+ "required": [
+ "invite_code"
+ ],
"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"
- },
- "repeat_penalty": {
- "description": "Repeat penalty",
- "type": "number"
- },
- "seed": {
- "description": "Seed",
- "type": "integer"
- },
- "temperature": {
- "description": "Temperature",
- "type": "number"
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
},
- "top_k": {
- "description": "TopK",
- "type": "integer"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "top_p": {
- "description": "TopP",
- "type": "number"
+ "role": {
+ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
@@ -7120,7 +9698,7 @@
"type": "object",
"properties": {
"agent_config": {
- "description": "Global Agent configuration for this tenant (default for all sessions)",
+ "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
"allOf": [
{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig"
@@ -7144,7 +9722,7 @@
]
},
"conversation_config": {
- "description": "Global Conversation configuration for this tenant (default for normal mode sessions)",
+ "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
"allOf": [
{
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig"
@@ -7265,6 +9843,62 @@
}
}
},
+ "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 1000
+ },
+ "invite_code_validity_days": {
+ "description": "0=never, 1, 7, 30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "max members; 0=unlimited",
+ "type": "integer"
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "require_approval": {
+ "type": "boolean"
+ },
+ "searchable": {
+ "description": "open for search so others can discover and join",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
+ "type": "object",
+ "required": [
+ "permission"
+ ],
+ "properties": {
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
"github_com_Tencent_WeKnora_internal_types.User": {
"type": "object",
"properties": {
@@ -7420,6 +10054,29 @@
},
"target_id": {
"type": "string"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ },
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
}
}
},
@@ -7449,6 +10106,18 @@
}
}
},
+ "internal_handler.DeleteTagRequest": {
+ "type": "object",
+ "properties": {
+ "exclude_ids": {
+ "description": "Chunk seq_ids to exclude from deletion",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
"internal_handler.EvaluationRequest": {
"type": "object",
"properties": {
@@ -7658,6 +10327,32 @@
}
}
},
+ "internal_handler.ListMinioBucketsResponse": {
+ "type": "object",
+ "properties": {
+ "buckets": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.MinioBucketInfo"
+ }
+ }
+ }
+ },
+ "internal_handler.MinioBucketInfo": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "policy": {
+ "description": "\"public\", \"private\", \"custom\"",
+ "type": "string"
+ }
+ }
+ },
"internal_handler.RemoteModelCheckRequest": {
"type": "object",
"required": [
@@ -7697,6 +10392,23 @@
}
}
},
+ "internal_handler.UpdateAgentRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
+ },
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
"internal_handler.UpdateChunkRequest": {
"type": "object",
"properties": {
@@ -7764,6 +10476,36 @@
}
}
},
+ "internal_handler.addSimilarQuestionsRequest": {
+ "type": "object",
+ "required": [
+ "similar_questions"
+ ],
+ "properties": {
+ "similar_questions": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "internal_handler.updateLastFAQImportResultDisplayStatusRequest": {
+ "type": "object",
+ "required": [
+ "display_status"
+ ],
+ "properties": {
+ "display_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "close"
+ ]
+ }
+ }
+ },
"internal_handler_session.CreateKnowledgeQARequest": {
"type": "object",
"required": [
@@ -7774,6 +10516,18 @@
"description": "Whether agent mode is enabled for this request",
"type": "boolean"
},
+ "agent_id": {
+ "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
+ "type": "string"
+ },
+ "disable_title": {
+ "description": "Whether to disable auto title generation",
+ "type": "boolean"
+ },
+ "enable_memory": {
+ "description": "Whether memory feature is enabled for this request",
+ "type": "boolean"
+ },
"knowledge_base_ids": {
"description": "Selected knowledge base ID for this request",
"type": "array",
@@ -7812,25 +10566,13 @@
"internal_handler_session.CreateSessionRequest": {
"type": "object",
"properties": {
- "agent_config": {
- "description": "Agent configuration (optional, session-level config only: enabled and knowledge_bases)",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SessionAgentConfig"
- }
- ]
- },
- "knowledge_base_id": {
- "description": "ID of the associated knowledge base (optional, can be set/changed during queries)",
+ "description": {
+ "description": "Description for the session (optional)",
"type": "string"
},
- "session_strategy": {
- "description": "Session strategy configuration",
- "allOf": [
- {
- "$ref": "#/definitions/internal_handler_session.SessionStrategy"
- }
- ]
+ "title": {
+ "description": "Title for the session (optional)",
+ "type": "string"
}
}
},
@@ -7898,79 +10640,29 @@
}
}
},
- "internal_handler_session.SessionStrategy": {
+ "internal_handler_session.StopSessionRequest": {
"type": "object",
+ "required": [
+ "message_id"
+ ],
"properties": {
- "embedding_top_k": {
- "description": "Number of top results to retrieve from vector search",
- "type": "integer"
- },
- "enable_rewrite": {
- "description": "Whether to enable query rewrite for multi-round conversations",
- "type": "boolean"
- },
- "fallback_response": {
- "description": "Fixed response content for fallback",
- "type": "string"
- },
- "fallback_strategy": {
- "description": "Strategy to use when no relevant knowledge is found",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy"
- }
- ]
- },
- "keyword_threshold": {
- "description": "Threshold for keyword-based retrieval",
- "type": "number"
- },
- "max_rounds": {
- "description": "Maximum number of conversation rounds to maintain",
- "type": "integer"
- },
- "no_match_prefix": {
- "description": "Prefix for responses when no match is found",
- "type": "string"
- },
- "rerank_model_id": {
- "description": "ID of the model used for reranking results",
- "type": "string"
- },
- "rerank_threshold": {
- "description": "Threshold for reranking results",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "Number of top results after reranking",
- "type": "integer"
- },
- "summary_model_id": {
- "description": "ID of the model used for summarization",
+ "message_id": {
"type": "string"
- },
- "summary_parameters": {
- "description": "Parameters for the summary model",
- "allOf": [
- {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig"
- }
- ]
- },
- "vector_threshold": {
- "description": "Threshold for vector-based retrieval",
- "type": "number"
}
}
},
- "internal_handler_session.StopSessionRequest": {
+ "internal_handler_session.batchDeleteRequest": {
"type": "object",
"required": [
- "message_id"
+ "ids"
],
"properties": {
- "message_id": {
- "type": "string"
+ "ids": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
}
}
}
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 301cba7f7..f4aa96eb4 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -54,11 +54,19 @@ definitions:
- ErrAgentInvalidTemperature
github_com_Tencent_WeKnora_internal_types.AgentConfig:
properties:
+ allowed_skills:
+ description: Skill names whitelist (empty = allow all)
+ items:
+ type: string
+ type: array
allowed_tools:
description: List of allowed tool names
items:
type: string
type: array
+ history_turns:
+ description: Number of history turns to keep in context
+ type: integer
knowledge_bases:
description: Accessible knowledge base IDs
items:
@@ -72,18 +80,50 @@ definitions:
max_iterations:
description: Maximum number of ReAct iterations
type: integer
+ mcp_selection_mode:
+ description: MCP service selection
+ type: string
+ mcp_services:
+ description: Selected MCP service IDs (when mode is "selected")
+ items:
+ type: string
+ type: array
+ multi_turn_enabled:
+ description: Whether multi-turn conversation is enabled
+ type: boolean
reflection_enabled:
description: Whether to enable reflection
type: boolean
+ retrieve_kb_only_when_mentioned:
+ description: 'Whether to retrieve knowledge base only when explicitly mentioned
+ with @ (default: false)'
+ type: boolean
+ skill_dirs:
+ description: Directories to search for skills
+ items:
+ type: string
+ type: array
+ skills_enabled:
+ description: Skills configuration (Progressive Disclosure pattern)
+ type: boolean
+ system_prompt:
+ description: Unified system prompt (uses web_search_status placeholder for
+ dynamic behavior)
+ type: string
system_prompt_web_disabled:
- description: Custom prompt when web search is disabled
+ description: 'Deprecated: Custom prompt when web search is disabled'
type: string
system_prompt_web_enabled:
- description: Custom prompt when web search is enabled
+ description: 'Deprecated: Use SystemPrompt instead. Kept for backward compatibility
+ during migration.'
type: string
temperature:
description: LLM temperature for agent
type: number
+ thinking:
+ description: Whether to enable thinking mode (for models that support extended
+ thinking)
+ type: boolean
use_custom_system_prompt:
description: Whether to use custom system prompt instead of default
type: boolean
@@ -191,6 +231,7 @@ definitions:
description: Retrieval & strategy parameters
type: integer
prompt:
+ description: Prompt is the system prompt for normal mode
type: string
rerank_model_id:
type: string
@@ -209,13 +250,192 @@ definitions:
temperature:
description: Temperature controls the randomness of the model output
type: number
- use_custom_context_template:
+ vector_threshold:
+ type: number
+ type: object
+ github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest:
+ properties:
+ avatar:
+ description: optional avatar URL
+ maxLength: 512
+ type: string
+ description:
+ maxLength: 1000
+ type: string
+ invite_code_validity_days:
+ description: 'optional: 0=never, 1, 7, 30; default 7'
+ type: integer
+ member_limit:
+ description: 'optional: max members; 0=unlimited; default 50'
+ type: integer
+ name:
+ maxLength: 255
+ minLength: 1
+ type: string
+ required:
+ - name
+ type: object
+ github_com_Tencent_WeKnora_internal_types.CustomAgentConfig:
+ properties:
+ agent_mode:
+ description: |-
+ ===== Basic Settings =====
+ Agent mode: "quick-answer" for RAG mode, "smart-reasoning" for ReAct agent mode
+ type: string
+ allowed_tools:
+ description: Allowed tools (only for agent type)
+ items:
+ type: string
+ type: array
+ context_template:
+ description: Context template for normal mode (how to format retrieved chunks)
+ type: string
+ embedding_top_k:
+ description: |-
+ ===== Retrieval Strategy Settings (for both modes) =====
+ Embedding/Vector retrieval top K
+ type: integer
+ enable_query_expansion:
+ description: |-
+ ===== Advanced Settings (mainly for normal mode) =====
+ Whether to enable query expansion
+ type: boolean
+ enable_rewrite:
+ description: Whether to enable query rewrite for multi-turn conversations
+ type: boolean
+ fallback_prompt:
+ description: Fallback prompt (when FallbackStrategy is "model")
+ type: string
+ fallback_response:
+ description: Fixed fallback response (when FallbackStrategy is "fixed")
+ type: string
+ fallback_strategy:
+ description: 'Fallback strategy: "fixed" for fixed response, "model" for model
+ generation'
+ type: string
+ faq_direct_answer_threshold:
+ description: FAQ direct answer threshold - if similarity > this value, use
+ FAQ answer directly
+ type: number
+ faq_priority_enabled:
+ description: |-
+ ===== FAQ Strategy Settings =====
+ Whether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)
type: boolean
- use_custom_system_prompt:
- description: Prompt is the system prompt for normal mode
+ faq_score_boost:
+ description: FAQ score boost multiplier - FAQ results score multiplied by
+ this factor
+ type: number
+ history_turns:
+ description: Number of history turns to keep in context
+ type: integer
+ kb_selection_mode:
+ description: |-
+ ===== Knowledge Base Settings =====
+ Knowledge base selection mode: "all" = all KBs, "selected" = specific KBs, "none" = no KB
+ type: string
+ keyword_threshold:
+ description: Keyword retrieval threshold
+ type: number
+ knowledge_bases:
+ description: Associated knowledge base IDs (only used when KBSelectionMode
+ is "selected")
+ items:
+ type: string
+ type: array
+ max_completion_tokens:
+ description: Maximum completion tokens (only for normal mode)
+ type: integer
+ max_iterations:
+ description: |-
+ ===== Agent Mode Settings =====
+ Maximum iterations for ReAct loop (only for agent type)
+ type: integer
+ mcp_selection_mode:
+ description: 'MCP service selection mode: "all" = all enabled MCP services,
+ "selected" = specific services, "none" = no MCP'
+ type: string
+ mcp_services:
+ description: Selected MCP service IDs (only used when MCPSelectionMode is
+ "selected")
+ items:
+ type: string
+ type: array
+ model_id:
+ description: |-
+ ===== Model Settings =====
+ Model ID to use for conversations
+ type: string
+ multi_turn_enabled:
+ description: |-
+ ===== Multi-turn Conversation Settings =====
+ Whether multi-turn conversation is enabled
+ type: boolean
+ reflection_enabled:
+ description: Whether reflection is enabled (only for agent type)
+ type: boolean
+ rerank_model_id:
+ description: ReRank model ID for retrieval
+ type: string
+ rerank_threshold:
+ description: Rerank threshold
+ type: number
+ rerank_top_k:
+ description: Rerank top K
+ type: integer
+ retrieve_kb_only_when_mentioned:
+ description: |-
+ Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)
+ When true, knowledge base retrieval only happens if user explicitly mentions KB/files with @
+ When false, knowledge base retrieval happens according to KBSelectionMode
+ type: boolean
+ rewrite_prompt_system:
+ description: Rewrite prompt system message
+ type: string
+ rewrite_prompt_user:
+ description: Rewrite prompt user message template
+ type: string
+ selected_skills:
+ description: Selected skill names (only used when SkillsSelectionMode is "selected")
+ items:
+ type: string
+ type: array
+ skills_selection_mode:
+ description: |-
+ ===== Skills Settings (only for smart-reasoning mode) =====
+ Skills selection mode: "all" = all preloaded skills, "selected" = specific skills, "none" = no skills
+ type: string
+ supported_file_types:
+ description: |-
+ ===== File Type Restriction Settings =====
+ Supported file types for this agent (e.g., ["csv", "xlsx", "xls"])
+ Empty means all file types are supported
+ When set, only files with matching extensions can be used with this agent
+ items:
+ type: string
+ type: array
+ system_prompt:
+ description: System prompt for the agent (unified prompt, uses web_search_status
+ placeholder for dynamic behavior)
+ type: string
+ temperature:
+ description: Temperature for LLM (0-1)
+ type: number
+ thinking:
+ description: Whether to enable thinking mode (for models that support extended
+ thinking)
type: boolean
vector_threshold:
+ description: Vector retrieval threshold
type: number
+ web_search_enabled:
+ description: |-
+ ===== Web Search Settings =====
+ Whether web search is enabled
+ type: boolean
+ web_search_max_results:
+ description: Maximum web search results
+ type: integer
type: object
github_com_Tencent_WeKnora_internal_types.EmbeddingParameters:
properties:
@@ -245,6 +465,9 @@ definitions:
type: object
github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload:
properties:
+ dry_run:
+ description: 仅验证,不实际导入
+ type: boolean
entries:
items:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload'
@@ -256,6 +479,9 @@ definitions:
- append
- replace
type: string
+ task_id:
+ description: 可选,如果不传则自动生成UUID
+ type: string
required:
- entries
type: object
@@ -271,13 +497,18 @@ definitions:
by_id:
additionalProperties:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate'
- description: ByID 按条目ID更新,key为条目ID
+ description: ByID 按条目ID更新,key为条目ID (seq_id)
type: object
by_tag:
additionalProperties:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate'
- description: ByTag 按Tag批量更新,key为TagID(空字符串表示未分类)
+ description: ByTag 按Tag批量更新,key为TagID (seq_id)
type: object
+ exclude_ids:
+ description: ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)
+ items:
+ type: integer
+ type: array
type: object
github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate:
properties:
@@ -286,7 +517,7 @@ definitions:
is_recommended:
type: boolean
tag_id:
- type: string
+ type: integer
type: object
github_com_Tencent_WeKnora_internal_types.FAQEntryPayload:
properties:
@@ -296,6 +527,9 @@ definitions:
items:
type: string
type: array
+ id:
+ description: ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)
+ type: integer
is_enabled:
type: boolean
is_recommended:
@@ -311,7 +545,7 @@ definitions:
standard_question:
type: string
tag_id:
- type: string
+ type: integer
tag_name:
type: string
required:
@@ -336,29 +570,28 @@ definitions:
- FAQQuestionIndexModeSeparate
github_com_Tencent_WeKnora_internal_types.FAQSearchRequest:
properties:
+ first_priority_tag_ids:
+ description: 第一优先级标签ID列表,限定命中范围,优先级最高
+ items:
+ type: integer
+ type: array
match_count:
type: integer
+ only_recommended:
+ description: 是否仅返回推荐的条目
+ type: boolean
query_text:
type: string
+ second_priority_tag_ids:
+ description: 第二优先级标签ID列表,限定命中范围,优先级低于第一优先级
+ items:
+ type: integer
+ type: array
vector_threshold:
type: number
required:
- query_text
type: object
- github_com_Tencent_WeKnora_internal_types.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.GraphNode:
properties:
attributes:
@@ -387,6 +620,43 @@ definitions:
description: Model ID
type: string
type: object
+ github_com_Tencent_WeKnora_internal_types.InviteMemberRequest:
+ properties:
+ role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: 'Role to assign: admin/editor/viewer'
+ user_id:
+ description: User ID to invite
+ type: string
+ required:
+ - role
+ - user_id
+ type: object
+ github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest:
+ properties:
+ message:
+ description: Optional message for join request
+ maxLength: 500
+ type: string
+ organization_id:
+ type: string
+ role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: 'Optional: requested role (admin/editor/viewer); default viewer'
+ required:
+ - organization_id
+ type: object
+ github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest:
+ properties:
+ invite_code:
+ maxLength: 32
+ minLength: 8
+ type: string
+ required:
+ - invite_code
+ type: object
github_com_Tencent_WeKnora_internal_types.Knowledge:
properties:
created_at:
@@ -432,6 +702,11 @@ definitions:
knowledge_base_name:
description: Knowledge base name (not stored in database, populated on query)
type: string
+ last_faq_import_result:
+ description: Last FAQ import result (for FAQ type knowledge only)
+ items:
+ type: integer
+ type: array
metadata:
description: Metadata of the knowledge
items:
@@ -533,6 +808,10 @@ definitions:
- $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
summary_model_id:
description: Summary model ID
type: string
@@ -565,6 +844,75 @@ definitions:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig'
description: Image processing configuration
type: object
+ github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse:
+ properties:
+ chunk_count:
+ type: integer
+ created_at:
+ type: string
+ id:
+ type: string
+ knowledge_base_id:
+ type: string
+ knowledge_base_name:
+ type: string
+ knowledge_base_type:
+ type: string
+ knowledge_count:
+ type: integer
+ my_permission:
+ description: Effective permission for current user = min(Permission, MyRoleInOrg)
+ type: string
+ my_role_in_org:
+ description: Current user's role in this organization (admin/editor/viewer)
+ type: string
+ organization_id:
+ type: string
+ organization_name:
+ type: string
+ permission:
+ description: 'Share permission (what the space was granted: viewer/editor)'
+ type: string
+ require_approval:
+ type: boolean
+ shared_by_user_id:
+ type: string
+ shared_by_username:
+ type: string
+ source_tenant_id:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ListMembersResponse:
+ properties:
+ members:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse'
+ type: array
+ total:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse:
+ properties:
+ organizations:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse'
+ type: array
+ resource_counts:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse'
+ description: 各空间内知识库/智能体数量,供列表侧栏展示
+ total:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ListSharesResponse:
+ properties:
+ shares:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse'
+ type: array
+ total:
+ type: integer
+ type: object
github_com_Tencent_WeKnora_internal_types.LoginRequest:
properties:
email:
@@ -695,6 +1043,8 @@ definitions:
type: string
status:
type: string
+ tag_id:
+ type: string
title:
type: string
type: object
@@ -709,8 +1059,10 @@ definitions:
- 6
- 7
- 8
+ - 9
type: integer
x-enum-comments:
+ MatchTypeDataAnalysis: 数据分析匹配类型
MatchTypeDirectLoad: 直接加载匹配类型
MatchTypeParentChunk: 父Chunk匹配类型
MatchTypeRelationChunk: 关系Chunk匹配类型
@@ -725,6 +1077,7 @@ definitions:
- ""
- 网络搜索匹配类型
- 直接加载匹配类型
+ - 数据分析匹配类型
x-enum-varnames:
- MatchTypeEmbedding
- MatchTypeKeywords
@@ -735,6 +1088,7 @@ definitions:
- MatchTypeGraph
- MatchTypeWebSearch
- MatchTypeDirectLoad
+ - MatchTypeDataAnalysis
github_com_Tencent_WeKnora_internal_types.MentionedItem:
properties:
id:
@@ -807,30 +1161,82 @@ definitions:
type: string
embedding_parameters:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters'
+ extra_config:
+ additionalProperties:
+ type: string
+ description: Provider-specific configuration
+ type: object
interface_type:
type: string
parameter_size:
description: Ollama model parameter size (e.g., "7B", "13B", "70B")
type: string
+ provider:
+ description: 'Provider identifier: openai, aliyun, zhipu, generic'
+ type: string
type: object
github_com_Tencent_WeKnora_internal_types.ModelSource:
enum:
- local
- remote
- aliyun
+ - zhipu
+ - volcengine
+ - deepseek
+ - hunyuan
+ - minimax
+ - openai
+ - gemini
+ - mimo
+ - siliconflow
+ - jina
+ - openrouter
type: string
x-enum-comments:
ModelSourceAliyun: Aliyun DashScope model
+ ModelSourceDeepseek: Deepseek model
+ ModelSourceGemini: Gemini model
+ ModelSourceHunyuan: Hunyuan model
+ ModelSourceJina: Jina AI model
ModelSourceLocal: Local model
+ ModelSourceMimo: Mimo model
+ ModelSourceMinimax: Minimax mode
+ ModelSourceOpenAI: OpenAI model
+ ModelSourceOpenRouter: OpenRouter model
ModelSourceRemote: Remote model
+ ModelSourceSiliconFlow: SiliconFlow model
+ ModelSourceVolcengine: Volcengine model
+ ModelSourceZhipu: Zhipu model
x-enum-descriptions:
- Local model
- Remote model
- Aliyun DashScope model
+ - Zhipu model
+ - Volcengine model
+ - Deepseek model
+ - Hunyuan model
+ - Minimax mode
+ - OpenAI model
+ - Gemini model
+ - Mimo model
+ - SiliconFlow model
+ - Jina AI model
+ - OpenRouter model
x-enum-varnames:
- ModelSourceLocal
- ModelSourceRemote
- ModelSourceAliyun
+ - ModelSourceZhipu
+ - ModelSourceVolcengine
+ - ModelSourceDeepseek
+ - ModelSourceHunyuan
+ - ModelSourceMinimax
+ - ModelSourceOpenAI
+ - ModelSourceGemini
+ - ModelSourceMimo
+ - ModelSourceSiliconFlow
+ - ModelSourceJina
+ - ModelSourceOpenRouter
github_com_Tencent_WeKnora_internal_types.ModelType:
enum:
- Embedding
@@ -853,6 +1259,83 @@ definitions:
- ModelTypeRerank
- ModelTypeKnowledgeQA
- ModelTypeVLLM
+ github_com_Tencent_WeKnora_internal_types.OrgMemberRole:
+ enum:
+ - admin
+ - editor
+ - viewer
+ type: string
+ x-enum-varnames:
+ - OrgRoleAdmin
+ - OrgRoleEditor
+ - OrgRoleViewer
+ github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse:
+ properties:
+ avatar:
+ type: string
+ email:
+ type: string
+ id:
+ type: string
+ joined_at:
+ type: string
+ role:
+ type: string
+ tenant_id:
+ type: integer
+ user_id:
+ type: string
+ username:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.OrganizationResponse:
+ properties:
+ agent_share_count:
+ description: 共享到该组织的智能体数量
+ type: integer
+ avatar:
+ type: string
+ created_at:
+ type: string
+ description:
+ type: string
+ has_pending_upgrade:
+ description: 当前用户是否有待处理的权限升级申请
+ type: boolean
+ id:
+ type: string
+ invite_code:
+ type: string
+ invite_code_expires_at:
+ type: string
+ invite_code_validity_days:
+ type: integer
+ is_owner:
+ type: boolean
+ member_count:
+ type: integer
+ member_limit:
+ description: 0 = unlimited
+ type: integer
+ my_role:
+ type: string
+ name:
+ type: string
+ owner_id:
+ type: string
+ pending_join_request_count:
+ description: 待审批加入申请数(仅管理员可见)
+ type: integer
+ require_approval:
+ type: boolean
+ searchable:
+ type: boolean
+ share_count:
+ description: 共享到该组织的知识库数量
+ type: integer
+ updated_at:
+ type: string
+ type: object
github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig:
properties:
enabled:
@@ -889,10 +1372,40 @@ definitions:
user:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User'
type: object
- github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams:
+ github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest:
properties:
- retriever_engine_type:
- allOf:
+ message:
+ description: Optional message explaining the reason
+ maxLength: 500
+ type: string
+ requested_role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: The role user wants to upgrade to
+ required:
+ - requested_role
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse:
+ properties:
+ agents:
+ properties:
+ by_organization:
+ additionalProperties:
+ type: integer
+ type: object
+ type: object
+ knowledge_bases:
+ properties:
+ by_organization:
+ additionalProperties:
+ type: integer
+ type: object
+ type: object
+ type: object
+ github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams:
+ properties:
+ retriever_engine_type:
+ allOf:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType'
description: Retriever engine type
retriever_type:
@@ -939,6 +1452,19 @@ definitions:
- KeywordsRetrieverType
- VectorRetrieverType
- WebSearchRetrieverType
+ github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest:
+ properties:
+ approved:
+ type: boolean
+ message:
+ maxLength: 500
+ type: string
+ role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: 'Optional: role to assign when approving; overrides applicant''s
+ requested role'
+ type: object
github_com_Tencent_WeKnora_internal_types.SearchParams:
properties:
disable_keywords_match:
@@ -953,8 +1479,15 @@ definitions:
type: array
match_count:
type: integer
+ only_recommended:
+ type: boolean
query_text:
type: string
+ tag_ids:
+ description: Tag IDs for filtering (used for FAQ priority filtering)
+ items:
+ type: string
+ type: array
vector_threshold:
type: number
type: object
@@ -1003,6 +1536,11 @@ definitions:
allOf:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType'
description: Match type
+ matched_content:
+ description: |-
+ MatchedContent is the actual content that was matched in vector search
+ For FAQ: this is the matched question text (standard or similar question)
+ type: string
metadata:
additionalProperties:
type: string
@@ -1028,14 +1566,6 @@ definitions:
type: object
github_com_Tencent_WeKnora_internal_types.Session:
properties:
- agent_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SessionAgentConfig'
- description: Agent 配置(会话级别,仅存储enabled和knowledge_bases)
- context_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig'
- description: 上下文管理配置(可选)
created_at:
type: string
deleted_at:
@@ -1043,47 +1573,9 @@ definitions:
description:
description: Description
type: string
- embedding_top_k:
- description: 向量召回TopK
- type: integer
- enable_rewrite:
- description: 多轮改写开关
- type: boolean
- fallback_response:
- description: 固定回复内容
- type: string
- fallback_strategy:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy'
- description: 兜底策略
id:
description: ID
type: string
- keyword_threshold:
- description: 关键词召回阈值
- type: number
- knowledge_base_id:
- description: Strategy configuration
- type: string
- max_rounds:
- description: 多轮保持轮数
- type: integer
- rerank_model_id:
- description: 排序模型ID
- type: string
- rerank_threshold:
- description: 排序阈值
- type: number
- rerank_top_k:
- description: 排序TopK
- type: integer
- summary_model_id:
- description: 总结模型ID
- type: string
- summary_parameters:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig'
- description: 总结模型参数
tenant_id:
description: Tenant ID
type: integer
@@ -1092,28 +1584,16 @@ definitions:
type: string
updated_at:
type: string
- vector_threshold:
- description: 向量召回阈值
- type: number
type: object
- github_com_Tencent_WeKnora_internal_types.SessionAgentConfig:
+ github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest:
properties:
- agent_mode_enabled:
- description: Whether agent mode is enabled for this session
- type: boolean
- knowledge_bases:
- description: Accessible knowledge base IDs for this session
- items:
- type: string
- type: array
- knowledge_ids:
- description: Accessible knowledge IDs (individual documents) for this session
- items:
- type: string
- type: array
- web_search_enabled:
- description: Whether web search is enabled for this session
- type: boolean
+ organization_id:
+ type: string
+ permission:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ required:
+ - organization_id
+ - permission
type: object
github_com_Tencent_WeKnora_internal_types.StorageConfig:
properties:
@@ -1139,51 +1619,31 @@ definitions:
description: Secret Key
type: string
type: object
- github_com_Tencent_WeKnora_internal_types.SummaryConfig:
+ github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest:
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
+ invite_code:
+ maxLength: 32
+ minLength: 8
type: string
- presence_penalty:
- description: Presence penalty
- type: number
- prompt:
- description: Prompt
+ message:
+ maxLength: 500
type: string
- repeat_penalty:
- description: Repeat penalty
- type: number
- seed:
- description: Seed
- type: integer
- temperature:
- description: Temperature
- type: number
- top_k:
- description: TopK
- type: integer
- top_p:
- description: TopP
- type: number
+ role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: 'Optional: role the applicant requests (admin/editor/viewer);
+ default viewer'
+ required:
+ - invite_code
type: object
github_com_Tencent_WeKnora_internal_types.Tenant:
properties:
agent_config:
allOf:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig'
- description: Global Agent configuration for this tenant (default for all sessions)
+ description: |-
+ Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.
+ This field is kept for backward compatibility and will be removed in future versions.
api_key:
description: API key
type: string
@@ -1198,8 +1658,9 @@ definitions:
conversation_config:
allOf:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig'
- description: Global Conversation configuration for this tenant (default for
- normal mode sessions)
+ description: |-
+ Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.
+ This field is kept for backward compatibility and will be removed in future versions.
created_at:
description: Creation time
type: string
@@ -1277,6 +1738,45 @@ definitions:
description: Whether the tool executed successfully
type: boolean
type: object
+ github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest:
+ properties:
+ role:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ required:
+ - role
+ type: object
+ github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest:
+ properties:
+ avatar:
+ description: optional avatar URL
+ maxLength: 512
+ type: string
+ description:
+ maxLength: 1000
+ type: string
+ invite_code_validity_days:
+ description: 0=never, 1, 7, 30
+ type: integer
+ member_limit:
+ description: max members; 0=unlimited
+ type: integer
+ name:
+ maxLength: 255
+ minLength: 1
+ type: string
+ require_approval:
+ type: boolean
+ searchable:
+ description: open for search so others can discover and join
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest:
+ properties:
+ permission:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ required:
+ - permission
+ type: object
github_com_Tencent_WeKnora_internal_types.User:
properties:
avatar:
@@ -1385,9 +1885,24 @@ definitions:
type: string
target_id:
type: string
+ task_id:
+ type: string
required:
- source_id
type: object
+ internal_handler.CreateAgentRequest:
+ properties:
+ avatar:
+ type: string
+ config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig'
+ description:
+ type: string
+ name:
+ type: string
+ required:
+ - name
+ type: object
internal_handler.CreateModelRequest:
properties:
description:
@@ -1406,6 +1921,14 @@ definitions:
- source
- type
type: object
+ internal_handler.DeleteTagRequest:
+ properties:
+ exclude_ids:
+ description: Chunk seq_ids to exclude from deletion
+ items:
+ type: integer
+ type: array
+ type: object
internal_handler.EvaluationRequest:
properties:
chat_id:
@@ -1545,6 +2068,23 @@ definitions:
source:
type: string
type: object
+ internal_handler.ListMinioBucketsResponse:
+ properties:
+ buckets:
+ items:
+ $ref: '#/definitions/internal_handler.MinioBucketInfo'
+ type: array
+ type: object
+ internal_handler.MinioBucketInfo:
+ properties:
+ created_at:
+ type: string
+ name:
+ type: string
+ policy:
+ description: '"public", "private", "custom"'
+ type: string
+ type: object
internal_handler.RemoteModelCheckRequest:
properties:
apiKey:
@@ -1571,6 +2111,17 @@ definitions:
- tags
- text
type: object
+ internal_handler.UpdateAgentRequest:
+ properties:
+ avatar:
+ type: string
+ config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig'
+ description:
+ type: string
+ name:
+ type: string
+ type: object
internal_handler.UpdateChunkRequest:
properties:
chunk_index:
@@ -1615,11 +2166,41 @@ definitions:
type:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
type: object
+ internal_handler.addSimilarQuestionsRequest:
+ properties:
+ similar_questions:
+ items:
+ type: string
+ minItems: 1
+ type: array
+ required:
+ - similar_questions
+ type: object
+ internal_handler.updateLastFAQImportResultDisplayStatusRequest:
+ properties:
+ display_status:
+ enum:
+ - open
+ - close
+ type: string
+ required:
+ - display_status
+ type: object
internal_handler_session.CreateKnowledgeQARequest:
properties:
agent_enabled:
description: Whether agent mode is enabled for this request
type: boolean
+ agent_id:
+ description: Selected custom agent ID (backend resolves shared agent and its
+ tenant from share relation)
+ type: string
+ disable_title:
+ description: Whether to disable auto title generation
+ type: boolean
+ enable_memory:
+ description: Whether memory feature is enabled for this request
+ type: boolean
knowledge_base_ids:
description: Selected knowledge base ID for this request
items:
@@ -1650,19 +2231,12 @@ definitions:
type: object
internal_handler_session.CreateSessionRequest:
properties:
- agent_config:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SessionAgentConfig'
- description: 'Agent configuration (optional, session-level config only: enabled
- and knowledge_bases)'
- knowledge_base_id:
- description: ID of the associated knowledge base (optional, can be set/changed
- during queries)
+ description:
+ description: Description for the session (optional)
+ type: string
+ title:
+ description: Title for the session (optional)
type: string
- session_strategy:
- allOf:
- - $ref: '#/definitions/internal_handler_session.SessionStrategy'
- description: Session strategy configuration
type: object
internal_handler_session.GenerateTitleRequest:
properties:
@@ -1708,50 +2282,6 @@ definitions:
required:
- query
type: object
- internal_handler_session.SessionStrategy:
- properties:
- embedding_top_k:
- description: Number of top results to retrieve from vector search
- type: integer
- enable_rewrite:
- description: Whether to enable query rewrite for multi-round conversations
- type: boolean
- fallback_response:
- description: Fixed response content for fallback
- type: string
- fallback_strategy:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FallbackStrategy'
- description: Strategy to use when no relevant knowledge is found
- keyword_threshold:
- description: Threshold for keyword-based retrieval
- type: number
- max_rounds:
- description: Maximum number of conversation rounds to maintain
- type: integer
- no_match_prefix:
- description: Prefix for responses when no match is found
- type: string
- rerank_model_id:
- description: ID of the model used for reranking results
- type: string
- rerank_threshold:
- description: Threshold for reranking results
- type: number
- rerank_top_k:
- description: Number of top results after reranking
- type: integer
- summary_model_id:
- description: ID of the model used for summarization
- type: string
- summary_parameters:
- allOf:
- - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SummaryConfig'
- description: Parameters for the summary model
- vector_threshold:
- description: Threshold for vector-based retrieval
- type: number
- type: object
internal_handler_session.StopSessionRequest:
properties:
message_id:
@@ -1759,6 +2289,16 @@ definitions:
required:
- message_id
type: object
+ internal_handler_session.batchDeleteRequest:
+ properties:
+ ids:
+ items:
+ type: string
+ minItems: 1
+ type: array
+ required:
+ - ids
+ type: object
info:
contact:
name: WeKnora Github
@@ -1768,73 +2308,284 @@ info:
title: WeKnora API
version: "1.0"
paths:
- /auth/change-password:
- post:
+ /agents:
+ get:
consumes:
- application/json
- description: 修改当前用户的登录密码
- parameters:
- - description: 密码修改请求
- in: body
- name: request
- required: true
- schema:
- properties:
- new_password:
- type: string
- old_password:
- type: string
- type: object
+ description: 获取当前租户的所有智能体(包括内置智能体)
produces:
- application/json
responses:
"200":
- description: 修改成功
+ description: 智能体列表
schema:
additionalProperties: true
type: object
- "400":
- description: 请求参数错误
+ "500":
+ description: 服务器错误
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- summary: 修改密码
+ - ApiKeyAuth: []
+ summary: 获取智能体列表
tags:
- - 认证
- /auth/login:
+ - 智能体
post:
consumes:
- application/json
- description: 用户登录并获取访问令牌
+ description: 创建新的自定义智能体
parameters:
- - description: 登录请求参数
+ - description: 智能体信息
in: body
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest'
+ $ref: '#/definitions/internal_handler.CreateAgentRequest'
produces:
- application/json
responses:
- "200":
- description: OK
+ "201":
+ description: 创建的智能体
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse'
- "401":
- description: 认证失败
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
- summary: 用户登录
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 创建智能体
tags:
- - 认证
- /auth/logout:
- post:
+ - 智能体
+ /agents/{id}:
+ delete:
consumes:
- application/json
- description: 撤销当前访问令牌并登出
- produces:
- - application/json
+ description: 删除指定的智能体
+ parameters:
+ - description: 智能体ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 删除成功
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "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: []
+ summary: 删除智能体
+ tags:
+ - 智能体
+ get:
+ consumes:
+ - application/json
+ description: 根据ID获取智能体详情
+ parameters:
+ - description: 智能体ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 智能体详情
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 智能体不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取智能体详情
+ tags:
+ - 智能体
+ put:
+ consumes:
+ - application/json
+ description: 更新智能体的名称、描述和配置
+ parameters:
+ - description: 智能体ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 更新请求
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.UpdateAgentRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 更新后的智能体
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ description: 无法修改内置智能体
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 更新智能体
+ tags:
+ - 智能体
+ /agents/{id}/copy:
+ post:
+ consumes:
+ - application/json
+ description: 复制指定的智能体
+ parameters:
+ - description: 智能体ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "201":
+ description: 复制成功
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 智能体不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 复制智能体
+ tags:
+ - 智能体
+ /agents/placeholders:
+ get:
+ consumes:
+ - application/json
+ description: 获取所有可用的提示词占位符定义,按字段类型分组
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 占位符定义
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取占位符定义
+ tags:
+ - 智能体
+ /auth/change-password:
+ post:
+ consumes:
+ - application/json
+ description: 修改当前用户的登录密码
+ parameters:
+ - description: 密码修改请求
+ in: body
+ name: request
+ required: true
+ schema:
+ properties:
+ new_password:
+ type: string
+ old_password:
+ type: string
+ type: object
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 修改成功
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 修改密码
+ tags:
+ - 认证
+ /auth/login:
+ post:
+ consumes:
+ - application/json
+ description: 用户登录并获取访问令牌
+ parameters:
+ - description: 登录请求参数
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse'
+ "401":
+ description: 认证失败
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ summary: 用户登录
+ tags:
+ - 认证
+ /auth/logout:
+ post:
+ consumes:
+ - application/json
+ description: 撤销当前访问令牌并登出
+ produces:
+ - application/json
responses:
"200":
description: 登出成功
@@ -2106,7 +2857,7 @@ paths:
get:
consumes:
- application/json
- description: 仅通过分块ID获取分块详情(不需要knowledge_id)
+ description: 仅通过分块ID获取分块详情(不需要knowledge_id);支持共享知识库下的分块访问
parameters:
- description: 分块ID
in: path
@@ -2743,7 +3494,12 @@ paths:
get:
consumes:
- application/json
- description: 获取当前租户的所有知识库
+ description: 获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)
+ parameters:
+ - description: 共享智能体 ID(传入时返回该智能体可用的知识库)
+ in: query
+ name: agent_id
+ type: string
produces:
- application/json
responses:
@@ -2823,13 +3579,17 @@ paths:
get:
consumes:
- application/json
- description: 根据ID获取知识库详情
+ description: 根据ID获取知识库详情。当使用共享智能体时,可传 agent_id 以校验该智能体是否有权访问该知识库。
parameters:
- description: 知识库ID
in: path
name: id
required: true
type: string
+ - description: 共享智能体 ID(用于校验智能体是否有权访问该知识库)
+ in: query
+ name: agent_id
+ type: string
produces:
- application/json
responses:
@@ -2897,7 +3657,7 @@ paths:
name: id
required: true
type: string
- - description: 要删除的FAQ ID列表
+ - description: 要删除的FAQ ID列表(seq_id)
in: body
name: request
required: true
@@ -2905,7 +3665,7 @@ paths:
properties:
ids:
items:
- type: string
+ type: integer
type: array
type: object
produces:
@@ -2944,10 +3704,10 @@ paths:
in: query
name: page_size
type: integer
- - description: 标签ID筛选
+ - description: 标签ID筛选(seq_id)
in: query
name: tag_id
- type: string
+ type: integer
- description: 关键词搜索
in: query
name: keyword
@@ -2982,7 +3742,10 @@ paths:
post:
consumes:
- application/json
- description: 异步批量更新或插入FAQ条目
+ description: |-
+ 异步批量更新或插入FAQ条目。支持 dry_run 模式(设置 dry_run=true),异步验证不实际导入。
+ dry_run 模式是异步操作,返回 task_id,通过 /faq/import/progress/{task_id} 查询进度和结果。
+ 验证内容包括:1) 条目基本格式 2) 重复问题(批次内和知识库已有) 3) 内容安全检查。
parameters:
- description: 知识库ID
in: path
@@ -3024,11 +3787,11 @@ paths:
name: id
required: true
type: string
- - description: FAQ条目ID
+ - description: FAQ条目ID(seq_id)
in: path
name: entry_id
required: true
- type: string
+ type: integer
produces:
- application/json
responses:
@@ -3061,11 +3824,11 @@ paths:
name: id
required: true
type: string
- - description: FAQ条目ID
+ - description: FAQ条目ID(seq_id)
in: path
name: entry_id
required: true
- type: string
+ type: integer
- description: FAQ条目
in: body
name: request
@@ -3090,6 +3853,50 @@ paths:
summary: 更新FAQ条目
tags:
- FAQ管理
+ /knowledge-bases/{id}/faq/entries/{entry_id}/similar-questions:
+ post:
+ consumes:
+ - application/json
+ description: 向指定的FAQ条目添加相似问题
+ parameters:
+ - description: 知识库ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: FAQ条目ID(seq_id)
+ in: path
+ name: entry_id
+ required: true
+ type: integer
+ - description: 相似问列表
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.addSimilarQuestionsRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 更新后的FAQ条目
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 条目不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 添加相似问
+ tags:
+ - FAQ管理
/knowledge-bases/{id}/faq/entries/export:
get:
consumes:
@@ -3223,28 +4030,28 @@ paths:
summary: 创建单个FAQ条目
tags:
- FAQ管理
- /knowledge-bases/{id}/faq/search:
- post:
+ /knowledge-bases/{id}/faq/import/last-result/display:
+ put:
consumes:
- application/json
- description: 使用混合搜索在FAQ中搜索
+ description: 更新FAQ知识库导入结果统计卡片的显示或隐藏状态
parameters:
- description: 知识库ID
in: path
name: id
required: true
type: string
- - description: 搜索请求
+ - description: 状态更新请求
in: body
name: request
required: true
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest'
+ $ref: '#/definitions/internal_handler.updateLastFAQImportResultDisplayStatusRequest'
produces:
- application/json
responses:
"200":
- description: 搜索结果
+ description: 更新成功
schema:
additionalProperties: true
type: object
@@ -3252,14 +4059,53 @@ 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: []
- summary: 搜索FAQ
+ summary: 更新FAQ最后一次导入结果显示状态
tags:
- FAQ管理
- /knowledge-bases/{id}/hybrid-search:
- get:
+ /knowledge-bases/{id}/faq/search:
+ post:
+ consumes:
+ - application/json
+ description: 使用混合搜索在FAQ中搜索,支持两级优先级标签召回:first_priority_tag_ids优先级最高,second_priority_tag_ids次之
+ parameters:
+ - description: 知识库ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 搜索请求
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 搜索结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 搜索FAQ
+ tags:
+ - FAQ管理
+ /knowledge-bases/{id}/hybrid-search:
+ get:
consumes:
- application/json
description: 在知识库中执行向量和关键词混合搜索
@@ -3432,7 +4278,7 @@ paths:
post:
consumes:
- application/json
- description: 从指定URL抓取内容并创建知识条目
+ description: 从指定URL抓取内容并创建知识条目。当提供 file_name/file_type 或 URL 路径含已知文件扩展名时,自动切换为文件下载模式
parameters:
- description: 知识库ID
in: path
@@ -3447,6 +4293,12 @@ paths:
properties:
enable_multimodel:
type: boolean
+ file_name:
+ type: string
+ file_type:
+ type: string
+ tag_id:
+ type: string
title:
type: string
url:
@@ -3475,6 +4327,127 @@ paths:
summary: 从URL创建知识
tags:
- 知识管理
+ /knowledge-bases/{id}/shares:
+ get:
+ description: 获取知识库的所有共享记录
+ parameters:
+ - description: 知识库ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse'
+ security:
+ - Bearer: []
+ summary: 获取知识库的共享列表
+ tags:
+ - 知识库共享
+ post:
+ consumes:
+ - application/json
+ description: 将知识库共享到指定组织
+ parameters:
+ - description: 知识库ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 共享信息
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest'
+ produces:
+ - application/json
+ responses:
+ "201":
+ description: Created
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 共享知识库到组织
+ tags:
+ - 知识库共享
+ /knowledge-bases/{id}/shares/{share_id}:
+ delete:
+ description: 取消知识库的共享
+ parameters:
+ - description: 知识库ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 共享记录ID
+ in: path
+ name: share_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 取消共享
+ tags:
+ - 知识库共享
+ put:
+ consumes:
+ - application/json
+ description: 更新知识库共享的权限级别
+ parameters:
+ - description: 知识库ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 共享记录ID
+ in: path
+ name: share_id
+ required: true
+ type: string
+ - description: 权限信息
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 更新共享权限
+ tags:
+ - 知识库共享
/knowledge-bases/{id}/tags:
get:
consumes:
@@ -3568,7 +4541,7 @@ paths:
name: id
required: true
type: string
- - description: 标签ID
+ - description: 标签ID (UUID或seq_id)
in: path
name: tag_id
required: true
@@ -3581,6 +4554,11 @@ paths:
in: query
name: content_only
type: boolean
+ - description: 删除选项
+ in: body
+ name: body
+ schema:
+ $ref: '#/definitions/internal_handler.DeleteTagRequest'
produces:
- application/json
responses:
@@ -3609,7 +4587,7 @@ paths:
name: id
required: true
type: string
- - description: 标签ID
+ - description: 标签ID (UUID或seq_id)
in: path
name: tag_id
required: true
@@ -3820,11 +4798,44 @@ paths:
summary: 下载知识文件
tags:
- 知识管理
+ /knowledge/{id}/reparse:
+ post:
+ consumes:
+ - application/json
+ description: 删除知识中现有的文档内容并重新解析,使用异步任务方式处理
+ parameters:
+ - description: 知识ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 重新解析任务已提交
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ description: 权限不足
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 重新解析知识
+ tags:
+ - 知识管理
/knowledge/batch:
get:
consumes:
- application/json
- description: 根据ID列表批量获取知识条目
+ description: 根据ID列表批量获取知识条目。可选 kb_id:指定时按该知识库校验权限并用于共享知识库的租户解析;可选 agent_id:使用共享智能体时传此参数,后端按智能体所属租户查询(用于刷新后恢复共享知识库下的文件)
parameters:
- collectionFormat: csv
description: 知识ID列表
@@ -3834,6 +4845,14 @@ paths:
name: ids
required: true
type: array
+ - description: 可选,知识库ID(用于共享知识库时指定范围)
+ in: query
+ name: kb_id
+ type: string
+ - description: 可选,共享智能体ID(用于按智能体租户批量拉取文件详情)
+ in: query
+ name: agent_id
+ type: string
produces:
- application/json
responses:
@@ -3934,7 +4953,8 @@ paths:
get:
consumes:
- application/json
- description: Search knowledge files by keyword across all knowledge bases
+ description: Search knowledge files by keyword. When agent_id is set (shared
+ agent), scope is the agent's configured knowledge bases.
parameters:
- description: Keyword to search
in: query
@@ -3948,6 +4968,14 @@ paths:
in: query
name: limit
type: integer
+ - description: Comma-separated file extensions to filter (e.g., csv,xlsx)
+ in: query
+ name: file_types
+ type: string
+ - description: Shared agent ID (search within agent's KB scope)
+ in: query
+ name: agent_id
+ type: string
produces:
- application/json
responses:
@@ -3970,9 +4998,9 @@ paths:
put:
consumes:
- application/json
- description: 批量更新知识条目的标签
+ description: 批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析
parameters:
- - description: 标签更新请求
+ - description: 标签更新请求(updates 必填,kb_id 可选)
in: body
name: request
required: true
@@ -4183,27 +5211,729 @@ paths:
- application/json
responses:
"200":
- description: 测试结果
+ description: 测试结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 测试MCP服务连接
+ tags:
+ - MCP服务
+ /mcp-services/{id}/tools:
+ get:
+ consumes:
+ - application/json
+ description: 获取MCP服务提供的工具列表
+ parameters:
+ - description: MCP服务ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 工具列表
+ schema:
+ additionalProperties: true
+ type: object
+ "500":
+ description: 服务器错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取MCP服务工具列表
+ tags:
+ - MCP服务
+ /messages/{session_id}/{id}:
+ delete:
+ consumes:
+ - application/json
+ description: 从会话中删除指定消息
+ parameters:
+ - description: 会话ID
+ in: path
+ name: session_id
+ required: true
+ type: string
+ - description: 消息ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 删除成功
+ schema:
+ additionalProperties: true
+ type: object
+ "500":
+ description: 服务器错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 删除消息
+ tags:
+ - 消息
+ /messages/{session_id}/load:
+ get:
+ consumes:
+ - application/json
+ description: 加载会话的消息历史,支持分页和时间筛选
+ parameters:
+ - description: 会话ID
+ in: path
+ name: session_id
+ required: true
+ type: string
+ - default: 20
+ description: 返回数量
+ in: query
+ name: limit
+ type: integer
+ - description: 在此时间之前的消息(RFC3339Nano格式)
+ in: query
+ name: before_time
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 消息列表
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 加载消息历史
+ tags:
+ - 消息
+ /models:
+ get:
+ consumes:
+ - application/json
+ description: 获取当前租户的所有模型
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 模型列表
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取模型列表
+ tags:
+ - 模型管理
+ post:
+ consumes:
+ - application/json
+ description: 创建新的模型配置
+ parameters:
+ - description: 模型信息
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.CreateModelRequest'
+ produces:
+ - application/json
+ responses:
+ "201":
+ description: 创建的模型
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 创建模型
+ tags:
+ - 模型管理
+ /models/{id}:
+ delete:
+ consumes:
+ - application/json
+ description: 删除指定的模型
+ parameters:
+ - description: 模型ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 删除成功
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: 模型不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 删除模型
+ tags:
+ - 模型管理
+ get:
+ consumes:
+ - application/json
+ description: 根据ID获取模型详情
+ parameters:
+ - description: 模型ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 模型详情
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: 模型不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取模型详情
+ tags:
+ - 模型管理
+ put:
+ consumes:
+ - application/json
+ description: 更新模型配置信息
+ parameters:
+ - description: 模型ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 更新信息
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.UpdateModelRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 更新后的模型
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: 模型不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 更新模型
+ tags:
+ - 模型管理
+ /models/providers:
+ get:
+ consumes:
+ - application/json
+ description: 根据模型类型获取支持的厂商列表及配置信息
+ parameters:
+ - description: 模型类型 (chat, embedding, rerank, vllm)
+ in: query
+ name: model_type
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 厂商列表
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取模型厂商列表
+ tags:
+ - 模型管理
+ /organizations:
+ get:
+ description: 获取当前用户所属的所有组织,并附带各空间内知识库/智能体数量
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse'
+ security:
+ - Bearer: []
+ summary: 获取我的组织列表
+ tags:
+ - 组织管理
+ post:
+ consumes:
+ - application/json
+ description: 创建新的组织,创建者自动成为管理员
+ parameters:
+ - description: 组织信息
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest'
+ produces:
+ - application/json
+ responses:
+ "201":
+ description: Created
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: Bad Request
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 创建组织
+ tags:
+ - 组织管理
+ /organizations/{id}:
+ delete:
+ description: 删除组织(仅组织创建者可操作)
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 删除组织
+ tags:
+ - 组织管理
+ get:
+ description: 根据ID获取组织详情
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "404":
+ description: Not Found
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 获取组织详情
+ tags:
+ - 组织管理
+ put:
+ consumes:
+ - application/json
+ description: 更新组织信息(需要管理员权限)
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 更新信息
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 更新组织
+ tags:
+ - 组织管理
+ /organizations/{id}/invite:
+ post:
+ consumes:
+ - application/json
+ description: 管理员直接添加用户为组织成员
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 邀请信息
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.InviteMemberRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: Bad Request
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 邀请成员
+ tags:
+ - 组织管理
+ /organizations/{id}/invite-code:
+ post:
+ description: 生成新的组织邀请码(需要管理员权限)
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 生成邀请码
+ tags:
+ - 组织管理
+ /organizations/{id}/join-requests:
+ get:
+ description: 获取组织的待审核加入申请(仅管理员)
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 获取待审核加入申请列表
+ tags:
+ - 组织管理
+ /organizations/{id}/join-requests/{request_id}/review:
+ put:
+ consumes:
+ - application/json
+ description: 通过或拒绝加入申请(仅管理员)
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 申请ID
+ in: path
+ name: request_id
+ required: true
+ type: string
+ - description: 审核结果
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 审核加入申请
+ tags:
+ - 组织管理
+ /organizations/{id}/leave:
+ post:
+ description: 退出指定组织
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 退出组织
+ tags:
+ - 组织管理
+ /organizations/{id}/members:
+ get:
+ description: 获取组织的所有成员
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListMembersResponse'
+ security:
+ - Bearer: []
+ summary: 获取组织成员列表
+ tags:
+ - 组织管理
+ /organizations/{id}/members/{user_id}:
+ delete:
+ description: 从组织中移除成员(需要管理员权限)
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 用户ID
+ in: path
+ name: user_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 移除成员
+ tags:
+ - 组织管理
+ put:
+ consumes:
+ - application/json
+ description: 更新组织成员的角色(需要管理员权限)
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 用户ID
+ in: path
+ name: user_id
+ required: true
+ type: string
+ - description: 角色信息
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "403":
+ description: Forbidden
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 更新成员角色
+ tags:
+ - 组织管理
+ /organizations/{id}/request-upgrade:
+ post:
+ consumes:
+ - application/json
+ description: 现有成员申请更高权限
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 申请信息
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: Bad Request
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: 申请权限升级
+ tags:
+ - 组织管理
+ /organizations/{id}/search-users:
+ get:
+ description: 搜索用户(排除已有成员)用于邀请加入组织
+ parameters:
+ - description: 组织ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 搜索关键词(用户名或邮箱)
+ in: query
+ name: q
+ required: true
+ type: string
+ - default: 10
+ description: 返回数量限制
+ in: query
+ name: limit
+ type: integer
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
schema:
additionalProperties: true
type: object
- "400":
- description: 请求参数错误
+ "403":
+ description: Forbidden
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- - ApiKeyAuth: []
- summary: 测试MCP服务连接
+ summary: 搜索可邀请的用户
tags:
- - MCP服务
- /mcp-services/{id}/tools:
+ - 组织管理
+ /organizations/{id}/shared-agents:
get:
- consumes:
- - application/json
- description: 获取MCP服务提供的工具列表
+ description: 获取指定空间下所有共享智能体,包含他人共享的与我共享的,用于列表页空间视角
parameters:
- - description: MCP服务ID
+ - description: 组织ID
in: path
name: id
required: true
@@ -4212,32 +5942,20 @@ paths:
- application/json
responses:
"200":
- description: 工具列表
+ description: OK
schema:
additionalProperties: true
type: object
- "500":
- description: 服务器错误
- schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- - ApiKeyAuth: []
- summary: 获取MCP服务工具列表
+ summary: 获取空间内全部智能体(含我共享的)
tags:
- - MCP服务
- /messages/{session_id}/{id}:
- delete:
- consumes:
- - application/json
- description: 从会话中删除指定消息
+ - 组织管理
+ /organizations/{id}/shared-knowledge-bases:
+ get:
+ description: 获取指定空间下所有共享知识库,包含直接共享的与通过共享智能体可见的,用于列表页空间视角
parameters:
- - description: 会话ID
- in: path
- name: session_id
- required: true
- type: string
- - description: 消息ID
+ - description: 组织ID
in: path
name: id
required: true
@@ -4246,201 +5964,175 @@ paths:
- application/json
responses:
"200":
- description: 删除成功
+ description: OK
schema:
additionalProperties: true
type: object
- "500":
- description: 服务器错误
- schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- - ApiKeyAuth: []
- summary: 删除消息
+ summary: 获取空间内全部知识库(含我共享的、含智能体携带的)
tags:
- - 消息
- /messages/{session_id}/load:
+ - 组织管理
+ /organizations/{id}/shares:
get:
- consumes:
- - application/json
- description: 加载会话的消息历史,支持分页和时间筛选
+ description: 获取共享到指定组织的所有知识库
parameters:
- - description: 会话ID
+ - description: 组织ID
in: path
- name: session_id
+ name: id
required: true
type: string
- - default: 20
- description: 返回数量
- in: query
- name: limit
- type: integer
- - description: 在此时间之前的消息(RFC3339Nano格式)
- in: query
- name: before_time
- type: string
produces:
- application/json
responses:
"200":
- description: 消息列表
- schema:
- additionalProperties: true
- type: object
- "400":
- description: 请求参数错误
+ description: OK
schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse'
security:
- Bearer: []
- - ApiKeyAuth: []
- summary: 加载消息历史
+ summary: 获取组织的共享知识库列表
tags:
- - 消息
- /models:
- get:
+ - 组织管理
+ /organizations/join:
+ post:
consumes:
- application/json
- description: 获取当前租户的所有模型
+ description: 使用邀请码加入组织
+ parameters:
+ - description: 邀请码
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest'
produces:
- application/json
responses:
"200":
- description: 模型列表
+ description: OK
schema:
additionalProperties: true
type: object
- "400":
- description: 请求参数错误
+ "404":
+ description: Not Found
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- - ApiKeyAuth: []
- summary: 获取模型列表
+ summary: 通过邀请码加入组织
tags:
- - 模型管理
+ - 组织管理
+ /organizations/join-by-id:
post:
consumes:
- application/json
- description: 创建新的模型配置
+ description: 加入已开放可被搜索的空间,无需邀请码
parameters:
- - description: 模型信息
+ - description: 空间 ID
in: body
name: request
required: true
schema:
- $ref: '#/definitions/internal_handler.CreateModelRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest'
produces:
- application/json
responses:
- "201":
- description: 创建的模型
+ "200":
+ description: OK
schema:
additionalProperties: true
type: object
- "400":
- description: 请求参数错误
+ "403":
+ description: Forbidden
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- - ApiKeyAuth: []
- summary: 创建模型
+ summary: 通过空间 ID 加入(可搜索空间)
tags:
- - 模型管理
- /models/{id}:
- delete:
+ - 组织管理
+ /organizations/join-request:
+ post:
consumes:
- application/json
- description: 删除指定的模型
+ description: 对需要审核的组织提交加入申请
parameters:
- - description: 模型ID
- in: path
- name: id
+ - description: 申请信息
+ in: body
+ name: request
required: true
- type: string
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest'
produces:
- application/json
responses:
"200":
- description: 删除成功
+ description: OK
schema:
additionalProperties: true
type: object
- "404":
- description: 模型不存在
+ "400":
+ description: Bad Request
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- - ApiKeyAuth: []
- summary: 删除模型
+ summary: 提交加入申请
tags:
- - 模型管理
+ - 组织管理
+ /organizations/preview/{code}:
get:
- consumes:
- - application/json
- description: 根据ID获取模型详情
+ description: 通过邀请码获取组织基本信息(不加入)
parameters:
- - description: 模型ID
+ - description: 邀请码
in: path
- name: id
+ name: code
required: true
type: string
produces:
- application/json
responses:
"200":
- description: 模型详情
+ description: OK
schema:
additionalProperties: true
type: object
"404":
- description: 模型不存在
+ description: Not Found
schema:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- - ApiKeyAuth: []
- summary: 获取模型详情
+ summary: 通过邀请码预览组织
tags:
- - 模型管理
- put:
- consumes:
- - application/json
- description: 更新模型配置信息
+ - 组织管理
+ /organizations/search:
+ get:
+ description: 搜索已开放可被搜索的空间,用于发现并加入
parameters:
- - description: 模型ID
- in: path
- name: id
- required: true
+ - description: 搜索关键词(空间名称或描述)
+ in: query
+ name: q
type: string
- - description: 更新信息
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/internal_handler.UpdateModelRequest'
+ - default: 20
+ description: 返回数量限制
+ in: query
+ name: limit
+ type: integer
produces:
- application/json
responses:
"200":
- description: 更新后的模型
+ description: OK
schema:
additionalProperties: true
type: object
- "404":
- description: 模型不存在
- schema:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- - ApiKeyAuth: []
- summary: 更新模型
+ summary: 搜索可加入的空间
tags:
- - 模型管理
+ - 组织管理
/sessions:
get:
consumes:
@@ -4767,6 +6459,36 @@ paths:
summary: 生成会话标题
tags:
- 会话
+ /sessions/batch:
+ delete:
+ consumes:
+ - application/json
+ description: 根据ID列表批量删除对话会话
+ parameters:
+ - description: 批量删除请求
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler_session.batchDeleteRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 删除结果
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 批量删除会话
+ tags:
+ - 会话
/sessions/search:
post:
consumes:
@@ -4797,6 +6519,45 @@ paths:
summary: 知识搜索
tags:
- 问答
+ /shared-knowledge-bases:
+ get:
+ description: 获取通过组织共享给当前用户的所有知识库
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ summary: 获取共享给我的知识库列表
+ tags:
+ - 知识库共享
+ /skills:
+ get:
+ consumes:
+ - application/json
+ description: 获取所有预装的Agent Skills元数据
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: Skills列表
+ schema:
+ additionalProperties: true
+ type: object
+ "500":
+ description: 服务器错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取预装Skills列表
+ tags:
+ - Skills
/system/info:
get:
consumes:
@@ -4812,6 +6573,31 @@ paths:
summary: 获取系统信息
tags:
- 系统
+ /system/minio/buckets:
+ get:
+ consumes:
+ - application/json
+ description: 获取所有 MinIO 存储桶及其访问权限
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 存储桶列表
+ schema:
+ $ref: '#/definitions/internal_handler.ListMinioBucketsResponse'
+ "400":
+ description: MinIO 未启用
+ schema:
+ additionalProperties: true
+ type: object
+ "500":
+ description: 服务器错误
+ schema:
+ additionalProperties: true
+ type: object
+ summary: 列出 MinIO 存储桶
+ tags:
+ - 系统
/tenants:
get:
consumes:
@@ -5086,6 +6872,29 @@ paths:
summary: 获取租户对话配置
tags:
- 租户管理
+ /tenants/kv/prompt-templates:
+ get:
+ consumes:
+ - application/json
+ description: 获取系统配置的提示词模板列表
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 提示词模板配置
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取提示词模板
+ tags:
+ - 租户管理
/tenants/kv/web-search-config:
get:
consumes:
diff --git a/internal/handler/organization.go b/internal/handler/organization.go
index 5e9c07a0d..8d24d1e5a 100644
--- a/internal/handler/organization.go
+++ b/internal/handler/organization.go
@@ -59,7 +59,7 @@ func NewOrganizationHandler(
// @Produce json
// @Param request body types.CreateOrganizationRequest true "组织信息"
// @Success 201 {object} map[string]interface{}
-// @Failure 400 {object} errors.AppError
+// @Failure 400 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations [post]
func (h *OrganizationHandler) CreateOrganization(c *gin.Context) {
@@ -100,7 +100,7 @@ func (h *OrganizationHandler) CreateOrganization(c *gin.Context) {
// @Produce json
// @Param id path string true "组织ID"
// @Success 200 {object} map[string]interface{}
-// @Failure 404 {object} errors.AppError
+// @Failure 404 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id} [get]
func (h *OrganizationHandler) GetOrganization(c *gin.Context) {
@@ -278,7 +278,7 @@ func (h *OrganizationHandler) buildResourceCountsByOrg(ctx context.Context, orgs
// @Param id path string true "组织ID"
// @Param request body types.UpdateOrganizationRequest true "更新信息"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id} [put]
func (h *OrganizationHandler) UpdateOrganization(c *gin.Context) {
@@ -320,7 +320,7 @@ func (h *OrganizationHandler) UpdateOrganization(c *gin.Context) {
// @Tags 组织管理
// @Param id path string true "组织ID"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id} [delete]
func (h *OrganizationHandler) DeleteOrganization(c *gin.Context) {
@@ -398,7 +398,7 @@ func (h *OrganizationHandler) ListMembers(c *gin.Context) {
// @Param user_id path string true "用户ID"
// @Param request body types.UpdateMemberRoleRequest true "角色信息"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/members/{user_id} [put]
func (h *OrganizationHandler) UpdateMemberRole(c *gin.Context) {
@@ -433,7 +433,7 @@ func (h *OrganizationHandler) UpdateMemberRole(c *gin.Context) {
// @Param id path string true "组织ID"
// @Param user_id path string true "用户ID"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/members/{user_id} [delete]
func (h *OrganizationHandler) RemoveMember(c *gin.Context) {
@@ -462,7 +462,7 @@ func (h *OrganizationHandler) RemoveMember(c *gin.Context) {
// @Produce json
// @Param id path string true "组织ID"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/invite-code [post]
func (h *OrganizationHandler) GenerateInviteCode(c *gin.Context) {
@@ -491,7 +491,7 @@ func (h *OrganizationHandler) GenerateInviteCode(c *gin.Context) {
// @Produce json
// @Param code path string true "邀请码"
// @Success 200 {object} map[string]interface{}
-// @Failure 404 {object} errors.AppError
+// @Failure 404 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/preview/{code} [get]
func (h *OrganizationHandler) PreviewByInviteCode(c *gin.Context) {
@@ -547,7 +547,7 @@ func (h *OrganizationHandler) PreviewByInviteCode(c *gin.Context) {
// @Produce json
// @Param request body types.JoinOrganizationRequest true "邀请码"
// @Success 200 {object} map[string]interface{}
-// @Failure 404 {object} errors.AppError
+// @Failure 404 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/join [post]
func (h *OrganizationHandler) JoinByInviteCode(c *gin.Context) {
@@ -588,7 +588,7 @@ func (h *OrganizationHandler) JoinByInviteCode(c *gin.Context) {
// @Produce json
// @Param request body types.SubmitJoinRequestRequest true "申请信息"
// @Success 200 {object} map[string]interface{}
-// @Failure 400 {object} errors.AppError
+// @Failure 400 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/join-request [post]
func (h *OrganizationHandler) SubmitJoinRequest(c *gin.Context) {
@@ -694,7 +694,7 @@ func (h *OrganizationHandler) SearchOrganizations(c *gin.Context) {
// @Produce json
// @Param request body types.JoinByOrganizationIDRequest true "空间 ID"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/join-by-id [post]
func (h *OrganizationHandler) JoinByOrganizationID(c *gin.Context) {
@@ -750,7 +750,7 @@ func (h *OrganizationHandler) JoinByOrganizationID(c *gin.Context) {
// @Param id path string true "组织ID"
// @Param request body types.RequestRoleUpgradeRequest true "申请信息"
// @Success 200 {object} map[string]interface{}
-// @Failure 400 {object} errors.AppError
+// @Failure 400 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/request-upgrade [post]
func (h *OrganizationHandler) RequestRoleUpgrade(c *gin.Context) {
@@ -808,7 +808,7 @@ func (h *OrganizationHandler) RequestRoleUpgrade(c *gin.Context) {
// @Tags 组织管理
// @Param id path string true "组织ID"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/leave [post]
func (h *OrganizationHandler) LeaveOrganization(c *gin.Context) {
@@ -849,7 +849,7 @@ func (h *OrganizationHandler) LeaveOrganization(c *gin.Context) {
// @Produce json
// @Param id path string true "组织ID"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/join-requests [get]
func (h *OrganizationHandler) ListJoinRequests(c *gin.Context) {
@@ -919,7 +919,7 @@ func (h *OrganizationHandler) ListJoinRequests(c *gin.Context) {
// @Param request_id path string true "申请ID"
// @Param request body types.ReviewJoinRequestRequest true "审核结果"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/join-requests/{request_id}/review [put]
func (h *OrganizationHandler) ReviewJoinRequest(c *gin.Context) {
@@ -979,7 +979,7 @@ func (h *OrganizationHandler) ReviewJoinRequest(c *gin.Context) {
// @Param id path string true "知识库ID"
// @Param request body types.ShareKnowledgeBaseRequest true "共享信息"
// @Success 201 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /knowledge-bases/{id}/shares [post]
func (h *OrganizationHandler) ShareKnowledgeBase(c *gin.Context) {
@@ -1082,7 +1082,7 @@ func (h *OrganizationHandler) ListKBShares(c *gin.Context) {
// @Param share_id path string true "共享记录ID"
// @Param request body types.UpdateSharePermissionRequest true "权限信息"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /knowledge-bases/{id}/shares/{share_id} [put]
func (h *OrganizationHandler) UpdateSharePermission(c *gin.Context) {
@@ -1116,7 +1116,7 @@ func (h *OrganizationHandler) UpdateSharePermission(c *gin.Context) {
// @Param id path string true "知识库ID"
// @Param share_id path string true "共享记录ID"
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /knowledge-bases/{id}/shares/{share_id} [delete]
func (h *OrganizationHandler) RemoveShare(c *gin.Context) {
@@ -1662,7 +1662,7 @@ func (h *OrganizationHandler) toOrgResponse(ctx context.Context, org *types.Orga
// @Param q query string true "搜索关键词(用户名或邮箱)"
// @Param limit query int false "返回数量限制" default(10)
// @Success 200 {object} map[string]interface{}
-// @Failure 403 {object} errors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/search-users [get]
func (h *OrganizationHandler) SearchUsersForInvite(c *gin.Context) {
@@ -1742,8 +1742,8 @@ func (h *OrganizationHandler) SearchUsersForInvite(c *gin.Context) {
// @Param id path string true "组织ID"
// @Param request body types.InviteMemberRequest true "邀请信息"
// @Success 200 {object} map[string]interface{}
-// @Failure 400 {object} errors.AppError
-// @Failure 403 {object} errors.AppError
+// @Failure 400 {object} apperrors.AppError
+// @Failure 403 {object} apperrors.AppError
// @Security Bearer
// @Router /organizations/{id}/invite [post]
func (h *OrganizationHandler) InviteMember(c *gin.Context) {
diff --git a/internal/types/agent.go b/internal/types/agent.go
index 4390f7312..f162b3d30 100644
--- a/internal/types/agent.go
+++ b/internal/types/agent.go
@@ -16,7 +16,7 @@ type AgentConfig struct {
Temperature float64 `json:"temperature"` // LLM temperature for agent
KnowledgeBases []string `json:"knowledge_bases"` // Accessible knowledge base IDs
KnowledgeIDs []string `json:"knowledge_ids"` // Accessible knowledge IDs (individual documents)
- SystemPrompt string `json:"system_prompt,omitempty"` // Unified system prompt (uses {{web_search_status}} placeholder for dynamic behavior)
+ SystemPrompt string `json:"system_prompt,omitempty"` // Unified system prompt (uses web_search_status placeholder for dynamic behavior)
// Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.
SystemPromptWebEnabled string `json:"system_prompt_web_enabled,omitempty"` // Deprecated: Custom prompt when web search is enabled
SystemPromptWebDisabled string `json:"system_prompt_web_disabled,omitempty"` // Deprecated: Custom prompt when web search is disabled
@@ -35,9 +35,9 @@ type AgentConfig struct {
RetrieveKBOnlyWhenMentioned bool `json:"retrieve_kb_only_when_mentioned"`
// Skills configuration (Progressive Disclosure pattern)
- SkillsEnabled bool `json:"skills_enabled"` // Whether skills are enabled (default: false)
- SkillDirs []string `json:"skill_dirs"` // Directories to search for skills
- AllowedSkills []string `json:"allowed_skills"` // Skill names whitelist (empty = allow all)
+ SkillsEnabled bool `json:"skills_enabled"` // Whether skills are enabled (default: false)
+ SkillDirs []string `json:"skill_dirs"` // Directories to search for skills
+ AllowedSkills []string `json:"allowed_skills"` // Skill names whitelist (empty = allow all)
}
// SessionAgentConfig represents session-level agent configuration
diff --git a/internal/types/custom_agent.go b/internal/types/custom_agent.go
index 2d170d59a..7cf0c66ab 100644
--- a/internal/types/custom_agent.go
+++ b/internal/types/custom_agent.go
@@ -65,7 +65,7 @@ type CustomAgentConfig struct {
// ===== Basic Settings =====
// Agent mode: "quick-answer" for RAG mode, "smart-reasoning" for ReAct agent mode
AgentMode string `yaml:"agent_mode" json:"agent_mode"`
- // System prompt for the agent (unified prompt, uses {{web_search_status}} placeholder for dynamic behavior)
+ // System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)
SystemPrompt string `yaml:"system_prompt" json:"system_prompt"`
// Context template for normal mode (how to format retrieved chunks)
ContextTemplate string `yaml:"context_template" json:"context_template"`