vertex-engine / seed.py
Aditya Aadi
feat: initial commit for vertex monorepo layout
0b3ae6d
Raw History Blame Contribute Delete
1.39 kB
import requests
import time
# The endpoint you built in main.py
API_URL = "http://127.0.0.1:8000/crawl/dispatch"
# The workspace profile to upload this data into
WORKSPACE_PROFILE = "public"
# The websites you want Vertex to learn
seed_urls = [
"https://en.wikipedia.org/wiki/Search_engine",
"https://en.wikipedia.org/wiki/Vector_database",
"https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
"https://en.wikipedia.org/wiki/Distributed_computing"
]
print(f"πŸš€ Starting Vertex Bulk Ingestion into workspace: '{WORKSPACE_PROFILE}'\n")
for url in seed_urls:
payload = {
"url": url,
"user_profile": WORKSPACE_PROFILE
}
try:
# Send the URL to FastAPI
response = requests.post(API_URL, json=payload)
if response.status_code == 200:
data = response.json()
print(f"βœ… [QUEUED] {url}")
print(f" Task ID: {data['task_id']}")
else:
print(f"❌ [FAILED] {url} - {response.text}")
except requests.exceptions.ConnectionError:
print("❌ [ERROR] Could not connect to FastAPI. Is uvicorn running in your other terminal?")
break
# Pause for half a second so we don't overwhelm the local server
time.sleep(0.5)
print("\nπŸŽ‰ All URLs dispatched! Watch your Celery terminal to see the AI extracting the data.")