Skip to content

Conversation

stephentoub
Copy link
Contributor

Reuse the same fix as was previously applied for CreateMessage
Fixes #52671

Reuse the same fix as was previously applied for CreateMessage
@stephentoub stephentoub requested a review from trangevi as a code owner October 6, 2025 01:15
@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 01:15
@github-actions github-actions bot added AI Model Inference AI Projects Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Oct 6, 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

Fixes incorrect serialization in CreateMessageAsync by reusing the same JSON serialization logic as the synchronous CreateMessage method. Extracts the shared serialization logic into a new private helper to eliminate duplication and correct the earlier bug.

  • Refactors duplicated serialization logic into ConvertMessageInputContentBlocksToJson.
  • Corrects async path to serialize the produced JsonElements instead of the original content block objects.

Copy link

github-actions bot commented Oct 6, 2025

Thank you for your contribution @stephentoub! We will review the pull request and get back to you soon.

@nick863 nick863 merged commit 0dd3cf9 into Azure:main Oct 8, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Model Inference AI Projects Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Serialization error with AI Agents: Unable to cast object of type 'd__2' to type

3 participants