-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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
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
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
bot
added
kernel
Issues or pull requests impacting the core kernel
kernel.core
labels
May 15, 2023
SergeyMenshykh
commented
May 15, 2023
samples/apps/copilot-chat-app/webapi/SemanticKernelExtensions.cs
Outdated
Show resolved
Hide resolved
…function's disposal is fixed.
dotnet/src/Connectors/Connectors.UnitTests/OpenAI/AIServicesOpenAIExtensionsTests.cs
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/OpenAIKernelBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
…t/semantic-kernel into feature-serviceregistry
lemillermicrosoft
previously approved these changes
May 19, 2023
There was a problem hiding this 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.
/dotnet format |
…t/semantic-kernel into feature-serviceregistry
shawncal
approved these changes
May 22, 2023
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.
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.
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.
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
dotnet format