C-Loftus / talon-ai-tools

Query LLMs and AI tools with voice commands
http://colton.place/talon-ai-tools/
MIT License
46 stars 17 forks source link

Do we always want to set clipboard to result? #7

Closed pokey closed 8 months ago

pokey commented 8 months ago

Seems a bit surprising

https://github.com/C-Loftus/talon-ai-tools/blob/de8e3fc34e971a4559a90b1ae0019403d707a17b/GPT/gpt.py#L99-L100

https://github.com/C-Loftus/talon-ai-tools/blob/de8e3fc34e971a4559a90b1ae0019403d707a17b/GPT/gpt.py#L106-L107

C-Loftus commented 8 months ago

I agree it might not be necessary. The reason I have this is that in the past there have been instances in which while I was working, the focus was shifted for the cursor (for instance if an error pops up on some website that steals focus and is unrelated) and then it could not be pasted. So then I would have to redo the command. Honestly this is probably not super necessary anyways for most people (especially those using it within visual studio code where this is likely not an issue), and is more so to compensate for using the model on websites that steal focus.

If you think this is unnecessary then I will get rid of it

jaresty commented 8 months ago

I don't like things messing with my clipboard unless I ask them to, so my vote would be to only do so when the command specifies the result goes to the clipboard.

C-Loftus commented 8 months ago

Okay I have changed this and pushed. if for some reason this becomes an issue for others in the future then perhaps we can have some sort of additional argument that defaults to true that can be contextually overwritten to have true in case they always want to have the clipboard.

but for now I will not do that and keep it simple

pokey commented 8 months ago

fwiw the way we have handled that sort of problem in the past is to store the last value in a global variable in that module, and then have a command that just pastes from that variable. You can see that in action in the vscode draft window