Class AbstractSkFunction<RequestConfiguration>
- java.lang.Object
-
- com.microsoft.semantickernel.orchestration.AbstractSkFunction<RequestConfiguration>
-
- All Implemented Interfaces:
RegistrableSkFunction,SKFunction<RequestConfiguration>
- Direct Known Subclasses:
AIFunction
public abstract class AbstractSkFunction<RequestConfiguration> extends Object implements SKFunction<RequestConfiguration>, RegistrableSkFunction
Abstract implementation of the SKFunction interface.
-
-
Constructor Summary
Constructors Constructor Description AbstractSkFunction(List<ParameterView> parameters, String skillName, String functionName, String description, List<ParameterView> returnParameters, KernelSkillsSupplier skillsSupplier)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescription()StringgetName()List<ParameterView>getParametersView()The parameters of the function.StringgetSkillName()KernelSkillsSuppliergetSkillsSupplier()Gets the skill supplier.reactor.core.publisher.Mono<SKContext>invokeAsync()Invokes the functionreactor.core.publisher.Mono<SKContext>invokeAsync(SKContext context)Invokes the function with the given context and settingsreactor.core.publisher.Mono<SKContext>invokeAsync(SKContext context, RequestConfiguration settings)Invokes the function with the given context and settingsreactor.core.publisher.Mono<SKContext>invokeAsync(String input)Invokes the function with the given inputreactor.core.publisher.Mono<SKContext>invokeAsync(String input, SKContext context, RequestConfiguration settings)Invokes the function with the given input, context and settingsreactor.core.publisher.Mono<SKContext>invokeAsync(String input, RequestConfiguration settings)Invokes the function with the given context and settingsreactor.core.publisher.Mono<SKContext>invokeWithCustomInputAsync(ContextVariables variables, SemanticTextMemory semanticMemory, ReadOnlySkillCollection skills)Invokes the function with the given input, context and settingsStringtoEmbeddingString()Create a string for generating an embedding for a function.StringtoFullyQualifiedName()The function to create a fully qualified name forStringtoManualString(boolean includeOutputs)Create a manual-friendly string for a function.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microsoft.semantickernel.orchestration.RegistrableSkFunction
registerOnKernel
-
Methods inherited from interface com.microsoft.semantickernel.orchestration.SKFunction
describe, getType
-
-
-
-
Constructor Detail
-
AbstractSkFunction
public AbstractSkFunction(List<ParameterView> parameters, String skillName, String functionName, String description, List<ParameterView> returnParameters, @Nullable KernelSkillsSupplier skillsSupplier)
Constructor.- Parameters:
parameters- The parameters of the function.skillName- The name of the skill.functionName- The name of the function.description- The description of the function.skillsSupplier- The skill supplier.
-
-
Method Detail
-
getSkillsSupplier
@Nullable public KernelSkillsSupplier getSkillsSupplier()
Gets the skill supplier.- Returns:
- The skill supplier.
-
invokeAsync
public reactor.core.publisher.Mono<SKContext> invokeAsync(@Nullable String input, @Nullable RequestConfiguration settings)
Description copied from interface:SKFunctionInvokes the function with the given context and settings- Specified by:
invokeAsyncin interfaceSKFunction<RequestConfiguration>- Parameters:
input- input provided to the functionsettings- Configuration of the request- Returns:
- an updated context with the result of the request
-
invokeAsync
public reactor.core.publisher.Mono<SKContext> invokeAsync(@Nullable String input, @Nullable SKContext context, @Nullable RequestConfiguration settings)
Description copied from interface:SKFunctionInvokes the function with the given input, context and settings- Specified by:
invokeAsyncin interfaceSKFunction<RequestConfiguration>- Parameters:
input- input provided to the functioncontext- Request contextsettings- Configuration of the request- Returns:
- an updated context with the result of the request
-
invokeAsync
public reactor.core.publisher.Mono<SKContext> invokeAsync(String input)
Description copied from interface:SKFunctionInvokes the function with the given input- Specified by:
invokeAsyncin interfaceSKFunction<RequestConfiguration>- Parameters:
input- input provided to the function- Returns:
- an updated context with the result of the request
-
invokeAsync
public reactor.core.publisher.Mono<SKContext> invokeAsync(@Nullable SKContext context, @Nullable RequestConfiguration settings)
Description copied from interface:SKFunctionInvokes the function with the given context and settings- Specified by:
invokeAsyncin interfaceSKFunction<RequestConfiguration>- Parameters:
context- Request contextsettings- Configuration of the request- Returns:
- an updated context with the result of the request
-
getSkillName
public String getSkillName()
- Specified by:
getSkillNamein interfaceSKFunction<RequestConfiguration>- Returns:
- The name of the skill that this function is within
-
getName
public String getName()
- Specified by:
getNamein interfaceSKFunction<RequestConfiguration>- Returns:
- The name of this function
-
getParametersView
public List<ParameterView> getParametersView()
The parameters of the function.- Returns:
- The parameters of the function.
-
toFullyQualifiedName
public String toFullyQualifiedName()
The function to create a fully qualified name for- Specified by:
toFullyQualifiedNamein interfaceSKFunction<RequestConfiguration>- Returns:
- A fully qualified name for a function
-
getDescription
@Nullable public String getDescription()
- Specified by:
getDescriptionin interfaceSKFunction<RequestConfiguration>- Returns:
- A description of the function
-
toEmbeddingString
public String toEmbeddingString()
Description copied from interface:SKFunctionCreate a string for generating an embedding for a function.- Specified by:
toEmbeddingStringin interfaceSKFunction<RequestConfiguration>- Returns:
- A string for generating an embedding for a function.
-
toManualString
public String toManualString(boolean includeOutputs)
Description copied from interface:SKFunctionCreate a manual-friendly string for a function.- Specified by:
toManualStringin interfaceSKFunction<RequestConfiguration>- Parameters:
includeOutputs- Whether to include function outputs in the string.- Returns:
- A manual-friendly string for a function.
-
invokeWithCustomInputAsync
public reactor.core.publisher.Mono<SKContext> invokeWithCustomInputAsync(ContextVariables variables, @Nullable SemanticTextMemory semanticMemory, @Nullable ReadOnlySkillCollection skills)
Description copied from interface:SKFunctionInvokes the function with the given input, context and settings- Specified by:
invokeWithCustomInputAsyncin interfaceSKFunction<RequestConfiguration>- Parameters:
variables- variables to be used in the functionsemanticMemory- semantic memory to be used in the functionskills- skills to be used in the function- Returns:
- an updated context with the result of the request
-
invokeAsync
public reactor.core.publisher.Mono<SKContext> invokeAsync()
Description copied from interface:SKFunctionInvokes the function- Specified by:
invokeAsyncin interfaceSKFunction<RequestConfiguration>- Returns:
- an updated context with the result of the request
-
invokeAsync
public reactor.core.publisher.Mono<SKContext> invokeAsync(SKContext context)
Description copied from interface:SKFunctionInvokes the function with the given context and settings- Specified by:
invokeAsyncin interfaceSKFunction<RequestConfiguration>- Parameters:
context- Request context- Returns:
- an updated context with the result of the request
-
-