mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Mistral: Change tool call id algorithm
This commit is contained in:
		| @@ -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 => { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user