Mistral: Change tool call id algorithm

4f46a8ff10ae68a65742415304036267ea129e15

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -1Showing whitespace changes
src/prompt-converters.js+2 -1
@@ -1,5 +1,6 @@
11require('./polyfill.js');
22const { getConfigValue } = require('./util.js');
3+const crypto = require('crypto');
34
45const PROMPT_PLACEHOLDER = getConfigValue('promptPlaceholder', 'Let\'s get started.');
56
@@ -522,7 +523,7 @@ function convertMistralMessages(messages, charName = '', userName = '') {
522523 lastMsg.prefix = true;
523524 }
524525
525526 const sanitizeToolId = (id) => idcrypto.replacehash(/[^a-zA-Z0-9]/g'sha512', id, 'base64').slice(0, 9);
526527
527528 // Doesn't support completion names, so prepend if not already done by the frontend (e.g. for group chats).
528529 messages.forEach(msg => {