Skip to content

Commit 1c507b6

Browse files
committed
feat(pyperclip): add model selection support
1 parent b8608ac commit 1c507b6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/pyperclip_client/pyperclip_client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import pyperclip
22
import argparse
33

4+
MODEL_MAPPING = {
5+
"gpt-4o": "openai/gpt-4o",
6+
"gpt-4.1": "openai/gpt-4.1",
7+
}
8+
49
def call_pyperclip_api(prompt, model=None):
510
messages = [{"role": "user", "content": prompt}]
611
return call_clipboard_api_with_messages(messages, model)
@@ -13,15 +18,16 @@ def call_clipboard_api_with_messages(messages, model=None):
1318
break
1419
if not user_message:
1520
raise Exception("No user message found in messages")
16-
# Use call_pyperclip_api to handle the clipboard interaction
1721
pyperclip.copy(user_message)
18-
input("Press Enter after you've copied the answer from Copilot Chat...")
22+
input(f"Using model: {model}\nPress Enter after you've copied the answer from Copilot Chat...")
1923
answer = pyperclip.paste()
2024
return answer if answer else None
2125

2226
if __name__ == "__main__":
2327
parser = argparse.ArgumentParser(description="Copy prompt to clipboard for Copilot Chat workflow.")
2428
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")
2530
args = parser.parse_args()
2631
prompt = " ".join(args.prompt)
27-
call_pyperclip_api(prompt)
32+
model = MODEL_MAPPING[args.model]
33+
call_pyperclip_api(prompt, model)

0 commit comments

Comments
 (0)