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: Merge Kernel, KernelBase, KernelExtensions #1015

Merged
merged 14 commits into from
May 17, 2023

Conversation

awharrison-28
Copy link
Contributor

Motivation and Context

The separation of Kernel, KernelBase, and KernelExtensions is several layers of unnecessary abstraction. This PR does not change any API or kernel behavior - it just reduces the number of files and namespaces to accomplish the same functionality.

Description

  • Removed the semantic_kernel/kernel_extensions namespace. Methods that existed in this namespace now exist in kernel.py.
  • Removed KernelBase - this abstract class implies that there are multiple ways to instantiate SK. For Python, we expect only a single type of Kernel to instantiated for all instances.
  • Updated tests and imports to accommodate the above changes.

Contribution Checklist

@awharrison-28 awharrison-28 requested review from dluc and mkarle May 15, 2023 23:10
@github-actions github-actions bot added the python Pull requests for the Python Semantic Kernel label May 15, 2023
alexchaomander
alexchaomander previously approved these changes May 15, 2023
Copy link
Contributor

@alexchaomander alexchaomander left a comment

Choose a reason for hiding this comment

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

Glad we're cleaning this up!

dluc
dluc previously approved these changes May 15, 2023
@awharrison-28 awharrison-28 requested a review from mkarle May 16, 2023 18:57
@awharrison-28 awharrison-28 dismissed stale reviews from alexchaomander and dluc via f73c672 May 16, 2023 19:23
@awharrison-28 awharrison-28 added the PR: ready to merge PR has been approved by all reviewers, and is ready to merge. label May 17, 2023
@dluc dluc merged commit 493dfc1 into microsoft:main May 17, 2023
29 checks passed
andhesky pushed a commit to andhesky/semantic-kernel that referenced this pull request May 18, 2023
### Motivation and Context
The separation of Kernel, KernelBase, and KernelExtensions is several
layers of unnecessary abstraction. This PR does not change any API or
kernel behavior - it just reduces the number of files and namespaces to
accomplish the same functionality.


### Description
- Removed the `semantic_kernel/kernel_extensions` namespace. Methods
that existed in this namespace now exist in kernel.py.
- Removed KernelBase - this abstract class implies that there are
multiple ways to instantiate SK. For Python, we expect only a single
type of Kernel to instantiated for all instances.
- Updated tests and imports to accommodate the above changes.
shawncal pushed a commit to johnoliver/semantic-kernel that referenced this pull request May 19, 2023
### Motivation and Context
The separation of Kernel, KernelBase, and KernelExtensions is several
layers of unnecessary abstraction. This PR does not change any API or
kernel behavior - it just reduces the number of files and namespaces to
accomplish the same functionality.


### Description
- Removed the `semantic_kernel/kernel_extensions` namespace. Methods
that existed in this namespace now exist in kernel.py.
- Removed KernelBase - this abstract class implies that there are
multiple ways to instantiate SK. For Python, we expect only a single
type of Kernel to instantiated for all instances.
- Updated tests and imports to accommodate the above changes.
lemillermicrosoft pushed a commit that referenced this pull request May 19, 2023
### Motivation and Context
Use of abstraction was not consistent in the python SK. This PR makes
the import and use of ABC consistent and removes unused file kernel.py.

### Description
- MemoryStoreBase derives from ABC - this properly sets its metaclass.
MemoryStoreBase itself should never be instantiated, only derived.
- RetryMechanism derives ABC, so should be named 'Base' like all other
derivatives of ABC in this repo.
- removed kernel_base.py, was made obsolete by
#1015
shawncal pushed a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
### Motivation and Context
Use of abstraction was not consistent in the python SK. This PR makes
the import and use of ABC consistent and removes unused file kernel.py.

### Description
- MemoryStoreBase derives from ABC - this properly sets its metaclass.
MemoryStoreBase itself should never be instantiated, only derived.
- RetryMechanism derives ABC, so should be named 'Base' like all other
derivatives of ABC in this repo.
- removed kernel_base.py, was made obsolete by
microsoft#1015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: ready to merge PR has been approved by all reviewers, and is ready to merge. python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants