| import sys |
| import os |
| import sqlite3 |
| import traceback |
|
|
| def run_telemetry(): |
| print("=== WORKSPACE TELEMETRY START ===") |
| |
| |
| print("\n[1] Verifying Library Bindings:") |
| libs = ['streamlit', 'pandas', 'google.genai', 'google.generativeai', 'bs4', 'requests', 'ddgs', 'duckduckgo_search'] |
| for lib in libs: |
| try: |
| __import__(lib) |
| print(f" - {lib}: AVAILABLE") |
| except ImportError as e: |
| print(f" - {lib}: FAILED ({e})") |
|
|
| |
| print("\n[2] Code Inspection (pipeline.py - Search Call Block):") |
| if os.path.exists('pipeline.py'): |
| with open('pipeline.py', 'r', encoding='utf-8') as f: |
| lines = f.readlines() |
| for idx, line in enumerate(lines): |
| if 'DDGS' in line or 'ddgs.text' in line or 'backend=' in line: |
| print(f" Line {idx+1}: {line.strip()}") |
| else: |
| print(" - pipeline.py NOT FOUND") |
|
|
| |
| print("\n[3] Active Network Engine Execution Trace:") |
| try: |
| from ddgs import DDGS |
| print(" - Initiating DDGS context standard search...") |
| with DDGS() as ddgs: |
| |
| test_results = list(ddgs.text("Monterrey automation company", max_results=3)) |
| print(f" - DDG Raw Text Output Success. Results found: {len(test_results)}") |
| if test_results: |
| print(f" - Sample Meta: {test_results[0]}") |
| except Exception as e: |
| print(" - DDG ENGINE CRASH DETECTED:") |
| traceback.print_exc(file=sys.stdout) |
|
|
| print("\n=== WORKSPACE TELEMETRY END ===") |
|
|
| if __name__ == '__main__': |
| run_telemetry() |
|
|