Share via


FunctionResultMetadata<UsageType> Class

  • java.lang.Object
    • com.microsoft.semantickernel.orchestration.FunctionResultMetadata<UsageType>

Type Parameters

UsageType

The result type of the function invocation.

public class FunctionResultMetadata<UsageType>

Metadata about the result of a function invocation.

This class is used to return metadata about the result of a function invocation.

Field Summary

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

The key for createdAt metadata.

static final java.lang.String ID

The key for id metadata.

static final java.lang.String USAGE

The key for usage metadata.

Constructor Summary

Constructor Description
FunctionResultMetadata()

Create a new instance of FunctionResultMetadata.

FunctionResultMetadata(CaseInsensitiveMap<ContextVariable<?>> metadata)

Create a new instance of FunctionResultMetadata.

Method Summary

Modifier and Type Method and Description
static FunctionResultMetadata<UsageType> build(String id, UsageType usage, OffsetDateTime createdAt)

Create a new instance of FunctionResultMetadata.

static FunctionResultMetadata<?> build(String id)

Create a new instance of FunctionResultMetadata.

static FunctionResultMetadata<?> empty()

Create a new instance of FunctionResultMetadata with no metadata.

java.time.OffsetDateTime getCreatedAt()

Get the time the result was created.

java.lang.String getId()

Get the id of the result of the function invocation.

CaseInsensitiveMap<ContextVariable<?>> getMetadata()

Get the metadata about the result of the function invocation.

UsageType getUsage()

Get the usage of the result of the function invocation.

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

CREATED_AT

public static final String CREATED_AT

The key for createdAt metadata.

ID

public static final String ID

The key for id metadata.

USAGE

public static final String USAGE

The key for usage metadata.

Constructor Details

FunctionResultMetadata

public FunctionResultMetadata()

Create a new instance of FunctionResultMetadata.

FunctionResultMetadata

public FunctionResultMetadata(CaseInsensitiveMap> metadata)

Create a new instance of FunctionResultMetadata.

Parameters:

metadata - Metadata about the result of the function invocation.

Method Details

build

public static FunctionResultMetadata build(String id, UsageType usage, OffsetDateTime createdAt)

Create a new instance of FunctionResultMetadata.

Parameters:

id - The id of the result of the function invocation.
usage - The usage of the result of the function invocation.
createdAt - The time the result was created.

Returns:

A new instance of FunctionResultMetadata.

build

public static FunctionResultMetadata build(String id)

Create a new instance of FunctionResultMetadata.

Parameters:

id - The id of the result of the function invocation.

Returns:

A new instance of FunctionResultMetadata.

empty

public static FunctionResultMetadata empty()

Create a new instance of FunctionResultMetadata with no metadata.

Returns:

A new instance of FunctionResultMetadata.

getCreatedAt

public OffsetDateTime getCreatedAt()

Get the time the result was created.

Returns:

The time the result was created.

getId

public String getId()

Get the id of the result of the function invocation.

Returns:

The id of the result of the function invocation.

getMetadata

public CaseInsensitiveMap> getMetadata()

Get the metadata about the result of the function invocation.

Returns:

The metadata about the result of the function invocation.

getUsage

public UsageType getUsage()

Get the usage of the result of the function invocation.

Returns:

The usage of the result of the function invocation.

Applies to