diff --git a/src/kili/presentation/client/label.py b/src/kili/presentation/client/label.py index e9eb82733..6c4bc3663 100644 --- a/src/kili/presentation/client/label.py +++ b/src/kili/presentation/client/label.py @@ -1229,7 +1229,7 @@ def is_rectangle(coco_annotation, coco_image, kili_annotation): self, # pyright: ignore[reportGeneralTypeIssues] asset_ids=resolved_asset_ids, project_id=ProjectId(project_id), - export_type="latest", + export_type="normal" if fmt == "llm_v1" else "latest", label_format=fmt, split_option=layout, single_file=single_file, diff --git a/src/kili/services/export/format/llm/__init__.py b/src/kili/services/export/format/llm/__init__.py index d5a2f7ae5..6390f548b 100644 --- a/src/kili/services/export/format/llm/__init__.py +++ b/src/kili/services/export/format/llm/__init__.py @@ -54,8 +54,6 @@ def process(self, assets: List[Dict]) -> List[Dict[str, Union[List[str], str]]]: def _process(self, assets: List[Dict]) -> List[Dict[str, Union[List[str], str]]]: result = [] for asset in assets: - jobs_config = self.project["jsonInterface"]["jobs"] - latest_label = asset["latestLabel"] result.append( { "raw_data": _format_raw_data(asset), @@ -63,14 +61,19 @@ def _process(self, assets: List[Dict]) -> List[Dict[str, Union[List[str], str]]] "external_id": asset["externalId"], "metadata": asset["jsonMetadata"], "labels": [ - { - "author": latest_label["author"]["email"], - "created_at": latest_label["createdAt"], - "label_type": latest_label["labelType"], - "label": _format_json_response( - jobs_config, latest_label["jsonResponse"] - ), - } + list( + map( + lambda label: { + "author": label["author"]["email"], + "created_at": label["createdAt"], + "label_type": label["labelType"], + "label": _format_json_response( + self.project["jsonInterface"]["jobs"], label["jsonResponse"] + ), + }, + asset["labels"], + ) + ) ], } )