diff options
| author | Grail Finder <wohilas@gmail.com> | 2025-11-25 17:59:42 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2025-11-25 17:59:42 +0300 |
| commit | f5829b34ad564e76156e68ffbccd3c4e2d40c282 (patch) | |
| tree | 956457147873ca540ceee3e784929c91862dd7f2 /tui.go | |
| parent | 01da37b3971a6aa1c3c051c34666672b339ae2b6 (diff) | |
Enha: ctrl+l to rotate free models for openrouter
Diffstat (limited to 'tui.go')
| -rw-r--r-- | tui.go | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -70,7 +70,7 @@ var ( [yellow]Ctrl+v[white]: switch between /completion and /chat api (if provided in config) [yellow]Ctrl+r[white]: start/stop recording from your microphone (needs stt server) [yellow]Ctrl+t[white]: remove thinking (<think>) and tool messages from context (delete from chat) -[yellow]Ctrl+l[white]: update connected model name (llamacpp) +[yellow]Ctrl+l[white]: rotate through free OpenRouter models (if openrouter api) or update connected model name (llamacpp) [yellow]Ctrl+k[white]: switch tool use (recommend tool use to llm after user msg) [yellow]Ctrl+j[white]: if chat agent is char.png will show the image; then any key to return [yellow]Ctrl+a[white]: interrupt tts (needs tts server) @@ -547,10 +547,21 @@ func init() { return nil } if event.Key() == tcell.KeyCtrlL { - go func() { - fetchLCPModelName() // blocks + // Check if the current API is an OpenRouter API + if strings.Contains(cfg.CurrentAPI, "openrouter.ai/api/v1/") { + // Rotate through OpenRouter free models + if len(ORFreeModels) > 0 { + currentORModelIndex = (currentORModelIndex + 1) % len(ORFreeModels) + chatBody.Model = ORFreeModels[currentORModelIndex] + } updateStatusLine() - }() + } else { + // For non-OpenRouter APIs, use the old logic + go func() { + fetchLCPModelName() // blocks + updateStatusLine() + }() + } return nil } if event.Key() == tcell.KeyCtrlT { |
