Skip to content

Conversation

@annie444
Copy link

Non-OpenAI APIs that implement a similar interface don't always include the output[].content[].annotations JSON path. Specifically, I ran into this issue with LM Studio, which doesn't include that attribute.

This pull request makes a minor change to the OutputTextContent struct in async-openai/src/types/responses/response.rs. The change ensures that the annotations field will now default to an empty vector if it is missing during deserialization, which improves robustness when handling API responses for non-OpenAI APIs.

…ude the `output[].content[].annotations` path
Copilot AI review requested due to automatic review settings November 21, 2025 23:20
Copilot finished reviewing on behalf of annie444 November 21, 2025 23:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves compatibility with non-OpenAI APIs that implement OpenAI-compatible interfaces (such as LM Studio) by making the annotations field in OutputTextContent optional during deserialization. The change uses the #[serde(default)] attribute to ensure that if the field is missing in the API response, it will default to an empty vector instead of causing a deserialization error.

Key Changes

  • Added #[serde(default)] attribute to the annotations field in the OutputTextContent struct to allow it to be missing from API responses while defaulting to an empty Vec

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@annie444 annie444 marked this pull request as draft November 21, 2025 23:42
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