Mistral: Change tool call id algorithm
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | require('./polyfill.js'); |
| 2 | 2 | const { getConfigValue } = require('./util.js'); |
| 3 | +const crypto = require('crypto'); | |
| 3 | 4 | |
| 4 | 5 | const PROMPT_PLACEHOLDER = getConfigValue('promptPlaceholder', 'Let\'s get started.'); |
| 5 | 6 | |
| @@ -522,7 +523,7 @@ function convertMistralMessages(messages, charName = '', userName = '') { | ||
| 522 | 523 | lastMsg.prefix = true; |
| 523 | 524 | } |
| 524 | 525 | |
| 525 | 526 | const sanitizeToolId = (id) => idcrypto.replacehash(/[^a-zA-Z0-9]/g'sha512', id, 'base64').slice(0, 9); |
| 526 | 527 | |
| 527 | 528 | // Doesn't support completion names, so prepend if not already done by the frontend (e.g. for group chats). |
| 528 | 529 | messages.forEach(msg => { |