Skip to content

Self-improving AI Employees for everyone

fix(credentials): Perplexity probe skips HTTP call

trohitg21328cc416d1
diff --git a/server/nodes/search/perplexity_search/__init__.py b/server/nodes/search/perplexity_search/__init__.py
index b35b955c..22538cd2 100644
--- a/server/nodes/search/perplexity_search/__init__.py
+++ b/server/nodes/search/perplexity_search/__init__.py
@@ -18,6 +18,7 @@ from services.plugin import (
ApiKeyCredential,
NodeContext,
Operation,
+ ProbeResult,
TaskQueue,
)
@@ -29,15 +30,15 @@ class PerplexityCredential(ApiKeyCredential):
key_name = "Authorization"
key_location = "bearer"
docs_url = "https://docs.perplexity.ai/guides/getting-started"
- # Cheapest valid request: minimal completion, max_tokens=1.
- # Sonar is the always-available default model -- no entitlement gate.
- probe_url = "https://api.perplexity.ai/chat/completions"
- probe_method = "POST"
- probe_json = {
- "model": "sonar",
- "messages": [{"role": "user", "content": "ping"}],
- "max_tokens": 1,
- }
+
+ @classmethod
+ async def _probe(cls, api_key: str) -> ProbeResult:
+ # Perplexity exposes no cheap auth-gated endpoint: /v1/models
+ # returns 200 for any key (including garbage), and the chat /
+ # search / embeddings endpoints all charge tokens per call.
+ # Store the key as-is; runtime calls will surface 401 if the
+ # key is wrong.
+ return ProbeResult(valid=True)
class PerplexityResult(BaseModel):
diff --git a/server/services/plugin/__init__.py b/server/services/plugin/__init__.py
index 6fa0d640..f4a4f93e 100644
--- a/server/services/plugin/__init__.py
+++ b/server/services/plugin/__init__.py
@@ -36,6 +36,7 @@ from services.plugin.credential import (
Credential,
OAuth2Credential,
ApiKeyCredential,
+ ProbeResult,
CREDENTIAL_REGISTRY,
)
from services.plugin.connection import Connection
@@ -64,6 +65,7 @@ __all__ = [
"Credential",
"OAuth2Credential",
"ApiKeyCredential",
+ "ProbeResult",
"CREDENTIAL_REGISTRY",
"Connection",
"NodeContext",