ngpt 3.10.0__py3-none-any.whl → 3.11.0__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/args.py +5 -0
- ngpt/cli/modes/rewrite.py +110 -3
- {ngpt-3.10.0.dist-info → ngpt-3.11.0.dist-info}/METADATA +6 -2
- {ngpt-3.10.0.dist-info → ngpt-3.11.0.dist-info}/RECORD +7 -7
- {ngpt-3.10.0.dist-info → ngpt-3.11.0.dist-info}/WHEEL +0 -0
- {ngpt-3.10.0.dist-info → ngpt-3.11.0.dist-info}/entry_points.txt +0 -0
- {ngpt-3.10.0.dist-info → ngpt-3.11.0.dist-info}/licenses/LICENSE +0 -0
ngpt/cli/args.py
CHANGED
@@ -135,6 +135,11 @@ def setup_argument_parser():
|
|
135
135
|
mode_exclusive_group.add_argument('-g', '--gitcommsg', action='store_true',
|
136
136
|
help='Generate AI-powered git commit messages from staged changes or diff file')
|
137
137
|
|
138
|
+
# Rewrite mode options
|
139
|
+
rewrite_group = parser.add_argument_group('Rewrite Mode Options')
|
140
|
+
rewrite_group.add_argument('--humanize', action='store_true',
|
141
|
+
help='Transform AI-generated text into human-like content that passes AI detection tools')
|
142
|
+
|
138
143
|
return parser
|
139
144
|
|
140
145
|
def parse_args():
|
ngpt/cli/modes/rewrite.py
CHANGED
@@ -70,6 +70,80 @@ ORIGINAL: "The user interface, which is built using React, Redux, and various ot
|
|
70
70
|
BETTER: "The React/Redux user interface needs redesigning to accommodate our planned new features."
|
71
71
|
"""
|
72
72
|
|
73
|
+
# System prompt for humanizing AI-generated text
|
74
|
+
HUMANIZE_SYSTEM_PROMPT = """You are an advanced TextHumanizer specialist with expertise in transforming AI-generated content into authentic, undetectable human writing. Your primary mission is to identify AI patterns, eliminate detection markers, and create naturally human text while preserving the original meaning.
|
75
|
+
|
76
|
+
PRIMARY GOAL:
|
77
|
+
Transform AI-generated text to make it indistinguishable from human writing while preserving the core meaning and information.
|
78
|
+
|
79
|
+
IDENTIFICATION AND ANALYSIS:
|
80
|
+
1. Identify common AI writing patterns, including:
|
81
|
+
- Overuse of em dashes (—) and predictable sentence structures (e.g., "It's not just X, it's Y")
|
82
|
+
- Formulaic lists and groups of three items (AI loves triplets)
|
83
|
+
- Repetitive clarifications and unnecessary context setting
|
84
|
+
- Overly consistent paragraph lengths and sentence structures
|
85
|
+
- Perfect grammar and overly formal academic language
|
86
|
+
- Excessive use of transition phrases and connecting words
|
87
|
+
- Generic corporate language and vague positive adjectives ("innovative", "practical", "elevate")
|
88
|
+
- Unusual collocations or word pairings that feel slightly off
|
89
|
+
- Predictable flow that lacks natural human tangents
|
90
|
+
- Perfectly balanced arguments without personal bias
|
91
|
+
- Suspiciously consistent tone throughout the piece
|
92
|
+
|
93
|
+
HUMANIZATION TECHNIQUES:
|
94
|
+
1. Vary sentence structure with a mix of simple, compound, and complex sentences
|
95
|
+
2. Create irregular paragraph lengths, mimicking natural human writing patterns
|
96
|
+
3. Introduce strategic "imperfections" like sentence fragments or occasional wordiness
|
97
|
+
4. Replace clichés and stock phrases with unexpected alternatives
|
98
|
+
5. Break predictable patterns by varying rhythm and cadence
|
99
|
+
6. Add strategic redundancies where natural in human speech
|
100
|
+
7. Insert occasional asides, parentheticals, or digressions that feel authentic
|
101
|
+
8. Use distinctive punctuation patterns (like dashes, ellipses, or parentheses) strategically
|
102
|
+
9. Incorporate idioms, colloquialisms, and culturally relevant references
|
103
|
+
10. Add subtle opinion markers or perspective indicators
|
104
|
+
11. Include personal anecdotes or first-person perspective ONLY when specific personal context is provided by the user - NEVER invent or hallucinate personal experiences or relationships
|
105
|
+
|
106
|
+
CONTENT TYPE CUSTOMIZATION:
|
107
|
+
1. Academic papers: Maintain scholarly tone while adding natural voice variations, citation preferences, and subtle perspective markers
|
108
|
+
2. Blog posts: Incorporate conversational tone, personal anecdotes (only if provided), and reader engagement elements
|
109
|
+
3. Business content: Balance professionalism with authentic voice, avoiding corporate jargon while maintaining expertise
|
110
|
+
4. Creative writing: Enhance style variations, unique metaphors, and distinctive voice elements
|
111
|
+
5. Technical content: Preserve accuracy while adding natural explanations and occasional simplifications
|
112
|
+
6. Social media: Include informal language, cultural references, and authentic engagement hooks
|
113
|
+
|
114
|
+
AI DETECTION EVASION STRATEGIES:
|
115
|
+
1. Avoid perfect coherence between paragraphs, mimicking natural thought progression
|
116
|
+
2. Introduce strategic tense variations where naturally occurring
|
117
|
+
3. Simulate human thinking patterns with occasional backtracking or clarification
|
118
|
+
4. Vary vocabulary sophistication throughout the text
|
119
|
+
5. Include subjective judgments and personal opinions where appropriate
|
120
|
+
6. Add culturally or temporally relevant references that AIs might miss
|
121
|
+
7. Incorporate casual phrasings, contractions, and verbal quirks
|
122
|
+
8. Use nonlinear information organization that follows human association patterns
|
123
|
+
|
124
|
+
READABILITY AND PURPOSE ADJUSTMENT:
|
125
|
+
1. Adapt content to the specified audience and goal
|
126
|
+
2. Match language complexity to human capabilities
|
127
|
+
3. Allow perspective shifts that occur naturally in human writing
|
128
|
+
4. Use strategic repetition for emphasis (unlike AI's mechanical repetition)
|
129
|
+
5. Create natural flow between topics rather than mechanical transitions
|
130
|
+
|
131
|
+
IMPORTANT: Never invent personal stories, experiences, or relationships unless specifically provided by the user.
|
132
|
+
|
133
|
+
OUTPUT INSTRUCTION:
|
134
|
+
Provide ONLY the humanized text with no explanations, comments, or meta-text.
|
135
|
+
|
136
|
+
EXAMPLES:
|
137
|
+
|
138
|
+
AI VERSION: "Artificial intelligence is revolutionizing the healthcare industry by enhancing diagnostic accuracy, streamlining administrative processes, and improving patient outcomes. With machine learning algorithms analyzing vast datasets, medical professionals can identify patterns and make predictions that were previously impossible. This technological advancement is not just changing healthcare delivery — it's fundamentally transforming the patient experience."
|
139
|
+
|
140
|
+
HUMANIZED VERSION: "AI is shaking things up in healthcare, and honestly, it's about time. Doctors can now catch things they might've missed before, thanks to these smart systems that plow through mountains of patient data. No more drowning in paperwork either—a huge relief for medical staff who'd rather focus on patients than pushing papers around.
|
141
|
+
|
142
|
+
The real winners? Patients. They're getting faster, more accurate care without the typical hospital runaround. Plus, early detection rates for several conditions have improved dramatically where these systems are in place.
|
143
|
+
|
144
|
+
But let's not pretend it's all perfect. These systems cost a fortune to implement, and plenty of doctors still view them with skepticism. Can't really blame them-medicine has always been as much art as science. The trick will be finding that sweet spot where technology enhances the human touch rather than replacing it."
|
145
|
+
"""
|
146
|
+
|
73
147
|
def rewrite_mode(client, args, logger=None):
|
74
148
|
"""Handle the text rewriting mode.
|
75
149
|
|
@@ -94,7 +168,10 @@ def rewrite_mode(client, args, logger=None):
|
|
94
168
|
input_text = args.prompt
|
95
169
|
else:
|
96
170
|
# No pipe or prompt - use multiline input
|
97
|
-
|
171
|
+
if getattr(args, 'humanize', False):
|
172
|
+
print("Enter or paste AI-generated text to humanize (Ctrl+D or Ctrl+Z to submit):")
|
173
|
+
else:
|
174
|
+
print("Enter or paste text to rewrite (Ctrl+D or Ctrl+Z to submit):")
|
98
175
|
input_text = get_multiline_input()
|
99
176
|
if input_text is None:
|
100
177
|
# Input was cancelled or empty
|
@@ -145,15 +222,18 @@ def rewrite_mode(client, args, logger=None):
|
|
145
222
|
print(f"{COLORS['yellow']}Warning: Failed to enhance input with web search: {str(e)}{COLORS['reset']}")
|
146
223
|
# Continue with the original input if web search fails
|
147
224
|
|
225
|
+
# Determine which system prompt to use based on the humanize flag
|
226
|
+
system_prompt = HUMANIZE_SYSTEM_PROMPT if getattr(args, 'humanize', False) else REWRITE_SYSTEM_PROMPT
|
227
|
+
|
148
228
|
# Set up messages array with system prompt and user content
|
149
229
|
messages = [
|
150
|
-
{"role": "system", "content":
|
230
|
+
{"role": "system", "content": system_prompt},
|
151
231
|
{"role": "user", "content": input_text}
|
152
232
|
]
|
153
233
|
|
154
234
|
# Log the messages if logging is enabled
|
155
235
|
if logger:
|
156
|
-
logger.log("system",
|
236
|
+
logger.log("system", system_prompt)
|
157
237
|
logger.log("user", input_text)
|
158
238
|
|
159
239
|
# Set default streaming behavior based on --no-stream and --prettify arguments
|
@@ -215,6 +295,24 @@ def rewrite_mode(client, args, logger=None):
|
|
215
295
|
if args.stream_prettify and live_display:
|
216
296
|
stream_callback = spinner_handling_callback
|
217
297
|
|
298
|
+
if getattr(args, 'humanize', False):
|
299
|
+
operation_text = "Humanizing AI text"
|
300
|
+
else:
|
301
|
+
operation_text = "Rewriting text"
|
302
|
+
|
303
|
+
# Start spinner for processing
|
304
|
+
if not args.stream_prettify and not args.no_stream:
|
305
|
+
stop_spinner = threading.Event()
|
306
|
+
spinner_thread = threading.Thread(
|
307
|
+
target=spinner,
|
308
|
+
args=(f"{operation_text}...",),
|
309
|
+
kwargs={"stop_event": stop_spinner, "color": COLORS['cyan']}
|
310
|
+
)
|
311
|
+
spinner_thread.daemon = True
|
312
|
+
# Use lock to prevent terminal rendering conflicts when starting spinner
|
313
|
+
with TERMINAL_RENDER_LOCK:
|
314
|
+
spinner_thread.start()
|
315
|
+
|
218
316
|
response = client.chat(
|
219
317
|
prompt=None, # Not used when messages are provided
|
220
318
|
stream=should_stream,
|
@@ -226,6 +324,15 @@ def rewrite_mode(client, args, logger=None):
|
|
226
324
|
messages=messages # Use messages array instead of prompt
|
227
325
|
)
|
228
326
|
|
327
|
+
# Stop spinner if it was started
|
328
|
+
if not args.stream_prettify and not args.no_stream:
|
329
|
+
stop_spinner.set()
|
330
|
+
spinner_thread.join()
|
331
|
+
# Clear the spinner line
|
332
|
+
with TERMINAL_RENDER_LOCK:
|
333
|
+
sys.stdout.write("\r" + " " * 100 + "\r")
|
334
|
+
sys.stdout.flush()
|
335
|
+
|
229
336
|
# Ensure spinner is stopped if no content was received
|
230
337
|
if stop_spinner_event and not first_content_received:
|
231
338
|
stop_spinner_event.set()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ngpt
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.11.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
|
@@ -288,7 +288,7 @@ usage: ngpt [-h] [-v] [--language LANGUAGE] [--config [CONFIG]] [--config-index
|
|
288
288
|
[--preprompt PREPROMPT | --role ROLE] [--no-stream | --prettify | --stream-prettify]
|
289
289
|
[--renderer {auto,rich,glow}] [--rec-chunk] [--diff [FILE]] [--chunk-size CHUNK_SIZE]
|
290
290
|
[--analyses-chunk-size ANALYSES_CHUNK_SIZE] [--max-msg-lines MAX_MSG_LINES]
|
291
|
-
[--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -r | -g]
|
291
|
+
[--max-recursion-depth MAX_RECURSION_DEPTH] [-i | -s | -c | -t | -r | -g] [--humanize]
|
292
292
|
[prompt]
|
293
293
|
|
294
294
|
nGPT - Interact with AI language models via OpenAI-compatible APIs
|
@@ -355,6 +355,10 @@ Modes (mutually exclusive)::
|
|
355
355
|
-r, --rewrite Rewrite text from stdin to be more natural while preserving tone and meaning
|
356
356
|
-g, --gitcommsg Generate AI-powered git commit messages from staged changes or diff file
|
357
357
|
|
358
|
+
Rewrite Mode Options::
|
359
|
+
|
360
|
+
--humanize Transform AI-generated text into human-like content that passes AI detection tools
|
361
|
+
|
358
362
|
```
|
359
363
|
|
360
364
|
> **Note**: For better visualization of conventional commit messages on GitHub, you can use the [GitHub Commit Labels](https://greasyfork.org/en/scripts/526153-github-commit-labels) userscript, which adds colorful labels to your commits.
|
@@ -2,7 +2,7 @@ ngpt/__init__.py,sha256=kpKhViLakwMdHZkuLht2vWcjt0uD_5gR33gvMhfXr6w,664
|
|
2
2
|
ngpt/__main__.py,sha256=j3eFYPOtCCFBOGh7NK5IWEnADnTMMSEB9GLyIDoW724,66
|
3
3
|
ngpt/client.py,sha256=XjpA2UnvrRvzk6_DzVEddUTzoPlF8koQ-cZURpHoT7c,9041
|
4
4
|
ngpt/cli/__init__.py,sha256=hebbDSMGiOd43YNnQP67uzr67Ue6rZPwm2czynr5iZY,43
|
5
|
-
ngpt/cli/args.py,sha256=
|
5
|
+
ngpt/cli/args.py,sha256=Vih8fBectyHHr2G8q3Kl2lflo_yFbB0ory55MZv1dEI,15048
|
6
6
|
ngpt/cli/config_manager.py,sha256=NQQcWnjUppAAd0s0p9YAf8EyKS1ex5-0EB4DvKdB4dk,3662
|
7
7
|
ngpt/cli/formatters.py,sha256=HBYGlx_7eoAKyzfy0Vq5L0yn8yVKjngqYBukMmXCcz0,9401
|
8
8
|
ngpt/cli/main.py,sha256=36mi8uYDcl56IhTkt-TJTRRhwHeF157xMAYgufLRAMo,29256
|
@@ -14,7 +14,7 @@ ngpt/cli/modes/chat.py,sha256=x1leClKq7UupA_CdW4tym0AivY2o_II123-I5IcAkxQ,7091
|
|
14
14
|
ngpt/cli/modes/code.py,sha256=Qj59xq6fZqgUDw7SbvmPKX_gdpc7DHJhNkn1sB5qgUU,12932
|
15
15
|
ngpt/cli/modes/gitcommsg.py,sha256=qFOrll333ebFOkzLP_WD1Qw0VfpphYqeiuHumkP6OB4,54833
|
16
16
|
ngpt/cli/modes/interactive.py,sha256=E0c38NA8xnuRKAce40F35uFYcohFDvaqSB8nf1ywS-4,17958
|
17
|
-
ngpt/cli/modes/rewrite.py,sha256=
|
17
|
+
ngpt/cli/modes/rewrite.py,sha256=hA3KxfuZSTGKWD0HyzpHP2cExncQrTM2npln_3k_-N4,18050
|
18
18
|
ngpt/cli/modes/shell.py,sha256=it1Brq1-LGeNfPKYBeVAwF-a78g9UP-KscofBZQkbr4,41589
|
19
19
|
ngpt/cli/modes/text.py,sha256=NOikaU9YVCBgyaCl6pwy9EVt-YY5Q4jBx0l47izpVTA,6986
|
20
20
|
ngpt/utils/__init__.py,sha256=_92f8eGMMOtQQA3uwgSRVwUEl1EIRFjWPUjcfGgI-eI,1244
|
@@ -23,8 +23,8 @@ ngpt/utils/config.py,sha256=wsArA4osnh8fKqOvtsPqqBxAz3DpdjtaWUFaRtnUdyc,10452
|
|
23
23
|
ngpt/utils/log.py,sha256=f1jg2iFo35PAmsarH8FVL_62plq4VXH0Mu2QiP6RJGw,15934
|
24
24
|
ngpt/utils/pipe.py,sha256=qRHF-Ma7bbU0cOcb1Yhe4S-kBavivtnnvLA3EYS4FY4,2162
|
25
25
|
ngpt/utils/web_search.py,sha256=w5ke4KJMRxq7r5jtbUXvspja6XhjoPZloVkZ0IvBXIE,30731
|
26
|
-
ngpt-3.
|
27
|
-
ngpt-3.
|
28
|
-
ngpt-3.
|
29
|
-
ngpt-3.
|
30
|
-
ngpt-3.
|
26
|
+
ngpt-3.11.0.dist-info/METADATA,sha256=LVlb93ajT_eKq-CbaqX2zzShkKfxlAlgpt5ctdbNma8,31332
|
27
|
+
ngpt-3.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
28
|
+
ngpt-3.11.0.dist-info/entry_points.txt,sha256=SqAAvLhMrsEpkIr4YFRdUeyuXQ9o0IBCeYgE6AVojoI,44
|
29
|
+
ngpt-3.11.0.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
|
30
|
+
ngpt-3.11.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|