fix: fail fast when CloudClient gets an empty api_key

This commit is contained in:
Ray 2026-07-21 17:10:31 +08:00
parent 6a451ea98f
commit f5552546c6

View file

@ -309,5 +309,10 @@ class CloudClient(PageIndexClient):
"""Cloud mode — fully managed by PageIndex cloud service. No LLM key needed."""
def __init__(self, api_key: str):
if not api_key:
raise PageIndexAPIError(
"CloudClient requires a PageIndex API key — get one at "
"https://dash.pageindex.ai."
)
self._empty_api_key = False
self._init_cloud(api_key)