summaryrefslogtreecommitdiff
path: root/tools.go
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 /tools.go
parentdc71009f43a2294aafab2a7fcd7d67d71c70c562 (diff)
Enha: /completion command explanation
Diffstat (limited to 'tools.go')
-rw-r--r--tools.go22
1 files changed, 19 insertions, 3 deletions
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",