@@ -1699,7 +1699,8 @@ def prepare_export(
16991699
17001700 - integration_name: The name of the integration within the platform that is being used.
17011701 - format: The format in which the data will be exported in multimodal projects.
1702- It can be either CSV or JSON. If None, the data will be exported in the default JSON format.
1702+ The data can be exported in CSV, JSON, or JSONL format. If None, the data will be exported
1703+ in the default JSON format.
17031704 :return: metadata object of the prepared export
17041705 :rtype: dict
17051706
@@ -1737,6 +1738,8 @@ def prepare_export(
17371738 export_type = export_type .lower ()
17381739 if export_type == "csv" :
17391740 _export_type = 3
1741+ elif export_type == "jsonl" :
1742+ _export_type = 4
17401743 response = self .controller .prepare_export (
17411744 project_name = project_name ,
17421745 folder_names = folders ,
@@ -3440,7 +3443,7 @@ def list_items(
34403443 exclude = {"meta" , "annotator_email" , "qa_email" }
34413444 if not include_custom_metadata :
34423445 exclude .add ("custom_metadata" )
3443- return BaseSerializer .serialize_iterable (res , exclude = exclude )
3446+ return BaseSerializer .serialize_iterable (res , exclude = exclude , by_alias = False )
34443447
34453448 def list_projects (
34463449 self ,
@@ -3828,6 +3831,7 @@ def download_annotations(
38283831 items : Optional [List [NotEmptyStr ]] = None ,
38293832 recursive : bool = False ,
38303833 callback : Callable = None ,
3834+ data_spec : Literal ["default" , "multimodal" ] = "default" ,
38313835 ):
38323836 """Downloads annotation JSON files of the selected items to the local directory.
38333837
@@ -3853,6 +3857,31 @@ def download_annotations(
38533857 The function receives each annotation as an argument and the returned value will be applied to the download.
38543858 :type callback: callable
38553859
3860+ :param data_spec: Specifies the format for processing and transforming annotations before upload.
3861+
3862+ Options are:
3863+ - default: Retains the annotations in their original format.
3864+ - multimodal: Converts annotations for multimodal projects, optimizing for
3865+ compact and multimodal-specific data representation.
3866+
3867+ :type data_spec: str, optional
3868+
3869+ Example Usage of Multimodal Projects::
3870+
3871+ from superannotate import SAClient
3872+
3873+
3874+ sa = SAClient()
3875+
3876+ # Call the get_annotations function
3877+ response = sa.download_annotations(
3878+ project="project1/folder1",
3879+ path="path/to/download",
3880+ items=["item_1", "item_2"],
3881+ data_spec='multimodal'
3882+ )
3883+
3884+
38563885 :return: local path of the downloaded annotations folder.
38573886 :rtype: str
38583887 """
@@ -3865,6 +3894,7 @@ def download_annotations(
38653894 recursive = recursive ,
38663895 item_names = items ,
38673896 callback = callback ,
3897+ transform_version = "llmJsonV2" if data_spec == "multimodal" else None ,
38683898 )
38693899 if response .errors :
38703900 raise AppException (response .errors )
0 commit comments