ngpt 2.11.0__tar.gz → 2.11.1__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 (55) hide show
  1. {ngpt-2.11.0 → ngpt-2.11.1}/CONTRIBUTING.md +18 -4
  2. {ngpt-2.11.0 → ngpt-2.11.1}/PKG-INFO +5 -3
  3. {ngpt-2.11.0 → ngpt-2.11.1}/README.md +4 -2
  4. {ngpt-2.11.0 → ngpt-2.11.1}/docs/CONTRIBUTING.md +17 -3
  5. ngpt-2.11.1/docs/api/README.md +85 -0
  6. {ngpt-2.11.0 → ngpt-2.11.1}/docs/api/cli.md +338 -64
  7. ngpt-2.11.1/docs/api/cli_config.md +256 -0
  8. {ngpt-2.11.0 → ngpt-2.11.1}/docs/api/client.md +44 -3
  9. {ngpt-2.11.0 → ngpt-2.11.1}/docs/api/config.md +59 -21
  10. {ngpt-2.11.0 → ngpt-2.11.1}/docs/configuration.md +1 -1
  11. {ngpt-2.11.0 → ngpt-2.11.1}/docs/examples/README.md +10 -1
  12. {ngpt-2.11.0 → ngpt-2.11.1}/docs/examples/advanced.md +47 -18
  13. {ngpt-2.11.0 → ngpt-2.11.1}/docs/examples/basic.md +32 -0
  14. {ngpt-2.11.0 → ngpt-2.11.1}/docs/examples/cli_components.md +15 -7
  15. {ngpt-2.11.0 → ngpt-2.11.1}/docs/examples/integrations.md +13 -10
  16. {ngpt-2.11.0 → ngpt-2.11.1}/docs/usage/README.md +4 -2
  17. {ngpt-2.11.0 → ngpt-2.11.1}/docs/usage/cli_config.md +36 -0
  18. {ngpt-2.11.0 → ngpt-2.11.1}/docs/usage/cli_framework.md +122 -21
  19. {ngpt-2.11.0 → ngpt-2.11.1}/docs/usage/cli_usage.md +1 -1
  20. {ngpt-2.11.0 → ngpt-2.11.1}/docs/usage/library_usage.md +72 -13
  21. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/__init__.py +2 -2
  22. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/config_manager.py +1 -1
  23. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/interactive.py +1 -1
  24. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/main.py +18 -8
  25. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/modes/chat.py +1 -1
  26. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/modes/code.py +1 -1
  27. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/modes/shell.py +1 -1
  28. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/modes/text.py +1 -1
  29. ngpt-2.11.1/ngpt/utils/__init__.py +33 -0
  30. {ngpt-2.11.0 → ngpt-2.11.1}/pyproject.toml +1 -1
  31. {ngpt-2.11.0 → ngpt-2.11.1}/uv.lock +1 -1
  32. ngpt-2.11.0/docs/api/README.md +0 -47
  33. ngpt-2.11.0/ngpt/utils/__init__.py +0 -1
  34. {ngpt-2.11.0 → ngpt-2.11.1}/.github/workflows/python-publish.yml +0 -0
  35. {ngpt-2.11.0 → ngpt-2.11.1}/.gitignore +0 -0
  36. {ngpt-2.11.0 → ngpt-2.11.1}/.python-version +0 -0
  37. {ngpt-2.11.0 → ngpt-2.11.1}/COMMIT_GUIDELINES.md +0 -0
  38. {ngpt-2.11.0 → ngpt-2.11.1}/LICENSE +0 -0
  39. {ngpt-2.11.0 → ngpt-2.11.1}/docs/LICENSE.md +0 -0
  40. {ngpt-2.11.0 → ngpt-2.11.1}/docs/README.md +0 -0
  41. {ngpt-2.11.0 → ngpt-2.11.1}/docs/_config.yml +0 -0
  42. {ngpt-2.11.0 → ngpt-2.11.1}/docs/assets/css/style.scss +0 -0
  43. {ngpt-2.11.0 → ngpt-2.11.1}/docs/installation.md +0 -0
  44. {ngpt-2.11.0 → ngpt-2.11.1}/docs/overview.md +0 -0
  45. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/__init__.py +0 -0
  46. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/args.py +0 -0
  47. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/formatters.py +0 -0
  48. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/modes/__init__.py +0 -0
  49. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/renderers.py +0 -0
  50. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli/ui.py +0 -0
  51. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/cli.py +0 -0
  52. {ngpt-2.11.0 → ngpt-2.11.1}/ngpt/client.py +0 -0
  53. {ngpt-2.11.0/ngpt → ngpt-2.11.1/ngpt/utils}/cli_config.py +0 -0
  54. {ngpt-2.11.0/ngpt → ngpt-2.11.1/ngpt/utils}/config.py +0 -0
  55. {ngpt-2.11.0/ngpt → ngpt-2.11.1/ngpt/utils}/log.py +0 -0
@@ -20,9 +20,23 @@ Thank you for your interest in contributing to NGPT! This document provides guid
20
20
 
21
21
  - `ngpt/` - Main package directory
22
22
  - `__init__.py` - Package initialization
23
- - `cli.py` - Command-line interface implementation
24
- - `config.py` - Configuration management
25
- - `client.py` - Client implementation
23
+ - `cli.py` - Top-level CLI script (potentially legacy)
24
+ - `client.py` - Client implementation for API interaction
25
+ - `cli/` - Command-line interface implementation
26
+ - `__init__.py`
27
+ - `main.py` - Main CLI application logic
28
+ - `args.py` - Argument parsing setup
29
+ - `config_manager.py` - CLI configuration handling
30
+ - `formatters.py` - Output formatting logic
31
+ - `interactive.py` - Interactive mode implementation
32
+ - `modes/` - Different operational modes (e.g., chat, run)
33
+ - `renderers.py` - Output rendering logic (e.g., markdown)
34
+ - `ui.py` - User interface elements (e.g., prompts, spinners)
35
+ - `utils/` - Utility modules
36
+ - `__init__.py`
37
+ - `config.py` - API endpoint and general configuration management
38
+ - `cli_config.py` - CLI-specific option configuration management
39
+ - `log.py` - Logging setup and utilities
26
40
  - `.github/` - GitHub workflows and templates
27
41
  - `pyproject.toml` - Project configuration and dependencies
28
42
 
@@ -87,4 +101,4 @@ For questions about the project that aren't bugs or feature requests, please use
87
101
 
88
102
  ## License
89
103
 
90
- By contributing to this project, you agree that your contributions will be licensed under the same [LICENSE](LICENSE) as the project.
104
+ By contributing to this project, you agree that your contributions will be licensed under the same [LICENSE](LICENSE) as the project.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 2.11.0
3
+ Version: 2.11.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
@@ -231,7 +231,8 @@ For more CLI examples and detailed usage information, see the [CLI Usage Guide](
231
231
  ### As a Library
232
232
 
233
233
  ```python
234
- from ngpt import NGPTClient, load_config
234
+ from ngpt import NGPTClient
235
+ from ngpt.utils.config import load_config
235
236
 
236
237
  # Load the first configuration (index 0) from config file
237
238
  config = load_config(config_index=0)
@@ -295,7 +296,8 @@ For advanced usage patterns and integrations, check out the [Advanced Examples](
295
296
  nGPT can also be used as a framework to build your own AI-powered command-line tools. You can leverage nGPT's pre-built CLI components to quickly develop sophisticated CLI applications.
296
297
 
297
298
  ```python
298
- from ngpt import NGPTClient, load_config
299
+ from ngpt import NGPTClient
300
+ from ngpt.utils.config import load_config
299
301
  from ngpt.cli.interactive import interactive_chat_session
300
302
  from ngpt.cli.renderers import prettify_markdown
301
303
  from ngpt.cli.args import setup_argument_parser
@@ -196,7 +196,8 @@ For more CLI examples and detailed usage information, see the [CLI Usage Guide](
196
196
  ### As a Library
197
197
 
198
198
  ```python
199
- from ngpt import NGPTClient, load_config
199
+ from ngpt import NGPTClient
200
+ from ngpt.utils.config import load_config
200
201
 
201
202
  # Load the first configuration (index 0) from config file
202
203
  config = load_config(config_index=0)
@@ -260,7 +261,8 @@ For advanced usage patterns and integrations, check out the [Advanced Examples](
260
261
  nGPT can also be used as a framework to build your own AI-powered command-line tools. You can leverage nGPT's pre-built CLI components to quickly develop sophisticated CLI applications.
261
262
 
262
263
  ```python
263
- from ngpt import NGPTClient, load_config
264
+ from ngpt import NGPTClient
265
+ from ngpt.utils.config import load_config
264
266
  from ngpt.cli.interactive import interactive_chat_session
265
267
  from ngpt.cli.renderers import prettify_markdown
266
268
  from ngpt.cli.args import setup_argument_parser
@@ -23,9 +23,23 @@ Thank you for your interest in contributing to NGPT! This document provides guid
23
23
 
24
24
  - `ngpt/` - Main package directory
25
25
  - `__init__.py` - Package initialization
26
- - `cli.py` - Command-line interface implementation
27
- - `config.py` - Configuration management
28
- - `client.py` - Client implementation
26
+ - `cli.py` - Top-level CLI script (potentially legacy)
27
+ - `client.py` - Client implementation for API interaction
28
+ - `cli/` - Command-line interface implementation
29
+ - `__init__.py`
30
+ - `main.py` - Main CLI application logic
31
+ - `args.py` - Argument parsing setup
32
+ - `config_manager.py` - CLI configuration handling
33
+ - `formatters.py` - Output formatting logic
34
+ - `interactive.py` - Interactive mode implementation
35
+ - `modes/` - Different operational modes (e.g., chat, run)
36
+ - `renderers.py` - Output rendering logic (e.g., markdown)
37
+ - `ui.py` - User interface elements (e.g., prompts, spinners)
38
+ - `utils/` - Utility modules
39
+ - `__init__.py`
40
+ - `config.py` - API endpoint and general configuration management
41
+ - `cli_config.py` - CLI-specific option configuration management
42
+ - `log.py` - Logging setup and utilities
29
43
  - `.github/` - GitHub workflows and templates
30
44
  - `pyproject.toml` - Project configuration and dependencies
31
45
 
@@ -0,0 +1,85 @@
1
+ # API Reference
2
+
3
+ This section provides detailed documentation for the nGPT API, including all classes, methods, functions, and parameters.
4
+
5
+ ## Overview
6
+
7
+ nGPT's API consists of several main components:
8
+
9
+ 1. **NGPTClient**: The main client class used to interact with AI providers
10
+ 2. **Configuration Utilities**: Functions for managing configuration files and settings
11
+ 3. **CLI Components**: Modular CLI utilities that can be reused in custom applications
12
+ 4. **CLI Configuration Utilities**: Functions for managing CLI-specific configurations
13
+
14
+ ## Table of Contents
15
+
16
+ - [NGPTClient](client.md) - Primary client for interacting with LLM APIs
17
+ - [Initialization](client.md#initialization)
18
+ - [Chat Method](client.md#chat-method)
19
+ - [Generate Shell Command](client.md#generate-shell-command)
20
+ - [Generate Code](client.md#generate-code)
21
+ - [List Models](client.md#list-models)
22
+
23
+ - [Configuration](config.md) - Functions for managing configurations
24
+ - [Loading Configurations](config.md#loading-configurations)
25
+ - [Creating Configurations](config.md#creating-configurations)
26
+ - [Editing Configurations](config.md#editing-configurations)
27
+ - [Removing Configurations](config.md#removing-configurations)
28
+ - [Configuration Paths](config.md#configuration-paths)
29
+
30
+ - [CLI Components](cli.md) - CLI functionality
31
+ - [Module Structure](cli.md#module-structure)
32
+ - [Interactive Chat Module](cli.md#interactive-chat-module)
33
+ - [Formatters Module](cli.md#formatters-module)
34
+ - [Renderers Module](cli.md#renderers-module)
35
+ - [CLI Configuration Utilities](cli.md#cli-configuration-utilities)
36
+ - [Operation Modes](cli.md#operation-modes)
37
+
38
+ - [CLI Configuration](cli_config.md) - Persistent CLI settings
39
+ - [Loading Configuration](cli_config.md#load_cli_config)
40
+ - [Setting Options](cli_config.md#set_cli_config_option)
41
+ - [Getting Options](cli_config.md#get_cli_config_option)
42
+ - [Removing Options](cli_config.md#unset_cli_config_option)
43
+ - [Applying Configuration](cli_config.md#apply_cli_config)
44
+ - [Available Options](cli_config.md#available-cli-configuration-options)
45
+
46
+ ## Quick Reference
47
+
48
+ ```python
49
+ # Import core components
50
+ from ngpt import NGPTClient, load_config
51
+
52
+ # Import configuration utilities
53
+ from ngpt.utils.config import (
54
+ load_configs,
55
+ get_config_path,
56
+ get_config_dir,
57
+ add_config_entry,
58
+ remove_config_entry
59
+ )
60
+
61
+ # Import CLI configuration utilities
62
+ from ngpt.utils.cli_config import (
63
+ load_cli_config,
64
+ set_cli_config_option,
65
+ get_cli_config_option,
66
+ unset_cli_config_option,
67
+ apply_cli_config
68
+ )
69
+
70
+ # Import CLI module components
71
+ from ngpt.cli.interactive import interactive_chat_session
72
+ from ngpt.cli.formatters import prettify_markdown, ColoredHelpFormatter, COLORS
73
+ from ngpt.cli.renderers import prettify_streaming_markdown, has_markdown_renderer
74
+
75
+ # Import operation modes
76
+ from ngpt.cli.modes.chat import chat_mode
77
+ from ngpt.cli.modes.code import code_mode
78
+ from ngpt.cli.modes.shell import shell_mode
79
+ from ngpt.cli.modes.text import text_mode
80
+
81
+ # Import version information
82
+ from ngpt import __version__
83
+ ```
84
+
85
+ For complete documentation on using these components, see the linked reference pages.