Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Expose M.E.AI.OpenAI input message conversions#6601

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
stephentoub merged 1 commit intodotnet:mainfromstephentoub:messagehelpers
Jul 11, 2025

Conversation

@stephentoub
Copy link
Member

@stephentoubstephentoub commentedJul 11, 2025
edited by dotnet-policy-servicebot
Loading

Internally we have helpers that convert from M.E.AI chat messages to the various OpenAI object models. To ease interop when a developer gets M.E.AI messages from another library and then wants to submit them on their own to OpenAI, this just exposes those helpers publicly.

Microsoft Reviewers:Open in CodeFlow

Internally we have helpers that convert from M.E.AI chat messages to the various OpenAI object models. To ease interop when a developer gets M.E.AI messages from another library and then wants to submit them on their own to OpenAI, this just exposes those helpers publicly.
@stephentoubstephentoub requested a review froma team as acode ownerJuly 11, 2025 20:43
@github-actionsgithub-actionsbot added the area-aiMicrosoft.Extensions.AI libraries labelJul 11, 2025
Copy link
Contributor

CopilotAI 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 exposes internal helper methods to convert M.E.AI chat messages into OpenAI SDK types by making them accessible via public extensions and updating existing client implementations.

  • Add public extensionsAsOpenAIChatMessages andAsOpenAIResponseItems
  • ChangeToOpenAIChatMessages andToOpenAIResponseItems from private to internal and adjust their signatures
  • UpdateOpenAIChatClient andOpenAIResponseChatClient to use default JSON options and call the new internal methods
  • Add comprehensive tests for the new extensions; remove a duplicate test file

Reviewed Changes

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

Show a summary per file
FileDescription
test/Libraries/Microsoft.Extensions.AI.OpenAI.Tests/OpenAIConversionTests.csNew tests coveringAsOpenAIChatMessages andAsOpenAIResponseItems
test/Libraries/Microsoft.Extensions.AI.OpenAI.Tests/OpenAIAIFunctionConversionTests.csRemoved redundant conversion tests
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIResponseChatClient.csMadeToOpenAIResponseItems internal; added pragma for SA1202
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIClientExtensions.csAddedAsOpenAIChatMessages &AsOpenAIResponseItems extensions
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIChatClient.csUpdatedToOpenAIChatMessages signature and removed JSON options parameter
Comments suppressed due to low confidence (1)

src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIResponseChatClient.cs:20

  • [nitpick] Disabling SA1202 suppresses warnings about element ordering; consider reordering members to follow access-order conventions instead of disabling the rule.
#pragma warning disable SA1202 // Elements should be ordered by access

@stephentoubstephentoubenabled auto-merge (squash)July 11, 2025 21:15
@stephentoubstephentoub merged commit194d9db intodotnet:mainJul 11, 2025
7 checks passed
jeffhandley pushed a commit to jeffhandley/extensions that referenced this pull requestJul 14, 2025
Internally we have helpers that convert from M.E.AI chat messages to the various OpenAI object models. To ease interop when a developer gets M.E.AI messages from another library and then wants to submit them on their own to OpenAI, this just exposes those helpers publicly.
jeffhandley pushed a commit that referenced this pull requestJul 15, 2025
Internally we have helpers that convert from M.E.AI chat messages to the various OpenAI object models. To ease interop when a developer gets M.E.AI messages from another library and then wants to submit them on their own to OpenAI, this just exposes those helpers publicly.
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 11, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

Copilot code reviewCopilotCopilot left review comments

@jeffhandleyjeffhandleyjeffhandley approved these changes

@eiriktsarpaliseiriktsarpalisAwaiting requested review from eiriktsarpalis

Assignees

@stephentoubstephentoub

Labels

area-aiMicrosoft.Extensions.AI libraries

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@stephentoub@jeffhandley

[8]ページ先頭

©2009-2025 Movatter.jp