Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use RequestOptions from chat/responses clients - #6819

#6819
Merged
stephentoub merged 1 commit into
dotnet:maindotnet/extensions:mainfrom
stephentoub:userequestoptionsstephentoub/extensions:userequestoptionsCopy head branch name to clipboard
Sep 18, 2025
Merged

Use RequestOptions from chat/responses clients#6819
stephentoub merged 1 commit into
dotnet:maindotnet/extensions:mainfrom
stephentoub:userequestoptionsstephentoub/extensions:userequestoptionsCopy head branch name to clipboard

Conversation

@stephentoub

@stephentoub stephentoub commented Sep 18, 2025

Copy link
Copy Markdown
Member
Microsoft Reviewers: Open in CodeFlow

@stephentoub
stephentoub requested a review from a team as a code owner September 18, 2025 03:13
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIChatClient.cs
@rogerbarreto

Copy link
Copy Markdown
Contributor

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

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

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.