Package com.microsoft.semantickernel
Interface Kernel
-
- All Superinterfaces:
Buildable,SkillExecutor
public interface Kernel extends SkillExecutor, Buildable
Interface for the semantic kernel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceKernel.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Kernel.Builderbuilder()KernelConfiggetConfig()Settings required to execute functions, including details about AI dependencies, e.g.SKFunctiongetFunction(String skill, String function)Obtains a semantic function with the given nameSemanticTextMemorygetMemory()Get the SemanticTextMemory in use.PromptTemplateEnginegetPromptTemplateEngine()Reference to the engine rendering prompt templatesCompletionSKFunction.BuildergetSemanticFunctionBuilder()Get a completion function builder, functions created with this builder will be registered on the kernel<T extends AIService>
TgetService(String name, Class<T> clazz)Obtains the service with the given name and type<RequestConfiguration,FunctionType extends SKFunction<RequestConfiguration>>
FunctionTyperegisterSemanticFunction(FunctionType semanticFunctionDefinition)Registers a semantic function on this kernelCompletionSKFunctionregisterSemanticFunction(String skillName, String functionName, SemanticFunctionConfig functionConfig)Register a semantic function on this kernelreactor.core.publisher.Mono<SKContext>runAsync(ContextVariables variables, SKFunction<?>... pipeline)Run a pipeline composed of synchronous and asynchronous functions.reactor.core.publisher.Mono<SKContext>runAsync(SKFunction<?>... pipeline)Run a pipeline composed of synchronous and asynchronous functions.reactor.core.publisher.Mono<SKContext>runAsync(String input, SKFunction<?>... pipeline)Run a pipeline composed of synchronous and asynchronous functions.-
Methods inherited from interface com.microsoft.semantickernel.SkillExecutor
getSkill, getSkills, importSkill, importSkill, importSkillFromDirectory, importSkillFromDirectory, importSkillFromResources, importSkillFromResources, importSkillsFromDirectory
-
-
-
-
Method Detail
-
getConfig
KernelConfig getConfig()
Settings required to execute functions, including details about AI dependencies, e.g. endpoints and API keys.
-
getPromptTemplateEngine
PromptTemplateEngine getPromptTemplateEngine()
Reference to the engine rendering prompt templates- Returns:
- Reference to the engine rendering prompt templates
-
getMemory
SemanticTextMemory getMemory()
Get the SemanticTextMemory in use.- Returns:
- the SemanticTextMemory in use
-
runAsync
reactor.core.publisher.Mono<SKContext> runAsync(SKFunction<?>... pipeline)
Run a pipeline composed of synchronous and asynchronous functions.- Parameters:
pipeline- List of functions- Returns:
- Result of the function composition
-
runAsync
reactor.core.publisher.Mono<SKContext> runAsync(String input, SKFunction<?>... pipeline)
Run a pipeline composed of synchronous and asynchronous functions.- Parameters:
input- Input to processpipeline- List of functions- Returns:
- Result of the function composition
-
runAsync
reactor.core.publisher.Mono<SKContext> runAsync(ContextVariables variables, SKFunction<?>... pipeline)
Run a pipeline composed of synchronous and asynchronous functions.- Parameters:
variables- variables to initialise the context withpipeline- List of functions- Returns:
- Result of the function composition
-
registerSemanticFunction
CompletionSKFunction registerSemanticFunction(String skillName, String functionName, SemanticFunctionConfig functionConfig)
Register a semantic function on this kernel- Parameters:
skillName- The skill namefunctionName- The function namefunctionConfig- The function configuration- Returns:
- The registered function
-
getSemanticFunctionBuilder
CompletionSKFunction.Builder getSemanticFunctionBuilder()
Get a completion function builder, functions created with this builder will be registered on the kernel
-
getService
<T extends AIService> T getService(@Nullable String name, Class<T> clazz) throws KernelException
Obtains the service with the given name and type- Throws:
KernelException
-
registerSemanticFunction
<RequestConfiguration,FunctionType extends SKFunction<RequestConfiguration>> FunctionType registerSemanticFunction(FunctionType semanticFunctionDefinition)
Registers a semantic function on this kernel
-
getFunction
SKFunction getFunction(String skill, String function)
Obtains a semantic function with the given name
-
builder
static Kernel.Builder builder()
-
-