Skip to content
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

.Net: Added support for OpenAI image detail level property #9561

Merged
merged 9 commits into from
Nov 6, 2024

Conversation

dmytrostruk
Copy link
Member

@dmytrostruk dmytrostruk commented Nov 5, 2024

Motivation and Context

Resolves: #4759

This PR adds a support for the detail property in the OpenAI image API. The property can be configured using ImageContent.Metadata property.

ImageContent.Metadata usage:

chatHistory.AddUserMessage(
[
    new TextContent("What’s in this image?"),
    new ImageContent(imageBytes, "image/jpg") { Metadata = new Dictionary<string, object?> { ["ChatImageDetailLevel"] = "high" } }
]);

Contribution Checklist

@dmytrostruk dmytrostruk self-assigned this Nov 5, 2024
@dmytrostruk dmytrostruk requested a review from a team as a code owner November 5, 2024 22:06
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Nov 5, 2024
@dmytrostruk dmytrostruk enabled auto-merge November 6, 2024 21:35
@dmytrostruk dmytrostruk added this pull request to the merge queue Nov 6, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 6, 2024
@dmytrostruk dmytrostruk added this pull request to the merge queue Nov 6, 2024
Merged via the queue into microsoft:main with commit 19fef34 Nov 6, 2024
15 checks passed
@dmytrostruk dmytrostruk deleted the image-content-detail branch November 6, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for a "detail" parameter when passing an ImageContent into ChatHistory.
3 participants