File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 183183Assume role of the LLM and give your response.*
184184
185185</details >
186+
187+ - Combine both of piped and explicitly issued prompt #13
188+ - Support piping input in Windows. #13
Original file line number Diff line number Diff line change 1111import json
1212import re
1313import sys
14- import platform
1514import datetime
1615import time
1716from time import sleep
@@ -1190,7 +1189,7 @@ def generate(
11901189 prompt = prompt + sep + clipman .get ()
11911190 assert prompt .strip () != sep , "No copied text found, issue prompt"
11921191
1193- if not prompt and sys .stdin .isatty (): # No prompt issued and no piped input
1192+ if not prompt and sys .stdin .isatty (): # No prompt issued and no piped input
11941193 help_info = (
11951194 "Usage: pytgpt generate [OPTIONS] PROMPT\n "
11961195 "Try 'pytgpt generate --help' for help.\n "
@@ -1201,7 +1200,7 @@ def generate(
12011200 ) # Let's try to mimic the click's missing argument help info
12021201 sys .exit (1 )
12031202
1204- if not sys .stdin .isatty (): # Piped input detected - True
1203+ if not sys .stdin .isatty (): # Piped input detected - True
12051204 # Let's try to read piped input
12061205 stdin = click .get_text_stream ("stdin" ).read ()
12071206 prompt = prompt + "\n " + stdin if prompt else stdin
You can’t perform that action at this time.
0 commit comments