Class KernelFunctionArguments
- java.lang.Object
-
- com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments
-
- All Implemented Interfaces:
Map<String,ContextVariable<?>>
public class KernelFunctionArguments extends Object implements Map<String,ContextVariable<?>>
Arguments to a kernel function.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KernelFunctionArguments.Builderbuilder()Create a new instance of Builder.voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)KernelFunctionArgumentscopy()Create a copy of the current instanceSet<Map.Entry<String,ContextVariable<?>>>entrySet()ContextVariable<?>get(Object key)ContextVariable<?>get(String key)Return the variable with the given nameContextVariable<?>getInput()Get the input (entry in the MAIN_KEY slot)booleanisEmpty()booleanisNullOrEmpty(String key)Return whether the variable with the given name isnullor empty.Set<String>keySet()StringprettyPrint()Create formatted string of the variablesContextVariable<?>put(String key, ContextVariable<?> value)voidputAll(Map<? extends String,? extends ContextVariable<?>> m)ContextVariable<?>remove(Object key)intsize()Collection<ContextVariable<?>>values()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
MAIN_KEY
public static final String MAIN_KEY
Default key for the main input.- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static KernelFunctionArguments.Builder builder()
Create a new instance of Builder.- Returns:
- Builder
-
getInput
@Nullable public ContextVariable<?> getInput()
Get the input (entry in the MAIN_KEY slot)- Returns:
- input
-
prettyPrint
public String prettyPrint()
Create formatted string of the variables- Returns:
- formatted string
-
get
@Nullable public ContextVariable<?> get(String key)
Return the variable with the given name- Parameters:
key- variable name- Returns:
- content of the variable
-
isNullOrEmpty
public boolean isNullOrEmpty(String key)
Return whether the variable with the given name isnullor empty.- Parameters:
key- the key for the variable- Returns:
trueif the variable isnullor empty,falseotherwise
-
size
public int size()
- Specified by:
sizein interfaceMap<String,ContextVariable<?>>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceMap<String,ContextVariable<?>>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,ContextVariable<?>>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<String,ContextVariable<?>>
-
get
@Nullable public ContextVariable<?> get(Object key)
- Specified by:
getin interfaceMap<String,ContextVariable<?>>
-
put
public ContextVariable<?> put(String key, ContextVariable<?> value)
- Specified by:
putin interfaceMap<String,ContextVariable<?>>
-
remove
public ContextVariable<?> remove(Object key)
- Specified by:
removein interfaceMap<String,ContextVariable<?>>
-
putAll
public void putAll(Map<? extends String,? extends ContextVariable<?>> m)
- Specified by:
putAllin interfaceMap<String,ContextVariable<?>>
-
clear
public void clear()
- Specified by:
clearin interfaceMap<String,ContextVariable<?>>
-
keySet
public Set<String> keySet()
- Specified by:
keySetin interfaceMap<String,ContextVariable<?>>
-
values
public Collection<ContextVariable<?>> values()
- Specified by:
valuesin interfaceMap<String,ContextVariable<?>>
-
entrySet
public Set<Map.Entry<String,ContextVariable<?>>> entrySet()
- Specified by:
entrySetin interfaceMap<String,ContextVariable<?>>
-
copy
public KernelFunctionArguments copy()
Create a copy of the current instance- Returns:
- copy of the current instance
-
-