docs: 更新 callAIKeywords 参数说明

This commit is contained in:
Del Wang
2025-04-19 10:16:20 +08:00
parent 9ab2ec4058
commit b63a8f95a6
+4
View File
@@ -8,6 +8,10 @@ async function main() {
baseURL: "https://api.openai.com/v1",
apiKey: "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
// 默认只会处理以下关键词开头的消息(你也可以自定义),比如:
// - 请问地球为什么是圆的?
// - 你知道世界上跑的最快的动物是什么吗?
callAIKeywords: ["请", "你"],
async onMessage(_engine, { text }) {
if (text.startsWith("你好")) {
await sleep(1000);