async def _process_file(
        self,
        client: httpx.AsyncClient,
        workspace_slug: str,
        repo_slug: str,
        item_path: str,
        item: Dict[str, Any],
        breadcrumbs: List[Breadcrumb],
        branch: str,
    ) -> AsyncGenerator[ChunkEntity, None]:
        """Process a file item and create file entities.

        Args:
            client: HTTP client
            workspace_slug: Workspace slug
            repo_slug: Repository slug
            item_path: Path to the file
            item: File item data
            breadcrumbs: Current breadcrumb chain
            branch: Branch name

        Yields:
            File entities
        """
        try:
            # Get file content - use raw format to get actual file content
            file_url = (
                f"{self.BASE_URL}/repositories/{workspace_slug}/{repo_slug}"
                f"/src/{branch}/{item_path}"
            )
            # Create Basic auth credentials
            credentials = f"{self.username}:{self.app_password}"
            encoded_credentials = base64.b64encode(credentials.encode()).decode()

            file_response = await client.get(
                file_url,
                headers={
                    "Authorization": f"Basic {encoded_credentials}",
                    "Accept": "text/plain",  # Request raw content, not JSON
                },
                params={"format": "raw"},  # BitBucket parameter to get raw file content
            )
            file_response.raise_for_status()

            # Get the raw file content
            content_text = file_response.text
            file_size = len(content_text.encode("utf-8"))

            # Check if this is a text file
            content_sample = content_text.encode("utf-8")[:1024] if content_text else None
            if is_text_file(item_path, file_size, content_sample):
                # Detect language
                language = self._detect_language_from_extension(item_path)

                # Ensure we have a valid path
                file_name = Path(item_path).name

                # Set line count if we have content
                line_count = 0
                if content_text:
                    try:
                        line_count = content_text.count("\n") + 1
                    except Exception as e:
                        logger.error(f"Error counting lines for {item_path}: {str(e)}")

                # Create file entity with content stored in memory
                file_entity = BitbucketCodeFileEntity(
                    entity_id=f"{workspace_slug}/{repo_slug}/{item_path}",
                    source_name="bitbucket",
                    file_id=item.get("commit", {}).get("hash", ""),
                    name=file_name,
                    mime_type=mimetypes.guess_type(item_path)[0] or "text/plain",
                    size=file_size,
                    path=item_path,
                    repo_slug=repo_slug,
                    repo_full_name=f"{workspace_slug}/{repo_slug}",
                    workspace_slug=workspace_slug,
                    commit_hash=item.get("commit", {}).get("hash"),
                    breadcrumbs=breadcrumbs.copy(),
                    url=f"https://bitbucket.org/{workspace_slug}/{repo_slug}/src/{branch}/{item_path}",
                    language=language,
                    line_count=line_count,
                    path_in_repo=item_path,
                    content=content_text,  # Store the content directly in the entity
                    # Required fields from CodeFileEntity base class
                    repo_name=repo_slug,  # Repository name
                    repo_owner=workspace_slug,  # Repository owner (workspace)
                    last_modified=datetime.fromisoformat(
                        item.get("commit", {}).get("date", "").replace("Z", "+00:00")
                    )
                    if item.get("commit", {}).get("date")
                    else None,
                )

                yield file_entity
        except Exception as e:
            logger.error(f"Error processing file {item_path}: {str(e)}")
Process a file item and create file entities.

        Args:
            client: HTTP client
            workspace_slug: Workspace slug
            repo_slug: Repository slug
            item_path: Path to the file
            item: File item data
            breadcrumbs: Current breadcrumb chain
            branch: Branch name

        Yields:
            File entities
        
backend/airweave/platform/sources/bitbucket.py