Skip to content
Draft
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
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "label-studio-sdk"

[tool.poetry]
name = "label-studio-sdk"
version = "2.0.15"
version = "2.0.16"
description = ""
readme = "README.md"
authors = []
Expand Down
24 changes: 20 additions & 4 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1521,10 +1521,10 @@ client.annotations.list(
<dd>


Add annotations to a task like an annotator does. The content of the result field depends on your
labeling configuration. For example, send the following data as part of your POST
Add annotations to a task like an annotator does. The content of the result field depends on your
labeling configuration. For example, send the following data as part of your POST
request to send an empty annotation with the ID of the user who completed the task:

```json
{
"result": {},
Expand All @@ -1533,7 +1533,7 @@ client.annotations.list(
"lead_time": 0,
"task": 0
"completed_by": 123
}
}
```

</dd>
Expand Down Expand Up @@ -10784,6 +10784,14 @@ client.tasks.create(
<dl>
<dd>

**allow_skip:** `typing.Optional[bool]` — Whether this task can be skipped. Set to False to make task unskippable.

</dd>
</dl>

<dl>
<dd>

**cancelled_annotations:** `typing.Optional[int]` — Number of total cancelled annotations for the current task

</dd>
Expand Down Expand Up @@ -11114,6 +11122,14 @@ client.tasks.update(
<dl>
<dd>

**allow_skip:** `typing.Optional[bool]` — Whether this task can be skipped. Set to False to make task unskippable.

</dd>
</dl>

<dl>
<dd>

**avg_lead_time:** `typing.Optional[float]`

</dd>
Expand Down
20 changes: 20 additions & 0 deletions src/label_studio_sdk/tasks/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ def list(
def create(
self,
*,
allow_skip: typing.Optional[bool] = OMIT,
cancelled_annotations: typing.Optional[int] = OMIT,
comment_authors: typing.Optional[typing.Sequence[int]] = OMIT,
comment_count: typing.Optional[int] = OMIT,
Expand All @@ -313,6 +314,9 @@ def create(

Parameters
----------
allow_skip : typing.Optional[bool]
Whether this task can be skipped. Set to False to make task unskippable.

cancelled_annotations : typing.Optional[int]
Number of total cancelled annotations for the current task

Expand Down Expand Up @@ -381,6 +385,7 @@ def create(
"api/tasks/",
method="POST",
json={
"allow_skip": allow_skip,
"cancelled_annotations": cancelled_annotations,
"comment_authors": comment_authors,
"comment_count": comment_count,
Expand Down Expand Up @@ -508,6 +513,7 @@ def update(
self,
id: str,
*,
allow_skip: typing.Optional[bool] = OMIT,
avg_lead_time: typing.Optional[float] = OMIT,
cancelled_annotations: typing.Optional[int] = OMIT,
comment_count: typing.Optional[int] = OMIT,
Expand Down Expand Up @@ -539,6 +545,9 @@ def update(
id : str
Task ID

allow_skip : typing.Optional[bool]
Whether this task can be skipped. Set to False to make task unskippable.

avg_lead_time : typing.Optional[float]

cancelled_annotations : typing.Optional[int]
Expand Down Expand Up @@ -613,6 +622,7 @@ def update(
f"api/tasks/{jsonable_encoder(id)}/",
method="PATCH",
json={
"allow_skip": allow_skip,
"avg_lead_time": avg_lead_time,
"cancelled_annotations": cancelled_annotations,
"comment_count": comment_count,
Expand Down Expand Up @@ -1127,6 +1137,7 @@ async def main() -> None:
async def create(
self,
*,
allow_skip: typing.Optional[bool] = OMIT,
cancelled_annotations: typing.Optional[int] = OMIT,
comment_authors: typing.Optional[typing.Sequence[int]] = OMIT,
comment_count: typing.Optional[int] = OMIT,
Expand All @@ -1149,6 +1160,9 @@ async def create(

Parameters
----------
allow_skip : typing.Optional[bool]
Whether this task can be skipped. Set to False to make task unskippable.

cancelled_annotations : typing.Optional[int]
Number of total cancelled annotations for the current task

Expand Down Expand Up @@ -1228,6 +1242,7 @@ async def main() -> None:
"api/tasks/",
method="POST",
json={
"allow_skip": allow_skip,
"cancelled_annotations": cancelled_annotations,
"comment_authors": comment_authors,
"comment_count": comment_count,
Expand Down Expand Up @@ -1371,6 +1386,7 @@ async def update(
self,
id: str,
*,
allow_skip: typing.Optional[bool] = OMIT,
avg_lead_time: typing.Optional[float] = OMIT,
cancelled_annotations: typing.Optional[int] = OMIT,
comment_count: typing.Optional[int] = OMIT,
Expand Down Expand Up @@ -1402,6 +1418,9 @@ async def update(
id : str
Task ID

allow_skip : typing.Optional[bool]
Whether this task can be skipped. Set to False to make task unskippable.

avg_lead_time : typing.Optional[float]

cancelled_annotations : typing.Optional[int]
Expand Down Expand Up @@ -1484,6 +1503,7 @@ async def main() -> None:
f"api/tasks/{jsonable_encoder(id)}/",
method="PATCH",
json={
"allow_skip": allow_skip,
"avg_lead_time": avg_lead_time,
"cancelled_annotations": cancelled_annotations,
"comment_count": comment_count,
Expand Down
7 changes: 6 additions & 1 deletion src/label_studio_sdk/types/import_api_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .annotation_request import AnnotationRequest
import pydantic
from .annotation_request import AnnotationRequest
import datetime as dt
from .prediction_request import PredictionRequest
from ..core.pydantic_utilities import IS_PYDANTIC_V2
Expand All @@ -14,6 +14,11 @@ class ImportApiRequest(UncheckedBaseModel):
Tasks serializer for Import API (TaskBulkCreateAPI)
"""

allow_skip: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether this task can be skipped. Set to False to make task unskippable.
"""

annotations: typing.Optional[typing.List[AnnotationRequest]] = None
cancelled_annotations: typing.Optional[int] = pydantic.Field(default=None)
"""
Expand Down
1 change: 1 addition & 0 deletions src/label_studio_sdk/types/lse_organization_member_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class LseOrganizationMemberList(UncheckedBaseModel):
which fields should be displayed.
"""

concurrency: typing.Optional[str] = None
id: typing.Optional[int] = None
organization: int = pydantic.Field()
"""
Expand Down
5 changes: 5 additions & 0 deletions src/label_studio_sdk/types/lse_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class LseTask(UncheckedBaseModel):

agreement: typing.Optional[str] = None
agreement_selected: typing.Optional[str] = None
allow_skip: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether this task can be skipped. Set to False to make task unskippable.
"""

annotations: typing.Optional[str] = None
annotations_ids: typing.Optional[str] = None
annotations_results: typing.Optional[str] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class LseTaskSerializerForReviewers(UncheckedBaseModel):

agreement: typing.Optional[str] = None
agreement_selected: typing.Optional[str] = None
allow_skip: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether this task can be skipped. Set to False to make task unskippable.
"""

annotations: typing.Optional[str] = None
annotations_ids: typing.Optional[str] = None
annotations_results: typing.Optional[str] = None
Expand Down
3 changes: 3 additions & 0 deletions src/label_studio_sdk/types/organization_billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@


class OrganizationBilling(UncheckedBaseModel):
enforce_session_concurrency: typing.Optional[str] = None
manual_role_management: typing.Optional[str] = None
manual_workspace_management: typing.Optional[str] = None
max_parallel_sessions: typing.Optional[str] = None
session_concurrency_window_seconds: typing.Optional[str] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
Expand Down
Loading