41 lines
1.4 KiB
Python
41 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Verifiable script: search for Python package download stats
|
|
and produce concrete output that can be measured.
|
|
"""
|
|
|
|
from hermes_tools import web_search
|
|
|
|
# Search for a well-defined, measurable query
|
|
result = web_search(query="pypi download statistics Python packages", limit=3)
|
|
|
|
# Extract and verify we got real data
|
|
data = result.get("data", {})
|
|
web_results = data.get("web", [])
|
|
|
|
# Produce verifiable output
|
|
import os
|
|
os.makedirs("/root/.hermes/wizard-outputs/spark", exist_ok=True)
|
|
|
|
with open("/root/.hermes/wizard-outputs/spark/spider-maze-output.txt", "w") as f:
|
|
f.write("SEARCH RESULTS FOR: pypi download statistics Python packages\n")
|
|
f.write("=" * 60 + "\n\n")
|
|
|
|
if web_results:
|
|
f.write(f"Found {len(web_results)} results:\n\n")
|
|
for i, item in enumerate(web_results, 1):
|
|
title = item.get("title", "N/A")
|
|
url = item.get("url", "N/A")
|
|
desc = item.get("description", "N/A")[:150]
|
|
f.write(f"{i}. {title}\n")
|
|
f.write(f" URL: {url}\n")
|
|
f.write(f" Desc: {desc}...\n\n")
|
|
else:
|
|
f.write("No results found.\n")
|
|
|
|
# Verification: count results and write summary
|
|
count = len(web_results)
|
|
with open("/root/.hermes/wizard-outputs/spark/spider-maze-verification.txt", "w") as f:
|
|
f.write(f"result_count:{count}\n")
|
|
|
|
print(f"VERIFIED: Found {count} web search results for Python package statistics") |