Class FunctionResultMetadata
- java.lang.Object
-
- com.microsoft.semantickernel.orchestration.FunctionResultMetadata
-
public class FunctionResultMetadata extends Object
Metadata about the result of a function invocation.This class is used to return metadata about the result of a function invocation.
-
-
Constructor Summary
Constructors Constructor Description FunctionResultMetadata()Create a new instance of FunctionResultMetadata.FunctionResultMetadata(CaseInsensitiveMap<ContextVariable<?>> metadata)Create a new instance of FunctionResultMetadata.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FunctionResultMetadatabuild(String id)Create a new instance of FunctionResultMetadata.static FunctionResultMetadatabuild(String id, com.azure.ai.openai.models.CompletionsUsage usage, OffsetDateTime createdAt)Create a new instance of FunctionResultMetadata.static FunctionResultMetadataempty()Create a new instance of FunctionResultMetadata with no metadata.OffsetDateTimegetCreatedAt()Get the time the result was created.StringgetId()Get the id of the result of the function invocation.CaseInsensitiveMap<ContextVariable<?>>getMetadata()Get the metadata about the result of the function invocation.com.azure.ai.openai.models.CompletionsUsagegetUsage()Get the usage of the result of the function invocation.
-
-
-
Field Detail
-
ID
public static final String ID
The key for id metadata.- See Also:
- Constant Field Values
-
USAGE
public static final String USAGE
The key for usage metadata.- See Also:
- Constant Field Values
-
CREATED_AT
public static final String CREATED_AT
The key for createdAt metadata.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FunctionResultMetadata
public FunctionResultMetadata()
Create a new instance of FunctionResultMetadata.
-
FunctionResultMetadata
public FunctionResultMetadata(CaseInsensitiveMap<ContextVariable<?>> metadata)
Create a new instance of FunctionResultMetadata.- Parameters:
metadata- Metadata about the result of the function invocation.
-
-
Method Detail
-
build
public static FunctionResultMetadata build(String id)
Create a new instance of FunctionResultMetadata.
-
build
public static FunctionResultMetadata build(String id, @Nullable com.azure.ai.openai.models.CompletionsUsage usage, @Nullable 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.
-
empty
public static FunctionResultMetadata empty()
Create a new instance of FunctionResultMetadata with no metadata.- Returns:
- A new instance of FunctionResultMetadata.
-
getMetadata
public CaseInsensitiveMap<ContextVariable<?>> getMetadata()
Get the metadata about the result of the function invocation.- Returns:
- The metadata about the result of the function invocation.
-
getId
@Nullable public String getId()
Get the id of the result of the function invocation.- Returns:
- The id of the result of the function invocation.
-
getUsage
@Nullable public com.azure.ai.openai.models.CompletionsUsage getUsage()
Get the usage of the result of the function invocation.- Returns:
- The usage of the result of the function invocation.
-
getCreatedAt
@Nullable public OffsetDateTime getCreatedAt()
Get the time the result was created.- Returns:
- The time the result was created.
-
-