ngpt 1.3.0__py3-none-any.whl → 1.4.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ngpt/cli.py CHANGED
@@ -103,6 +103,8 @@ def main():
103
103
  global_group.add_argument('--model', help='Model to use')
104
104
  global_group.add_argument('--web-search', action='store_true',
105
105
  help='Enable web search capability (Note: Your API endpoint must support this feature)')
106
+ global_group.add_argument('-n', '--no-stream', action='store_true',
107
+ help='Return the whole response without streaming')
106
108
 
107
109
  # Mode flags (mutually exclusive)
108
110
  mode_group = parser.add_argument_group('Modes (mutually exclusive)')
@@ -401,7 +403,9 @@ def main():
401
403
  sys.exit(130)
402
404
 
403
405
  print("\nSubmission successful. Waiting for response...")
404
- client.chat(prompt, web_search=args.web_search)
406
+ response = client.chat(prompt, stream=not args.no_stream, web_search=args.web_search)
407
+ if args.no_stream and response:
408
+ print(response)
405
409
 
406
410
  else:
407
411
  # Default to chat mode
@@ -414,7 +418,9 @@ def main():
414
418
  sys.exit(130)
415
419
  else:
416
420
  prompt = args.prompt
417
- client.chat(prompt, web_search=args.web_search)
421
+ response = client.chat(prompt, stream=not args.no_stream, web_search=args.web_search)
422
+ if args.no_stream and response:
423
+ print(response)
418
424
 
419
425
  except KeyboardInterrupt:
420
426
  print("\nOperation cancelled by user. Exiting gracefully.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 1.3.0
3
+ Version: 1.4.1
4
4
  Summary: A lightweight Python CLI and library for interacting with OpenAI-compatible APIs, supporting both official and self-hosted LLM endpoints.
5
5
  Project-URL: Homepage, https://github.com/nazdridoy/ngpt
6
6
  Project-URL: Repository, https://github.com/nazdridoy/ngpt
@@ -64,6 +64,9 @@ pip install ngpt
64
64
  # Chat with default settings
65
65
  ngpt "Tell me about quantum computing"
66
66
 
67
+ # Return response without streaming
68
+ ngpt -n "Tell me about quantum computing"
69
+
67
70
  # Generate code
68
71
  ngpt --code "function to calculate the Fibonacci sequence"
69
72
 
@@ -202,6 +205,7 @@ You can configure the client using the following options:
202
205
  | `--base-url` | Base URL for the API |
203
206
  | `--model` | Model to use |
204
207
  | `--web-search` | Enable web search capability |
208
+ | `-n, --no-stream` | Return the whole response without streaming |
205
209
  | `--config` | Path to a custom configuration file or, when used without a value, enters interactive configuration mode |
206
210
  | `--config-index` | Index of the configuration to use (default: 0) |
207
211
  | `--remove` | Remove the configuration at the specified index (requires --config and --config-index) |
@@ -0,0 +1,9 @@
1
+ ngpt/__init__.py,sha256=ehInP9w0MZlS1vZ1g6Cm4YE1ftmgF72CnEddQ3Le9n4,368
2
+ ngpt/cli.py,sha256=0oOh0hmqBrITihyacTfTt7elMoVenmsgxtED6YDcQUc,20254
3
+ ngpt/client.py,sha256=O0dPYeQCJlpWZWBBsroo-5UxeyBVwqC6o3Pm8lRnDiY,10329
4
+ ngpt/config.py,sha256=BF0G3QeiPma8l7EQyc37bR7LWZog7FHJQNe7uj9cr4w,6896
5
+ ngpt-1.4.1.dist-info/METADATA,sha256=NPF972cMmb088HjbEDfmsRMMnbZPJyji41o_Pt6arEQ,10086
6
+ ngpt-1.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ ngpt-1.4.1.dist-info/entry_points.txt,sha256=1cnAMujyy34DlOahrJg19lePSnb08bLbkUs_kVerqdk,39
8
+ ngpt-1.4.1.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
9
+ ngpt-1.4.1.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- ngpt/__init__.py,sha256=ehInP9w0MZlS1vZ1g6Cm4YE1ftmgF72CnEddQ3Le9n4,368
2
- ngpt/cli.py,sha256=U8A9JKOpp-GorBk9yMs2nPThSdUwm83P_e3sDgfqCYo,19880
3
- ngpt/client.py,sha256=O0dPYeQCJlpWZWBBsroo-5UxeyBVwqC6o3Pm8lRnDiY,10329
4
- ngpt/config.py,sha256=BF0G3QeiPma8l7EQyc37bR7LWZog7FHJQNe7uj9cr4w,6896
5
- ngpt-1.3.0.dist-info/METADATA,sha256=mGKNDQa1ppPnBp8lXILcSGYsS_40J0TQRQWLgpF_ewQ,9939
6
- ngpt-1.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- ngpt-1.3.0.dist-info/entry_points.txt,sha256=1cnAMujyy34DlOahrJg19lePSnb08bLbkUs_kVerqdk,39
8
- ngpt-1.3.0.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
9
- ngpt-1.3.0.dist-info/RECORD,,
File without changes