Class Plan
- java.lang.Object
-
- com.microsoft.semantickernel.orchestration.AbstractSkFunction<CompletionRequestSettings>
-
- com.microsoft.semantickernel.planner.actionplanner.Plan
-
- All Implemented Interfaces:
RegistrableSkFunction,SKFunction<CompletionRequestSettings>
public class Plan extends AbstractSkFunction<CompletionRequestSettings>
Standard Semantic Kernel callable plan. Plan is used to create trees of SKFunctions.
-
-
Constructor Summary
Constructors Constructor Description Plan(SKFunction<?> function, ContextVariables parameters, ContextVariables state, List<String> functionOutputs, KernelSkillsSupplier kernelSkillsSupplier)Plan(SKFunction<?> function, ContextVariables state, List<String> functionOutputs, KernelSkillsSupplier kernelSkillsSupplier)Plan(SKFunction<?> function, KernelSkillsSupplier kernelSkillsSupplier)Plan(SKFunction<?> function, List<String> functionOutputs, KernelSkillsSupplier kernelSkillsSupplier)Plan(String goal, ContextVariables state, KernelSkillsSupplier kernelSkillsSupplier)Plan(String goal, ContextVariables parameters, KernelSkillsSupplier kernelSkillsSupplier, SKFunction<?>... steps)Plan(String goal, KernelSkillsSupplier kernelSkillsSupplier)Plan(String goal, KernelSkillsSupplier kernelSkillsSupplier, SKFunction<?>... steps)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOutputs(List<String> outputs)voidaddSteps(SKFunction<?>... steps)Adds one or more new steps to the end of the current plan.voidaddSteps(Plan... steps)Adds one or more existing plans to the end of the current plan as steps.FunctionViewdescribe()ClassgetType()reactor.core.publisher.Mono<SKContext>invokeAsync(String input, SKContext context, CompletionRequestSettings settings)reactor.core.publisher.Mono<SKContext>invokeAsync(String input, CompletionRequestSettings settings, SemanticTextMemory memory)reactor.core.publisher.Mono<SKContext>invokeNextStepAsync(SKContext context, CompletionRequestSettings settings)Invoke the next step of the planvoidregisterOnKernel(Kernel kernel)voidsetParameters(ContextVariables functionVariables)StringtoPlanString()-
Methods inherited from class com.microsoft.semantickernel.orchestration.AbstractSkFunction
getDescription, getName, getParametersView, getSkillName, getSkillsSupplier, invokeAsync, invokeAsync, invokeAsync, invokeAsync, invokeWithCustomInputAsync, toEmbeddingString, toFullyQualifiedName, toManualString
-
-
-
-
Constructor Detail
-
Plan
public Plan(String goal, ContextVariables state, @Nullable KernelSkillsSupplier kernelSkillsSupplier)
-
Plan
public Plan(String goal, @Nullable KernelSkillsSupplier kernelSkillsSupplier)
-
Plan
public Plan(SKFunction<?> function, ContextVariables state, List<String> functionOutputs, KernelSkillsSupplier kernelSkillsSupplier)
-
Plan
public Plan(SKFunction<?> function, @Nullable ContextVariables parameters, ContextVariables state, List<String> functionOutputs, KernelSkillsSupplier kernelSkillsSupplier)
-
Plan
public Plan(SKFunction<?> function, List<String> functionOutputs, KernelSkillsSupplier kernelSkillsSupplier)
-
Plan
public Plan(SKFunction<?> function, KernelSkillsSupplier kernelSkillsSupplier)
-
Plan
public Plan(String goal, ContextVariables parameters, KernelSkillsSupplier kernelSkillsSupplier, SKFunction<?>... steps)
-
Plan
public Plan(String goal, KernelSkillsSupplier kernelSkillsSupplier, SKFunction<?>... steps)
-
-
Method Detail
-
registerOnKernel
public void registerOnKernel(Kernel kernel)
-
describe
@Nullable public FunctionView describe()
-
addSteps
public void addSteps(Plan... steps)
Adds one or more existing plans to the end of the current plan as steps. When you add a plan as a step to the current plan, the steps of the added plan are executed after the steps of the current plan have completed.- Parameters:
steps- The plans to add as steps to the current plan.
-
addSteps
public void addSteps(SKFunction<?>... steps)
Adds one or more new steps to the end of the current plan. When you add a new step to the current plan, it is executed after the previous step in the plan has completed. Each step can be a function call or another plan.- Parameters:
steps- The steps to add to the current plan.
-
setParameters
public void setParameters(ContextVariables functionVariables)
-
invokeNextStepAsync
public reactor.core.publisher.Mono<SKContext> invokeNextStepAsync(SKContext context, @Nullable CompletionRequestSettings settings)
Invoke the next step of the plan- Parameters:
context- Context to usesettings- Settings to use- Returns:
- The updated plan
-
invokeAsync
public reactor.core.publisher.Mono<SKContext> invokeAsync(@Nullable String input, @Nullable CompletionRequestSettings settings, @Nullable SemanticTextMemory memory)
-
invokeAsync
public reactor.core.publisher.Mono<SKContext> invokeAsync(@Nullable String input, @Nullable SKContext context, @Nullable CompletionRequestSettings settings)
- Specified by:
invokeAsyncin interfaceSKFunction<CompletionRequestSettings>- Overrides:
invokeAsyncin classAbstractSkFunction<CompletionRequestSettings>
-
toPlanString
public String toPlanString()
-
-