mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-11 17:07:07 +01:00
Mistral: Change tool call id algorithm
This commit is contained in:
parent
927c2418e0
commit
4f46a8ff10
@ -1,5 +1,6 @@
|
|||||||
require('./polyfill.js');
|
require('./polyfill.js');
|
||||||
const { getConfigValue } = require('./util.js');
|
const { getConfigValue } = require('./util.js');
|
||||||
|
const crypto = require('crypto');
|
||||||
|
|
||||||
const PROMPT_PLACEHOLDER = getConfigValue('promptPlaceholder', 'Let\'s get started.');
|
const PROMPT_PLACEHOLDER = getConfigValue('promptPlaceholder', 'Let\'s get started.');
|
||||||
|
|
||||||
@ -522,7 +523,7 @@ function convertMistralMessages(messages, charName = '', userName = '') {
|
|||||||
lastMsg.prefix = true;
|
lastMsg.prefix = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sanitizeToolId = (id) => id.replace(/[^a-zA-Z0-9]/g, '').slice(0, 9);
|
const sanitizeToolId = (id) => crypto.hash('sha512', id, 'base64').slice(0, 9);
|
||||||
|
|
||||||
// Doesn't support completion names, so prepend if not already done by the frontend (e.g. for group chats).
|
// Doesn't support completion names, so prepend if not already done by the frontend (e.g. for group chats).
|
||||||
messages.forEach(msg => {
|
messages.forEach(msg => {
|
||||||
|
Loading…
Reference in New Issue
Block a user