ngpt 3.9.5__tar.gz → 3.10.0__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.
- {ngpt-3.9.5 → ngpt-3.10.0}/PKG-INFO +1 -1
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/examples/role_gallery.md +14 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/modes/gitcommsg.py +112 -2
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/modes/text.py +10 -2
- {ngpt-3.9.5 → ngpt-3.10.0}/pyproject.toml +1 -1
- {ngpt-3.9.5 → ngpt-3.10.0}/uv.lock +1 -1
- {ngpt-3.9.5 → ngpt-3.10.0}/.github/banner.svg +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/.github/workflows/aur-publish.yml +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/.github/workflows/python-publish.yml +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/.github/workflows/repo-mirror.yml +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/.gitignore +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/.python-version +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/COMMIT_GUIDELINES.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/CONTRIBUTING.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/LICENSE +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/PKGBUILD +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/README.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/CONTRIBUTING.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/LICENSE.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/_config.yml +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/_sass/custom/custom.scss +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/configuration.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/examples/advanced.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/examples/basic.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/examples.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/index.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/installation.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/overview.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/usage/cli_config.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/usage/cli_usage.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/usage/gitcommsg.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/usage/roles.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/usage/web_search.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/docs/usage.md +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/__init__.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/__main__.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/__init__.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/args.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/config_manager.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/formatters.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/main.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/modes/__init__.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/modes/chat.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/modes/code.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/modes/interactive.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/modes/rewrite.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/modes/shell.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/renderers.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/roles.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/cli/ui.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/client.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/utils/__init__.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/utils/cli_config.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/utils/config.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/utils/log.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/utils/pipe.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/ngpt/utils/web_search.py +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/previews/icon.png +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/previews/ngpt-g.png +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/previews/ngpt-i.png +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/previews/ngpt-s-c.png +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/previews/ngpt-sh-c-a.png +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/previews/ngpt-w-self.png +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/previews/ngpt-w.png +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/previews/social-preview.png +0 -0
- {ngpt-3.9.5 → ngpt-3.10.0}/wiki.md +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ngpt
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.10.0
|
4
4
|
Summary: A Swiss army knife for LLMs: A fast, lightweight CLI and interactive chat tool that brings the power of any OpenAI-compatible LLM (OpenAI, Ollama, Groq, Claude, Gemini, etc.) straight to your terminal. rewrite texts or refine code, craft git commit messages, generate and run OS-aware shell commands.
|
5
5
|
Project-URL: Homepage, https://github.com/nazdridoy/ngpt
|
6
6
|
Project-URL: Repository, https://github.com/nazdridoy/ngpt
|
@@ -655,6 +655,20 @@ You are an academic research expert. When addressing research questions:
|
|
655
655
|
Maintain academic integrity and precision while making complex topics accessible.
|
656
656
|
```
|
657
657
|
|
658
|
+
### HRM Professor (BBA/MBA Level)
|
659
|
+
|
660
|
+
```
|
661
|
+
You are an Educator and Professor specializing in Human Resource Management (HRM) for BBA/MBA students. When explaining concepts or addressing questions:
|
662
|
+
1 Explain HRM concepts, theories, and models with clarity, depth, and academic rigor appropriate for the BBA/MBA level.
|
663
|
+
2 Connect theoretical frameworks to practical applications using relevant business examples, case studies, and industry best practices.
|
664
|
+
3 Cover the core functions and strategic aspects of HRM, including workforce planning, talent acquisition, learning & development, compensation & benefits, performance management, employee relations, and HR analytics.
|
665
|
+
4 Address current trends, challenges, and future directions in HRM, such as the impact of technology, diversity & inclusion, organizational change, and the changing nature of work.
|
666
|
+
5 Emphasize the strategic importance of HRM for organizational success and provide managerial insights relevant to future leaders.
|
667
|
+
6 Encourage critical thinking and analysis of complex HR issues, ethical dilemmas, and cross-cultural considerations.
|
668
|
+
7 Structure responses logically, breaking down complex topics into understandable components.
|
669
|
+
Maintain academic integrity and precision while making complex topics accessible.
|
670
|
+
```
|
671
|
+
|
658
672
|
### Interview Question Generator
|
659
673
|
|
660
674
|
```
|
@@ -582,7 +582,7 @@ def process_with_chunking(client, diff_content, preprompt, chunk_size=200, recur
|
|
582
582
|
|
583
583
|
# If the commit message is too long, we need to condense it
|
584
584
|
if len(commit_message.splitlines()) > max_msg_lines:
|
585
|
-
|
585
|
+
commit_message = condense_commit_message(
|
586
586
|
client,
|
587
587
|
commit_message,
|
588
588
|
commit_system_prompt,
|
@@ -591,6 +591,10 @@ def process_with_chunking(client, diff_content, preprompt, chunk_size=200, recur
|
|
591
591
|
1, # Start at depth 1
|
592
592
|
logger
|
593
593
|
)
|
594
|
+
|
595
|
+
# Format the final commit message to eliminate path repetition and improve readability
|
596
|
+
commit_message = optimize_file_references(client, commit_message, commit_system_prompt, logger)
|
597
|
+
|
594
598
|
return commit_message
|
595
599
|
except Exception as e:
|
596
600
|
# Stop the spinner
|
@@ -672,7 +676,7 @@ DO NOT include any explanation or commentary outside the commit message format."
|
|
672
676
|
|
673
677
|
# If the commit message is too long, we need to condense it
|
674
678
|
if len(commit_message.splitlines()) > max_msg_lines:
|
675
|
-
|
679
|
+
commit_message = condense_commit_message(
|
676
680
|
client,
|
677
681
|
commit_message,
|
678
682
|
commit_system_prompt,
|
@@ -681,6 +685,10 @@ DO NOT include any explanation or commentary outside the commit message format."
|
|
681
685
|
1, # Start at depth 1
|
682
686
|
logger
|
683
687
|
)
|
688
|
+
|
689
|
+
# Format the final commit message to eliminate path repetition and improve readability
|
690
|
+
commit_message = optimize_file_references(client, commit_message, commit_system_prompt, logger)
|
691
|
+
|
684
692
|
return commit_message
|
685
693
|
|
686
694
|
# Analysis is still too large, need to chunk it
|
@@ -1015,6 +1023,105 @@ def strip_code_block_formatting(text):
|
|
1015
1023
|
return match.group(1).rstrip()
|
1016
1024
|
return text
|
1017
1025
|
|
1026
|
+
def optimize_file_references(client, commit_message, system_prompt=None, logger=None):
|
1027
|
+
"""Optimize the file references in the commit message by eliminating path repetition and improving readability.
|
1028
|
+
|
1029
|
+
Args:
|
1030
|
+
client: The NGPTClient instance
|
1031
|
+
commit_message: The commit message to format
|
1032
|
+
system_prompt: Optional system prompt for formatting
|
1033
|
+
logger: Optional logger instance
|
1034
|
+
|
1035
|
+
Returns:
|
1036
|
+
str: Commit message with optimized file references
|
1037
|
+
"""
|
1038
|
+
# If no system prompt provided, use a minimalist one
|
1039
|
+
if not system_prompt:
|
1040
|
+
system_prompt = """You are an expert Git commit message formatter."""
|
1041
|
+
|
1042
|
+
format_prompt = f"""TASK: Reformat file paths in this commit message to make it more readable while preserving the standard format
|
1043
|
+
|
1044
|
+
COMMIT MESSAGE TO OPTIMIZE:
|
1045
|
+
{commit_message}
|
1046
|
+
|
1047
|
+
MAINTAIN THIS EXACT FORMAT FOR EACH BULLET:
|
1048
|
+
- [type] Description with file references (filepath:line/function)
|
1049
|
+
|
1050
|
+
FILE PATH OPTIMIZATION RULES (CRITICAL PRIORITY):
|
1051
|
+
1. PRESERVE PROPER PARENTHESES FORMAT - File references go in parentheses at the end of each bullet:
|
1052
|
+
• "- [add] Add components (src/components/Button.jsx, Card.jsx)"
|
1053
|
+
• Always keep references in parentheses at the end
|
1054
|
+
|
1055
|
+
2. ELIMINATE PATH REPETITION in file lists:
|
1056
|
+
• "- [add] Add components (src/components/Button.jsx, src/components/Card.jsx)" - BAD
|
1057
|
+
• "- [add] Add components (src/components/*.jsx)" - Use wildcard when appropriate
|
1058
|
+
• "- [add] Add 5 component files (src/components/)" - Use count for many files
|
1059
|
+
|
1060
|
+
3. AVOID REDUNDANT FILENAMES:
|
1061
|
+
• Don't repeat filenames in both description and parentheses
|
1062
|
+
• Group files by category in the description
|
1063
|
+
|
1064
|
+
EXAMPLES THAT FOLLOW THE PROPER FORMAT:
|
1065
|
+
|
1066
|
+
❌ BEFORE (POOR FORMATTING):
|
1067
|
+
- [docs] Add documentation for tawhid, names_of_allah, transcendence (islam/beliefs/tawhid.md, islam/beliefs/names_of_allah.md, islam/beliefs/transcendence.md)
|
1068
|
+
|
1069
|
+
✅ AFTER (GOOD FORMATTING):
|
1070
|
+
- [docs] Add documentation for theological concepts (islam/beliefs/tawhid.md, names_of_allah.md, transcendence.md)
|
1071
|
+
|
1072
|
+
❌ BEFORE (POOR FORMATTING):
|
1073
|
+
- [fix] Update error handling in app/utils/errors.js, app/utils/validation.js, app/utils/formatting.js
|
1074
|
+
|
1075
|
+
✅ AFTER (GOOD FORMATTING):
|
1076
|
+
- [fix] Update error handling (app/utils/errors.js, validation.js, formatting.js)
|
1077
|
+
|
1078
|
+
RULES FOR OUTPUT:
|
1079
|
+
1. PRESERVE proper format with parentheses at the end
|
1080
|
+
2. Keep the same bullet structure and number of bullets
|
1081
|
+
3. DO NOT change type tags or summary line
|
1082
|
+
4. Mention common paths ONCE, then list files
|
1083
|
+
|
1084
|
+
THE STANDARD FORMAT FOR COMMIT MESSAGES IS:
|
1085
|
+
type[(scope)]: concise summary
|
1086
|
+
|
1087
|
+
- [type] Description (filepath:line/function)
|
1088
|
+
- [type] Another description (filepath:line/function)"""
|
1089
|
+
|
1090
|
+
# Log formatting template
|
1091
|
+
if logger:
|
1092
|
+
logger.log_template("DEBUG", "OPTIMIZE_FILE_REFS", format_prompt)
|
1093
|
+
|
1094
|
+
# Start spinner for formatting
|
1095
|
+
stop_spinner = threading.Event()
|
1096
|
+
spinner_thread = threading.Thread(
|
1097
|
+
target=spinner,
|
1098
|
+
args=("Optimizing file references...",),
|
1099
|
+
kwargs={"stop_event": stop_spinner, "color": COLORS['green']}
|
1100
|
+
)
|
1101
|
+
spinner_thread.daemon = True
|
1102
|
+
spinner_thread.start()
|
1103
|
+
|
1104
|
+
try:
|
1105
|
+
formatted_message = handle_api_call(client, format_prompt, system_prompt, logger)
|
1106
|
+
# Stop the spinner
|
1107
|
+
stop_spinner.set()
|
1108
|
+
spinner_thread.join()
|
1109
|
+
|
1110
|
+
if logger:
|
1111
|
+
logger.log_content("DEBUG", "OPTIMIZED_FILE_REFS", formatted_message)
|
1112
|
+
|
1113
|
+
return formatted_message
|
1114
|
+
except Exception as e:
|
1115
|
+
# Stop the spinner
|
1116
|
+
stop_spinner.set()
|
1117
|
+
spinner_thread.join()
|
1118
|
+
|
1119
|
+
print(f"{COLORS['red']}Error optimizing file references: {str(e)}{COLORS['reset']}")
|
1120
|
+
if logger:
|
1121
|
+
logger.error(f"Error optimizing file references: {str(e)}")
|
1122
|
+
# Return the original message if formatting fails
|
1123
|
+
return commit_message
|
1124
|
+
|
1018
1125
|
def gitcommsg_mode(client, args, logger=None):
|
1019
1126
|
"""Handle the Git commit message generation mode.
|
1020
1127
|
|
@@ -1195,6 +1302,9 @@ def gitcommsg_mode(client, args, logger=None):
|
|
1195
1302
|
1, # Start at depth 1
|
1196
1303
|
active_logger
|
1197
1304
|
)
|
1305
|
+
|
1306
|
+
# Format the final commit message to eliminate path repetition and improve readability
|
1307
|
+
result = optimize_file_references(client, result, commit_system_prompt, active_logger)
|
1198
1308
|
|
1199
1309
|
if not result:
|
1200
1310
|
print(f"{COLORS['red']}Failed to generate commit message.{COLORS['reset']}")
|
@@ -1,9 +1,10 @@
|
|
1
1
|
from ..formatters import COLORS
|
2
2
|
from ..renderers import prettify_markdown, prettify_streaming_markdown, TERMINAL_RENDER_LOCK
|
3
|
-
from ..ui import get_multiline_input, spinner
|
3
|
+
from ..ui import get_multiline_input, spinner, copy_to_clipboard
|
4
4
|
from ...utils import enhance_prompt_with_web_search
|
5
5
|
import threading
|
6
6
|
import sys
|
7
|
+
import time
|
7
8
|
|
8
9
|
def text_mode(client, args, logger=None):
|
9
10
|
"""Handle the multi-line text input mode.
|
@@ -152,6 +153,8 @@ def text_mode(client, args, logger=None):
|
|
152
153
|
# Before stopping the live display, update with complete=True to show final formatted content
|
153
154
|
if stream_callback and response:
|
154
155
|
stream_callback(response, complete=True)
|
156
|
+
# Add a small delay to ensure terminal stability
|
157
|
+
time.sleep(0.2)
|
155
158
|
|
156
159
|
# Log the AI response if logging is enabled
|
157
160
|
if logger and response:
|
@@ -163,4 +166,9 @@ def text_mode(client, args, logger=None):
|
|
163
166
|
if args.prettify:
|
164
167
|
prettify_markdown(response, args.renderer)
|
165
168
|
else:
|
166
|
-
print(response)
|
169
|
+
print(response)
|
170
|
+
|
171
|
+
# Offer to copy to clipboard if not in a redirected output
|
172
|
+
if not args.no_stream and response:
|
173
|
+
with TERMINAL_RENDER_LOCK:
|
174
|
+
copy_to_clipboard(response)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "ngpt"
|
3
|
-
version = "3.
|
3
|
+
version = "3.10.0"
|
4
4
|
description = "A Swiss army knife for LLMs: A fast, lightweight CLI and interactive chat tool that brings the power of any OpenAI-compatible LLM (OpenAI, Ollama, Groq, Claude, Gemini, etc.) straight to your terminal. rewrite texts or refine code, craft git commit messages, generate and run OS-aware shell commands."
|
5
5
|
authors = [
|
6
6
|
{name = "nazDridoy", email = "nazdridoy399@gmail.com"},
|
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
|
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
|