{"record":{"id":"b4e550199ccc551f","repo":"BerriAI/litellm","slug":"standard-logging-object-not-found-in-kwargs-b4e550","errorCode":null,"errorMessage":"standard_logging_object not found in kwargs","messagePattern":"standard_logging_object not found in kwargs","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/posthog.py","lineNumber":152,"sourceCode":"        self.log_queue.append({\"event\": event_payload, \"api_key\": api_key, \"api_url\": api_url})\n        verbose_logger.debug(\"PostHog, event added to queue. Will flush in %s seconds...\", self.flush_interval)\n\n        if len(self.log_queue) >= self.batch_size:\n            await self.flush_queue()\n\n    def create_posthog_event_payload(self, kwargs: dict[str, Any]) -> PostHogEventPayload:\n        \"\"\"\n        Helper function to create a PostHog event payload for logging\n\n        Args:\n            kwargs (Dict[str, Any]): request kwargs containing standard_logging_object\n\n        Returns:\n            PostHogEventPayload: defined in types.py\n        \"\"\"\n        standard_logging_object: Final[StandardLoggingPayload | None] = kwargs.get(\"standard_logging_object\", None)\n        if standard_logging_object is None:\n            raise ValueError(\"standard_logging_object not found in kwargs\")\n\n        call_type: Final = standard_logging_object.get(\"call_type\", \"\")\n        event_name: Final = \"$ai_embedding\" if call_type == \"embedding\" else \"$ai_generation\"\n\n        properties: Final = self._create_posthog_properties(\n            standard_logging_object=standard_logging_object,\n            kwargs=kwargs,\n            event_name=event_name,\n        )\n\n        distinct_id: Final = self._get_distinct_id(standard_logging_object, kwargs)\n\n        return PostHogEventPayload(\n            event=event_name,\n            properties=properties,\n            distinct_id=distinct_id,\n        )\n","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/posthog.py#L134-L170","documentation":"Error \"standard_logging_object not found in kwargs\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/integrations/posthog.py:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure standard_logging_object is present in kwargs before the PostHog callback runs."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}