FunctionResult<T> Class
- java.
lang. Object - com.
microsoft. semantickernel. orchestration. FunctionResult<T>
- com.
Type Parameters
- T
The type of the result of the function invocation.
public class FunctionResult<T>
The result of a function invocation.
This class is used to return the result of a function invocation. It contains the result of the function invocation and metadata about the result.
Constructor Summary
Constructor | Description |
---|---|
FunctionResult(ContextVariable<T> result, FunctionResultMetadata<?> metadata, Object unconvertedResult) |
Create a new instance of Function |
FunctionResult(ContextVariable<T> of, Object unconvertedResult) |
Create a new instance of Function |
Method Summary
Modifier and Type | Method and Description |
---|---|
Function |
getMetadata()
Get the metadata about the result of the function invocation. |
T |
getResult()
Get the result of the function invocation. |
Context |
getResultVariable()
Get the result of the function invocation. |
java.lang.Object |
getUnconvertedResult()
Get the result of the function invocation before it was converted to the expected type. |
Methods inherited from java.lang.Object
Constructor Details
FunctionResult
public FunctionResult(ContextVariable
Create a new instance of FunctionResult.
Parameters:
FunctionResult
public FunctionResult(ContextVariable
Create a new instance of FunctionResult with no metadata.
Parameters:
Method Details
getMetadata
public FunctionResultMetadata getMetadata()
Get the metadata about the result of the function invocation.
Returns:
getResult
public T getResult()
Get the result of the function invocation. NOTE: If you get a ClassCastException from this method, try adding a result type with withResultType(ContextVariableType<U> resultType) )}
Returns:
getResultVariable
public ContextVariable
Get the result of the function invocation.
Returns:
getUnconvertedResult
public Object getUnconvertedResult()
Get the result of the function invocation before it was converted to the expected type.
Returns: