{"record":{"id":"f85de9b0be75a9c7","repo":"xtekky/gpt4free","slug":"no-response","errorCode":null,"errorMessage":"No response","messagePattern":"No response","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"warning","filePath":"g4f/Provider/Perplexity.py","lineNumber":113,"sourceCode":"        \"pplx_reasoning\",\n        \"r1\",\n    ]\n    fallback_models = [\"perplexity\", \"pplx_pro\"]\n    model_aliases = {\n        \"gpt-5\": \"gpt5\",\n        \"gpt-5-thinking\": \"gpt5_thinking\",\n        \"r1-1776\": \"r1\",\n    }\n\n    @classmethod\n    async def get_quota(cls, **kwargs):\n        chunks = []\n        async for chunk in cls.create_async_generator(\n            cls.default_model, [{\"role\": \"user\", \"content\": \"say only okay\"}]\n        ):\n            if isinstance(chunk, str):\n                return {\"content\": chunk}\n        raise RuntimeError(\"No response\")\n\n    @classmethod\n    async def create_async_generator(\n        cls,\n        model: str,\n        messages: Messages,\n        cookies: Cookies = None,\n        proxy: str = None,\n        conversation: JsonConversation = None,\n        prompt: str = None,\n        **kwargs,\n    ) -> AsyncResult:\n        \"\"\"\n        Create async generator for Perplexity requests with HAR file support.\n\n        Authentication priority:\n        1. HAR file cookies (har_and_cookies/perplexity*.har)\n        2. Cookie jar from get_cookies()","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/Perplexity.py#L95-L131","documentation":"Raised by Perplexity.get_quota when its probe request (a minimal 'say only okay' chat to the default model) completes without ever yielding a string chunk. It signals that the provider responded with nothing usable — typically an auth/cookie challenge page or an immediate stream termination — so quota could not be measured.","triggerScenarios":"Calling get_quota (or APIs that call it, like provider status checks) when Perplexity's web endpoint returns an empty stream: missing/expired cookies, Cloudflare interstitial, or the default_model alias being invalid at the time.","commonSituations":"Status/quota dashboards probing all providers; cookie-based sessions expired since last use; Perplexity frontend API changes breaking the scraper; running without the browser impersonation needed to pass bot checks.","solutions":["Treat this provider as unavailable rather than retrying immediately — an empty stream usually means blocked auth.","Pass fresh Perplexity cookies if your flow supports it.","Update g4f; Perplexity's internal API is scraped and breaks often.","Use a different provider for the actual work and exclude Perplexity from quota checks."],"exampleFix":"# before\nquota = await PerplexityAi.get_quota()\n\n# after\ntry:\n    quota = await PerplexityAi.get_quota()\nexcept RuntimeError:\n    quota = None  # mark provider offline, skip in this run","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    quota = await PerplexityAi.get_quota()\nexcept RuntimeError:\n    quota = None  # treat provider as offline; exclude from this run","preventionTips":["Never gate critical flows on get_quota for scraped providers","Supply fresh cookies if your flow supports them","Mark provider unavailable instead of retry-storming","Update g4f for Perplexity frontend changes"],"tags":["perplexity","quota","empty-response","scraping","auth"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}