) from e
    def __send_event(self, event: Dict[str, Any]) -> None:
        headers = {"Content-Type": "application/json"}
        event = {**event, "app": self.__app_id, "timestamp": str(datetime.utcnow())}
        if self.__verbose:
            print("llmonitor_callback", event)
        data = {"events": event}
        requests.post(headers=headers, url=f"{self.__api_url}/api/report", json=data)
[docs]    def on_llm_start(
        self,
        serialized: Dict[str, Any],
        prompts: List[str],
        *,
        run_id: UUID,
        parent_run_id: Union[UUID, None] = None,
        tags: Union[List[str], None] = None,
        metadata: Union[Dict[str, Any], None] = None,
        **kwargs: Any,
    ) -> None:
        user_id = _get_user_id(metadata)
        user_props = _get_user_props(metadata)
        event = {
            "event": "start",
            "type": "llm",
            "userId": user_id,
            "runId": str(run_id),
            "parentRunId": str(parent_run_id) if parent_run_id else None,
            "input": _parse_input(prompts),
            "name": kwargs.get("invocation_params", {}).get("model_name"),
            "tags": tags,
            "metadata": metadata,
        }
        if user_props:
            event["userProps"] = user_props
        self.__send_event(event)
[docs]    def on_chat_model_start(
        self,
        serialized: Dict[str, Any],
        messages: List[List[BaseMessage]],
        *,
        run_id: UUID,