Kernel.Builder Class
- java.
lang. Object - com.
microsoft. semantickernel. Kernel. Builder
- com.
Implements
public static class Kernel.Builder
implements SemanticKernelBuilder<Kernel>
A fluent builder for creating a new instance of Kernel
.
Constructor Summary
Constructor | Description |
---|---|
Builder() |
Construct a Builder for creating a new instance of |
Method Summary
Modifier and Type | Method and Description |
---|---|
Builder |
withAIService(Class<T> clazz, T aiService)
Adds a service to the kernel. |
Kernel |
build()
Builds a new instance of |
Builder |
withPlugin(KernelPlugin plugin)
Adds a plugin to the kernel. |
Builder |
withServiceSelector(Function<AIServiceCollection,AIServiceSelector> serviceSelector)
Sets the service selector provider for the kernel. |
Methods inherited from java.lang.Object
Constructor Details
Builder
public Builder()
Construct a Builder for creating a new instance of Kernel
.
Method Details
withAIService
public Kernel.Builder
Adds a service to the kernel.
Parameters:
Returns:
this
builder with the service added.build
public Kernel build()
Builds a new instance of Kernel
with the services and plugins provided.
Returns:
Kernel
.withPlugin
public Kernel.Builder withPlugin(KernelPlugin plugin)
Adds a plugin to the kernel.
Parameters:
Returns:
this
builder with the plugin added.withServiceSelector
public Kernel.Builder withServiceSelector(Function
Sets the service selector provider for the kernel.
Parameters:
Returns:
this
builder with the service selector provider set.