Adding multiple services of same type to the kernel (e.g. chat completion) #6375
-
This is a question just for understanding, as I couldn't find any clue in the documentaion. The kernel builder offers extension methods for adding services of same type, like Now I am wondering if:
I hope anyone can give a explanation for better understaning. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @akordowski !
Yes, you can add multiple services of the same type (e.g. multiple
This can be done, and it's especially useful when you want to switch to different chat completion endpoint in specific period of application runtime.
We have
I think it depends on your use-case. If you use one AI model and it works correctly for you, then one I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @dmytrostruk for the good explanation! Now I understand better how the things work and how they can be extended. |
Beta Was this translation helpful? Give feedback.
Hi @akordowski !
Yes, you can add multiple services of the same type (e.g. multiple
IChatCompletionService
services).This can be done, and it's especially useful when you want to switch to different chat completion endpoint in specific period of application runtime.
We have
IAIServiceSelector
abstraction, which is responsible for service selection. If you don't specify any explicitly, default OrderedAIServiceSelector will be used. But it is possible to override…