Skip to content

Conversation

@arnab621
Copy link

@arnab621 arnab621 commented Apr 7, 2025

Added SelectionStrategy

Motivation and Context

The SelectionStrategy class was defined in the semantic_kernel.agents.strategies.selection module but was not included in the package's init.py file. This omission means it was not exposed as part of the public API when importing from semantic_kernel.agents.strategies. Including this allows the use of SelectionStrategy within AgentGroupChat etc.

Description

This PR adds SelectionStrategy to the init.py file under semantic_kernel.agents.strategies, both as an import and in the all list. This change ensures the strategy is properly exported as part of the public interface of the module.

Contribution Checklist

@arnab621 arnab621 requested a review from a team as a code owner April 7, 2025 23:04
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Apr 7, 2025
@github-actions github-actions bot changed the title Update __init__.py for selectionstrategy Python: Update __init__.py for selectionstrategy Apr 7, 2025
@markwallace-microsoft
Copy link
Member

Python Unit Test Overview

Tests Skipped Failures Errors Time
3418 5 💤 0 ❌ 0 🔥 1m 29s ⏱️

Copy link
Collaborator

@moonbox3 moonbox3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. Please make sure you install and run the pre-commit checks as part of developing locally. See here for more info.

Just as a quick note on Python conventions: while adding something to __init__.py provides a convenient, shorter import path, the absence of an import in __init__.py doesn't necessarily imply that something is not part of the public API. Python doesn't have strict enforcement of public/private APIs as seen in some other languages; rather, public versus private is typically indicated by naming conventions and documented usage patterns.

Nevertheless, your update makes the import more convenient and consistent with the rest of the package, so this is a helpful improvement -- thank you.

@moonbox3
Copy link
Collaborator

moonbox3 commented Apr 8, 2025

Also @arnab621, I realized that the SelectionStrategy class should be handled here and here, given the way we're handling the agent imports now.

@moonbox3
Copy link
Collaborator

Haven't heard from you in a bit so superseding with #11636.

@moonbox3 moonbox3 closed this Apr 22, 2025
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

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants