File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
python/semantic_kernel/agents/open_ai Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -1242,10 +1242,19 @@ def _get_tools(
12421242 if agent .tools :
12431243 tools .extend (agent .tools )
12441244
1245- # TODO(evmattso): make sure to respect filters on FCB
1246- if kernel .plugins :
1247- funcs = kernel .get_full_list_of_function_metadata ()
1248- tools .extend ([kernel_function_metadata_to_response_function_call_format (f ) for f in funcs ])
1245+ if not function_choice_behavior .enable_kernel_functions :
1246+ return tools
1247+
1248+ if not kernel .plugins :
1249+ return tools
1250+
1251+ funcs = (
1252+ kernel .get_list_of_function_metadata (function_choice_behavior .filters )
1253+ if function_choice_behavior .filters
1254+ else kernel .get_full_list_of_function_metadata ()
1255+ )
1256+
1257+ tools .extend ([kernel_function_metadata_to_response_function_call_format (f ) for f in funcs ])
12491258
12501259 return tools
12511260
You can’t perform that action at this time.
0 commit comments