From e7b542730c76e94b1fe806c3ae3ae262d934d38f Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Mon, 8 Dec 2025 16:43:38 +0300 Subject: Enha: /completion command explanation --- helpfuncs.go | 2 +- tools.go | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/helpfuncs.go b/helpfuncs.go index c9f2a0d..df49ae5 100644 --- a/helpfuncs.go +++ b/helpfuncs.go @@ -118,7 +118,7 @@ func renameUser(oldname, newname string) { if role == cfg.AssistantRole { continue } - if role == cfg.ToolRole { + if role == "tool" { continue } if role == "system" { diff --git a/tools.go b/tools.go index 7dc7621..8f2549a 100644 --- a/tools.go +++ b/tools.go @@ -90,7 +90,7 @@ Your current tools: { "name":"execute_command", "args": ["command", "args"], -"when_to_use": "when asked to execute a system command; args is optional" +"when_to_use": "when asked to execute a system command; args is optional; allowed commands: grep, sed, awk, find, cat, head, tail, sort, uniq, wc, ls, echo, cut, tr, cp, mv, rm, mkdir, rmdir, pwd, df, free, ps, top, du, whoami, date, uname" } ] @@ -103,6 +103,14 @@ __tool_call__ } __tool_call__ + +__tool_call__ +{ +"name":"execute_command", +"args": {"command": "ls", "args": "-la /home"} +} +__tool_call__ + Tool call is addressed to the tool agent, avoid sending more info than tool call itself, while making a call. When done right, tool call will be delivered to the tool agent. tool agent will respond with the results of the call. @@ -784,6 +792,14 @@ func isCommandAllowed(command string) bool { "mkdir": true, "rmdir": true, "pwd": true, + "df": true, + "free": true, + "ps": true, + "top": true, + "du": true, + "whoami": true, + "date": true, + "uname": true, } return allowedCommands[command] } @@ -1045,14 +1061,14 @@ var baseTools = []models.Tool{ Type: "function", Function: models.ToolFunc{ Name: "execute_command", - Description: "Execute a shell command safely. Use when you need to run system commands like grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd", + Description: "Execute a shell command safely. Use when you need to run system commands like grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd df free ps top du whoami date uname", Parameters: models.ToolFuncParams{ Type: "object", Required: []string{"command"}, Properties: map[string]models.ToolArgProps{ "command": models.ToolArgProps{ Type: "string", - Description: "command to execute (only commands from whitelist are allowed: grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd", + Description: "command to execute (only commands from whitelist are allowed: grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd df free ps top du whoami date uname", }, "args": models.ToolArgProps{ Type: "string", -- cgit v1.2.3