From 30f2585d33d24f58d59560ea516c8b96065585a5 Mon Sep 17 00:00:00 2001 From: Hayden Johnson Date: Fri, 25 Apr 2025 16:22:41 -0700 Subject: [PATCH] add copy function --- assistant.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assistant.py b/assistant.py index 3fb812f..4ae15d3 100755 --- a/assistant.py +++ b/assistant.py @@ -67,6 +67,11 @@ def parse_commands(text): context_query = '\n\nThe following is context provided by the user:\n' context_query += get_string_from_clipboard() + '\n' return text.split('/clipboard ')[1] + context_query + case '/copy': + blocks = extract_code_block(history[-1]['content']) + if len(blocks): + copy_string_to_clipboard(blocks[0]) + return True case '/exit': exit() return False