Skip to content

Commit 23aa920

Browse files
authored
Fix array history list truncation method
1 parent 868319d commit 23aa920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Shared/ChatGPTAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ChatGPTAPI: @unchecked Sendable {
5555
var messages = [systemMessage] + historyList + [Message(role: "user", content: text)]
5656

5757
if messages.contentCount > (4000 * 4) {
58-
_ = historyList.dropFirst()
58+
_ = historyList.removeFirst()
5959
messages = generateMessages(from: text)
6060
}
6161
return messages

0 commit comments

Comments
 (0)