Files
X-Agents/server/docs/swagger.json
DESKTOP-72TV0V4\caoxiaozhu 71e8cc59d5 feat: 更新 Server 后端服务
- 更新 agent handler 和 service 层
- 新增 chat_group handler 和 service
- 删除废弃的 chat_handler
- 更新 tool 相关处理
- 更新 API 文档和依赖

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:26:27 +08:00

4888 lines
163 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"swagger": "2.0",
"info": {
"contact": {}
},
"paths": {
"/api/agent/chat": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"智能体管理"
],
"summary": "单智能体对话",
"parameters": [
{
"description": "对话请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handler.ChatRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.ChatResponse"
}
}
}
}
},
"/api/agent/chat/stream": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"text/event-stream"
],
"tags": [
"智能体管理"
],
"summary": "单智能体对话(流式输出)",
"parameters": [
{
"description": "对话请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handler.ChatRequest"
}
}
],
"responses": {}
}
},
"/api/agent/create": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"智能体管理"
],
"summary": "创建智能体",
"parameters": [
{
"description": "创建智能体请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handler.CreateAgentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.CreateAgentResponse"
}
}
}
}
},
"/api/agent/list": {
"get": {
"produces": [
"application/json"
],
"tags": [
"智能体管理"
],
"summary": "获取智能体列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.ListAgentsResponse"
}
}
}
}
},
"/api/agent/team/chat": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"智能体管理"
],
"summary": "多智能体群聊",
"parameters": [
{
"description": "群聊请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handler.TeamChatRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.TeamChatResponse"
}
}
}
}
},
"/api/file_proxy": {
"get": {
"description": "代理访问文件,解决 MinIO 内网和 HTTPS 问题",
"consumes": [
"application/json"
],
"produces": [
"application/octet-stream"
],
"tags": [
"文件上传"
],
"summary": "代理文件访问",
"parameters": [
{
"type": "string",
"description": "文件Key",
"name": "key",
"in": "query",
"required": true
},
{
"type": "string",
"description": "知识库ID",
"name": "kb_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "file"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/file_upload": {
"post": {
"description": "上传文件到服务器本地存储或MinIO",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"文件上传"
],
"summary": "上传文件",
"parameters": [
{
"type": "file",
"description": "要上传的文件",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/file_upload/{filename}": {
"delete": {
"description": "删除指定文件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"文件上传"
],
"summary": "删除文件",
"parameters": [
{
"type": "string",
"description": "文件名",
"name": "filename",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/knowledge/create": {
"post": {
"description": "创建一个新的知识库",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"知识库"
],
"summary": "创建知识库",
"parameters": [
{
"description": "知识库信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.CreateKnowledgeRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/knowledge/list": {
"get": {
"description": "获取所有知识库列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"知识库"
],
"summary": "获取知识库列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/knowledge/{id}": {
"get": {
"description": "根据ID获取知识库详细信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"知识库"
],
"summary": "获取知识库详情",
"parameters": [
{
"type": "string",
"description": "知识库ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"put": {
"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/model.UpdateKnowledgeRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"description": "删除指定的知识库",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"知识库"
],
"summary": "删除知识库",
"parameters": [
{
"type": "string",
"description": "知识库ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/knowledge/{id}/documents": {
"get": {
"description": "获取指定知识库下的所有文档",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"知识库"
],
"summary": "获取知识库文档列表",
"parameters": [
{
"type": "string",
"description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "文档状态筛选",
"name": "status",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"post": {
"description": "上传文档到指定知识库",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"知识库"
],
"summary": "上传文档",
"parameters": [
{
"type": "string",
"description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "file",
"description": "文档文件",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/knowledge/{id}/documents/{doc_id}": {
"delete": {
"description": "删除知识库中的指定文档",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"知识库"
],
"summary": "删除文档",
"parameters": [
{
"type": "string",
"description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "文档ID",
"name": "doc_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/knowledge/{id}/documents/{doc_id}/preview": {
"get": {
"description": "获取文档的解析预览内容",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"知识库"
],
"summary": "获取文档预览",
"parameters": [
{
"type": "string",
"description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "文档ID",
"name": "doc_id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "页码",
"name": "page",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/knowledge/{id}/documents/{doc_id}/reparse": {
"post": {
"description": "重新解析指定文档(用于更新解析结果)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"知识库"
],
"summary": "重新解析文档",
"parameters": [
{
"type": "string",
"description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "文档ID",
"name": "doc_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/auth/login": {
"post": {
"description": "用户登录并获取 JWT Token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"认证"
],
"summary": "用户登录",
"parameters": [
{
"description": "登录请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handler.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.LoginResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/auth/me": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "获取已登录用户的详细信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"认证"
],
"summary": "获取当前用户信息",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/auth/register": {
"post": {
"description": "新用户注册账号",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"认证"
],
"summary": "用户注册",
"parameters": [
{
"description": "注册请求",
"name": "RegisterRequest",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handler.RegisterRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/database/add": {
"post": {
"description": "添加新的数据库连接信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"数据库管理"
],
"summary": "创建数据库",
"parameters": [
{
"description": "数据库信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.CreateDatabaseRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/model.DatabaseInfo"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/database/check": {
"post": {
"description": "测试数据库连接是否正常",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"数据库管理"
],
"summary": "检查数据库连接",
"parameters": [
{
"description": "数据库连接信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.CheckRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/database/graph/save": {
"post": {
"description": "保存数据库的图谱结构信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"数据库管理"
],
"summary": "保存图谱信息",
"parameters": [
{
"description": "图谱信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.SaveGraphRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/database/list": {
"get": {
"description": "获取所有已添加的数据库列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"数据库管理"
],
"summary": "获取数据库列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/database/{id}": {
"get": {
"description": "根据ID获取数据库详细信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"数据库管理"
],
"summary": "获取数据库详情",
"parameters": [
{
"type": "string",
"description": "数据库ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.DatabaseInfo"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"put": {
"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/model.UpdateDatabaseRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.DatabaseInfo"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"description": "删除指定的数据库连接",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"数据库管理"
],
"summary": "删除数据库",
"parameters": [
{
"type": "string",
"description": "数据库ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/mcp/add": {
"post": {
"description": "创建新的MCP工具配置",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"MCP管理"
],
"summary": "创建MCP",
"parameters": [
{
"description": "MCP信息",
"name": "mcp",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.MCP"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/mcp/list": {
"get": {
"description": "获取所有MCP工具配置",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"MCP管理"
],
"summary": "获取MCP列表",
"parameters": [
{
"type": "string",
"description": "分类",
"name": "category",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/mcp/{id}": {
"get": {
"description": "根据ID获取MCP配置",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"MCP管理"
],
"summary": "获取MCP详情",
"parameters": [
{
"type": "string",
"description": "MCP ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"put": {
"description": "更新MCP配置",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"MCP管理"
],
"summary": "更新MCP",
"parameters": [
{
"type": "string",
"description": "MCP ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "MCP信息",
"name": "mcp",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.MCP"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"description": "删除MCP配置",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"MCP管理"
],
"summary": "删除MCP",
"parameters": [
{
"type": "string",
"description": "MCP ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/model/add": {
"post": {
"description": "添加新的AI模型配置",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"模型管理"
],
"summary": "添加模型",
"parameters": [
{
"description": "模型信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.CreateModelRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/model/list": {
"get": {
"description": "获取所有已添加的AI模型列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"模型管理"
],
"summary": "获取模型列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/model/test": {
"post": {
"description": "测试AI模型连接是否正常",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"模型管理"
],
"summary": "测试模型连接",
"parameters": [
{
"description": "模型测试请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.TestModelRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/model/{id}": {
"get": {
"description": "根据ID获取模型详细信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"模型管理"
],
"summary": "获取模型详情",
"parameters": [
{
"type": "string",
"description": "模型ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.ModelInfo"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"put": {
"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/model.UpdateModelRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"description": "删除指定的AI模型",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"模型管理"
],
"summary": "删除模型",
"parameters": [
{
"type": "string",
"description": "模型ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "boolean"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/neo4j/check": {
"post": {
"description": "测试 Neo4j 数据库连接是否正常",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Neo4j"
],
"summary": "检查 Neo4j 连接",
"parameters": [
{
"description": "Neo4j连接信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Neo4jCheckRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/neo4j/graphs": {
"post": {
"description": "获取 Neo4j 中的图谱概览数据",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Neo4j"
],
"summary": "获取图谱概览",
"parameters": [
{
"description": "图谱查询请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Neo4jGraphRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/neo4j/nodes": {
"post": {
"description": "获取 Neo4j 中的节点详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Neo4j"
],
"summary": "获取节点列表",
"parameters": [
{
"description": "节点查询请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Neo4jNodeRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/neo4j/relationships": {
"post": {
"description": "获取 Neo4j 中的关系详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Neo4j"
],
"summary": "获取关系列表",
"parameters": [
{
"description": "关系查询请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Neo4jRelRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/skill/add": {
"post": {
"description": "创建新的技能,支持文件上传。管理员用户(admin)上传为system技能存到core/agents/skills/system/其他用户上传为user技能存到core/agents/skills/user/",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"技能管理"
],
"summary": "创建技能",
"parameters": [
{
"type": "string",
"description": "技能名称",
"name": "skill_name",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "技能描述",
"name": "skill_desc",
"in": "formData"
},
{
"type": "string",
"description": "技能类型(system/user),不传则根据用户角色自动判断",
"name": "skill_type",
"in": "formData"
},
{
"type": "file",
"description": "技能文件(SKILL.md)",
"name": "file",
"in": "formData"
}
],
"responses": {
"200": {
"description": "{\"message\": \"skill created\", \"skill\": {}}",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/skill/content": {
"get": {
"description": "获取指定技能对应的 SKILL.md 文件内容",
"consumes": [
"application/json"
],
"produces": [
"text/plain"
],
"tags": [
"技能管理"
],
"summary": "获取技能文件内容",
"parameters": [
{
"type": "string",
"description": "技能ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "文件内容",
"schema": {
"type": "string"
}
}
}
}
},
"/skill/list": {
"get": {
"description": "获取所有技能列表,支持按类型筛选(system/user)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"技能管理"
],
"summary": "获取技能列表",
"parameters": [
{
"type": "string",
"description": "技能类型: system(系统技能)/user(用户技能)",
"name": "type",
"in": "query"
}
],
"responses": {
"200": {
"description": "{\"list\": [], \"total\": 0}",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/skill/sync": {
"get": {
"description": "从文件系统扫描 skills 目录并同步到数据库。扫描 account/admin/skills(系统技能) 和 account/{username}/skills(用户技能)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"技能管理"
],
"summary": "手动同步技能",
"responses": {
"200": {
"description": "{\"message\": \"skills synced\", \"count\": 0}",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/skill/{id}": {
"get": {
"description": "根据ID获取技能详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"技能管理"
],
"summary": "获取技能详情",
"parameters": [
{
"type": "string",
"description": "技能ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "{\"skill\": {}}",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"put": {
"description": "更新技能信息\n更新技能信息支持文件上传",
"consumes": [
"application/json",
"multipart/form-data"
],
"produces": [
"application/json",
"application/json"
],
"tags": [
"技能管理",
"技能管理"
],
"summary": "更新技能",
"parameters": [
{
"type": "string",
"description": "技能ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "技能信息",
"name": "skill",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Skill"
}
},
{
"type": "string",
"description": "技能ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "技能名称",
"name": "skill_name",
"in": "formData"
},
{
"type": "string",
"description": "技能描述",
"name": "skill_desc",
"in": "formData"
},
{
"type": "string",
"description": "技能类型",
"name": "skill_type",
"in": "formData"
},
{
"type": "file",
"description": "技能文件(SKILL.md)",
"name": "file",
"in": "formData"
}
],
"responses": {
"200": {
"description": "{\"message\": \"skill updated\"}",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"description": "删除技能",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"技能管理"
],
"summary": "删除技能",
"parameters": [
{
"type": "string",
"description": "技能ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "{\"message\": \"skill deleted\"}",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/sub-table/add": {
"post": {
"description": "添加数据库的子表映射关系",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"子表管理"
],
"summary": "创建子表映射",
"parameters": [
{
"description": "子表信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.CreateSubTableRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/model.SubTableInfo"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/sub-table/database/{database_id}": {
"get": {
"description": "获取指定数据库的所有子表映射列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"子表管理"
],
"summary": "获取数据库下所有子表",
"parameters": [
{
"type": "string",
"description": "数据库ID",
"name": "database_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/sub-table/ddl/{database_id}": {
"get": {
"description": "获取数据库下所有表的DDL语句",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"子表管理"
],
"summary": "获取表结构DDL",
"parameters": [
{
"type": "string",
"description": "数据库ID",
"name": "database_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/sub-table/mapping/{database_id}": {
"get": {
"description": "从文件中读取子表映射关系",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"子表管理"
],
"summary": "从文件获取映射",
"parameters": [
{
"type": "string",
"description": "数据库ID",
"name": "database_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/sub-table/{id}": {
"get": {
"description": "根据ID获取子表映射详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"子表管理"
],
"summary": "获取子表详情",
"parameters": [
{
"type": "string",
"description": "子表ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.SubTableInfo"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"put": {
"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/model.UpdateSubTableRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.SubTableInfo"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"description": "删除指定的子表映射",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"子表管理"
],
"summary": "删除子表映射",
"parameters": [
{
"type": "string",
"description": "子表ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/system/info": {
"get": {
"description": "获取服务器系统信息CPU、内存等",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"系统"
],
"summary": "获取系统信息",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.SystemInfo"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/tool/add": {
"post": {
"description": "创建新的工具",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"工具管理"
],
"summary": "创建工具",
"parameters": [
{
"description": "工具信息",
"name": "tool",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Tool"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/tool/list": {
"get": {
"description": "获取所有工具列表,支持按分类和状态筛选",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"工具管理"
],
"summary": "获取工具列表",
"parameters": [
{
"type": "string",
"description": "工具分类",
"name": "category",
"in": "query"
},
{
"type": "string",
"description": "工具状态",
"name": "status",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/tool/sync": {
"get": {
"description": "从代码中的默认配置同步工具到数据库",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"工具管理"
],
"summary": "手动同步工具",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/tool/{id}": {
"get": {
"description": "根据ID获取工具详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"工具管理"
],
"summary": "获取工具详情",
"parameters": [
{
"type": "string",
"description": "工具ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"put": {
"description": "更新工具信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"工具管理"
],
"summary": "更新工具",
"parameters": [
{
"type": "string",
"description": "工具ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "工具信息",
"name": "tool",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Tool"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"description": "删除工具",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"工具管理"
],
"summary": "删除工具",
"parameters": [
{
"type": "string",
"description": "工具ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/user/list": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "获取所有用户列表(需要管理员权限)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"用户管理"
],
"summary": "获取所有用户",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/user/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据ID获取用户详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"用户管理"
],
"summary": "获取用户详情",
"parameters": [
{
"type": "string",
"description": "用户ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/chat/sessions": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "创建新的聊天会话",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"会话管理"
],
"summary": "创建会话",
"parameters": [
{
"description": "创建会话请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.CreateSessionRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.ChatSession"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "获取用户的会话列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"会话管理"
],
"summary": "获取会话列表",
"parameters": [
{
"type": "string",
"description": "用户ID",
"name": "user_id",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "每页数量",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "偏移量",
"name": "offset",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.SessionListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/chat/sessions/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据ID获取会话详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"会话管理"
],
"summary": "获取会话详情",
"parameters": [
{
"type": "string",
"description": "会话ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.ChatSession"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"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/model.UpdateSessionRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.ChatSession"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "删除会话",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"会话管理"
],
"summary": "删除会话",
"parameters": [
{
"type": "string",
"description": "会话ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/chat/sessions/{id}/messages": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "获取会话的消息历史",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"会话管理"
],
"summary": "获取会话消息历史",
"parameters": [
{
"type": "string",
"description": "会话ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "每页数量",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "偏移量",
"name": "offset",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.MessageListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/chat/messages": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "保存聊天消息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"会话管理"
],
"summary": "保存消息",
"parameters": [
{
"description": "创建消息请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.CreateMessageRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.ChatMessage"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"/api/agent/{id}/memories": {
"get": {
"security": [{"BearerAuth": []}],
"description": "获取记忆列表,支持分类和类型筛选",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "获取记忆列表",
"parameters": [
{"type": "string", "description": "Agent ID", "name": "id", "in": "path", "required": true},
{"type": "string", "description": "用户ID", "name": "user_id", "in": "query"},
{"type": "string", "description": "记忆分类", "name": "category", "in": "query"},
{"type": "string", "description": "记忆类型", "name": "memory_type", "in": "query"},
{"type": "integer", "description": "每页数量", "name": "limit", "in": "query"},
{"type": "integer", "description": "偏移量", "name": "offset", "in": "query"}
],
"responses": {
"200": {"description": "OK", "schema": {"$ref": "#/definitions/model.MemoryListResponse"}}
}
},
"post": {
"security": [{"BearerAuth": []}],
"description": "创建新记忆",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "创建记忆",
"parameters": [
{"type": "string", "description": "Agent ID", "name": "id", "in": "path", "required": true},
{"description": "创建记忆请求", "name": "request", "in": "body", "required": true, "schema": {"$ref": "#/definitions/model.CreateMemoryRequest"}}
],
"responses": {
"200": {"description": "OK", "schema": {"$ref": "#/definitions/model.AgentMemory"}}
}
}
},
"/api/agent/{id}/memories/search": {
"post": {
"security": [{"BearerAuth": []}],
"description": "搜索记忆,支持关键词、标签、分类筛选",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "搜索记忆",
"responses": {
"200": {"description": "OK", "schema": {"$ref": "#/definitions/model.MemoryListResponse"}}
}
}
},
"/api/agent/{id}/memories/categories": {
"get": {
"security": [{"BearerAuth": []}],
"description": "获取记忆分类列表",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "获取记忆分类列表",
"parameters": [
{"type": "string", "description": "Agent ID", "name": "id", "in": "path", "required": true},
{"type": "string", "description": "用户ID", "name": "user_id", "in": "query"}
],
"responses": {
"200": {"description": "OK", "schema": {"type": "object"}}
}
}
},
"/api/agent/{id}/memories/tags": {
"get": {
"security": [{"BearerAuth": []}],
"description": "获取记忆标签列表",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "获取记忆标签列表",
"parameters": [
{"type": "string", "description": "Agent ID", "name": "id", "in": "path", "required": true},
{"type": "string", "description": "用户ID", "name": "user_id", "in": "query"}
],
"responses": {
"200": {"description": "OK", "schema": {"type": "object"}}
}
}
},
"/api/agent/{id}/memories/export": {
"get": {
"security": [{"BearerAuth": []}],
"description": "导出记忆支持JSON和CSV格式",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "导出记忆",
"parameters": [
{"type": "string", "description": "Agent ID", "name": "id", "in": "path", "required": true},
{"type": "string", "description": "用户ID", "name": "user_id", "in": "query"},
{"type": "string", "description": "导出格式 (json/csv)", "name": "format", "in": "query"}
],
"responses": {
"200": {"description": "OK", "schema": {"type": "object"}}
}
}
},
"/api/agent/{id}/memories/import": {
"post": {
"security": [{"BearerAuth": []}],
"description": "导入记忆",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "导入记忆",
"parameters": [
{"type": "string", "description": "Agent ID", "name": "id", "in": "path", "required": true},
{"description": "导入记忆请求", "name": "request", "in": "body", "required": true, "schema": {"$ref": "#/definitions/model.ImportMemoryRequest"}}
],
"responses": {
"200": {"description": "OK", "schema": {"type": "object"}}
}
}
},
"/api/agent/memories/{memory_id}": {
"get": {
"security": [{"BearerAuth": []}],
"description": "获取单个记忆详情",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "获取记忆详情",
"parameters": [
{"type": "string", "description": "记忆ID", "name": "memory_id", "in": "path", "required": true}
],
"responses": {
"200": {"description": "OK", "schema": {"$ref": "#/definitions/model.AgentMemory"}},
"404": {"description": "Not Found"}
}
},
"put": {
"security": [{"BearerAuth": []}],
"description": "更新记忆",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "更新记忆",
"parameters": [
{"type": "string", "description": "记忆ID", "name": "memory_id", "in": "path", "required": true},
{"description": "更新记忆请求", "name": "request", "in": "body", "required": true, "schema": {"$ref": "#/definitions/model.UpdateMemoryRequest"}}
],
"responses": {
"200": {"description": "OK", "schema": {"$ref": "#/definitions/model.AgentMemory"}},
"404": {"description": "Not Found"}
}
},
"delete": {
"security": [{"BearerAuth": []}],
"description": "删除记忆",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["记忆管理"],
"summary": "删除记忆",
"parameters": [
{"type": "string", "description": "记忆ID", "name": "memory_id", "in": "path", "required": true}
],
"responses": {
"200": {"description": "OK"},
"404": {"description": "Not Found"}
}
}
},
"definitions": {
"handler.ChatRequest": {
"type": "object",
"required": [
"agent_id",
"message"
],
"properties": {
"agent_id": {
"type": "integer"
},
"message": {
"type": "string"
},
"model_id": {
"type": "string"
},
"session_id": {
"type": "string"
},
"use_xbot": {
"type": "boolean"
}
}
},
"handler.ChatResponse": {
"type": "object",
"properties": {
"agent_id": {
"type": "integer"
},
"duration_ms": {
"type": "integer"
},
"metadata": {},
"reply": {
"type": "string"
},
"session_id": {
"type": "string"
},
"tokens_used": {
"type": "integer"
},
"tools_used": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"handler.CreateAgentRequest": {
"type": "object",
"required": [
"name"
],
"properties": {
"avatar": {
"type": "string"
},
"description": {
"type": "string"
},
"knowledge": {
"description": "知识库",
"type": "string"
},
"model_name": {
"type": "string"
},
"model_provider": {
"description": "模型配置",
"type": "string"
},
"name": {
"type": "string"
},
"prompt": {
"description": "自定义提示词",
"type": "string"
},
"skills": {
"type": "array",
"items": {
"type": "string"
}
},
"skills_mode": {
"description": "技能配置",
"type": "string"
}
}
},
"handler.CreateAgentResponse": {
"type": "object",
"properties": {
"agent_id": {
"type": "integer"
},
"message": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"handler.ListAgentsResponse": {
"type": "object",
"properties": {
"agents": {
"type": "array",
"items": {}
}
}
},
"handler.LoginRequest": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handler.LoginResponse": {
"type": "object",
"properties": {
"token": {
"type": "string"
},
"user": {}
}
},
"handler.RegisterRequest": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handler.TeamChatRequest": {
"type": "object",
"required": [
"member_agent_ids",
"message",
"supervisor_agent_id"
],
"properties": {
"member_agent_ids": {
"type": "array",
"items": {
"type": "integer"
}
},
"message": {
"type": "string"
},
"session_id": {
"type": "string"
},
"strategy": {
"type": "string"
},
"supervisor_agent_id": {
"type": "integer"
}
}
},
"handler.TeamChatResponse": {
"type": "object",
"properties": {
"duration_ms": {
"type": "integer"
},
"metadata": {},
"reply": {
"type": "string"
},
"session_id": {
"type": "string"
},
"strategy": {
"type": "string"
},
"subtask_results": {},
"supervisor_agent_id": {
"type": "integer"
}
}
},
"model.CPUInfo": {
"type": "object",
"properties": {
"core_count": {
"description": "核心数",
"type": "integer"
},
"model_name": {
"description": "CPU型号",
"type": "string"
},
"percent": {
"description": "CPU使用率",
"type": "number"
}
}
},
"model.CheckRequest": {
"type": "object",
"required": [
"db_type",
"host",
"port",
"username"
],
"properties": {
"charset": {
"type": "string"
},
"database": {
"type": "string"
},
"database_id": {
"description": "可选,用于获取已保存的字段映射",
"type": "string"
},
"db_type": {
"type": "string"
},
"host": {
"type": "string"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"ssl_mode": {
"type": "string"
},
"uri": {
"description": "Neo4j 连接地址,如 bolt://localhost:7687",
"type": "string"
},
"username": {
"type": "string"
}
}
},
"model.CreateDatabaseRequest": {
"type": "object",
"required": [
"db_type",
"host",
"name",
"port",
"username"
],
"properties": {
"charset": {
"type": "string"
},
"database": {
"type": "string"
},
"db_type": {
"type": "string"
},
"description": {
"type": "string"
},
"host": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"ssl_mode": {
"type": "string"
},
"sub_tables": {
"description": "可选,子表配置",
"type": "array",
"items": {
"$ref": "#/definitions/model.CreateSubTableRequest"
}
},
"username": {
"type": "string"
}
}
},
"model.CreateKnowledgeRequest": {
"type": "object",
"required": [
"embedding_model_id",
"llm_model_id",
"name",
"parsing_config"
],
"properties": {
"description": {
"type": "string"
},
"embedding_model_id": {
"type": "string"
},
"llm_model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"parsing_config": {
"$ref": "#/definitions/model.ParsingConfig"
},
"storage_config": {
"description": "存储配置,不传则使用全局配置",
"allOf": [
{
"$ref": "#/definitions/model.StorageConfig"
}
]
}
}
},
"model.CreateModelRequest": {
"type": "object",
"required": [
"api_key",
"base_url",
"model",
"model_type",
"name",
"provider"
],
"properties": {
"api_endpoint": {
"type": "string"
},
"api_key": {
"type": "string"
},
"base_url": {
"type": "string"
},
"model": {
"type": "string"
},
"model_type": {
"type": "string"
},
"name": {
"type": "string"
},
"provider": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"model.CreateSubTableRequest": {
"type": "object",
"required": [
"database_id",
"parent_table",
"sub_table_name"
],
"properties": {
"database_id": {
"type": "string"
},
"ddl": {
"description": "建表DDL",
"type": "string"
},
"fields": {
"description": "字段映射列表",
"type": "array",
"items": {
"$ref": "#/definitions/model.FieldMapping"
}
},
"mapping_type": {
"type": "string"
},
"parent_table": {
"type": "string"
},
"relation_field": {
"type": "string"
},
"relation_type": {
"type": "string"
},
"sub_table_comment": {
"type": "string"
},
"sub_table_name": {
"type": "string"
}
}
},
"model.DatabaseInfo": {
"type": "object",
"properties": {
"charset": {
"description": "连接选项",
"type": "string"
},
"created_at": {
"description": "时间",
"type": "string"
},
"database": {
"description": "数据库名",
"type": "string"
},
"db_type": {
"description": "数据库类型: mysql, postgres, mongodb, neo4j等",
"type": "string"
},
"description": {
"description": "描述",
"type": "string"
},
"graph_labels": {
"description": "Neo4j 标签列表 (JSON 格式)",
"type": "string"
},
"graph_relationship": {
"description": "Neo4j 关系类型列表 (JSON 格式)",
"type": "string"
},
"host": {
"description": "主机地址",
"type": "string"
},
"id": {
"description": "UUID",
"type": "string"
},
"name": {
"description": "数据库名称",
"type": "string"
},
"password": {
"description": "密码(建议加密存储)",
"type": "string"
},
"port": {
"description": "端口",
"type": "integer"
},
"selected_label": {
"description": "当前选中的标签",
"type": "string"
},
"ssl_mode": {
"description": "SSL模式",
"type": "string"
},
"table_count": {
"description": "子表数量",
"type": "integer"
},
"updated_at": {
"type": "string"
},
"uri": {
"description": "Neo4j 专用字段",
"type": "string"
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"model.FieldMapping": {
"type": "object",
"properties": {
"column_name": {
"description": "列名",
"type": "string"
},
"mapped_name": {
"description": "中文映射名",
"type": "string"
}
}
},
"model.MCP": {
"type": "object",
"properties": {
"args": {
"description": "参数JSON数组格式",
"type": "string"
},
"category": {
"description": "分类",
"type": "string"
},
"command": {
"description": "启动命令",
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"description": "英文描述",
"type": "string"
},
"description_cn": {
"description": "中文描述",
"type": "string"
},
"env": {
"description": "环境变量JSON对象格式",
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"type": "string"
},
"transport": {
"description": "stdio, http, sse",
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"model.MemoryInfo": {
"type": "object",
"properties": {
"available": {
"description": "可用(字节)",
"type": "integer"
},
"available_gb": {
"description": "可用(GB)",
"type": "number"
},
"percent": {
"description": "使用率",
"type": "number"
},
"total": {
"description": "总内存(字节)",
"type": "integer"
},
"total_gb": {
"description": "总内存(GB)",
"type": "number"
},
"used": {
"description": "已使用(字节)",
"type": "integer"
},
"used_gb": {
"description": "已使用(GB)",
"type": "number"
}
}
},
"model.ModelInfo": {
"type": "object",
"properties": {
"api_endpoint": {
"description": "API 端点路径",
"type": "string"
},
"api_key": {
"description": "API 密钥",
"type": "string"
},
"base_url": {
"description": "基础 URL",
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"model": {
"description": "模型标识",
"type": "string"
},
"model_type": {
"description": "chat/embedding/rerank/vlm",
"type": "string"
},
"name": {
"type": "string"
},
"provider": {
"description": "OpenAI/Ollama",
"type": "string"
},
"status": {
"description": "active/inactive",
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"model.Neo4jCheckRequest": {
"type": "object",
"required": [
"host",
"password",
"port",
"username"
],
"properties": {
"database": {
"description": "可选,默认 neo4j",
"type": "string"
},
"description": {
"description": "可选,数据库描述",
"type": "string"
},
"host": {
"type": "string"
},
"name": {
"description": "数据库名称",
"type": "string"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"uri": {
"description": "可选Neo4j 连接地址 (bolt://host:7687)",
"type": "string"
},
"username": {
"type": "string"
}
}
},
"model.Neo4jGraphRequest": {
"type": "object",
"required": [
"password",
"uri",
"username"
],
"properties": {
"database": {
"description": "可选,默认 neo4j",
"type": "string"
},
"password": {
"type": "string"
},
"uri": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"model.Neo4jNodeRequest": {
"type": "object",
"required": [
"label",
"password",
"uri",
"username"
],
"properties": {
"database": {
"type": "string"
},
"label": {
"type": "string"
},
"limit": {
"description": "默认 10",
"type": "integer"
},
"password": {
"type": "string"
},
"uri": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"model.Neo4jRelRequest": {
"type": "object",
"required": [
"password",
"relationship_type",
"uri",
"username"
],
"properties": {
"database": {
"type": "string"
},
"limit": {
"description": "默认 10",
"type": "integer"
},
"password": {
"type": "string"
},
"relationship_type": {
"type": "string"
},
"uri": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"model.ParsingConfig": {
"type": "object",
"properties": {
"docling_url": {
"description": "Docling 服务 URL",
"type": "string"
},
"enable_pdf": {
"description": "是否启用 PDF 解析",
"type": "boolean"
},
"engine": {
"description": "markitdown / docling",
"type": "string"
},
"pandoc": {
"description": "是否启用 Pandoc",
"type": "boolean"
},
"vlm_api_key": {
"description": "API Key",
"type": "string"
},
"vlm_base_url": {
"description": "自定义 API 地址",
"type": "string"
},
"vlm_enabled": {
"description": "VLM 配置(用于图片 OCR 等)",
"type": "boolean"
},
"vlm_model": {
"description": "模型名称",
"type": "string"
},
"vlm_prompt": {
"description": "自定义提示词",
"type": "string"
},
"vlm_provider": {
"description": "VLM 提供商: openai, anthropic, local 等",
"type": "string"
}
}
},
"model.SaveGraphRequest": {
"type": "object",
"required": [
"databaseId",
"databaseName",
"labels",
"relationshipTypes",
"uri",
"username"
],
"properties": {
"databaseId": {
"type": "string"
},
"databaseName": {
"type": "string"
},
"labels": {
"type": "array",
"items": {
"type": "string"
}
},
"relationshipTypes": {
"type": "array",
"items": {
"type": "string"
}
},
"selectedLabel": {
"type": "string"
},
"uri": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"model.Skill": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"created_by": {
"description": "创建者用户名",
"type": "string"
},
"id": {
"type": "string"
},
"path": {
"description": "skill 文件路径",
"type": "string"
},
"skill_desc": {
"type": "string"
},
"skill_name": {
"type": "string"
},
"skill_type": {
"description": "system / user",
"type": "string"
},
"status": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"model.StorageConfig": {
"type": "object",
"properties": {
"access_key_id": {
"description": "MinIO/S3 access key",
"type": "string"
},
"bucket": {
"description": "MinIO/S3 bucket",
"type": "string"
},
"endpoint": {
"description": "MinIO/S3 endpoint",
"type": "string"
},
"secret_access_key": {
"description": "MinIO/S3 secret key",
"type": "string"
},
"type": {
"description": "local / minio / s3",
"type": "string"
},
"use_ssl": {
"description": "MinIO/S3 use SSL",
"type": "boolean"
}
}
},
"model.SubTableInfo": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"database_id": {
"description": "关联的数据库ID",
"type": "string"
},
"ddl": {
"description": "建表 DDL",
"type": "string"
},
"fields": {
"description": "字段映射列表(返回给前端)",
"type": "array",
"items": {
"$ref": "#/definitions/model.FieldMapping"
}
},
"id": {
"description": "UUID",
"type": "string"
},
"mapping_type": {
"description": "映射类型",
"type": "string"
},
"parent_table": {
"description": "父表名",
"type": "string"
},
"relation_field": {
"description": "关联字段",
"type": "string"
},
"relation_type": {
"description": "关联类型",
"type": "string"
},
"sub_table_comment": {
"description": "子表注释",
"type": "string"
},
"sub_table_name": {
"description": "子表名",
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"model.SystemInfo": {
"type": "object",
"properties": {
"cpu": {
"$ref": "#/definitions/model.CPUInfo"
},
"memory": {
"$ref": "#/definitions/model.MemoryInfo"
}
}
},
"model.TestModelRequest": {
"type": "object",
"required": [
"api_key",
"base_url",
"model",
"model_type",
"provider"
],
"properties": {
"api_endpoint": {
"type": "string"
},
"api_key": {
"type": "string"
},
"base_url": {
"type": "string"
},
"model": {
"type": "string"
},
"model_type": {
"type": "string"
},
"provider": {
"type": "string"
}
}
},
"model.Tool": {
"type": "object",
"properties": {
"args": {
"description": "参数JSON数组格式",
"type": "string"
},
"category": {
"type": "string"
},
"command": {
"description": "启动命令",
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"description": "英文描述",
"type": "string"
},
"description_cn": {
"description": "中文描述",
"type": "string"
},
"env": {
"description": "环境变量JSON对象格式",
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"parameters": {
"description": "JSON格式存储",
"type": "string"
},
"provider": {
"type": "string"
},
"require_approval": {
"type": "boolean"
},
"security_level": {
"type": "string"
},
"status": {
"description": "状态",
"type": "string"
},
"transport": {
"description": "MCP 特有字段",
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"model.UpdateDatabaseRequest": {
"type": "object",
"properties": {
"charset": {
"type": "string"
},
"database": {
"type": "string"
},
"db_type": {
"type": "string"
},
"description": {
"type": "string"
},
"graph_labels": {
"description": "Neo4j 标签列表 (JSON)",
"type": "string"
},
"graph_relationship": {
"description": "Neo4j 关系类型列表 (JSON)",
"type": "string"
},
"host": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"selected_label": {
"description": "当前选中的标签",
"type": "string"
},
"ssl_mode": {
"type": "string"
},
"sub_tables": {
"description": "子表配置",
"type": "array",
"items": {
"$ref": "#/definitions/model.CreateSubTableRequest"
}
},
"table_count": {
"type": "integer"
},
"uri": {
"description": "Neo4j 连接地址",
"type": "string"
},
"username": {
"type": "string"
}
}
},
"model.UpdateKnowledgeRequest": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"embedding_model_id": {
"type": "string"
},
"llm_model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"parsing_config": {
"$ref": "#/definitions/model.ParsingConfig"
},
"status": {
"type": "string"
},
"storage_config": {
"$ref": "#/definitions/model.StorageConfig"
}
}
},
"model.UpdateModelRequest": {
"type": "object",
"properties": {
"api_endpoint": {
"type": "string"
},
"api_key": {
"type": "string"
},
"base_url": {
"type": "string"
},
"model": {
"type": "string"
},
"model_type": {
"type": "string"
},
"name": {
"type": "string"
},
"provider": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"model.UpdateSubTableRequest": {
"type": "object",
"properties": {
"ddl": {
"type": "string"
},
"mapping_type": {
"type": "string"
},
"parent_table": {
"type": "string"
},
"relation_field": {
"type": "string"
},
"relation_type": {
"type": "string"
},
"sub_table_comment": {
"type": "string"
},
"sub_table_name": {
"type": "string"
}
}
},
"model.ChatSession": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "会话ID"
},
"user_id": {
"type": "string",
"description": "用户ID"
},
"agent_id": {
"type": "string",
"description": "Agent ID"
},
"title": {
"type": "string",
"description": "会话标题"
},
"model_id": {
"type": "string",
"description": "模型ID"
},
"status": {
"type": "string",
"description": "会话状态 (active/archived)"
},
"created_at": {
"type": "string",
"description": "创建时间"
},
"updated_at": {
"type": "string",
"description": "更新时间"
}
}
},
"model.ChatMessage": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "消息ID"
},
"session_id": {
"type": "string",
"description": "会话ID"
},
"role": {
"type": "string",
"description": "角色 (user/assistant/system)"
},
"content": {
"type": "string",
"description": "消息内容"
},
"tokens_used": {
"type": "integer",
"description": "使用的token数"
},
"duration_ms": {
"type": "integer",
"description": "响应耗时(毫秒)"
},
"metadata": {
"type": "string",
"description": "额外信息(JSON格式)"
},
"created_at": {
"type": "string",
"description": "创建时间"
}
}
},
"model.CreateSessionRequest": {
"type": "object",
"required": ["user_id", "agent_id"],
"properties": {
"user_id": {
"type": "string",
"description": "用户ID"
},
"agent_id": {
"type": "string",
"description": "Agent ID"
},
"title": {
"type": "string",
"description": "会话标题"
},
"model_id": {
"type": "string",
"description": "模型ID"
}
}
},
"model.UpdateSessionRequest": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "会话标题"
},
"status": {
"type": "string",
"description": "会话状态 (active/archived)"
}
}
},
"model.CreateMessageRequest": {
"type": "object",
"required": ["session_id", "role", "content"],
"properties": {
"session_id": {
"type": "string",
"description": "会话ID"
},
"role": {
"type": "string",
"description": "角色 (user/assistant)"
},
"content": {
"type": "string",
"description": "消息内容"
},
"tokens_used": {
"type": "integer",
"description": "使用的token数"
},
"duration_ms": {
"type": "integer",
"description": "响应耗时(毫秒)"
},
"metadata": {
"type": "string",
"description": "额外信息(JSON格式)"
}
}
},
"model.SessionListResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/model.ChatSession"
}
},
"total": {
"type": "integer",
"description": "总数"
}
}
},
"model.MessageListResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/model.ChatMessage"
}
},
"total": {
"type": "integer",
"description": "总数"
}
}
},
"model.AgentMemory": {
"type": "object",
"properties": {
"id": {"type": "string", "description": "记忆ID"},
"agent_id": {"type": "string", "description": "Agent ID"},
"user_id": {"type": "string", "description": "用户ID"},
"content": {"type": "string", "description": "记忆内容"},
"memory_type": {"type": "string", "description": "记忆类型 (experience/preference/conversation/fact)"},
"category": {"type": "string", "description": "记忆分类"},
"tags": {"type": "string", "description": "标签JSON数组格式"},
"keywords": {"type": "string", "description": "关键词,用于搜索"},
"importance": {"type": "integer", "description": "重要性等级 (1-10)"},
"is_pinned": {"type": "boolean", "description": "是否置顶"},
"created_at": {"type": "string", "description": "创建时间"},
"updated_at": {"type": "string", "description": "更新时间"}
}
},
"model.CreateMemoryRequest": {
"type": "object",
"required": ["agent_id", "content"],
"properties": {
"agent_id": {"type": "string", "description": "Agent ID"},
"user_id": {"type": "string", "description": "用户ID"},
"content": {"type": "string", "description": "记忆内容"},
"memory_type": {"type": "string", "description": "记忆类型"},
"category": {"type": "string", "description": "记忆分类"},
"tags": {"type": "string", "description": "标签"},
"keywords": {"type": "string", "description": "关键词"},
"importance": {"type": "integer", "description": "重要性等级"},
"is_pinned": {"type": "boolean", "description": "是否置顶"}
}
},
"model.SearchMemoryRequest": {
"type": "object",
"required": ["agent_id"],
"properties": {
"agent_id": {"type": "string", "description": "Agent ID"},
"user_id": {"type": "string", "description": "用户ID"},
"keyword": {"type": "string", "description": "搜索关键词"},
"tags": {"type": "string", "description": "标签筛选"},
"category": {"type": "string", "description": "记忆分类"},
"memory_type": {"type": "string", "description": "记忆类型"},
"min_score": {"type": "integer", "description": "最小重要性分数"},
"limit": {"type": "integer", "description": "每页数量"},
"offset": {"type": "integer", "description": "偏移量"}
}
},
"model.UpdateMemoryRequest": {
"type": "object",
"properties": {
"content": {"type": "string", "description": "记忆内容"},
"memory_type": {"type": "string", "description": "记忆类型"},
"category": {"type": "string", "description": "记忆分类"},
"tags": {"type": "string", "description": "标签"},
"keywords": {"type": "string", "description": "关键词"},
"importance": {"type": "integer", "description": "重要性等级"},
"is_pinned": {"type": "boolean", "description": "是否置顶"}
}
},
"model.ImportMemoryRequest": {
"type": "object",
"required": ["agent_id", "memories"],
"properties": {
"agent_id": {"type": "string", "description": "Agent ID"},
"user_id": {"type": "string", "description": "用户ID"},
"memories": {
"type": "array",
"items": {"$ref": "#/definitions/model.ImportMemoryItem"}
}
}
},
"model.ImportMemoryItem": {
"type": "object",
"required": ["content"],
"properties": {
"content": {"type": "string", "description": "记忆内容"},
"memory_type": {"type": "string", "description": "记忆类型"},
"category": {"type": "string", "description": "记忆分类"},
"tags": {"type": "string", "description": "标签"},
"keywords": {"type": "string", "description": "关键词"},
"importance": {"type": "integer", "description": "重要性等级"}
}
},
"model.MemoryListResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {"$ref": "#/definitions/model.AgentMemory"}
},
"total": {"type": "integer", "description": "总数"}
}
}
}
}