Interface PromptTemplateEngine
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePromptTemplateEngine.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static PromptTemplateEngine.Builderbuilder()List<Block>extractBlocks(String promptTemplate)Given a prompt template string, extract all the blocks (text, variables, function calls)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
-
-
-
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
-
builder
static PromptTemplateEngine.Builder builder()
-
-