Skip to content

Conversation

@rogerbarreto
Copy link
Contributor

@rogerbarreto rogerbarreto commented Nov 13, 2025

Similar how it is handled by the OpenAIChatClient this allows setting the ImageDetail for OpenAIResponsesChatClient.

Microsoft Reviewers: Open in CodeFlow

@rogerbarreto rogerbarreto requested a review from a team as a code owner November 13, 2025 14:45
Copilot AI review requested due to automatic review settings November 13, 2025 14:45
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Nov 13, 2025
Copilot finished reviewing on behalf of rogerbarreto November 13, 2025 14:48
Copy link
Contributor

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

This PR adds image detail level support to OpenAIResponsesChatClient, enabling users to specify detail levels (like "high" or "low") for image content in chat messages. This feature was already available in OpenAIChatClient and is now being added for consistency.

  • Implements a GetImageDetail helper method that extracts detail level from AIContent.AdditionalProperties
  • Updates image content handling to pass the detail level to OpenAI's CreateInputImagePart methods
  • Adds comprehensive test coverage for both URI and data-based image content with detail levels

Reviewed Changes

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

File Description
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIResponsesChatClient.cs Adds GetImageDetail helper method and updates image content conversion to include detail level parameter
test/Libraries/Microsoft.Extensions.AI.OpenAI.Tests/OpenAIResponseClientTests.cs Adds test cases for image content with both string and ResponseImageDetailLevel type detail levels

@stephentoub stephentoub merged commit f78280e into dotnet:main Nov 14, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants