Skip to content

.Net: Fix Google Gemini Enums Schema definition #11617

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

Conversation

RogerBarreto
Copy link
Member

@RogerBarreto RogerBarreto commented Apr 17, 2025

Motivation and Context

AIJsonUtilities Schema generation does not generate the type for enum properties, this workaround became necessary to allow enums to be used with VertexAI/GoogleAI API's.

FYI @eiriktsarpalis

@RogerBarreto RogerBarreto self-assigned this Apr 17, 2025
@RogerBarreto RogerBarreto requested a review from a team as a code owner April 17, 2025 11:14
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Apr 17, 2025
@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Apr 17, 2025
github-merge-queue bot pushed a commit that referenced this pull request Apr 17, 2025
### Motivation and Context

- Fix #11395 

AIJsonUtilities Schema generation does not generate the `type` for
`enum` properties, this workaround became necessary to allow enums to be
used with VertexAI/GoogleAI API's.

FYI @eiriktsarpalis
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 17, 2025
@markwallace-microsoft
Copy link
Member

Merged failed due to timeouts

[xUnit.net 00:01:30.26]     SemanticKernel.IntegrationTests.Connectors.OpenAI.OpenAIChatCompletionFunctionCallingTests.ConnectorAgnosticFunctionCallingModelClassesSupportSimulatedFunctionCallsAsync [FAIL]
[xUnit.net 00:01:30.26]       Polly.Timeout.TimeoutRejectedException : The operation didn't complete within the allowed timeout of '00:00:30'.
[xUnit.net 00:01:30.26]       ---- System.Threading.Tasks.TaskCanceledException : A task was canceled.

@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Apr 17, 2025
Merged via the queue into microsoft:main with commit dbf0726 Apr 17, 2025
20 checks passed
@eiriktsarpalis
Copy link
Member

AIJsonUtilities Schema generation does not generate the type for enum properties

Can you elaborate? Pretty sure this is turned on by default:

https://github.com/dotnet/extensions/blob/44eaa2e6b4e0ad36c708d61eb806c93a15ff700f/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonSchemaCreateOptions.cs#L40-L43

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
5 participants