my prefect server setup prefect-metrics.waow.tech
python orchestration
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: pass anthropic + turso secrets to atlas build for publications + LLM labels

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+22 -3
+22 -3
flows/atlas.py
··· 7 7 Requires: 8 8 - Secret block "tpuf-token" (turbopuffer API key) 9 9 - Secret block "cloudflare-api-token" (Pages edit permission) 10 + - Secret block "anthropic-api-key" (LLM cluster label refinement) 11 + - Secret block "turso-url" (publication metadata) 12 + - Secret block "turso-token" (publication metadata) 10 13 """ 11 14 12 15 import os ··· 34 37 35 38 36 39 @task 37 - def build_atlas(repo_dir: Path, tpuf_key: str) -> Path: 40 + def build_atlas(repo_dir: Path, tpuf_key: str, anthropic_key: str = "", 41 + turso_url: str = "", turso_token: str = "") -> Path: 38 42 """Run the build-atlas script. Returns path to atlas.json.""" 39 43 logger = get_run_logger() 40 44 output = repo_dir / "site" / "atlas.json" 41 45 46 + env = {**os.environ, "TURBOPUFFER_API_KEY": tpuf_key} 47 + if anthropic_key: 48 + env["ANTHROPIC_API_KEY"] = anthropic_key 49 + if turso_url: 50 + env["TURSO_URL"] = turso_url 51 + if turso_token: 52 + env["TURSO_TOKEN"] = turso_token 53 + 42 54 result = subprocess.run( 43 55 ["uv", "run", "--script", str(repo_dir / "scripts" / "build-atlas"), 44 56 "--output", str(output)], 45 - env={**os.environ, "TURBOPUFFER_API_KEY": tpuf_key}, 57 + env=env, 46 58 capture_output=True, 47 59 text=True, 48 60 timeout=300, ··· 118 130 """Rebuild the 2D semantic map and deploy to Cloudflare Pages.""" 119 131 tpuf_key = Secret.load("tpuf-token").get() 120 132 cf_token = Secret.load("cloudflare-api-token").get() 133 + anthropic_key = Secret.load("anthropic-api-key").get() 134 + try: 135 + turso_url = Secret.load("turso-url").get() 136 + turso_token = Secret.load("turso-token").get() 137 + except ValueError: 138 + turso_url = "" 139 + turso_token = "" 121 140 122 141 with tempfile.TemporaryDirectory() as tmpdir: 123 142 repo_dir = clone_repo(Path(tmpdir) / "repo") 124 - build_atlas(repo_dir, tpuf_key) 143 + build_atlas(repo_dir, tpuf_key, anthropic_key, turso_url, turso_token) 125 144 deploy_to_pages(repo_dir / "site", cf_token) 126 145 127 146