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

Feature serviceregistry #993

Merged
merged 37 commits into from May 22, 2023
Merged

Feature serviceregistry #993

merged 37 commits into from May 22, 2023

Conversation

SergeyMenshykh
Copy link
Member

Motivation, Context and Description

This PR introduces several changes aimed to simplify the kernel and enhancing its extensibility for AI services management. The changes include the following:

  1. Kernel simplification and extensibility: The code responsible for AI services management, such as registration and resolution, has been moved out of the Kernel and KernelConfig classes into a new class called AIServiceProvider. This restructuring promotes the principle of Single Responsibility, ensuring that each class has a clear and focused purpose.

  2. Hosting apps customization: With the introduction of the AIServiceProvider, hosting applications now have the flexibility to provide their own implementation of the provider if needed. This promotes extensibility, allowing the hosting apps to tailor the AI service management according to their specific requirements.

  3. AI services registration improvements: A new method called WithAiService has been added, which enables the registration of any new AI service that is not currently supported.

  4. Improved kernel builder interface: The Add* methods for AI services registration have been moved from the KernelConfig class to the KernelBuilder. This change aligns the interface with other KernelBilder methods, such as WithLogger and WithMemory, creating a more cohesive and intuitive kernel builder interface.

Contribution Checklist

name and others added 6 commits May 7, 2023 20:13
### Description
Series of improvements to align service registration extension methods
with the other kernel builder ones and remove the "default" suffix from
service provider Get*ServiceOrDefault method name to not expose
unnecessary details with code that may use it.
### Description
This PR does following:
1. Fixes not compiling code that got broken after the merge with latest
bits from the main branch.
2. Pasing the logger registered in kernel builder to all service
registered by With* kernel extension methods.
3. Removes unnecessary logger parameter from signatures of all With*
kernel extension methods.
This PR adds a few examples showing the way SK SDK can be used by
applications that use DI/IoC containers for bootstrapping.
---------

Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com>
@github-actions github-actions bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels May 15, 2023
@SergeyMenshykh SergeyMenshykh added PR: ready for review All feedback addressed, ready for reviews and removed kernel Issues or pull requests impacting the core kernel samples labels May 15, 2023
@github-actions github-actions bot added kernel Issues or pull requests impacting the core kernel kernel.core labels May 15, 2023
Copy link
Member

@lemillermicrosoft lemillermicrosoft left a comment

Choose a reason for hiding this comment

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

Thanks Sergey. @shawncal will leave to you for final review/merge.

@shawncal
Copy link
Member

/dotnet format

@shawncal shawncal merged commit af03e00 into main May 22, 2023
30 checks passed
@shawncal shawncal deleted the feature-serviceregistry branch June 22, 2023 18:10
shawncal added a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
### Motivation, Context and Description

This PR introduces several changes aimed to simplify the kernel and
enhancing its extensibility for AI services management. The changes
include the following:

1. Kernel simplification and extensibility: The code responsible for AI
services management, such as registration and resolution, has been moved
out of the Kernel and KernelConfig classes into a new class called
AIServiceProvider. This restructuring promotes the principle of Single
Responsibility, ensuring that each class has a clear and focused
purpose.

2. Hosting apps customization: With the introduction of the
AIServiceProvider, hosting applications now have the flexibility to
provide their own implementation of the provider if needed. This
promotes extensibility, allowing the hosting apps to tailor the AI
service management according to their specific requirements.

3. AI services registration improvements: A new method called
WithAiService has been added, which enables the registration of any new
AI service that is not currently supported.

4. Improved kernel builder interface: The Add* methods for AI services
registration have been moved from the KernelConfig class to the
KernelBuilder. This change aligns the interface with other KernelBilder
methods, such as WithLogger and WithMemory, creating a more cohesive and
intuitive kernel builder interface.

---------

Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com>
Co-authored-by: Lee Miller <lemiller@microsoft.com>
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 PR: ready for review All feedback addressed, ready for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants