feat: roles must alternate between user and assistant in claude, so add a fake assistant message between two user messages

This commit is contained in:
butterfly
2024-04-07 18:02:31 +08:00
parent 768decde93
commit 86b5c55855
2 changed files with 20 additions and 153 deletions

View File

@@ -496,7 +496,6 @@ export const useChatStore = createPersistStore(
tokenCount += estimateTokenLength(getMessageTextContent(msg));
reversedRecentMessages.push(msg);
}
// concat all messages
const recentMessages = [
...systemPrompts,