def _group_transcript_with_timestamps(self, transcript_data: list, time_range: int, video_length: int) -> str:
        """
        Group transcript data into specified time ranges with timestamps.

        :param list transcript_data: List of dictionaries containing transcription details.
        :param int time_range: Time range for grouping in minutes (default: 2 minutes).
        :return: Grouped transcript with timestamps.
        :rtype: str
        """
        grouped_transcript = []
        current_start_time = 0
        current_end_time = time_range * 60
        current_text = []

        for entry in transcript_data:
            start_time = int(entry.get("start", 0))
            text = entry.get("text", "").strip()


            if start_time < current_end_time:
                current_text.append(text)
            else:
                actual_end_time = min(current_end_time, video_length)
                timestamp = f"[{current_start_time // 60:02d}:{current_start_time % 60:02d} - {actual_end_time // 60:02d}:{actual_end_time % 60:02d}]"
                grouped_transcript.append(f"{timestamp} {' '.join(current_text).strip()}\n")
                current_start_time = current_end_time
                current_end_time += time_range * 60
                current_text = [text]
                
        if current_text:
            actual_end_time = min(current_end_time, video_length)
            timestamp = f"[{current_start_time // 60:02d}:{current_start_time % 60:02d} - {actual_end_time // 60:02d}:{actual_end_time % 60:02d}]"
            grouped_transcript.append(f"{timestamp} {' '.join(current_text).strip()}\n")

        return "\n".join(grouped_transcript).replace(" - ", " ")

        Group transcript data into specified time ranges with timestamps.

        :param list transcript_data: List of dictionaries containing transcription details.
        :param int time_range: Time range for grouping in minutes (default: 2 minutes).
        :return: Grouped transcript with timestamps.
        :rtype: str
        
backend/director/agents/transcription.py