Partager via


FunctionResult Class

The result of a function.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Inheritance
FunctionResult

Constructor

FunctionResult(*, function: KernelFunctionMetadata, value: Any, metadata: dict[str, Any] = None)

Parameters

Name Description
function
Required

The metadata of the function that was invoked.

value
Required
Any

The value of the result.

metadata
Required
<xref:Mapping>[str,<xref: Any>]

The metadata of the result.

Keyword-Only Parameters

Name Description
function
Required
value
Required
metadata
Required

Methods

get_inner_content

Get the inner content of the function result when that is a KernelContent or subclass of the first item of the value if it is a list.

get_inner_content

Get the inner content of the function result when that is a KernelContent or subclass of the first item of the value if it is a list.

get_inner_content()

Parameters

Name Description
index
Default value: 0

Attributes

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True, 'validate_assignment': True}

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.fields from Pydantic V1.

model_fields: ClassVar[Dict[str, FieldInfo]] = {'function': FieldInfo(annotation=KernelFunctionMetadata, required=True), 'metadata': FieldInfo(annotation=dict[str, Any], required=False, default_factory=dict), 'value': FieldInfo(annotation=Any, required=True)}

function

function: KernelFunctionMetadata

metadata

metadata: dict[str, Any]

value

value: Any