Skip to content

KernelConfig.CompletionBackends is closed, cannot add custom ai backend to the kernel. #146

Closed

Description

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.

Activity

  1. dluc commented on Mar 24, 2023

    @dluc
    Contributor

    Rodrigo Matiazo (@matiazo) without disclosing private info, could you provide the technical changes you would make? we can try adding support for more scenarios

  2. 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
  3. matiazo commented on Mar 24, 2023

    @matiazo
    Author

    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:

    • add KernelConfig.AddCompletionBackend(IBackendConfig)
    • add public ITextCompletionClient CreateAIBackend() to IBackendConfig
    • Kernel.CreateSemanticFunction - replace a swtich on concrete implementation of IBackendConfig
  4. dluc commented on Mar 24, 2023

    @dluc
    Contributor

    right, that's in line with current work in progress:

    add KernelConfig.AddCompletionBackend(IBackendConfig)
    

    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

  5. dluc commented on Mar 25, 2023

    @dluc
    Contributor

    Rodrigo Matiazo (@matiazo) I have a PR almost ready addressing this, thanks for raising this issue

  6. dluc commented on Mar 26, 2023

    @dluc
    Contributor
  7. awharrison-28 commented on Mar 29, 2023

    @awharrison-28
    Contributor
  8. dluc commented on Mar 31, 2023

    @dluc
    Contributor

    Shipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions