From 3db52282b874033241c1d79f4db20162ff7f1d23 Mon Sep 17 00:00:00 2001 From: Junyan Qin <1010553892@qq.com> Date: Wed, 16 Oct 2024 16:08:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=90=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=80=BC=E4=B8=BA=E7=A9=BA=E6=97=B6=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=A2=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/schema/command.json | 14 +++++++------- templates/schema/pipeline.json | 33 ++++++++++++++++++++++----------- templates/schema/platform.json | 4 +++- templates/schema/provider.json | 33 ++++++++++++++++++++++----------- templates/schema/system.json | 3 ++- 5 files changed, 56 insertions(+), 31 deletions(-) diff --git a/templates/schema/command.json b/templates/schema/command.json index 70bfeda7..1cfc2541 100644 --- a/templates/schema/command.json +++ b/templates/schema/command.json @@ -8,16 +8,15 @@ "description": "以数组形式设置,程序将前缀符合设置的消息视为命令(群内需要符合群响应规则)", "items": { "type": "string" - } + }, + "default": [ + "!", + "!" + ] }, "privilege": { "type": "object", "title": "权限管理", - "layout": { - "props": { - "title": "权限管理" - } - }, "description": "设置每个命令的权限配置。普通用户权限级别为 1,管理员(system.json中设置的)权限级别为 2;在这里设置每个命令的最低权限级别,若设置为1,则用户和管理员均可用,若为2,则仅管理员可用;设置子命令时,以点号间隔,如\"plugin.on\"", "properties": { "placeholder": { @@ -33,7 +32,8 @@ "minimum": 1, "maximum": 2 } - } + }, + "default": {} } } } \ No newline at end of file diff --git a/templates/schema/pipeline.json b/templates/schema/pipeline.json index 4b443ea6..3a51aeba 100644 --- a/templates/schema/pipeline.json +++ b/templates/schema/pipeline.json @@ -13,7 +13,8 @@ "enum": [ "blacklist", "whitelist" - ] + ], + "default": "blacklist" }, "blacklist": { "type": "array", @@ -23,7 +24,8 @@ "type": "string", "format": "regex", "pattern": "^(person|group)_(\\d)*$" - } + }, + "default": [] }, "whitelist": { "type": "array", @@ -33,7 +35,8 @@ "type": "string", "format": "regex", "pattern": "^(person|group)_(\\d)*$" - } + }, + "default": [] } }, "required": [ @@ -65,7 +68,8 @@ "description": "带有指定前缀的消息即使没有 at 机器人也会被响应,发送给 AI 时会删除前缀", "items": { "type": "string" - } + }, + "default": [] }, "regexp": { "type": "array", @@ -74,7 +78,8 @@ "items": { "type": "string", "format": "regex" - } + }, + "default": [] }, "random": { "type": "number", @@ -113,7 +118,8 @@ "description": "带有指定前缀的消息即使没有 at 机器人也会被响应,发送给 AI 时会删除前缀", "items": { "type": "string" - } + }, + "default": [] }, "regexp": { "type": "array", @@ -122,7 +128,8 @@ "items": { "type": "string", "format": "regex" - } + }, + "default": [] }, "random": { "type": "number", @@ -164,7 +171,8 @@ "description": "具有指定前缀的消息将被忽略", "items": { "type": "string" - } + }, + "default": [] }, "regexp": { "type": "array", @@ -173,7 +181,8 @@ "items": { "type": "string", "format": "regex" - } + }, + "default": [] } } }, @@ -205,11 +214,13 @@ }, "api-key": { "type": "string", - "title": "API Key" + "title": "API Key", + "default": "" }, "api-secret": { "type": "string", - "title": "API Secret" + "title": "API Secret", + "default": "" } } }, diff --git a/templates/schema/platform.json b/templates/schema/platform.json index 064e966b..4c2bab31 100644 --- a/templates/schema/platform.json +++ b/templates/schema/platform.json @@ -5,6 +5,7 @@ "platform-adapters": { "type": "array", "title": "消息平台适配器", + "default": {}, "items": { "type": "object", "oneOf": [ @@ -236,7 +237,8 @@ }, "font-path": { "type": "string", - "description": "image的渲染字体。未设置时,如果在windows下,会尝试寻找系统的微软雅黑字体,若找不到,则转为forward策略。未设置时,若不是windows系统,则直接转为forward策略" + "description": "image的渲染字体。未设置时,如果在windows下,会尝试寻找系统的微软雅黑字体,若找不到,则转为forward策略。未设置时,若不是windows系统,则直接转为forward策略", + "default": "" } } }, diff --git a/templates/schema/provider.json b/templates/schema/provider.json index 833b73bb..6b214233 100644 --- a/templates/schema/provider.json +++ b/templates/schema/provider.json @@ -25,7 +25,8 @@ "description": "OpenAI API 密钥", "items": { "type": "string" - } + }, + "default": [] }, "anthropic": { "type": "array", @@ -33,7 +34,8 @@ "description": "Anthropic API 密钥", "items": { "type": "string" - } + }, + "default": [] }, "moonshot": { "type": "array", @@ -41,7 +43,8 @@ "description": "Moonshot API 密钥", "items": { "type": "string" - } + }, + "default": [] }, "deepseek": { "type": "array", @@ -49,7 +52,8 @@ "description": "DeepSeek API 密钥", "items": { "type": "string" - } + }, + "default": [] } } }, @@ -68,7 +72,8 @@ "title": "API URL" }, "args": { - "type": "object" + "type": "object", + "default": {} }, "timeout": { "type": "number", @@ -87,7 +92,8 @@ "title": "API URL" }, "args": { - "type": "object" + "type": "object", + "default": {} }, "timeout": { "type": "number", @@ -106,7 +112,8 @@ "title": "API URL" }, "args": { - "type": "object" + "type": "object", + "default": {} }, "timeout": { "type": "number", @@ -125,7 +132,8 @@ "title": "API URL" }, "args": { - "type": "object" + "type": "object", + "default": {} }, "timeout": { "type": "number", @@ -175,14 +183,16 @@ "default": { "type": "string", "title": "默认情景预设", - "description": "设置默认情景预设。值为空字符串时,将不使用情景预设(人格)" + "description": "设置默认情景预设。值为空字符串时,将不使用情景预设(人格)", + "default": "" } }, "patternProperties": { "^.*$": { "type": "string", "title": "情景预设", - "description": "设置情景预设。值为空字符串时,将不使用情景预设(人格)" + "description": "设置情景预设。值为空字符串时,将不使用情景预设(人格)", + "default": "" } }, "required": ["default"] @@ -190,7 +200,8 @@ "runner": { "type": "string", "title": "请求运行器", - "description": "设置请求运行器。值为local-agent时,使用内置默认运行器;支持插件扩展" + "description": "设置请求运行器。值为local-agent时,使用内置默认运行器;支持插件扩展", + "default": "local-agent" } } } \ No newline at end of file diff --git a/templates/schema/system.json b/templates/schema/system.json index 3b0298bb..01286a3c 100644 --- a/templates/schema/system.json +++ b/templates/schema/system.json @@ -10,7 +10,8 @@ "type": "string", "format": "regex", "pattern": "^(person|group)_(\\d+)$" - } + }, + "default": [] }, "network-proxies": { "type": "object",