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
        whitespace = OPENAI_WHITESPACE
        self._verify_all_labels()  # verify that all labels are strings

        if len(self._records) <= len(self._SETTINGS.label_schema) * 100:
            warnings.warn("OpenAI recommends at least 100 examples per class for training a classification model.")

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

            if rec.text is not None:
                prompt = rec.text
            elif rec.text is None and "text" in rec.inputs:
                prompt = rec.inputs["text"]
            else:
                prompt = ", ".join(f"{key}: {value}" for key, value in rec.inputs.items())
            prompt += separator  # needed for better performance

            if self._records[0].multi_label:
                completion = " ".join([str(self._SETTINGS.label2id[annotation]) for annotation in rec.annotation])
            else:
                completion = str(self._SETTINGS.label2id[rec.annotation])

            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