File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1051,14 +1051,14 @@ def handle_tool_call(
1051
1051
for inp in required_inputs :
1052
1052
if not isinstance (inp , dict ):
1053
1053
# dicts contain the keywords so its fine if theyre missing from the inputs.
1054
- if inp not in input_values :
1054
+ if inp not in input_values or input_values [ inp ] == "" :
1055
1055
missing_inputs .append (inp )
1056
1056
if len (missing_inputs ) > 0 :
1057
1057
# print(f"Missing required inputs for tool '{tool_name}': {missing_inputs}")
1058
1058
if attempt < n_attempts :
1059
1059
print (f"attempt { attempt + 1 } to generate inputs failed, trying again" )
1060
1060
print ("missing inputs" , missing_inputs )
1061
- print ("llm response" , response )
1061
+ # print("llm response", response)
1062
1062
print ("input values" , input_values )
1063
1063
return handle_tool_call (
1064
1064
command ,
@@ -1080,6 +1080,7 @@ def handle_tool_call(
1080
1080
}
1081
1081
1082
1082
# try:
1083
+ print ("Executing tool with input values:" , input_values )
1083
1084
tool_output = tool .execute (
1084
1085
input_values ,
1085
1086
npc .all_tools_dict ,
Original file line number Diff line number Diff line change @@ -222,6 +222,11 @@ def execute_step(
222
222
context ["results" ] = exec_env ["output" ]
223
223
except NameError as e :
224
224
print (f"NameError: { e } , on the following tool code: " , rendered_code )
225
+ except SyntaxError as e :
226
+ print (f"SyntaxError: { e } , on the following tool code: " , rendered_code )
227
+ except Exception as e :
228
+ print (f"Error executing Python code: { e } " )
229
+
225
230
return context
226
231
227
232
def to_dict (self ):
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ def get_setup_message():
57
57
58
58
setup (
59
59
name = "npcsh" ,
60
- version = "0.3.8 " ,
60
+ version = "0.3.9 " ,
61
61
packages = find_packages (exclude = ["tests*" ]),
62
62
install_requires = [
63
63
"redis" ,
You can’t perform that action at this time.
0 commit comments