-
Notifications
You must be signed in to change notification settings - Fork 839
Use RequestOptions from chat/responses clients #6819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.
src/Libraries/Microsoft.Extensions.AI.OpenAI/RequestOptionsExtensions.cs
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIResponsesChatClient.cs
Show resolved
Hide resolved
Would be nice just ensuring it works with Unit Tests checking the |
Microsoft Reviewers: Open in CodeFlow