mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-06 04:38:21 +01:00
#2557 Put MistralAI prefix under a feature toggle
This commit is contained in:
parent
8dd5d9321d
commit
5ad433c576
@ -93,6 +93,11 @@ openai:
|
||||
deepl:
|
||||
# Available options: default, more, less, prefer_more, prefer_less
|
||||
formality: default
|
||||
# -- MISTRAL API CONFIGURATION --
|
||||
mistral:
|
||||
# Enables prefilling of the reply with the last assistant message in the prompt
|
||||
# CAUTION: The prefix is echoed into the completion. You may want to use regex to trim it out.
|
||||
enablePrefix: false
|
||||
# -- SERVER PLUGIN CONFIGURATION --
|
||||
enableServerPlugins: false
|
||||
# User session timeout *in seconds* (defaults to 24 hours).
|
||||
|
@ -1,4 +1,5 @@
|
||||
require('./polyfill.js');
|
||||
const { getConfigValue } = require('./util.js');
|
||||
|
||||
/**
|
||||
* Convert a prompt from the ChatML objects to the format used by Claude.
|
||||
@ -373,8 +374,9 @@ function convertMistralMessages(messages, charName = '', userName = '') {
|
||||
}
|
||||
|
||||
// Make the last assistant message a prefill
|
||||
const prefixEnabled = getConfigValue('mistral.enablePrefix', false);
|
||||
const lastMsg = messages[messages.length - 1];
|
||||
if (messages.length > 0 && lastMsg && (lastMsg.role === 'assistant')) {
|
||||
if (prefixEnabled && messages.length > 0 && lastMsg?.role === 'assistant') {
|
||||
lastMsg.prefix = true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user