UNPKG

koishi-plugin-sus-chat

Version:
95 lines (94 loc) 4.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Config = void 0; const koishi_1 = require("koishi"); exports.Config = koishi_1.Schema.object({ api: koishi_1.Schema.string().description("API").required(), api_key: koishi_1.Schema.string().description("KEY").required(), model: koishi_1.Schema.string().default("gpt-3.5-turbo").description("模型"), max_length: koishi_1.Schema.number() .role("slider") .min(3) .max(50) .default(10) .step(1) .description("记忆长度上限"), temperature: koishi_1.Schema.number() .role("slider") .min(0.0) .max(2.0) .step(0.0001) .default(0.5) .description("默认温度(会受高阶提示词影响)"), prompt: koishi_1.Schema.intersect([ koishi_1.Schema.object({ pro_prompt: koishi_1.Schema.boolean().default(false).description("使用高阶提示词"), }).description("提示词"), koishi_1.Schema.union([ koishi_1.Schema.object({ pro_prompt: koishi_1.Schema.const(false), prompt_str: koishi_1.Schema.string() .default("你是个有用的助理,当前与你对话的用户的昵称为:{{ session.user.name }}") .description("提示词内容"), }), koishi_1.Schema.object({ pro_prompt: koishi_1.Schema.const(true).required(), prompt_directory: koishi_1.Schema.path({ filters: ["directory"], }) .required() .description("提示词文件所在目录"), default_prompt: koishi_1.Schema.computed(koishi_1.Schema.string().required()).description("默认提示词"), }), ]), ]), functionality: koishi_1.Schema.object({ persistence: koishi_1.Schema.boolean() .default(true) .description("是否将消息记录持久化"), extension_count: koishi_1.Schema.number() .default(0) .max(10) .step(1) .min(0) .description("追溯上下文条目数量"), logging: koishi_1.Schema.boolean() .default(false) .description("是否于每句对话输出日志"), tiggering: koishi_1.Schema.object({ random_reply: koishi_1.Schema.intersect([ koishi_1.Schema.object({ enable: koishi_1.Schema.boolean() .default(false) .description("是否启用随机回复"), }).description("随机回复"), koishi_1.Schema.union([ koishi_1.Schema.object({ enable: koishi_1.Schema.const(false), }), koishi_1.Schema.object({ enable: koishi_1.Schema.const(true).required(), probability: koishi_1.Schema.number() .default(0.5) .min(0) .max(1) .step(0.001) .role("slider") .description("随机回复概率"), }), ]), ]), keywords: koishi_1.Schema.object({ keywords_for_triggering: koishi_1.Schema.array(koishi_1.Schema.string()) .default([]) .description("触发关键词 (提示词文件中也可写 keywords)"), use_regex: koishi_1.Schema.boolean() .default(false) .description("关键词是否使用正则表达式"), }).description("关键词触发"), when_direct_reply: koishi_1.Schema.boolean() .default(false) .description("是否于私聊时无需任何方式,直接触发"), }), }).description("功能性"), });