We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be57514 commit af3ab69Copy full SHA for af3ab69
1 file changed
Core/Sources/OpenAIService/ChatGPTService.swift
@@ -128,6 +128,10 @@ public actor ChatGPTService: ChatGPTServiceType {
128
Task {
129
do {
130
let (trunks, cancel) = try await api()
131
+ guard isReceivingMessage else {
132
+ continuation.finish()
133
+ return
134
+ }
135
cancelTask = cancel
136
for try await trunk in trunks {
137
guard let delta = trunk.choices.first?.delta else { continue }
0 commit comments