Get intents from DB

This commit is contained in:
Apher 2026-07-07 02:07:16 +00:00
parent 146c17c0c0
commit 6a36e686b7

View File

@ -9,10 +9,23 @@ const models = require("./models");
const db = models.db;
const redis = models.redis;
const {sequelize, Sequelize} = db;
const Intent = db.intent;
async function getIntents() {
try {
const intents = await Intent.findAll();
console.log(intents);
return intents;
} catch (err) {
console.error("getIntents error:", err);
}
}
const config = require("./config");
const INTENTS = [
/*const INTENTS = [
{
name: "play_music",
examples: ["play music", "start music", "resume music", "play songs"],
@ -25,7 +38,7 @@ const INTENTS = [
name: "set_volume",
examples: ["set volume to 30", "volume 50", "turn volume up", "turn volume down"],
},
];
];*/
let extractor;
@ -148,6 +161,8 @@ const main = async () => {
if (doForce) console.info("Database dropped and resynced (force=true).");
const INTENTS = getIntents();
await initModel();
await redis.ensureGroup("transcripts", 'nlp');