FunctionCallContent Class
Class to hold a function call response.
Create function call content.
Constructor
FunctionCallContent(inner_content: Any | None = None, ai_model_id: str | None = None, id: str | None = None, index: int | None = None, name: str | None = None, function_name: str | None = None, plugin_name: str | None = None, arguments: str | Mapping[str, Any] | None = None, metadata: dict[str, Any] | None = None, *, content_type: Literal[ContentTypes.FUNCTION_CALL_CONTENT] = 'function_call')
Parameters
| Name | Description |
|---|---|
|
content_type
Required
|
The content type. |
|
inner_content
|
<xref:<xref:semantic_kernel.contents.function_call_content.Any | None>>
The inner content. Default value: None
|
|
ai_model_id
|
<xref:<xref:semantic_kernel.contents.function_call_content.str | None>>
The id of the AI model. Default value: None
|
|
id
|
<xref:<xref:semantic_kernel.contents.function_call_content.str | None>>
The id of the function call. Default value: None
|
|
index
|
<xref:<xref:semantic_kernel.contents.function_call_content.int | None>>
The index of the function call. Default value: None
|
|
name
|
<xref:<xref:semantic_kernel.contents.function_call_content.str | None>>
The name of the function call. When not supplied function_name and plugin_name should be supplied. Default value: None
|
|
function_name
|
<xref:<xref:semantic_kernel.contents.function_call_content.str | None>>
The function name. Not used when 'name' is supplied. Default value: None
|
|
plugin_name
|
<xref:<xref:semantic_kernel.contents.function_call_content.str | None>>
The plugin name. Not used when 'name' is supplied. Default value: None
|
|
arguments
|
The arguments of the function call. Default value: None
|
|
metadata
|
The metadata of the function call. Default value: None
|
|
kwargs
Required
|
Additional arguments. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
content_type
|
Default value: function_call
|
Methods
| combine_arguments |
Combine two arguments. |
| custom_fully_qualified_name |
Get the fully qualified name of the function with a custom separator. |
| from_element |
Create an instance from an Element. |
| parse_arguments |
Parse the arguments into a dictionary. |
| split_name |
Split the name into a plugin and function name. |
| split_name_dict |
Split the name into a plugin and function name. |
| to_dict |
Convert the instance to a dictionary. |
| to_element |
Convert the function call to an Element. |
| to_kernel_arguments |
Return the arguments as a KernelArguments instance. |
combine_arguments
Combine two arguments.
combine_arguments(arg1: str | Mapping[str, Any] | None, arg2: str | Mapping[str, Any] | None) -> str | Mapping[str, Any]
Parameters
| Name | Description |
|---|---|
|
arg1
Required
|
|
|
arg2
Required
|
|
custom_fully_qualified_name
Get the fully qualified name of the function with a custom separator.
custom_fully_qualified_name(separator: str) -> str
Parameters
| Name | Description |
|---|---|
|
separator
Required
|
The custom separator. |
Returns
| Type | Description |
|---|---|
|
The fully qualified name of the function with a custom separator. |
from_element
Create an instance from an Element.
from_element(element: Element) -> _T
Parameters
| Name | Description |
|---|---|
|
element
Required
|
|
parse_arguments
Parse the arguments into a dictionary.
parse_arguments() -> Mapping[str, Any] | None
split_name
Split the name into a plugin and function name.
split_name() -> list[str | None]
split_name_dict
Split the name into a plugin and function name.
split_name_dict() -> dict
to_dict
Convert the instance to a dictionary.
to_dict() -> dict[str, str | Any]
to_element
Convert the function call to an Element.
to_element() -> Element
to_kernel_arguments
Return the arguments as a KernelArguments instance.
to_kernel_arguments() -> KernelArguments
Attributes
ai_model_id
ai_model_id: str | None
arguments
arguments: str | Mapping[str, Any] | None
content_type
content_type: Literal[ContentTypes.FUNCTION_CALL_CONTENT]
function_name
function_name: str
id
id: str | None
index
index: int | None
inner_content
inner_content: Annotated[Any | None, Field(exclude=True)]
metadata
metadata: dict[str, Any]
name
name: str | None
plugin_name
plugin_name: str | None
tag
tag: ClassVar[str] = 'function_call'