File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -1912,7 +1912,8 @@ async def stream_body_handler(response):
19121912 tool_result_files = []
19131913 if isinstance (tool_result , list ):
19141914 for item in tool_result :
1915- if item .startswith ("data:" ):
1915+ # check if string
1916+ if isinstance (item , str ) and item .startswith ("data:" ):
19161917 tool_result_files .append (item )
19171918 tool_result .remove (item )
19181919
Original file line number Diff line number Diff line change @@ -69,14 +69,18 @@ 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+ )
80+
7281 callable = get_async_tool_function_and_apply_extra_params (
73- execute_tool_server ,
74- {
75- "token" : token ,
76- "url" : tool_server_data ["url" ],
77- "name" : function_name ,
78- "server_data" : tool_server_data ,
79- },
82+ tool_function ,
83+ {},
8084 )
8185
8286 tool_dict = {
You can’t perform that action at this time.
0 commit comments