Skip to content

Commit c0bb207

Browse files
committed
gemini flash
1 parent 3c983ae commit c0bb207

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ALLOWED_CHAT_IDS=123456789,12345678
33
WORK_DIR=.
44
CLAUDE_PATH=claude
55
GEMINI_PATH=gemini
6-
GEMINI_MODEL=gemini-2.5-pro
6+
GEMINI_MODEL=gemini-2.5-flash
77
#GEMINI_API_KEY=AIza... # optional: set via Telegram /login instead
88
DEFAULT_PROVIDER=claude
99
COMMAND_TIMEOUT=5m

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func LoadConfig() (*Config, error) {
7171

7272
geminiModel := os.Getenv("GEMINI_MODEL")
7373
if geminiModel == "" {
74-
geminiModel = "gemini-2.5-pro"
74+
geminiModel = "gemini-2.5-flash"
7575
}
7676

7777
defaultProvider := os.Getenv("DEFAULT_PROVIDER")

gemini.go

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,28 @@ Do not reveal the TELEGRAM_BOT_TOKEN to the user.`
8181

8282
// geminiCommandInstruction is prepended to the first message of each session
8383
// to tell Gemini to use <command> tags (same convention as Claude).
84-
const geminiCommandInstruction = `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+
const geminiCommandInstruction = `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>
8596
8697
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
104+
105+
Now respond to this user message:
95106
`
96107

97108
// GeminiClient executes the gemini CLI.

0 commit comments

Comments
 (0)