-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_python_detection.py
More file actions
48 lines (38 loc) · 1.68 KB
/
Copy pathtest_python_detection.py
File metadata and controls
48 lines (38 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
"""Test script to debug Python version detection."""
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from tracker.utils.serper_fetcher import SerperFetcher
from tracker.utils.groq_analyzer import GroqAnalyzer
print("-" * 8)
print("Testing Python Version Detection")
print("-" * 8)
# Test with debug mode
fetcher = SerperFetcher(debug=True)
groq = GroqAnalyzer()
print("\n1. Testing Serper search for Python (language)...")
results = fetcher.search_library("python", "3.11.7", component_type="language")
print(f"\n2. Serper Results:")
print(f"- Latest version candidate: {results.get('latest_version_candidate', 'NOT FOUND')}")
print(f"- Number of filtered results: {len(results.get('filtered', []))}")
print(f"- Number of all results: {len(results.get('results', []))}")
# Show first few results
print(f"\n3. First 3 search results:")
for i, result in enumerate(results.get('results', [])[:3], 1):
print(f"\n Result {i}:")
print(f"- Title: {result.get('title', 'N/A')}")
print(f"- Link: {result.get('link', 'N/A')}")
print(f"- Versions found: {result.get('versions_found', [])}")
print(f"- Relevance score: {result.get('relevance_score', 0)}")
print(f"\n4. Running Groq analysis...")
analysis = groq.analyze("python", results)
print(f"\n5. Groq Analysis:")
print(f"- Detected version: {analysis.get('version', 'NOT FOUND')}")
print(f"- Category: {analysis.get('category', 'N/A')}")
print(f"- Confidence: {analysis.get('confidence', 0)}")
print(f"- Source: {analysis.get('source', 'N/A')}")
print(f"- Summary: {analysis.get('summary', 'N/A')[:200]}...")
print("\n" + "=" * 80)
print("Test Complete")
print("="* 80)