def _prepare_for_training_with_openai(self, **kwargs) -> "datasets.Dataset":
        """Prepares the dataset for training using the "openai" framework.

        Args:
            **kwargs: Specific to the task of the dataset.

        Returns:
            A pd.DataFrame.
        """
        separator = OPENAI_SEPARATOR
        end_token = OPENAI_END_TOKEN
        whitespace = OPENAI_WHITESPACE
        self._verify_all_labels()

        if len(self._records) <= 500:
            warnings.warn("OpenAI recommends at least 500 examples for training a conditional generation model.")

        jsonl = []
        for rec in self._records:
            if rec.annotation is None:
                continue

            prompt = rec.text + separator  # needed for better performance

            completion = {}
            for label, start, end in rec.annotation:
                completion[rec.text[start:end]] = self._SETTINGS.label2id[label]

            completion = "\n".join([f"- {k} {v}" for k, v in completion.items()])
            completion = completion + end_token
            jsonl.append({"id": rec.id, "prompt": prompt, "completion": whitespace + completion})

        return jsonl
Prepares the dataset for training using the "openai" framework.

        Args:
            **kwargs: Specific to the task of the dataset.

        Returns:
            A pd.DataFrame.
        
argilla-v1/src/argilla_v1/client/datasets.py