ngpt 2.3.3__tar.gz → 2.3.4__tar.gz

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.
Files changed (32) hide show
  1. {ngpt-2.3.3 → ngpt-2.3.4}/PKG-INFO +2 -2
  2. {ngpt-2.3.3 → ngpt-2.3.4}/README.md +1 -1
  3. {ngpt-2.3.3 → ngpt-2.3.4}/docs/configuration.md +1 -1
  4. {ngpt-2.3.3 → ngpt-2.3.4}/docs/usage/cli_usage.md +4 -5
  5. {ngpt-2.3.3 → ngpt-2.3.4}/ngpt/cli.py +9 -9
  6. {ngpt-2.3.3 → ngpt-2.3.4}/ngpt/client.py +6 -6
  7. {ngpt-2.3.3 → ngpt-2.3.4}/pyproject.toml +1 -1
  8. {ngpt-2.3.3 → ngpt-2.3.4}/uv.lock +1 -1
  9. {ngpt-2.3.3 → ngpt-2.3.4}/.github/workflows/python-publish.yml +0 -0
  10. {ngpt-2.3.3 → ngpt-2.3.4}/.gitignore +0 -0
  11. {ngpt-2.3.3 → ngpt-2.3.4}/.python-version +0 -0
  12. {ngpt-2.3.3 → ngpt-2.3.4}/COMMIT_GUIDELINES.md +0 -0
  13. {ngpt-2.3.3 → ngpt-2.3.4}/CONTRIBUTING.md +0 -0
  14. {ngpt-2.3.3 → ngpt-2.3.4}/LICENSE +0 -0
  15. {ngpt-2.3.3 → ngpt-2.3.4}/docs/CONTRIBUTING.md +0 -0
  16. {ngpt-2.3.3 → ngpt-2.3.4}/docs/LICENSE.md +0 -0
  17. {ngpt-2.3.3 → ngpt-2.3.4}/docs/README.md +0 -0
  18. {ngpt-2.3.3 → ngpt-2.3.4}/docs/_config.yml +0 -0
  19. {ngpt-2.3.3 → ngpt-2.3.4}/docs/api/README.md +0 -0
  20. {ngpt-2.3.3 → ngpt-2.3.4}/docs/api/client.md +0 -0
  21. {ngpt-2.3.3 → ngpt-2.3.4}/docs/api/config.md +0 -0
  22. {ngpt-2.3.3 → ngpt-2.3.4}/docs/assets/css/style.scss +0 -0
  23. {ngpt-2.3.3 → ngpt-2.3.4}/docs/examples/README.md +0 -0
  24. {ngpt-2.3.3 → ngpt-2.3.4}/docs/examples/advanced.md +0 -0
  25. {ngpt-2.3.3 → ngpt-2.3.4}/docs/examples/basic.md +0 -0
  26. {ngpt-2.3.3 → ngpt-2.3.4}/docs/examples/integrations.md +0 -0
  27. {ngpt-2.3.3 → ngpt-2.3.4}/docs/installation.md +0 -0
  28. {ngpt-2.3.3 → ngpt-2.3.4}/docs/overview.md +0 -0
  29. {ngpt-2.3.3 → ngpt-2.3.4}/docs/usage/README.md +0 -0
  30. {ngpt-2.3.3 → ngpt-2.3.4}/docs/usage/library_usage.md +0 -0
  31. {ngpt-2.3.3 → ngpt-2.3.4}/ngpt/__init__.py +0 -0
  32. {ngpt-2.3.3 → ngpt-2.3.4}/ngpt/config.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 2.3.3
3
+ Version: 2.3.4
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
@@ -264,7 +264,7 @@ You can configure the client using the following options:
264
264
  | `-n, --no-stream` | Return the whole response without streaming |
265
265
  | `--temperature` | Set temperature (controls randomness, default: 0.7) |
266
266
  | `--top_p` | Set top_p (controls diversity, default: 1.0) |
267
- | `--max_length` | Set maximum response length in tokens |
267
+ | `--max_tokens` | Set maximum response length in tokens |
268
268
  | `--preprompt` | Set custom system prompt to control AI behavior |
269
269
  | `--log` | Set filepath to log conversation to (for interactive modes) |
270
270
  | `--config` | Path to a custom configuration file or, when used without a value, enters interactive configuration mode |
@@ -230,7 +230,7 @@ You can configure the client using the following options:
230
230
  | `-n, --no-stream` | Return the whole response without streaming |
231
231
  | `--temperature` | Set temperature (controls randomness, default: 0.7) |
232
232
  | `--top_p` | Set top_p (controls diversity, default: 1.0) |
233
- | `--max_length` | Set maximum response length in tokens |
233
+ | `--max_tokens` | Set maximum response length in tokens |
234
234
  | `--preprompt` | Set custom system prompt to control AI behavior |
235
235
  | `--log` | Set filepath to log conversation to (for interactive modes) |
236
236
  | `--config` | Path to a custom configuration file or, when used without a value, enters interactive configuration mode |
@@ -105,7 +105,7 @@ ngpt --api-key "your-key" --base-url "https://api.example.com/v1/" --model "cust
105
105
  ngpt --config-index 2 "Your prompt here"
106
106
 
107
107
  # Control response generation parameters
108
- ngpt --temperature 0.8 --top_p 0.95 --max_length 300 "Write a creative story"
108
+ ngpt --temperature 0.8 --top_p 0.95 --max_tokens 300 "Write a creative story"
109
109
 
110
110
  # Set a custom system prompt (preprompt)
111
111
  ngpt --preprompt "You are a Linux command line expert. Focus on efficient solutions." "How do I find the largest files in a directory?"
@@ -47,7 +47,7 @@ Here are the most commonly used options:
47
47
  | `--web-search` | Enable web search capability (if supported by your API) |
48
48
  | `--temperature` | Set temperature (controls randomness, default: 0.7) |
49
49
  | `--top_p` | Set top_p (controls diversity, default: 1.0) |
50
- | `--max_length` | Set maximum response length in tokens |
50
+ | `--max_tokens` | Set maximum response length in tokens |
51
51
 
52
52
  ## Feature Details
53
53
 
@@ -270,10 +270,10 @@ Set the maximum response length in tokens:
270
270
 
271
271
  ```bash
272
272
  # Get a concise response
273
- ngpt --max_length 100 "Explain quantum computing"
273
+ ngpt --max_tokens 100 "Explain quantum computing"
274
274
 
275
275
  # Allow for a longer, more detailed response
276
- ngpt --max_length 500 "Write a comprehensive guide to machine learning"
276
+ ngpt --max_tokens 500 "Write a comprehensive guide to machine learning"
277
277
  ```
278
278
 
279
279
  ## Examples by Task
@@ -338,7 +338,6 @@ ngpt --show-config
338
338
  # Try specifying the base URL directly
339
339
  ngpt --base-url "https://api.example.com/v1/" "Test connection"
340
340
  ```
341
-
342
341
  ### Authorization Problems
343
342
 
344
343
  If you're experiencing authentication issues:
@@ -384,4 +383,4 @@ If the `ngpt` command is not found after installation:
384
383
  5. **Improve efficiency**:
385
384
  - Use `-n` (no streaming) for faster responses in scripts
386
385
  - Use interactive mode when having a conversation
387
- - Exit interactive sessions when not in use to save API costs
386
+ - Exit interactive sessions when not in use to save API costs
@@ -325,7 +325,7 @@ def check_config(config):
325
325
 
326
326
  return True
327
327
 
328
- def interactive_chat_session(client, web_search=False, no_stream=False, temperature=0.7, top_p=1.0, max_length=None, log_file=None, preprompt=None):
328
+ def interactive_chat_session(client, web_search=False, no_stream=False, temperature=0.7, top_p=1.0, max_tokens=None, log_file=None, preprompt=None):
329
329
  """Run an interactive chat session with conversation history."""
330
330
  # Get terminal width for better formatting
331
331
  try:
@@ -492,7 +492,7 @@ def interactive_chat_session(client, web_search=False, no_stream=False, temperat
492
492
  web_search=web_search,
493
493
  temperature=temperature,
494
494
  top_p=top_p,
495
- max_tokens=max_length
495
+ max_tokens=max_tokens
496
496
  )
497
497
 
498
498
  # Add AI response to conversation history
@@ -572,12 +572,12 @@ def main():
572
572
  help='Set temperature (controls randomness, default: 0.7)')
573
573
  global_group.add_argument('--top_p', type=float, default=1.0,
574
574
  help='Set top_p (controls diversity, default: 1.0)')
575
- global_group.add_argument('--max_length', type=int,
575
+ global_group.add_argument('--max_tokens', type=int,
576
576
  help='Set max response length in tokens')
577
577
  global_group.add_argument('--log', metavar='FILE',
578
578
  help='Set filepath to log conversation to (For interactive modes)')
579
579
  global_group.add_argument('--preprompt',
580
- help='Set preprompt')
580
+ help='Set custom system prompt to control AI behavior')
581
581
 
582
582
  # Mode flags (mutually exclusive)
583
583
  mode_group = parser.add_argument_group('Modes (mutually exclusive)')
@@ -738,7 +738,7 @@ def main():
738
738
  # Interactive chat mode
739
739
  interactive_chat_session(client, web_search=args.web_search, no_stream=args.no_stream,
740
740
  temperature=args.temperature, top_p=args.top_p,
741
- max_length=args.max_length, log_file=args.log, preprompt=args.preprompt)
741
+ max_tokens=args.max_tokens, log_file=args.log, preprompt=args.preprompt)
742
742
  elif args.shell:
743
743
  if args.prompt is None:
744
744
  try:
@@ -752,7 +752,7 @@ def main():
752
752
 
753
753
  command = client.generate_shell_command(prompt, web_search=args.web_search,
754
754
  temperature=args.temperature, top_p=args.top_p,
755
- max_length=args.max_length)
755
+ max_tokens=args.max_tokens)
756
756
  if not command:
757
757
  return # Error already printed by client
758
758
 
@@ -790,7 +790,7 @@ def main():
790
790
 
791
791
  generated_code = client.generate_code(prompt, args.language, web_search=args.web_search,
792
792
  temperature=args.temperature, top_p=args.top_p,
793
- max_length=args.max_length)
793
+ max_tokens=args.max_tokens)
794
794
  if generated_code:
795
795
  print(f"\nGenerated code:\n{generated_code}")
796
796
 
@@ -913,7 +913,7 @@ def main():
913
913
 
914
914
  response = client.chat(prompt, stream=not args.no_stream, web_search=args.web_search,
915
915
  temperature=args.temperature, top_p=args.top_p,
916
- max_tokens=args.max_length, messages=messages)
916
+ max_tokens=args.max_tokens, messages=messages)
917
917
  if args.no_stream and response:
918
918
  print(response)
919
919
 
@@ -939,7 +939,7 @@ def main():
939
939
 
940
940
  response = client.chat(prompt, stream=not args.no_stream, web_search=args.web_search,
941
941
  temperature=args.temperature, top_p=args.top_p,
942
- max_tokens=args.max_length, messages=messages)
942
+ max_tokens=args.max_tokens, messages=messages)
943
943
  if args.no_stream and response:
944
944
  print(response)
945
945
 
@@ -167,7 +167,7 @@ class NGPTClient:
167
167
  web_search: bool = False,
168
168
  temperature: float = 0.4,
169
169
  top_p: float = 0.95,
170
- max_length: Optional[int] = None
170
+ max_tokens: Optional[int] = None
171
171
  ) -> str:
172
172
  """
173
173
  Generate a shell command based on the prompt.
@@ -177,7 +177,7 @@ class NGPTClient:
177
177
  web_search: Whether to enable web search capability
178
178
  temperature: Controls randomness in the response
179
179
  top_p: Controls diversity via nucleus sampling
180
- max_length: Maximum number of tokens to generate
180
+ max_tokens: Maximum number of tokens to generate
181
181
 
182
182
  Returns:
183
183
  The generated shell command
@@ -228,7 +228,7 @@ Command:"""
228
228
  web_search=web_search,
229
229
  temperature=temperature,
230
230
  top_p=top_p,
231
- max_tokens=max_length
231
+ max_tokens=max_tokens
232
232
  )
233
233
  except Exception as e:
234
234
  print(f"Error generating shell command: {e}")
@@ -241,7 +241,7 @@ Command:"""
241
241
  web_search: bool = False,
242
242
  temperature: float = 0.4,
243
243
  top_p: float = 0.95,
244
- max_length: Optional[int] = None
244
+ max_tokens: Optional[int] = None
245
245
  ) -> str:
246
246
  """
247
247
  Generate code based on the prompt.
@@ -252,7 +252,7 @@ Command:"""
252
252
  web_search: Whether to enable web search capability
253
253
  temperature: Controls randomness in the response
254
254
  top_p: Controls diversity via nucleus sampling
255
- max_length: Maximum number of tokens to generate
255
+ max_tokens: Maximum number of tokens to generate
256
256
 
257
257
  Returns:
258
258
  The generated code
@@ -285,7 +285,7 @@ Code:"""
285
285
  web_search=web_search,
286
286
  temperature=temperature,
287
287
  top_p=top_p,
288
- max_tokens=max_length
288
+ max_tokens=max_tokens
289
289
  )
290
290
  except Exception as e:
291
291
  print(f"Error generating code: {e}")
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ngpt"
3
- version = "2.3.3"
3
+ version = "2.3.4"
4
4
  description = "A lightweight Python CLI and library for interacting with OpenAI-compatible APIs, supporting both official and self-hosted LLM endpoints."
5
5
  authors = [
6
6
  {name = "nazDridoy", email = "nazdridoy399@gmail.com"},
@@ -113,7 +113,7 @@ wheels = [
113
113
 
114
114
  [[package]]
115
115
  name = "ngpt"
116
- version = "2.3.3"
116
+ version = "2.3.4"
117
117
  source = { editable = "." }
118
118
  dependencies = [
119
119
  { name = "prompt-toolkit" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes