File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -69,14 +69,24 @@ def get_tools(
6969 elif auth_type == "session" :
7070 token = request .state .token .credentials
7171
72- async def tool_function (** args ):
73- return await execute_tool_server (
74- token = token ,
75- url = tool_server_data ["url" ],
76- name = function_name ,
77- params = args ,
78- server_data = tool_server_data ,
79- )
72+ def make_tool_function (function_name , token , tool_server_data ):
73+ async def tool_function (** kwargs ):
74+ print (
75+ f"Executing tool function { function_name } with params: { kwargs } "
76+ )
77+ return await execute_tool_server (
78+ token = token ,
79+ url = tool_server_data ["url" ],
80+ name = function_name ,
81+ params = kwargs ,
82+ server_data = tool_server_data ,
83+ )
84+
85+ return tool_function
86+
87+ tool_function = make_tool_function (
88+ function_name , token , tool_server_data
89+ )
8090
8191 callable = get_async_tool_function_and_apply_extra_params (
8292 tool_function ,
You can’t perform that action at this time.
0 commit comments