Remove last message role restriction for Cohere

This commit is contained in:
cloak1505
2025-04-24 19:35:05 -05:00
committed by GitHub
parent c16be2ec0e
commit a4442899f6

View File

@ -351,11 +351,6 @@ export function convertCohereMessages(messages, names) {
}
});
// A prompt should end with a user/tool message
if (messages.length && !['user', 'tool'].includes(messages[messages.length - 1].role)) {
messages[messages.length - 1].role = 'user';
}
return { chatHistory: messages };
}