skip when choices is empty

This commit is contained in:
2023-12-22 17:14:28 +08:00
parent 54f2843677
commit 54abddc517
2 changed files with 6 additions and 9 deletions

View File

@@ -329,13 +329,6 @@ class Chat {
};
}
completeWithSteam() {
this.total_tokens = this.messages
.map((msg) => this.calculate_token_length(msg.content as string) + 20)
.reduce((a, v) => a + v);
return this._fetch(true);
}
calculate_token_length(content: string | MessageDetail[]): number {
return calculate_token_length(content);
}