rust-crate-pipeline 1.2.0__py3-none-any.whl → 1.2.1__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.
- rust_crate_pipeline/ai_processing.py +24 -29
- rust_crate_pipeline/version.py +1 -1
- {rust_crate_pipeline-1.2.0.dist-info → rust_crate_pipeline-1.2.1.dist-info}/METADATA +1 -1
- {rust_crate_pipeline-1.2.0.dist-info → rust_crate_pipeline-1.2.1.dist-info}/RECORD +8 -8
- {rust_crate_pipeline-1.2.0.dist-info → rust_crate_pipeline-1.2.1.dist-info}/WHEEL +0 -0
- {rust_crate_pipeline-1.2.0.dist-info → rust_crate_pipeline-1.2.1.dist-info}/entry_points.txt +0 -0
- {rust_crate_pipeline-1.2.0.dist-info → rust_crate_pipeline-1.2.1.dist-info}/licenses/LICENSE +0 -0
- {rust_crate_pipeline-1.2.0.dist-info → rust_crate_pipeline-1.2.1.dist-info}/top_level.txt +0 -0
@@ -166,34 +166,30 @@ class LLMEnricher:
|
|
166
166
|
prompt: str,
|
167
167
|
validation_func: Callable[[str], bool],
|
168
168
|
temp: float = 0.2,
|
169
|
-
max_tokens: int = 256, retries: int =
|
169
|
+
max_tokens: int = 256, retries: int = 4 # Increased from 2 to 4 for better success rates
|
170
170
|
) -> Optional[str]:
|
171
171
|
"""Run LLM with validation and automatic retry on failure"""
|
172
172
|
for attempt in range(retries):
|
173
|
-
try:
|
174
|
-
|
175
|
-
adjusted_temp = temp * (1 + (attempt * 0.1))
|
173
|
+
try: # More generous temperature adjustment for better variety
|
174
|
+
adjusted_temp = temp * (1 + (attempt * 0.2)) # 20% increases instead of 10%
|
176
175
|
result = self.run_llama(prompt, temp=adjusted_temp, max_tokens=max_tokens)
|
177
176
|
|
178
177
|
# Validate the result
|
179
178
|
if result and validation_func(result):
|
180
179
|
return result
|
181
180
|
|
182
|
-
# If we get here, validation failed - use debug level for early attempts
|
183
|
-
|
184
|
-
logging.warning(f"Final validation attempt failed. Using best available result.")
|
181
|
+
# If we get here, validation failed - use debug level for early attempts if attempt == retries - 1:
|
182
|
+
logging.debug(f"All {retries} validation attempts failed, using last available result.")
|
185
183
|
else:
|
186
|
-
logging.debug(f"Validation failed on attempt {attempt+1}/{retries}. Retrying with
|
187
|
-
|
188
|
-
|
189
|
-
if attempt == retries - 2:
|
184
|
+
logging.debug(f"Validation failed on attempt {attempt+1}/{retries}. Retrying with adjusted temp={adjusted_temp:.2f}")
|
185
|
+
# Only simplify prompt on later attempts (attempt 2+)
|
186
|
+
if attempt >= 2:
|
190
187
|
prompt = self.simplify_prompt(prompt)
|
191
188
|
|
192
189
|
except Exception as e:
|
193
190
|
logging.error(f"Generation error on attempt {attempt+1}: {str(e)}")
|
194
|
-
|
195
|
-
#
|
196
|
-
time.sleep(1.0 + (attempt * 0.5))
|
191
|
+
# More generous backoff - give the model more time
|
192
|
+
time.sleep(2.0 + (attempt * 1.0)) # 2s, 3s, 4s, 5s delays
|
197
193
|
|
198
194
|
# If we exhausted all retries, return the last result even if not perfect
|
199
195
|
return result if 'result' in locals() else None
|
@@ -247,9 +243,10 @@ class LLMEnricher:
|
|
247
243
|
temp=0.3,
|
248
244
|
max_tokens=300
|
249
245
|
)
|
250
|
-
|
251
|
-
|
252
|
-
|
246
|
+
# Extract key dependencies for context
|
247
|
+
key_deps = [dep.get("crate_id") for dep in crate.dependencies[:5]
|
248
|
+
if dep.get("kind") == "normal" and dep.get("crate_id")]
|
249
|
+
key_deps_str = ", ".join(str(dep) for dep in key_deps) if key_deps else "None"
|
253
250
|
|
254
251
|
# Generate other enrichments
|
255
252
|
enriched.feature_summary = self.summarize_features(crate)
|
@@ -296,13 +293,13 @@ class LLMEnricher:
|
|
296
293
|
|
297
294
|
def classify_use_case(self, crate: CrateMetadata, readme_summary: str) -> str:
|
298
295
|
"""Classify the use case of a crate with rich context"""
|
299
|
-
try:
|
300
|
-
# Calculate available tokens for prompt (classification usually needs ~20 response tokens)
|
296
|
+
try: # Calculate available tokens for prompt (classification usually needs ~20 response tokens)
|
301
297
|
available_prompt_tokens = self.config.model_token_limit - 200 # Reserve for response
|
302
298
|
|
303
299
|
joined = ", ".join(crate.keywords[:10]) if crate.keywords else "None"
|
304
|
-
key_deps = [dep.get("crate_id") for dep in crate.dependencies[:5]
|
305
|
-
|
300
|
+
key_deps = [dep.get("crate_id") for dep in crate.dependencies[:5]
|
301
|
+
if dep.get("kind") == "normal" and dep.get("crate_id")]
|
302
|
+
key_deps_str = ", ".join(str(dep) for dep in key_deps) if key_deps else "None"
|
306
303
|
|
307
304
|
# Adaptively truncate different sections based on importance
|
308
305
|
token_budget = available_prompt_tokens - 400 # Reserve tokens for prompt template
|
@@ -341,13 +338,12 @@ class LLMEnricher:
|
|
341
338
|
f"Category (pick only one): [AI, Database, Web Framework, Networking, Serialization, Utilities, DevTools, ML, Cryptography, Unknown]\n"
|
342
339
|
f"<|end|>"
|
343
340
|
)
|
344
|
-
|
345
|
-
# Validate classification with retry
|
341
|
+
# Validate classification with retry - more generous parameters
|
346
342
|
result = self.validate_and_retry(
|
347
343
|
prompt,
|
348
344
|
validation_func=self.validate_classification,
|
349
|
-
temp=0.
|
350
|
-
max_tokens=20
|
345
|
+
temp=0.2, # Increased from 0.1 for more variety
|
346
|
+
max_tokens=50 # Increased from 20 to allow more complete responses
|
351
347
|
)
|
352
348
|
|
353
349
|
return result or "Unknown"
|
@@ -377,13 +373,12 @@ class LLMEnricher:
|
|
377
373
|
f"Create exactly 5 pairs.\n"
|
378
374
|
f"<|end|>"
|
379
375
|
)
|
380
|
-
|
381
|
-
# Use validation for retry
|
376
|
+
# Use validation for retry - more generous parameters
|
382
377
|
result = self.validate_and_retry(
|
383
378
|
prompt,
|
384
379
|
validation_func=self.validate_factual_pairs,
|
385
|
-
temp=0.
|
386
|
-
max_tokens=500
|
380
|
+
temp=0.7, # Increased from 0.6 for more creativity
|
381
|
+
max_tokens=800 # Increased from 500 for more complete responses
|
387
382
|
)
|
388
383
|
|
389
384
|
return result or "Factual pairs generation failed."
|
rust_crate_pipeline/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: rust-crate-pipeline
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.1
|
4
4
|
Summary: A comprehensive system for gathering, enriching, and analyzing metadata for Rust crates using AI-powered insights
|
5
5
|
Home-page: https://github.com/DaveTmire85/SigilDERG-Data_Production
|
6
6
|
Author: SuperUser666-Sigil
|
@@ -1,6 +1,6 @@
|
|
1
1
|
rust_crate_pipeline/__init__.py,sha256=m9fb1WGbyOimxK2e18FSgvLWGYBwbLoHM_mscr-nAPs,1429
|
2
2
|
rust_crate_pipeline/__main__.py,sha256=fYgtPofuk4vkwiZ7ELP4GVMNj_QiKmZMSlvhzsNGuDs,155
|
3
|
-
rust_crate_pipeline/ai_processing.py,sha256=
|
3
|
+
rust_crate_pipeline/ai_processing.py,sha256=zs0eHxnoSajRqpUoZ5fXLxrK68jZ-J1Vavtsujskc9Q,18821
|
4
4
|
rust_crate_pipeline/analysis.py,sha256=ijP4zp3cFnN09nZkeCluyAvbyAtAW_M2YSxALpQX8LY,18615
|
5
5
|
rust_crate_pipeline/config.py,sha256=r4Y_5SD-lfrM1112edk9T0S0MiVxaNSSHk4q2yDrM88,1528
|
6
6
|
rust_crate_pipeline/github_token_checker.py,sha256=MJqHP8J84NEZ6nzdutpC7iRnsP0kyqscjLUosvmI4MI,3768
|
@@ -8,12 +8,12 @@ rust_crate_pipeline/main.py,sha256=J8ORQA6s3wyWw2R3oB_IEm2J5tx1CFdspw5kb5Ep8zQ,6
|
|
8
8
|
rust_crate_pipeline/network.py,sha256=t_G8eh_WHNugm_laMftcWVbHsmP0bOlTPnVW9DqF6SU,13375
|
9
9
|
rust_crate_pipeline/pipeline.py,sha256=Uwfw4uLL3aN1gJl5xSwvvyaY9ceeP7LVr02IzNx0tPM,12033
|
10
10
|
rust_crate_pipeline/production_config.py,sha256=2GT8bxytcrMRrcfjzpay5RTtATE3rbmDvNUBvVhrYSQ,2472
|
11
|
-
rust_crate_pipeline/version.py,sha256=
|
11
|
+
rust_crate_pipeline/version.py,sha256=8LymcBLNSPWijVTHpd9sS_Aqp8vRoMyZLCupAOnQkfs,1022
|
12
12
|
rust_crate_pipeline/utils/file_utils.py,sha256=lnHeLrt1JYaQhRDKtA1TWR2HIyRO8zwOyWb-KmAmWgk,2126
|
13
13
|
rust_crate_pipeline/utils/logging_utils.py,sha256=O4Jnr_k9dBchrVqXf-vqtDKgizDtL_ljh8g7G2VCX_c,2241
|
14
|
-
rust_crate_pipeline-1.2.
|
15
|
-
rust_crate_pipeline-1.2.
|
16
|
-
rust_crate_pipeline-1.2.
|
17
|
-
rust_crate_pipeline-1.2.
|
18
|
-
rust_crate_pipeline-1.2.
|
19
|
-
rust_crate_pipeline-1.2.
|
14
|
+
rust_crate_pipeline-1.2.1.dist-info/licenses/LICENSE,sha256=tpd4XNpbssrSx9-iErATOLrOh0ivNPfO2I5MAPUpats,1088
|
15
|
+
rust_crate_pipeline-1.2.1.dist-info/METADATA,sha256=zRFlOck4m9GDEHrmBM_cvzKVVKD-zBK4hzfClVbhuq0,16741
|
16
|
+
rust_crate_pipeline-1.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
17
|
+
rust_crate_pipeline-1.2.1.dist-info/entry_points.txt,sha256=9Rr_IRuFRIridXxUSdEJbB3ba0NnpEfKmknZXFdYRC0,70
|
18
|
+
rust_crate_pipeline-1.2.1.dist-info/top_level.txt,sha256=GUdB7RyxHLhijQxui_KTy3B8p_L2APui9C6RYa0FuaE,20
|
19
|
+
rust_crate_pipeline-1.2.1.dist-info/RECORD,,
|
File without changes
|
{rust_crate_pipeline-1.2.0.dist-info → rust_crate_pipeline-1.2.1.dist-info}/entry_points.txt
RENAMED
File without changes
|
{rust_crate_pipeline-1.2.0.dist-info → rust_crate_pipeline-1.2.1.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|