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: Add responseMimeType Parameter to GeminiPromptExecutionSettings for Enhanced Output Control. #9870

Merged

Conversation

shethaadit
Copy link
Contributor

Motivation and Context

Why is this change required?
The absence of the responseMimeType property in .NET prevented users from leveraging structured output formats available in the Gemini API, causing unintended behavior in scenarios requiring JSON or controlled output.

What problem does it solve?
Adds flexibility for developers by enabling control over MIME type responses, particularly for JSON data parsing and classification tasks.

What scenario does it contribute to?

  • Requests with structured response needs, such as JSON objects or controlled classification outputs.
  • Seamless migration and parity with the Python SDK's responseMimeType support.

Fixes #9863

Description

This PR adds support for the optional responseMimeType parameter to the GeminiPromptExecutionSettings class, allowing for better control over the output response format in Gemini API calls. This change addresses the missing ability to specify MIME types for valid JSON, plain text, or enumerated outputs.

Contribution Checklist

@shethaadit shethaadit requested a review from a team as a code owner December 3, 2024 04:44
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Dec 3, 2024
@github-actions github-actions bot changed the title Add responseMimeType Parameter to GeminiPromptExecutionSettings for Enhanced Output Control. .Net: Add responseMimeType Parameter to GeminiPromptExecutionSettings for Enhanced Output Control. Dec 3, 2024
@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Dec 3, 2024
Merged via the queue into microsoft:main with commit 3b8a7c2 Dec 3, 2024
18 checks passed
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
3 participants