mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-07 15:48:46 +01:00
just incase
This commit is contained in:
parent
47357da20c
commit
f16ac8686e
@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||||
width="63.000000pt" height="63.000000pt" viewBox="0 0 63.000000 63.000000"
|
width="64.000000pt" height="64.000000pt" viewBox="0 0 53.000000 60.000000"
|
||||||
preserveAspectRatio="xMidYMid meet">
|
preserveAspectRatio="xMidYMid meet">
|
||||||
|
|
||||||
<g transform="translate(0.000000,63.000000) scale(0.100000,-0.100000)"
|
<g transform="translate(0.000000,63.000000) scale(0.100000,-0.100000)"
|
||||||
|
Before Width: | Height: | Size: 731 B After Width: | Height: | Size: 731 B |
@ -405,17 +405,17 @@ async function sendMistralAIRequest(request, response) {
|
|||||||
return response.status(400).send({ error: true });
|
return response.status(400).send({ error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
//must send a user role as last message
|
|
||||||
const messages = Array.isArray(request.body.messages) ? request.body.messages : [];
|
|
||||||
const lastMsg = messages[messages.length - 1];
|
|
||||||
if (messages.length > 0 && lastMsg && (lastMsg.role === 'system' || lastMsg.role === 'assistant')) {
|
|
||||||
lastMsg.role = 'user';
|
|
||||||
if(lastMsg.role === 'assistant') {
|
|
||||||
lastMsg.content = lastMsg.name + ': ' + lastMsg.content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//must send a user role as last message
|
||||||
|
const messages = Array.isArray(request.body.messages) ? request.body.messages : [];
|
||||||
|
const lastMsg = messages[messages.length - 1];
|
||||||
|
if (messages.length > 0 && lastMsg && (lastMsg.role === 'system' || lastMsg.role === 'assistant')) {
|
||||||
|
lastMsg.role = 'user';
|
||||||
|
if(lastMsg.role === 'assistant') {
|
||||||
|
lastMsg.content = lastMsg.name + ': ' + lastMsg.content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
request.socket.removeAllListeners('close');
|
request.socket.removeAllListeners('close');
|
||||||
request.socket.on('close', function () {
|
request.socket.on('close', function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user