diff --git a/backend/src/bundles/chat/open-ai.service.ts b/backend/src/bundles/chat/open-ai.service.ts index 96f79a6b9..6005a2f71 100644 --- a/backend/src/bundles/chat/open-ai.service.ts +++ b/backend/src/bundles/chat/open-ai.service.ts @@ -72,7 +72,7 @@ class OpenAIService implements OpenAIServiceModule { break; } - messages.splice(1, 1); + messages.splice(0, 1); totalTokens -= this.modelEncoding.encode( removedMessage.content,