zhangnew commited on
Commit
e14c21e
·
unverified ·
1 Parent(s): 9ddedbe

Support to send a message by pressing Enter once (#74)

Browse files
Files changed (1) hide show
  1. src/EdgeGPT.py +7 -1
src/EdgeGPT.py CHANGED
@@ -271,6 +271,11 @@ def get_input(prompt):
271
  # Display the prompt
272
  print(prompt, end="")
273
 
 
 
 
 
 
274
  # Initialize an empty list to store the input lines
275
  lines = []
276
 
@@ -339,10 +344,11 @@ if __name__ == "__main__":
339
  !help for help
340
 
341
  Type !exit to exit
342
- Enter twice to send message
343
  """,
344
  )
345
  parser = argparse.ArgumentParser()
 
346
  parser.add_argument("--no-stream", action="store_true")
347
  parser.add_argument(
348
  "--cookie-file",
 
271
  # Display the prompt
272
  print(prompt, end="")
273
 
274
+ if args.enter_once:
275
+ user_input = input()
276
+ print()
277
+ return user_input
278
+
279
  # Initialize an empty list to store the input lines
280
  lines = []
281
 
 
344
  !help for help
345
 
346
  Type !exit to exit
347
+ Enter twice to send message or set --enter-once to send one line message
348
  """,
349
  )
350
  parser = argparse.ArgumentParser()
351
+ parser.add_argument("--enter-once", action="store_true")
352
  parser.add_argument("--no-stream", action="store_true")
353
  parser.add_argument(
354
  "--cookie-file",