Execute: riconosci comandi shell con argomenti (ls -la, etc.)
This commit is contained in:
1 parent
57c43d4738
commit
462f3d1785
1 file changed
+9
-1
+9
-1
@@ -406,7 +406,15 @@ For other questions, just answer normally without tools."""
|
||||
|
||||
return ToolCall(id='intent', name='write_file', arguments={'path': file_path, 'content': content})
|
||||
|
||||
# Execute command patterns
|
||||
# Execute command patterns - check FIRST for shell commands
|
||||
# Shell commands typically have spaces and flags like -, --
|
||||
if 'ls' in text_lower and ('-' in text or len(text.split()) > 1):
|
||||
# Looks like a shell command with args
|
||||
cmd = text_lower.split()[0] if text_lower.split() else text_lower
|
||||
args = ' '.join(text.split()[1:]) if len(text.split()) > 1 else ''
|
||||
full_cmd = f"{cmd} {args}".strip() if args else cmd
|
||||
return ToolCall(id='intent', name='execute', arguments={'command': full_cmd})
|
||||
|
||||
exec_patterns = [
|
||||
'esegui', 'eseguire', 'run', 'run command', 'lanciare',
|
||||
'avvia', 'comando', 'terminale', 'bash', 'shell'
|
||||
|
||||
Reference in new issue
Block a user