1
1
import pyperclip
2
2
import argparse
3
3
4
+ MODEL_MAPPING = {
5
+ "gpt-4o" : "openai/gpt-4o" ,
6
+ "gpt-4.1" : "openai/gpt-4.1" ,
7
+ }
8
+
4
9
def call_pyperclip_api (prompt , model = None ):
5
10
messages = [{"role" : "user" , "content" : prompt }]
6
11
return call_clipboard_api_with_messages (messages , model )
@@ -13,15 +18,16 @@ def call_clipboard_api_with_messages(messages, model=None):
13
18
break
14
19
if not user_message :
15
20
raise Exception ("No user message found in messages" )
16
- # Use call_pyperclip_api to handle the clipboard interaction
17
21
pyperclip .copy (user_message )
18
- input ("Press Enter after you've copied the answer from Copilot Chat..." )
22
+ input (f"Using model: { model } \n Press Enter after you've copied the answer from Copilot Chat..." )
19
23
answer = pyperclip .paste ()
20
24
return answer if answer else None
21
25
22
26
if __name__ == "__main__" :
23
27
parser = argparse .ArgumentParser (description = "Copy prompt to clipboard for Copilot Chat workflow." )
24
28
parser .add_argument ("prompt" , nargs = "+" , help = "Prompt to send to Copilot Chat" )
29
+ parser .add_argument ("--model" , choices = MODEL_MAPPING .keys (), required = True , help = "Model to use" )
25
30
args = parser .parse_args ()
26
31
prompt = " " .join (args .prompt )
27
- call_pyperclip_api (prompt )
32
+ model = MODEL_MAPPING [args .model ]
33
+ call_pyperclip_api (prompt , model )
0 commit comments