fix: append continuation message after prefill
This commit is contained in:
parent
14b48c5b34
commit
8401cc6032
|
@ -132,7 +132,9 @@ function convertClaudeMessages(messages, prefillString, useSysPrompt, humanMsgFi
|
|||
});
|
||||
|
||||
// Shouldn't be conditional anymore, messages api expects the last role to be user unless we're explicitly prefilling
|
||||
if (prefillString) {
|
||||
if (messages[messages.length - 1].role == 'assistant' && prefillString) {
|
||||
messages[messages.length - 1].content = prefillString.trimEnd() + messages[messages.length - 1].content;
|
||||
} else if (prefillString) {
|
||||
messages.push({
|
||||
role: 'assistant',
|
||||
content: prefillString.trimEnd(),
|
||||
|
|
Loading…
Reference in New Issue