Interface PromptTemplateEngine


  • public interface PromptTemplateEngine
    Prompt template engine interface
    • Method Detail

      • renderAsync

        reactor.core.publisher.Mono<String> renderAsync​(String templateText,
                                                        SKContext context)
        Given a prompt template, replace the variables with their values and execute the functions replacing their reference with the function result
        Parameters:
        templateText - Prompt template (see skprompt.txt files)
        context - Access into the current kernel execution context
        Returns:
        The prompt template ready to be used for an AI request
      • extractBlocks

        List<Block> extractBlocks​(String promptTemplate)
        Given a prompt template string, extract all the blocks (text, variables, function calls)
        Parameters:
        promptTemplate - Prompt template (see skprompt.txt files)
        Returns:
        A list of all the blocks, ie the template tokenized in text, variables and function calls