Share via


KernelFunctionArguments Class

  • java.lang.Object
    • com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments

Implements

java.util.Map<java.lang.String,ContextVariable<?>>

public class KernelFunctionArguments
implements java.util.Map<java.lang.String,ContextVariable<?>>

Arguments to a kernel function.

Field Summary

Modifier and Type Field and Description
static final java.lang.String MAIN_KEY

Default key for the main input.

Constructor Summary

Modifier Constructor Description
protected KernelFunctionArguments()

Create a new instance of KernelFunctionArguments.

protected KernelFunctionArguments(ContextVariable<?> content)

Create a new instance of KernelFunctionArguments.

protected KernelFunctionArguments(Map<String,ContextVariable<?>> variables)

Create a new instance of KernelFunctionArguments.

Method Summary

Modifier and Type Method and Description
static Builder builder()

Create a new instance of Builder.

void clear()
boolean containsKey(Object key)
boolean containsValue(Object value)
KernelFunctionArguments copy()

Create a copy of the current instance

java.util.Set<java.util.Map.Entry<java.lang.String,ContextVariable<?>>> entrySet()
ContextVariable<?> get(Object key)
ContextVariable<?> get(String key)

Return the variable with the given name

ContextVariable<?> getInput()

Get the input (entry in the MAIN_KEY slot)

boolean isEmpty()
boolean isNullOrEmpty(String key)

Return whether the variable with the given name is null or empty.

java.util.Set<java.lang.String> keySet()
java.lang.String prettyPrint()

Create formatted string of the variables

ContextVariable<?> put(String key, ContextVariable<?> value)
void putAll(Map<? extends String,? extends ContextVariable<?>> m)
ContextVariable<?> remove(Object key)
int size()
java.util.Collection<ContextVariable<?>> values()

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Field Details

MAIN_KEY

public static final String MAIN_KEY

Default key for the main input.

Constructor Details

KernelFunctionArguments

protected KernelFunctionArguments()

Create a new instance of KernelFunctionArguments.

KernelFunctionArguments

protected KernelFunctionArguments(ContextVariable content)

Create a new instance of KernelFunctionArguments.

Parameters:

content - The content to use for the function invocation.

KernelFunctionArguments

protected KernelFunctionArguments(Map> variables)

Create a new instance of KernelFunctionArguments.

Parameters:

variables - The variables to use for the function invocation.

Method Details

builder

public static KernelFunctionArguments.Builder builder()

Create a new instance of Builder.

Returns:

Builder

clear

public void clear()

containsKey

public boolean containsKey(Object key)

Parameters:

key

containsValue

public boolean containsValue(Object value)

Parameters:

value

copy

public KernelFunctionArguments copy()

Create a copy of the current instance

Returns:

copy of the current instance

entrySet

public Set>> entrySet()

get

public ContextVariable get(Object key)

Parameters:

key

get

public ContextVariable get(String key)

Return the variable with the given name

Parameters:

key - variable name

Returns:

content of the variable

getInput

public ContextVariable getInput()

Get the input (entry in the MAIN_KEY slot)

Returns:

input

isEmpty

public boolean isEmpty()

isNullOrEmpty

public boolean isNullOrEmpty(String key)

Return whether the variable with the given name is null or empty.

Parameters:

key - the key for the variable

Returns:

true if the variable is null or empty, false otherwise

keySet

public Set keySet()

prettyPrint

public String prettyPrint()

Create formatted string of the variables

Returns:

formatted string

put

public ContextVariable put(String key, ContextVariable value)

Parameters:

key
value

putAll

public void putAll(Map> m)

Parameters:

m

remove

public ContextVariable remove(Object key)

Parameters:

key

size

public int size()

values

public Collection> values()

Applies to