From 54b4cccf924517bbc836b1b86227fb413281fdd5 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Mon, 9 Mar 2026 10:45:30 +0300 Subject: Fix: make commands for whisper --- Makefile | 5 +++-- batteries/whisper.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1490074..d514a3f 100644 --- a/Makefile +++ b/Makefile @@ -134,8 +134,9 @@ setup-whisper: build-whisper download-whisper-model build-whisper: ## Build whisper.cpp from source in batteries directory @echo "Building whisper.cpp from source in batteries directory..." - @if [ ! -d "batteries/whisper.cpp" ]; then \ + @if [ ! -f "batteries/whisper.cpp/CMakeLists.txt" ]; then \ echo "Cloning whisper.cpp repository to batteries directory..."; \ + rm -rf batteries/whisper.cpp; \ git clone https://github.com/ggml-org/whisper.cpp.git batteries/whisper.cpp; \ fi cd batteries/whisper.cpp && cmake -B build -DGGML_CUDA=ON -DWHISPER_SDL2=ON; cmake --build build --config Release -j 8 @@ -144,7 +145,7 @@ build-whisper: ## Build whisper.cpp from source in batteries directory download-whisper-model: ## Download Whisper model for STT in batteries directory @echo "Downloading Whisper model for STT..." @if [ ! -d "batteries/whisper.cpp/models" ]; then \ - mkdir -p "batteries/whisper.cpp/models" \ + mkdir -p "batteries/whisper.cpp/models"; \ fi curl -o batteries/whisper.cpp/models/ggml-large-v3-turbo-q5_0.bin -L "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo-q5_0.bin?download=true" @echo "Whisper model downloaded successfully!" diff --git a/batteries/whisper.cpp b/batteries/whisper.cpp index a88b93f..30c5194 160000 --- a/batteries/whisper.cpp +++ b/batteries/whisper.cpp @@ -1 +1 @@ -Subproject commit a88b93f85f08fc6045e5d8a8c3f94b7be0ac8bce +Subproject commit 30c5194c9691e4e9a98b3dea9f19727397d3f46e -- cgit v1.2.3 From 528d4210fc23a1f8ee402c48be920f40bb435971 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Mon, 9 Mar 2026 11:56:30 +0300 Subject: Fix: path to whisper model binary --- batteries/whisper.cpp | 2 +- config.example.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/batteries/whisper.cpp b/batteries/whisper.cpp index 30c5194..a88b93f 160000 --- a/batteries/whisper.cpp +++ b/batteries/whisper.cpp @@ -1 +1 @@ -Subproject commit 30c5194c9691e4e9a98b3dea9f19727397d3f46e +Subproject commit a88b93f85f08fc6045e5d8a8c3f94b7be0ac8bce diff --git a/config.example.toml b/config.example.toml index f74d986..665fed6 100644 --- a/config.example.toml +++ b/config.example.toml @@ -42,7 +42,7 @@ STT_ENABLED = false STT_TYPE = "WHISPER_SERVER" # WHISPER_SERVER or WHISPER_BINARY STT_URL = "http://localhost:8081/inference" WhisperBinaryPath = "./batteries/whisper.cpp/build/bin/whisper-cli" # Path to whisper binary (for WHISPER_BINARY mode) -WhisperModelPath = "./batteries/whisper.cpp/ggml-large-v3-turbo-q5_0.bin" # Path to whisper model file (for WHISPER_BINARY mode) +WhisperModelPath = "./batteries/whisper.cpp/models/ggml-large-v3-turbo-q5_0.bin" # Path to whisper model file (for WHISPER_BINARY mode) STT_LANG = "en" # Language for speech recognition (for WHISPER_BINARY mode) STT_SR = 16000 # Sample rate for audio recording # -- cgit v1.2.3 From 3013f21a7591da6b432bc23854caec5e75427872 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Tue, 10 Mar 2026 12:21:27 +0300 Subject: Chore: remove roleinject from props table already exists as keybind (alt+7) --- props_table.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/props_table.go b/props_table.go index d1d3680..3cf796c 100644 --- a/props_table.go +++ b/props_table.go @@ -115,9 +115,6 @@ func makePropsTable(props map[string]float32) *tview.Table { row++ } // Add checkboxes - addCheckboxRow("Inject role", injectRole, func(checked bool) { - injectRole = checked - }) addCheckboxRow("TTS Enabled", cfg.TTS_ENABLED, func(checked bool) { cfg.TTS_ENABLED = checked }) -- cgit v1.2.3 From 6456cb092221001641266be1d5848fe10616344d Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Fri, 13 Mar 2026 07:52:11 +0300 Subject: Doc: add youtube showcase link --- README.md | 4 ++++ assets/yt_thumb.jpg | Bin 0 -> 555970 bytes 2 files changed, 4 insertions(+) create mode 100644 assets/yt_thumb.jpg diff --git a/README.md b/README.md index aa78b4f..9f39f9a 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ made with use of [tview](https://github.com/rivo/tview) - function calls (function calls are implemented natively, to avoid calling outside sources); - [character specific context (unique feature)](docs/char-specific-context.md) + +#### showcase on youtube +[![gf-lt video showcase](assets/yt_thumb.jpg)](https://youtu.be/WCS4Xc902F8 "gf-lt showcase") + #### how it looks ![how it looks](assets/ex01.png) diff --git a/assets/yt_thumb.jpg b/assets/yt_thumb.jpg new file mode 100644 index 0000000..36ad81c Binary files /dev/null and b/assets/yt_thumb.jpg differ -- cgit v1.2.3 From adc4dea644f3f14be8e282e280d6765e57919300 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Fri, 13 Mar 2026 07:56:23 +0300 Subject: Chore: resize yt link image --- assets/yt_thumb.jpg | Bin 555970 -> 42810 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/yt_thumb.jpg b/assets/yt_thumb.jpg index 36ad81c..ea8e2e0 100644 Binary files a/assets/yt_thumb.jpg and b/assets/yt_thumb.jpg differ -- cgit v1.2.3 From d9b820c9c4971922fcde0b373f70c54c870446d5 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Fri, 13 Mar 2026 09:23:17 +0300 Subject: Enha: insert to paste --- README.md | 3 ++- session.go | 28 +++++++++++++++++++++++++--- tui.go | 23 +++++++++++++++++++++-- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9f39f9a..6a7b144 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,8 @@ make noextra-run ``` #### keybinds -while running you can press f12 for list of keys; +- use `insert` button to paste text from the clipboard to the text area, instead of shift+insert (might freeze the program); +- press f12 for list of keys; ![keybinds](assets/helppage.png) #### setting up config diff --git a/session.go b/session.go index 980d998..ef3bab1 100644 --- a/session.go +++ b/session.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "encoding/json" "errors" "fmt" @@ -161,10 +162,31 @@ func loadOldChatOrGetNew() []models.RoleMsg { } func copyToClipboard(text string) error { - cmd := exec.Command("xclip", "-selection", "clipboard") - cmd.Stdin = nil + var cmd *exec.Cmd + if _, err := exec.LookPath("xclip"); err == nil { + cmd = exec.Command("xclip", "-selection", "clipboard") + } else if _, err := exec.LookPath("wl-copy"); err == nil { + cmd = exec.Command("wl-copy") + } else { + return errors.New("no clipboard tool found (install xclip or wl-clipboard)") + } + cmd.Stdin = strings.NewReader(text) cmd.Stdout = nil cmd.Stderr = nil - cmd.Stdin = strings.NewReader(text) return cmd.Run() } + +func readFromClipboard() (string, error) { + var cmd *exec.Cmd + if _, err := exec.LookPath("xclip"); err == nil { + cmd = exec.Command("xclip", "-selection", "clipboard", "-out") + } else if _, err := exec.LookPath("wl-paste"); err == nil { + cmd = exec.Command("wl-paste") + } else { + return "", errors.New("no clipboard tool found (install xclip or wl-clipboard)") + } + var out bytes.Buffer + cmd.Stdout = &out + err := cmd.Run() + return out.String(), err +} diff --git a/tui.go b/tui.go index 04ce38e..b8674c4 100644 --- a/tui.go +++ b/tui.go @@ -68,8 +68,8 @@ var ( [yellow]F4[white]: edit msg [yellow]F5[white]: toggle fullscreen for input/chat window [yellow]F6[white]: interrupt bot resp -[yellow]F7[white]: copy last msg to clipboard (linux xclip) -[yellow]F8[white]: copy n msg to clipboard (linux xclip) +[yellow]F7[white]: copy last msg to clipboard (linux xclip or wl-copy) +[yellow]F8[white]: copy n msg to clipboard (linux xclip or wl-copy) [yellow]F9[white]: table to copy from; with all code blocks [yellow]F10[white]: switch if LLM will respond on this message (for user to write multiple messages in a row) [yellow]F11[white]: import json chat file @@ -104,6 +104,7 @@ var ( [yellow]Alt+t[white]: toggle thinking blocks visibility (collapse/expand blocks) [yellow]Ctrl+t[white]: toggle tool call/response visibility (collapse/expand tool calls and non-shell tool responses) [yellow]Alt+i[white]: show colorscheme selection popup +[yellow]Insert[white]: paste from clipboard to the text area (use it instead shift+insert) === scrolling chat window (some keys similar to vim) === [yellow]arrows up/down and j/k[white]: scroll up and down @@ -318,6 +319,24 @@ func initTUI() { textArea = tview.NewTextArea(). SetPlaceholder("input is multiline; press to start the next line;\npress to send the message.") textArea.SetBorder(true).SetTitle("input") + textArea.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { + if event.Key() == tcell.KeyInsert { + text, err := readFromClipboard() + if err != nil { + logger.Error("failed to read clipboard", "error", err) + return event + } + maxPaste := 100000 + if len(text) > maxPaste { + text = text[:maxPaste] + showToast("paste truncated", "pasted text exceeded 100KB limit") + } + current := textArea.GetText() + textArea.SetText(current+text, true) + return nil + } + return event + }) textView = tview.NewTextView(). SetDynamicColors(true). SetRegions(true). -- cgit v1.2.3