Fix chat completion not recognizing 0-position

This commit is contained in:
maver 2023-06-15 18:11:03 +02:00
parent dd7f326460
commit 21b37950e4
1 changed files with 1 additions and 1 deletions

View File

@ -1106,7 +1106,7 @@ class ChatCompletion {
this.validateMessageCollection(collection);
this.checkTokenBudget(collection, collection.identifier);
if (position) {
if (null !== position && -1 !== position) {
this.messages.collection[position] = collection;
} else {
this.messages.collection.push(collection);