semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Please add (optional) ServiceId argument to CreateSemanticFunction

Open PederHP opened this issue 2 years ago • 0 comments

The CreateSemanticFunction extension methods (from InlineFunctionsDefinitionExtension) are great convenience methods for creating Semantic Functions on the fly, but it would be very useful to have an optional ServiceId (or better a Func providing it) to allow binding to a different Kernel service than the defeault behavior of always binding to the "Embedding" or "Completion" services registered with the Kernel.

This can be achieved manually by getting an alternative the service by name from the KernelConfig and setting it via the SetAIService method of the ISKFunction returned by CreateSemanticFunction. For convenience, it would be nice if this could happen in CreateSemanticFunction via the provided optional argument.

Kernels already support registering multiple AI service backends, so adding convenient mapping to these would be a useful feature.

PederHP avatar May 15 '23 06:05 PederHP