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: Expose underlying method from kernel function #11378

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

SergeyMenshykh
Copy link
Member

Motivation, Context and Description

Currently, there is no way to access the underlying method that an instance of KernelFunctionFromMethod was created from or wraps. Being able to access this underlying method is useful when additional metadata is needed. For example, if the method has a custom attribute, you may need to retrieve that attribute to determine the execution path.

This PR adopts the same approach as M.E.AI by exposing the native method through the public MethodInfo? UnderlyingMethod {...} property. This property is null by default and is only initialized for native functions represented by the KernelFunctionFromMethod class.

Closes: #11182

@SergeyMenshykh SergeyMenshykh requested a review from a team as a code owner April 4, 2025 12:53
@SergeyMenshykh SergeyMenshykh self-assigned this Apr 4, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Apr 4, 2025
@SergeyMenshykh SergeyMenshykh added function_calling and removed kernel Issues or pull requests impacting the core kernel kernel.core labels Apr 4, 2025
@markwallace-microsoft markwallace-microsoft added kernel Issues or pull requests impacting the core kernel kernel.core labels Apr 4, 2025
@SergeyMenshykh SergeyMenshykh enabled auto-merge April 4, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
function_calling kernel.core kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
Status: Sprint: In Review
Development

Successfully merging this pull request may close these issues.

.Net: New Feature: Define Additional Metadata of native plugin function via data annotations
3 participants