ngpt 2.11.1__tar.gz → 2.11.3__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 (53) hide show
  1. {ngpt-2.11.1 → ngpt-2.11.3}/PKG-INFO +3 -3
  2. {ngpt-2.11.1 → ngpt-2.11.3}/README.md +2 -2
  3. {ngpt-2.11.1 → ngpt-2.11.3}/docs/configuration.md +1 -1
  4. {ngpt-2.11.1 → ngpt-2.11.3}/docs/examples/basic.md +1 -1
  5. {ngpt-2.11.1 → ngpt-2.11.3}/docs/usage/cli_usage.md +3 -3
  6. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/args.py +1 -1
  7. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/utils/cli_config.py +26 -12
  8. {ngpt-2.11.1 → ngpt-2.11.3}/pyproject.toml +1 -1
  9. {ngpt-2.11.1 → ngpt-2.11.3}/uv.lock +1 -1
  10. {ngpt-2.11.1 → ngpt-2.11.3}/.github/workflows/python-publish.yml +0 -0
  11. {ngpt-2.11.1 → ngpt-2.11.3}/.gitignore +0 -0
  12. {ngpt-2.11.1 → ngpt-2.11.3}/.python-version +0 -0
  13. {ngpt-2.11.1 → ngpt-2.11.3}/COMMIT_GUIDELINES.md +0 -0
  14. {ngpt-2.11.1 → ngpt-2.11.3}/CONTRIBUTING.md +0 -0
  15. {ngpt-2.11.1 → ngpt-2.11.3}/LICENSE +0 -0
  16. {ngpt-2.11.1 → ngpt-2.11.3}/docs/CONTRIBUTING.md +0 -0
  17. {ngpt-2.11.1 → ngpt-2.11.3}/docs/LICENSE.md +0 -0
  18. {ngpt-2.11.1 → ngpt-2.11.3}/docs/README.md +0 -0
  19. {ngpt-2.11.1 → ngpt-2.11.3}/docs/_config.yml +0 -0
  20. {ngpt-2.11.1 → ngpt-2.11.3}/docs/api/README.md +0 -0
  21. {ngpt-2.11.1 → ngpt-2.11.3}/docs/api/cli.md +0 -0
  22. {ngpt-2.11.1 → ngpt-2.11.3}/docs/api/cli_config.md +0 -0
  23. {ngpt-2.11.1 → ngpt-2.11.3}/docs/api/client.md +0 -0
  24. {ngpt-2.11.1 → ngpt-2.11.3}/docs/api/config.md +0 -0
  25. {ngpt-2.11.1 → ngpt-2.11.3}/docs/assets/css/style.scss +0 -0
  26. {ngpt-2.11.1 → ngpt-2.11.3}/docs/examples/README.md +0 -0
  27. {ngpt-2.11.1 → ngpt-2.11.3}/docs/examples/advanced.md +0 -0
  28. {ngpt-2.11.1 → ngpt-2.11.3}/docs/examples/cli_components.md +0 -0
  29. {ngpt-2.11.1 → ngpt-2.11.3}/docs/examples/integrations.md +0 -0
  30. {ngpt-2.11.1 → ngpt-2.11.3}/docs/installation.md +0 -0
  31. {ngpt-2.11.1 → ngpt-2.11.3}/docs/overview.md +0 -0
  32. {ngpt-2.11.1 → ngpt-2.11.3}/docs/usage/README.md +0 -0
  33. {ngpt-2.11.1 → ngpt-2.11.3}/docs/usage/cli_config.md +0 -0
  34. {ngpt-2.11.1 → ngpt-2.11.3}/docs/usage/cli_framework.md +0 -0
  35. {ngpt-2.11.1 → ngpt-2.11.3}/docs/usage/library_usage.md +0 -0
  36. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/__init__.py +0 -0
  37. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/__init__.py +0 -0
  38. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/config_manager.py +0 -0
  39. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/formatters.py +0 -0
  40. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/interactive.py +0 -0
  41. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/main.py +0 -0
  42. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/modes/__init__.py +0 -0
  43. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/modes/chat.py +0 -0
  44. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/modes/code.py +0 -0
  45. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/modes/shell.py +0 -0
  46. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/modes/text.py +0 -0
  47. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/renderers.py +0 -0
  48. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli/ui.py +0 -0
  49. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/cli.py +0 -0
  50. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/client.py +0 -0
  51. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/utils/__init__.py +0 -0
  52. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/utils/config.py +0 -0
  53. {ngpt-2.11.1 → ngpt-2.11.3}/ngpt/utils/log.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 2.11.1
3
+ Version: 2.11.3
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
@@ -83,7 +83,7 @@ ngpt "Tell me about quantum computing"
83
83
  ngpt -i
84
84
 
85
85
  # Return response without streaming
86
- ngpt -n "Tell me about quantum computing"
86
+ ngpt --no-stream "Tell me about quantum computing"
87
87
 
88
88
  # Generate code
89
89
  ngpt --code "function to calculate the Fibonacci sequence"
@@ -349,7 +349,7 @@ You can configure the client using the following options:
349
349
  | `--model` | Model to use |
350
350
  | `--list-models` | List all available models for the selected configuration (can be combined with --config-index) |
351
351
  | `--web-search` | Enable web search capability |
352
- | `-n, --no-stream` | Return the whole response without streaming |
352
+ | `--no-stream` | Return the whole response without streaming |
353
353
  | `--temperature` | Set temperature (controls randomness, default: 0.7) |
354
354
  | `--top_p` | Set top_p (controls diversity, default: 1.0) |
355
355
  | `--max_tokens` | Set maximum response length in tokens |
@@ -48,7 +48,7 @@ ngpt "Tell me about quantum computing"
48
48
  ngpt -i
49
49
 
50
50
  # Return response without streaming
51
- ngpt -n "Tell me about quantum computing"
51
+ ngpt --no-stream "Tell me about quantum computing"
52
52
 
53
53
  # Generate code
54
54
  ngpt --code "function to calculate the Fibonacci sequence"
@@ -314,7 +314,7 @@ You can configure the client using the following options:
314
314
  | `--model` | Model to use |
315
315
  | `--list-models` | List all available models for the selected configuration (can be combined with --config-index) |
316
316
  | `--web-search` | Enable web search capability |
317
- | `-n, --no-stream` | Return the whole response without streaming |
317
+ | `--no-stream` | Return the whole response without streaming |
318
318
  | `--temperature` | Set temperature (controls randomness, default: 0.7) |
319
319
  | `--top_p` | Set top_p (controls diversity, default: 1.0) |
320
320
  | `--max_tokens` | Set maximum response length in tokens |
@@ -124,7 +124,7 @@ You can also set configuration options directly via command-line arguments:
124
124
  - `-c, --code`: Generate code.
125
125
  - `--language <lang>`: Specify the programming language for code generation (e.g., `python`, `javascript`, default: `python`).
126
126
  - `-t, --text`: Use a multiline editor for input.
127
- - `-n, --no-stream`: Disable streaming output.
127
+ - `--no-stream`: Disable streaming output.
128
128
  - `--prettify`: Enable formatted markdown/code output (disables streaming).
129
129
  - `--renderer <name>`: Choose the renderer (`auto`, `rich`, `glow`).
130
130
  - `--list-renderers`: Show available renderers.
@@ -128,7 +128,7 @@ print(response)
128
128
  ngpt "Tell me about quantum computing"
129
129
 
130
130
  # No streaming (wait for full response)
131
- ngpt -n "Explain the theory of relativity"
131
+ ngpt --no-stream "Explain the theory of relativity"
132
132
 
133
133
  # Prettify markdown output
134
134
  ngpt --prettify "Create a markdown table comparing different programming languages"
@@ -48,7 +48,7 @@ Below is a comprehensive list of all available command-line options, organized b
48
48
  | `-s, --shell` | Generate and execute shell commands appropriate for your operating system |
49
49
  | `-c, --code` | Generate clean code without markdown formatting or explanations |
50
50
  | `-t, --text` | Open interactive multiline editor for complex prompts with syntax highlighting |
51
- | `-n, --no-stream` | Return the whole response without streaming (useful for scripts) |
51
+ | `--no-stream` | Return the whole response without streaming (useful for scripts) |
52
52
 
53
53
  ### Configuration Management
54
54
 
@@ -598,7 +598,7 @@ You can combine various options:
598
598
  ngpt -c --web-search "function to get current weather using an API"
599
599
 
600
600
  # Use a specific model and no streaming
601
- ngpt --model gpt-4o-mini -n "Explain quantum entanglement"
601
+ ngpt --model gpt-4o-mini --no-stream "Explain quantum entanglement"
602
602
 
603
603
  # Interactive session with custom prompt and logging
604
604
  ngpt -i --preprompt "You are a data science tutor" --log datasci_tutoring.txt
@@ -768,6 +768,6 @@ If the `ngpt` command is not found after installation:
768
768
  - Use environment variables when appropriate
769
769
 
770
770
  5. **Improve efficiency**:
771
- - Use `-n` (no streaming) for faster responses in scripts
771
+ - Use `--no-stream` for faster responses in scripts
772
772
  - Use interactive mode when having a conversation
773
773
  - Exit interactive sessions when not in use to save API costs
@@ -48,7 +48,7 @@ def setup_argument_parser():
48
48
  global_group.add_argument('--model', help='Model to use')
49
49
  global_group.add_argument('--web-search', action='store_true',
50
50
  help='Enable web search capability (Note: Your API endpoint must support this feature)')
51
- global_group.add_argument('-n', '--no-stream', action='store_true',
51
+ global_group.add_argument('--no-stream', action='store_true',
52
52
  help='Return the whole response without streaming')
53
53
  global_group.add_argument('--temperature', type=float, default=0.7,
54
54
  help='Set temperature (controls randomness, default: 0.7)')
@@ -206,13 +206,23 @@ def apply_cli_config(args: Any, mode: str) -> Any:
206
206
  # Load CLI config
207
207
  cli_config = load_cli_config()
208
208
 
209
- # Get command-line arguments provided by the user
210
- explicit_args = set(arg for arg in sys.argv[1:] if arg.startswith('--'))
209
+ # Get command-line arguments provided by the user (both long and short forms)
210
+ explicit_args = set()
211
+ for arg in sys.argv[1:]:
212
+ if arg.startswith('--'):
213
+ explicit_args.add(arg)
214
+ # We've removed -n, but this pattern would handle other short options
211
215
 
212
216
  # Keep track of applied exclusive options
213
217
  applied_exclusives = set()
214
218
 
215
- # For each option in CLI config, check if it should be applied
219
+ # First pass: Check explicitly set args and track their exclusive options
220
+ for option in CLI_CONFIG_OPTIONS:
221
+ cli_option = f"--{option}"
222
+ if cli_option in explicit_args and "exclusive" in CLI_CONFIG_OPTIONS[option]:
223
+ applied_exclusives.update(CLI_CONFIG_OPTIONS[option]["exclusive"])
224
+
225
+ # Second pass: Apply CLI config options
216
226
  for option, value in cli_config.items():
217
227
  # Skip if not a valid option
218
228
  if option not in CLI_CONFIG_OPTIONS:
@@ -227,12 +237,8 @@ def apply_cli_config(args: Any, mode: str) -> Any:
227
237
  arg_name = option.replace("-", "_")
228
238
 
229
239
  # Skip if explicitly set via command line
230
- # Check common variants like --option
231
240
  cli_option = f"--{option}"
232
241
  if cli_option in explicit_args:
233
- # Add to applied_exclusives if this option has exclusivity constraints
234
- if "exclusive" in CLI_CONFIG_OPTIONS[option]:
235
- applied_exclusives.update(CLI_CONFIG_OPTIONS[option]["exclusive"])
236
242
  continue
237
243
 
238
244
  # Skip if an exclusive option has already been applied
@@ -240,7 +246,6 @@ def apply_cli_config(args: Any, mode: str) -> Any:
240
246
  continue
241
247
 
242
248
  # Check exclusivity constraints against *explicitly set* args
243
- # Don't apply a CLI config option if an exclusive option was explicitly set
244
249
  if "exclusive" in CLI_CONFIG_OPTIONS[option]:
245
250
  skip = False
246
251
  for excl_option in CLI_CONFIG_OPTIONS[option]["exclusive"]:
@@ -250,14 +255,23 @@ def apply_cli_config(args: Any, mode: str) -> Any:
250
255
  break # Skip applying this CLI config value
251
256
  if skip:
252
257
  continue
253
-
254
- # If we're applying this option, add its exclusives to the tracking set
255
- applied_exclusives.update(CLI_CONFIG_OPTIONS[option]["exclusive"])
256
-
258
+
257
259
  # Apply the value from CLI config
258
260
  # Ensure the attribute exists on args before setting
259
261
  if hasattr(args, arg_name):
260
262
  setattr(args, arg_name, value)
263
+
264
+ # For boolean options that are True, explicitly disable their exclusive options
265
+ option_type = CLI_CONFIG_OPTIONS[option]["type"]
266
+ if option_type == "bool" and value is True and "exclusive" in CLI_CONFIG_OPTIONS[option]:
267
+ for excl_option in CLI_CONFIG_OPTIONS[option]["exclusive"]:
268
+ # Convert to argparse naming and set to False if the attribute exists
269
+ excl_arg_name = excl_option.replace("-", "_")
270
+ if hasattr(args, excl_arg_name):
271
+ setattr(args, excl_arg_name, False)
272
+
273
+ # Add exclusives to tracking set to prevent them from being applied
274
+ applied_exclusives.update(CLI_CONFIG_OPTIONS[option]["exclusive"])
261
275
 
262
276
  return args
263
277
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ngpt"
3
- version = "2.11.1"
3
+ version = "2.11.3"
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"},
@@ -134,7 +134,7 @@ wheels = [
134
134
 
135
135
  [[package]]
136
136
  name = "ngpt"
137
- version = "2.11.1"
137
+ version = "2.11.3"
138
138
  source = { editable = "." }
139
139
  dependencies = [
140
140
  { 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
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