From 67ebf0fc06a6b712528714623fd39174a844f24d Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 6 Oct 2024 23:58:10 +0300 Subject: [PATCH] Use classic hash method for Node 18 --- src/prompt-converters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prompt-converters.js b/src/prompt-converters.js index a7e783a34..23dcd05c9 100644 --- a/src/prompt-converters.js +++ b/src/prompt-converters.js @@ -545,7 +545,7 @@ function convertMistralMessages(messages, charName = '', userName = '') { lastMsg.prefix = true; } - const sanitizeToolId = (id) => crypto.hash('sha512', id, 'hex').slice(0, 9); + const sanitizeToolId = (id) => crypto.createHash('sha512').update(id).digest('hex').slice(0, 9); // Doesn't support completion names, so prepend if not already done by the frontend (e.g. for group chats). messages.forEach(msg => {