async def _search_objects(
        self, client: httpx.AsyncClient, object_type: str
    ) -> AsyncGenerator[dict, None]:
        """Search for objects of a specific type."""
        url = "https://api.notion.com/v1/search"
        has_more = True
        start_cursor = None

        while has_more:
            json_data = {
                "filter": {"property": "object", "value": object_type},
                "page_size": 100,
            }

            if start_cursor:
                json_data["start_cursor"] = start_cursor

            try:
                response = await self._post_with_auth(client, url, json_data)
                results = response.get("results", [])

                for obj in results:
                    yield obj

                has_more = response.get("has_more", False)
                start_cursor = response.get("next_cursor")

            except Exception as e:
                logger.error(f"Error searching for {object_type}: {str(e)}")
                raise
Search for objects of a specific type.
backend/airweave/platform/sources/notion.py