Skip to content

Conversation

@longseespace
Copy link
Contributor

Overview

Currently, SwiftOpenAI throws a DecodingError.dataCorruptedError for an unknown response stream event. This is not a good behavior IMO. For example, currently there are new events from OpenAI that are not handled in the library. It's harmless (citation related) but it would break the happy path flow at the app-level.

I think the better solution is to return a unknownEventType response instead and let the app decide how to handle it.

@jamesrochabrun
Copy link
Owner

make sense to me!

@jamesrochabrun
Copy link
Owner

@longseespace sorry the delay, are you interested to merge this change? (asking because is a Draft still)

@longseespace longseespace marked this pull request as ready for review September 25, 2025 05:42
@longseespace
Copy link
Contributor Author

Ah sorry. I've marked it as ready.

@jamesrochabrun jamesrochabrun merged commit 0a5c9cc into jamesrochabrun:main Sep 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants