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

Python: Improve handling for kernel plugin from file. #10286

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

moonbox3
Copy link
Contributor

Motivation and Context

This PR addresses an issue in the KernelPlugin.from_directory() method where classes without any @kernel_function decorated methods are still being initialized during plugin loading.

The fix makes sure that only classes with at least one @kernel_function decorated method are instantiated and included as plugins. Classes without @kernel_function methods are now skipped entirely.

Description

This PR:

Contribution Checklist

@moonbox3 moonbox3 self-assigned this Jan 24, 2025
@moonbox3 moonbox3 requested a review from a team as a code owner January 24, 2025 03:25
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Jan 24, 2025
@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/functions
   kernel_plugin.py180697%392, 395, 408, 433, 454, 479
TOTAL16960182589% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3021 4 💤 0 ❌ 0 🔥 1m 49s ⏱️

@TaoChenOSU TaoChenOSU added this pull request to the merge queue Jan 24, 2025
Merged via the queue into microsoft:main with commit 5098ba3 Jan 24, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel
Projects
Status: Sprint: Done
Development

Successfully merging this pull request may close these issues.

Python: Bug: KernelPlugin.from_directory initialises Python classes with no @kernel_function methods
4 participants