Skip to content

Conversation

zats
Copy link
Contributor

@zats zats commented Sep 3, 2025

I noticed that local open-ai compatible response would fail parsing oftentimes with some fields missing;
Made toolChoice and the token metrics optional to satisfy.

I can see how it might be a breaking change for some consumers but unsure if it's better to provide a default value (might also break assumptions)

…s for optional fields.

This prevents crashes when the API response is missing optional fields that were previously expected to be present.

Changes:
- Added custom decoders to `ResponseObject` and `OutputTextContent` to provide default values for missing keys.
- Made `inputTokensDetails` and `outputTokensDetails` in `ResponseUsage` optional.
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.

1 participant