Skip to content

.Net: Expose GeminiKernelFunctionMetadataExtensions #12515

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JanainaLudwig
Copy link

@JanainaLudwig JanainaLudwig commented Jun 17, 2025

Motivation and Context

GeminiToolCallBehavior exposes the method EnableFunctions to enable filtering which Kernel Functions are available for auto invoke. However, there's no way to construct a GeminiFunction instance since the constructor is internal.

I saw there's an extension to build a GeminiFunction from a KernelFunctionMetadata, but it's under the test project. It seems that it was supposed to be exposed from the library, since there's also a test file for KernelFunctionMetadata.

This way, it will be possible to use GeminiToolCallBehavior.EnableFunctions to explicitly specify which tools can be auto-called by the Google connector.

Description

  • Move GeminiKernelFunctionMetadataExtensions from SemanticKernel.Connectors.Google.UnitTests to Microsoft.SemanticKernel.Connectors.Google.Extensions namespace.
  • Remove FunctionMetadataAsGeminiFunction and start using GeminiKernelFunctionMetadataExtensions instead.

Contribution Checklist

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Jun 17, 2025
@github-actions github-actions bot changed the title Expose GeminiKernelFunctionMetadataExtensions .Net: Expose GeminiKernelFunctionMetadataExtensions Jun 17, 2025
@JanainaLudwig JanainaLudwig force-pushed the kernel-to-gemini-function branch from eeb3e2a to e9c36b0 Compare June 17, 2025 21:06
@JanainaLudwig
Copy link
Author

@microsoft-github-policy-service agree

@JanainaLudwig JanainaLudwig marked this pull request as ready for review June 17, 2025 22:08
@JanainaLudwig JanainaLudwig requested a review from a team as a code owner June 17, 2025 22:08
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.

2 participants