Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

  • Fix KeyError when stream_options is not present in kwargs by using kwargs.get("stream_options") instead of kwargs["stream_options"] in both completions and responses methods

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: OhYee <13498329+OhYee@users.noreply.github.com>
@OhYee OhYee marked this pull request as ready for review December 5, 2025 02:44
Copilot AI review requested due to automatic review settings December 5, 2025 02:44
@OhYee OhYee merged commit c48aa3c into fix-add-include-usage Dec 5, 2025
3 checks passed
@OhYee OhYee deleted the copilot/sub-pr-11 branch December 5, 2025 02:44
Copilot AI requested a review from OhYee December 5, 2025 02:45
Copy link
Contributor

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 addresses a bug where accessing stream_options from kwargs could raise a KeyError when the key is not present. The fix uses kwargs.get("stream_options") instead of direct dictionary access kwargs["stream_options"] to safely handle cases where stream_options is not passed as an argument.

  • Changed dictionary access pattern from kwargs["stream_options"] to kwargs.get("stream_options") to prevent KeyError
  • Applied the fix consistently to both completions and responses methods in the ModelCompletionAPI class

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

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