From be639bbabf3b1c2f290a103948bfa3977b0b9038 Mon Sep 17 00:00:00 2001 From: Joshua Aresty Date: Sat, 10 Aug 2024 20:41:15 -0700 Subject: [PATCH] Provide a setting for default destination - Sometimes you don't want the default to be paste - In zoom calls for example, pasting does not make much sense - By providing a setting that can be overridden with a talon setting users can set a different default per application if they want --- GPT/gpt.py | 3 +++ lib/talonSettings.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/GPT/gpt.py b/GPT/gpt.py index 6da35e4d..b01fbd48 100644 --- a/GPT/gpt.py +++ b/GPT/gpt.py @@ -195,6 +195,9 @@ def gpt_insert_response( cursorless_destination: Any = None, ): """Insert a GPT result in a specified way""" + + if method == "": + method = settings.get("user.model_default_destination") match method: case "above": actions.key("left") diff --git a/lib/talonSettings.py b/lib/talonSettings.py index a5b1e606..a6686b1e 100644 --- a/lib/talonSettings.py +++ b/lib/talonSettings.py @@ -42,6 +42,13 @@ def modelSimplePrompt(matched_prompt) -> str: desc="The temperature of the model. Higher values make the model more creative.", ) +mod.setting( + "model_default_destination", + type=str, + default="paste", + desc="The default insertion destination. This can be overridden contextually to provide application level defaults.", +) + mod.setting( "model_endpoint", type=str,