summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-12-08 16:43:38 +0300
committerGrail Finder <wohilas@gmail.com>2025-12-08 16:43:38 +0300
commite7b542730c76e94b1fe806c3ae3ae262d934d38f (patch)
treedd0377940dcb981fd028b4321a3b3446a69d3f84
parentdc71009f43a2294aafab2a7fcd7d67d71c70c562 (diff)
Enha: /completion command explanation
-rw-r--r--helpfuncs.go2
-rw-r--r--tools.go22
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"
}
]
</tools>
@@ -103,6 +103,14 @@ __tool_call__
}
__tool_call__
</example_request>
+<example_request>
+__tool_call__
+{
+"name":"execute_command",
+"args": {"command": "ls", "args": "-la /home"}
+}
+__tool_call__
+</example_request>
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.
<example_response>
@@ -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",