Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- [Appendix](#appendix)
- [Annotation](#annotation)
- [Metadata](#metadata)
- [Comment](#comment)
- [Project](#project)
- [Dataset](#dataset)
- [Converter](#converter)
Expand Down Expand Up @@ -2654,6 +2655,48 @@ Example of a metadata object
}
```

## Comment

### Get Task Comments

Get comments of a task. (Up to 1000 comments)

```python
comments = client.get_task_comments(project="YOUR_PROJECT_SLUG", task_id="YOUR_TASK_ID")
```

### Response

Example of a comment object

```python
{
"id": "YOUR_COMMENT_ID",
"taskId": "YOUR_TASK_ID",
"contentId": "YOUR_CONTENT_ID",
"type": "text",
"isResolved": False,
"points": [185.98, 86.55],
"scale": 0,
"frame": 0,
"status": "todo",
"priority": 0,
"taskAnnotationId": None,
"issueCategoryId": None,
"color": None,
"threads": [
{
"id": "YOUR_THREAD_ID",
"text": "comment text",
"createdAt": "2026-03-03T03:51:55.247Z",
"updatedAt": "2026-03-03T03:51:55.247Z",
},
],
"createdAt": "2026-03-03T03:51:55.240Z",
"updatedAt": "2026-03-03T03:51:55.240Z",
}
```

## Project

### Create Project
Expand Down
8 changes: 8 additions & 0 deletions examples/get_task_comments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from pprint import pprint

import fastlabel

client = fastlabel.Client()

comments = client.get_task_comments(project="YOUR_PROJECT_SLUG", task_id="YOUR_TASK_ID")
pprint(comments)
21 changes: 21 additions & 0 deletions fastlabel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5184,6 +5184,27 @@ def get_histories(

return self.api.get_request(endpoint, params=params)

def get_task_comments(
self,
project: str,
task_id: str,
offset: int = None,
limit: int = 100,
) -> list:
if limit > 1000:
raise FastLabelInvalidException(
"Limit must be less than or equal to 1000.", 422
)
endpoint = "comments"
params = {"project": project}
if task_id:
params["taskId"] = task_id
if offset:
params["offset"] = offset
if limit:
params["limit"] = limit
return self.api.get_request(endpoint, params=params)

def mask_to_fastlabel_segmentation_points(
self, mask_image: Union[str, np.ndarray]
) -> List[List[List[int]]]:
Expand Down
Loading