Interface Kernel.Builder

    • 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 AIServiceKernel.Builder withDefaultAIService​(T instance)
        Adds an instance to the services collection
        Parameters:
        instance - The instance.
        Returns:
        The builder.
      • withDefaultAIService

        <T extends AIServiceKernel.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 AIServiceKernel.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 AIServiceKernel.Builder withAIService​(@Nullable
                                                           String serviceId,
                                                           T instance,
                                                           boolean setAsDefault,
                                                           Class<T> clazz)
        Adds an instance to the services collection
        Parameters:
        serviceId - The service ID
        instance - The instance.
        setAsDefault - Optional: set as the default AI service for type T
        clazz - The class of the instance.
      • withAIServiceFactory

        <T extends AIServiceKernel.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 ID
        factory - The factory method that creates the AI service instances of type T.
        setAsDefault - Optional: set as the default AI service for type T
        clazz - 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.