This function will get called if an “allowed_functions” argument is passed to the
run function. If it is passed, then the presense or absence of the function_filtering
feature flag will dictate what happens. If function_filtering is on, then the required
functions (if some) will get included, then your ranked functions will get added until the
token limit is reached. Without function_filtering feature enabled, all functions listed in
allowed_func_names and required_func_names will get sent.
Performs selective inclusion of tools based on the provided allowed_func_names and the state
of the function_filtering feature flag. When function_filtering is enabled and required_func_names
is specified, required functions are prioritized, followed by ranked functions until a token limit is reached.
Without the function_filtering feature, all functions in allowed_func_names and required_func_names
are included, irrespective of the token limit.