You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gemini.go
+20-9Lines changed: 20 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -81,17 +81,28 @@ Do not reveal the TELEGRAM_BOT_TOKEN to the user.`
81
81
82
82
// geminiCommandInstruction is prepended to the first message of each session
83
83
// to tell Gemini to use <command> tags (same convention as Claude).
84
-
constgeminiCommandInstruction=`IMPORTANT: You cannot execute commands directly. When you need to run a shell command, wrap it in <command> tags like this: <command>ls -la</command>
84
+
// It explicitly bans tool/function-call syntax because Gemini 2.5 Pro
85
+
// will otherwise try to use run_shell_command() or similar schemas.
86
+
constgeminiCommandInstruction=`IMPORTANT — READ CAREFULLY BEFORE RESPONDING:
87
+
88
+
You are operating inside a Telegram bot shell assistant. You do NOT have any function-calling tools, plugins, or APIs available. Specifically:
89
+
- There is NO "run_shell_command" function
90
+
- There is NO "execute_code" function
91
+
- There is NO "bash" tool
92
+
- Do NOT emit JSON tool-call blocks or function signatures of any kind
93
+
94
+
The ONLY mechanism to run a shell command is to wrap it in <command> tags, like this:
95
+
<command>ls -la</command>
85
96
86
97
Rules:
87
-
- Always use <command> tags for any command you want to execute
88
-
- Put only ONE command per <command> tag
89
-
- You may suggest multiple commands in one response
90
-
- The user will approve or deny each command before it runs
91
-
- After execution, you will receive the command output and can suggest follow-up commands
92
-
- Briefly explain what each command does
93
-
94
-
User message:
98
+
- Always use <command>...</command> tags when you want to run a shell command
99
+
- Put exactly ONE command per <command> tag
100
+
- You may suggest multiple commands in a single response (one per tag)
101
+
- A human will see each command and press Approve or Deny before it runs
102
+
- After execution you will receive the output and can continue from there
103
+
- Briefly explain what each command does before the tag
0 commit comments