Skip to content

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented Sep 18, 2025

Microsoft Reviewers: Open in CodeFlow

@stephentoub stephentoub requested a review from a team as a code owner September 18, 2025 03:13
@Copilot Copilot AI review requested due to automatic review settings September 18, 2025 03:13
@stephentoub stephentoub enabled auto-merge (squash) September 18, 2025 03:13
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Sep 18, 2025
Copy link
Contributor

@Copilot 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 adds support for using RequestOptions from chat/responses clients in the OpenAI integration. The changes introduce a new RequestOptionsExtensions class with utilities for creating RequestOptions and a custom user agent policy.

  • Adds RequestOptionsExtensions class with RequestOptions creation utilities and MEAI user agent support
  • Updates OpenAIChatClient to use internal overloads accepting RequestOptions via reflection
  • Updates OpenAIResponsesChatClient to use internal overloads accepting RequestOptions via reflection

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
RequestOptionsExtensions.cs New utility class for creating RequestOptions with custom MEAI user agent policy
OpenAIChatClient.cs Uses reflection to access internal RequestOptions overloads for chat completion methods
OpenAIResponsesChatClient.cs Uses reflection to access internal RequestOptions overloads for response creation methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rogerbarreto
Copy link
Contributor

Would be nice just ensuring it works with Unit Tests checking the User-Agent from an injected httpHandler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants