-
Notifications
You must be signed in to change notification settings - Fork 827
Expose additional chat model conversion helpers #6629
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
- Exposes the conversion routines for converting OpenAI output responses - Moves the extensions into the namespace most relevant to the performed operation
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 exposes additional chat model conversion helpers by refactoring extension methods and moving them to more appropriate namespaces. The changes improve API organization by placing conversion extensions within the OpenAI namespaces most relevant to each specific operation.
- Moves conversion extension methods from
OpenAIClientExtensions
to namespace-specific extension classes - Exposes internal conversion methods to support the new public extension methods
- Fixes class naming inconsistencies (e.g.,
OpenAIAssistantChatClient
→OpenAIAssistantsChatClient
)
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
OpenAIClientExtensions.cs | Removes conversion extension methods and updates class references |
MicrosoftExtensionsAIChatExtensions.cs | New extension class for OpenAI.Chat namespace conversions |
MicrosoftExtensionsAIAssistantsExtensions.cs | New extension class for OpenAI.Assistants namespace conversions |
MicrosoftExtensionsAIResponsesExtensions.cs | New extension class for OpenAI.Responses namespace conversions |
MicrosoftExtensionsAIRealtimeExtensions.cs | New extension class for OpenAI.Realtime namespace conversions |
OpenAIChatClient.cs | Exposes internal conversion method and removes unnecessary condition |
OpenAIResponsesChatClient.cs | Fixes class name and exposes internal conversion method |
OpenAIAssistantsChatClient.cs | Fixes class name and adds new constructor overload |
Comments suppressed due to low confidence (1)
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIResponsesChatClient.cs:26
- [nitpick] The class name change from 'OpenAIResponseChatClient' to 'OpenAIResponsesChatClient' adds an 's' but this doesn't align with the namespace 'OpenAI.Responses'. Consider 'OpenAIResponseChatClient' to match the singular form used in other similar class names in the codebase.
internal sealed class OpenAIResponsesChatClient : IChatClient
Microsoft Reviewers: Open in CodeFlow