MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _looks_like_auth_error

Function _looks_like_auth_error

skills/embedding/scripts/embed.py:152–165  ·  view source on GitHub ↗
(exc: Exception)

Source from the content-addressed store, hash-verified

150 "your_nscale" in normalized
151 or normalized.endswith("-here")
152 or "service_token" in normalized
153 or "api_key" in normalized
154 )
155
156
157def _looks_like_hf_user_token(api_key: Optional[str]) -> bool:
158 return str(api_key or "").strip().lower().startswith("hf_")
159
160
161def _looks_like_auth_error(exc: Exception) -> bool:
162 message = str(exc or "").lower()
163 return any(
164 token in message
165 for token in (
166 "401",
167 "unauthorized",
168 "invalid api key",

Callers 1

embed_batchMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected