Package com.microsoft.semantickernel
Interface Kernel.Builder
-
- All Superinterfaces:
SemanticKernelBuilder<Kernel>
- Enclosing interface:
- Kernel
public static interface Kernel.Builder extends SemanticKernelBuilder<Kernel>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends AIService>
Kernel.BuilderwithAIService(String serviceId, T instance, boolean setAsDefault, Class<T> clazz)Adds an instance to the services collection<T extends AIService>
Kernel.BuilderwithAIServiceFactory(String serviceId, Function<KernelConfig,T> factory, boolean setAsDefault, Class<T> clazz)Adds a factory method to the services collectionKernel.BuilderwithConfiguration(KernelConfig kernelConfig)Set the kernel configuration<T extends AIService>
Kernel.BuilderwithDefaultAIService(Supplier<T> factory, Class<T> clazz)Adds a factory method to the services collection<T extends AIService>
Kernel.BuilderwithDefaultAIService(T instance)Adds an instance to the services collection<T extends AIService>
Kernel.BuilderwithDefaultAIService(T instance, Class<T> clazz)Adds an instance to the services collectionKernel.BuilderwithMemory(SemanticTextMemory memory)Add a semantic text memory entity to the kernel to be built.Kernel.BuilderwithMemoryStorage(MemoryStore storage)Add memory storage to the kernel to be built.Kernel.BuilderwithMemoryStorage(Supplier<MemoryStore> factory)Add memory storage factory to the kernel.Kernel.BuilderwithMemoryStorageAndTextEmbeddingGeneration(MemoryStore storage, TextEmbeddingGeneration embeddingGenerator)Add memory storage and an embedding generator to the kernel to be built.Kernel.BuilderwithPromptTemplateEngine(PromptTemplateEngine promptTemplateEngine)Add prompt template engine to the kernel to be built.-
Methods inherited from interface com.microsoft.semantickernel.builders.SemanticKernelBuilder
build
-
-
-
-
Method Detail
-
withConfiguration
Kernel.Builder withConfiguration(KernelConfig kernelConfig)
Set the kernel configuration- Parameters:
kernelConfig- Kernel configuration- Returns:
- Builder
-
withPromptTemplateEngine
Kernel.Builder withPromptTemplateEngine(PromptTemplateEngine promptTemplateEngine)
Add prompt template engine to the kernel to be built.- Parameters:
promptTemplateEngine- Prompt template engine to add.- Returns:
- Updated kernel builder including the prompt template engine.
-
withMemoryStorage
Kernel.Builder withMemoryStorage(MemoryStore storage)
Add memory storage to the kernel to be built.- Parameters:
storage- Storage to add.- Returns:
- Updated kernel builder including the memory storage.
-
withMemoryStorage
Kernel.Builder withMemoryStorage(Supplier<MemoryStore> factory)
Add memory storage factory to the kernel.- Parameters:
factory- The storage factory.- Returns:
- Updated kernel builder including the memory storage.
-
withDefaultAIService
<T extends AIService> Kernel.Builder withDefaultAIService(T instance)
Adds an instance to the services collection- Parameters:
instance- The instance.- Returns:
- The builder.
-
withDefaultAIService
<T extends AIService> Kernel.Builder withDefaultAIService(T instance, Class<T> clazz)
Adds an instance to the services collection- Parameters:
instance- The instance.clazz- The class of the instance.- Returns:
- The builder.
-
withDefaultAIService
<T extends AIService> Kernel.Builder withDefaultAIService(Supplier<T> factory, Class<T> clazz)
Adds a factory method to the services collection- Parameters:
factory- The factory method that creates the AI service instances of type T.clazz- The class of the instance.
-
withAIService
<T extends AIService> Kernel.Builder withAIService(@Nullable String serviceId, T instance, boolean setAsDefault, Class<T> clazz)
Adds an instance to the services collection- Parameters:
serviceId- The service IDinstance- The instance.setAsDefault- Optional: set as the default AI service for type Tclazz- The class of the instance.
-
withAIServiceFactory
<T extends AIService> Kernel.Builder withAIServiceFactory(@Nullable String serviceId, Function<KernelConfig,T> factory, boolean setAsDefault, Class<T> clazz)
Adds a factory method to the services collection- Parameters:
serviceId- The service IDfactory- The factory method that creates the AI service instances of type T.setAsDefault- Optional: set as the default AI service for type Tclazz- The class of the instance.
-
withMemory
Kernel.Builder withMemory(SemanticTextMemory memory)
Add a semantic text memory entity to the kernel to be built.- Parameters:
memory- Semantic text memory entity to add.- Returns:
- Updated kernel builder including the semantic text memory entity.
-
withMemoryStorageAndTextEmbeddingGeneration
Kernel.Builder withMemoryStorageAndTextEmbeddingGeneration(MemoryStore storage, TextEmbeddingGeneration embeddingGenerator)
Add memory storage and an embedding generator to the kernel to be built.- Parameters:
storage- Storage to add.embeddingGenerator- Embedding generator to add.- Returns:
- Updated kernel builder including the memory storage and embedding generator.
-
-