Skip to content

Commit 3fcc656

Browse files
authored
Merge pull request #383 from neelvirdy/nvirdy/return-decode
Fix: Return after decoding ResponseStreamEvent successfully
2 parents a6e2f87 + 3e332ca commit 3fcc656

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/OpenAI/Public/Schemas/Facade/ResponseStreamEvent.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ public enum ResponseStreamEvent: Codable, Equatable, Sendable {
232232
default:
233233
throw ResponseStreamEventDecodingError.unknownEventType(responseEvent.type)
234234
}
235+
return
235236
} catch {
236237
// Do nothing, will try other coding types
237238
}
@@ -240,6 +241,7 @@ public enum ResponseStreamEvent: Codable, Equatable, Sendable {
240241
// Decoding Output Item events
241242
let outputItemAddedEvent = try ResponseOutputItemAddedEvent(from: decoder)
242243
self = .outputItem(.added(outputItemAddedEvent))
244+
return
243245
} catch {
244246
// Do nothing, will try other coding types
245247
}
@@ -248,6 +250,7 @@ public enum ResponseStreamEvent: Codable, Equatable, Sendable {
248250
// Decoding Output Item events
249251
let outputItemDoneEvent = try ResponseOutputItemDoneEvent(from: decoder)
250252
self = .outputItem(.done(outputItemDoneEvent))
253+
return
251254
} catch {
252255
// Do nothing, will try other coding types
253256
}
@@ -267,6 +270,7 @@ public enum ResponseStreamEvent: Codable, Equatable, Sendable {
267270
case .done(let doneEvent):
268271
self = .mcpCallArguments(.done(doneEvent))
269272
}
273+
return
270274
} catch {
271275
//
272276
}

0 commit comments

Comments
 (0)