mi-gpt/tests/db/index.ts
2024-01-30 23:40:31 +08:00

24 lines
660 B
TypeScript
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.

import { assert } from "console";
import { ConversationManager } from "../../src/services/bot/conversation";
import { println } from "../../src/utils/base";
export async function testDB() {
const manager = new ConversationManager({
bot: {
name: "小爱同学",
profile: "我是小爱同学,机器人",
},
master: {
name: "王黎",
profile: "我是王黎,人类",
},
room: {
name: "客厅",
description: "王黎的客厅,小爱同学放在角落里",
},
});
const { room } = await manager.loadOrUpdateConfig();
assert(room, "❌ load config failed");
println("✅ hello world");
}