* @returns a promise that resolves with the final ChatCompletion, or rejects * if an error occurred or the stream ended prematurely without producing a ChatCompletion.
()
| 81844 | } |
| 81845 | } |
| 81846 | } |
| 81847 | } |
| 81848 | /** |
| 81849 | * @returns a promise that resolves with the final ChatCompletion, or rejects |
| 81850 | * if an error occurred or the stream ended prematurely without producing a ChatCompletion. |
| 81851 | */ |
| 81852 | async finalChatCompletion() { |
| 81853 | await this.done(); |
| 81854 | const completion = this._chatCompletions[this._chatCompletions.length - 1]; |
| 81855 | if (!completion) |