mirror of
https://github.com/Ninluc/Dat_Boi.git
synced 2025-08-09 23:26:13 +02:00
Send message to ninluc
Some checks failed
Dat_Boi upload to portainer / Deploy (push) Failing after 2s
Some checks failed
Dat_Boi upload to portainer / Deploy (push) Failing after 2s
This commit is contained in:
@ -17,6 +17,7 @@ const { reset } = require("colors");
|
|||||||
const { resourceLimits } = require("node:worker_threads");
|
const { resourceLimits } = require("node:worker_threads");
|
||||||
const { strict } = require("node:assert");
|
const { strict } = require("node:assert");
|
||||||
const { connect } = require("node:http2");
|
const { connect } = require("node:http2");
|
||||||
|
const { sendNinluc } = require("../../handlers/functions");
|
||||||
|
|
||||||
// const { generateDependencyReport } = require('@discordjs/voice');
|
// const { generateDependencyReport } = require('@discordjs/voice');
|
||||||
// console.log(generateDependencyReport().blue);
|
// console.log(generateDependencyReport().blue);
|
||||||
@ -53,6 +54,10 @@ const SYSTEM_PROMPT =
|
|||||||
;
|
;
|
||||||
|
|
||||||
module.exports = async (client, oldState, voiceState) => {
|
module.exports = async (client, oldState, voiceState) => {
|
||||||
|
// DOn't do anything
|
||||||
|
if (getRandomInt(5) == 1) return;
|
||||||
|
|
||||||
|
|
||||||
var player, isRecording = false, isThinking = false, shouldStop = false, connection;
|
var player, isRecording = false, isThinking = false, shouldStop = false, connection;
|
||||||
let llmChat = [];
|
let llmChat = [];
|
||||||
llmChat.push({
|
llmChat.push({
|
||||||
@ -221,7 +226,7 @@ module.exports = async (client, oldState, voiceState) => {
|
|||||||
let llmAnswer = await getLLMAnswer(transcription, userId);
|
let llmAnswer = await getLLMAnswer(transcription, userId);
|
||||||
console.log(`> LLM Answer: ${llmAnswer.reply} ${llmAnswer.end_conversation ? "(end conversation)" : ""}`);
|
console.log(`> LLM Answer: ${llmAnswer.reply} ${llmAnswer.end_conversation ? "(end conversation)" : ""}`);
|
||||||
// Fin de la conversation
|
// Fin de la conversation
|
||||||
shouldStop = llmAnswer.end_conversation ?? llmChat.length >= CHAT_MAX_LENGTH ?? llmAnswer.reply.contains("à plus");
|
shouldStop = llmAnswer.end_conversation ?? llmChat.length >= CHAT_MAX_LENGTH ?? llmAnswer.reply.toLowerCase().contains("à plus");
|
||||||
if (!llmAnswer || llmAnswer.length < 1) {
|
if (!llmAnswer || llmAnswer.length < 1) {
|
||||||
console.error(`X LLM Answer failed or is empty!`, "error", 1);
|
console.error(`X LLM Answer failed or is empty!`, "error", 1);
|
||||||
handleRecording(connection, channel);
|
handleRecording(connection, channel);
|
||||||
@ -251,6 +256,7 @@ module.exports = async (client, oldState, voiceState) => {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log(`> Ending conversation with user ${userId}`);
|
console.log(`> Ending conversation with user ${userId}`);
|
||||||
|
sendNinluc(client, "Fin de la conversation avec l'utilisateur " + userId + " ```\n" + JSON.stringify(llmChat) + "\n```");
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user