Skip to content

Commit 4fb18d7

Browse files
authored
Update Sources/OpenAI/Private/Streaming/ModelResponseEventsStreamInterpreter.swift
1 parent 0840940 commit 4fb18d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/OpenAI/Private/Streaming/ModelResponseEventsStreamInterpreter.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ final class ModelResponseEventsStreamInterpreter: @unchecked Sendable, StreamInt
5858
let finalEvent = event.fixMappingError()
5959
var eventType = finalEvent.eventType
6060

61-
// "message" is currently the default if no SSE event name is specified
61+
/// If the SSE `event` property is not specified by the provider service, our parser defaults it to "message" which is not a valid model response type.
62+
/// In this case we check the `data.type` property for a valid model response type.
6263
if eventType == "message" || eventType.isEmpty,
6364
let payloadEventType = finalEvent.getPayloadType() {
6465
eventType = payloadEventType

0 commit comments

Comments
 (0)