You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
KernelConfig.CompletionBackends is closed, cannot add custom ai backend to the kernel. #146
Can we open CompletionBackends so we can use custom AI backends, my team has a service layer before OpenAI/AzureOpenAI so we need to inject a custom client.
Rodrigo Matiazo (@matiazo) without disclosing private info, could you provide the technical changes you would make? we can try adding support for more scenarios
changed the title [-]KernelConfig.CompletionBackends is closed, cannot add custom ai backs to the kernel.[/-][+]KernelConfig.CompletionBackends is closed, cannot add custom ai backend to the kernel.[/+]on Mar 24, 2023
Goal is not add more implementation but open Kernel to accept new implementations of IBackendConfig and ITextCompletionClient. We also need to review usage of IEmbeddingGenerator implementations.
I'm working in a PR but the overall changes so far:
spot on. Currently the list is hardcoded, we're removing that and simply work with interfaces 👍
add public ITextCompletionClient CreateAIBackend() to IBackendConfig
that could be a temporary stop gap, but we're removing this hard coded assumptions about what kind of AI is used.
Kernel.CreateSemanticFunction - replace a swtich on concrete implementation of IBackendConfig
yup makes sense, in fact I would suggest limiting the changes to a minimum and only in this area, without worrying too much about hardcoding a new option. In other words it's ok following the current approach and hardcoding a new option, because we're taking care of that and it's a rather big change
Activity
dluc commentedon Mar 24, 2023
Rodrigo Matiazo (@matiazo) without disclosing private info, could you provide the technical changes you would make? we can try adding support for more scenarios
[-]KernelConfig.CompletionBackends is closed, cannot add custom ai backs to the kernel.[/-][+]KernelConfig.CompletionBackends is closed, cannot add custom ai backend to the kernel.[/+]matiazo commentedon Mar 24, 2023
Goal is not add more implementation but open Kernel to accept new implementations of IBackendConfig and ITextCompletionClient. We also need to review usage of IEmbeddingGenerator implementations.
I'm working in a PR but the overall changes so far:
dluc commentedon Mar 24, 2023
right, that's in line with current work in progress:
spot on. Currently the list is hardcoded, we're removing that and simply work with interfaces 👍
that could be a temporary stop gap, but we're removing this hard coded assumptions about what kind of AI is used.
yup makes sense, in fact I would suggest limiting the changes to a minimum and only in this area, without worrying too much about hardcoding a new option. In other words it's ok following the current approach and hardcoding a new option, because we're taking care of that and it's a rather big change
dluc commentedon Mar 25, 2023
Rodrigo Matiazo (@matiazo) I have a PR almost ready addressing this, thanks for raising this issue
dluc commentedon Mar 26, 2023
Rodrigo Matiazo (@matiazo) this should help #161 - Here's an example showing how to plug in custom backends: https://github.com/dluc/semantic-kernel/blob/dluc99-backends/samples/dotnet/kernel-syntax-examples/Example16_CustomLLM.cs
awharrison-28 commentedon Mar 29, 2023
Updating thread with the link that is now in main https://github.com/microsoft/semantic-kernel/blob/main/samples/dotnet/kernel-syntax-examples/Example16_CustomLLM.cs
dluc commentedon Mar 31, 2023
Shipped