utils Module

Functions

finish_reason_from_bedrock_to_semantic_kernel

Convert a finish reason from Bedrock to Semantic Kernel.

finish_reason_from_bedrock_to_semantic_kernel(finish_reason: str) -> FinishReason | None

Parameters

Name Description
finish_reason
Required

format_bedrock_function_name_to_kernel_function_fully_qualified_name

Format the Bedrock function name to the kernel function fully qualified name.

format_bedrock_function_name_to_kernel_function_fully_qualified_name(bedrock_function_name: str) -> str

Parameters

Name Description
bedrock_function_name
Required

remove_none_recursively

Remove None values from a dictionary recursively.

remove_none_recursively(data: dict, max_depth: int = 5) -> dict

Parameters

Name Description
data
Required
max_depth
Default value: 5

run_in_executor

Run a function in an executor.

async run_in_executor(executor, func, *args, **kwargs)

Parameters

Name Description
executor
Required
func
Required

update_settings_from_function_choice_configuration

Update the settings from a FunctionChoiceConfiguration.

update_settings_from_function_choice_configuration(function_choice_configuration: FunctionCallChoiceConfiguration, settings: PromptExecutionSettings, type: FunctionChoiceType) -> None

Parameters

Name Description
function_choice_configuration
Required
settings
Required
type
Required