@@ -31,6 +31,42 @@ def with_raw_response(self) -> RawAnnotationsClient:
3131 """
3232 return self ._raw_client
3333
34+ def delete_bulk (
35+ self , * , ids : typing .Sequence [int ], project : int , request_options : typing .Optional [RequestOptions ] = None
36+ ) -> DeleteBulkAnnotationsResponse :
37+ """
38+ Delete multiple annotations by their IDs. The deletion is processed synchronously. Returns the count of deleted annotations in the response.
39+
40+ Parameters
41+ ----------
42+ ids : typing.Sequence[int]
43+ List of annotation IDs to delete
44+
45+ project : int
46+
47+ request_options : typing.Optional[RequestOptions]
48+ Request-specific configuration.
49+
50+ Returns
51+ -------
52+ DeleteBulkAnnotationsResponse
53+ Annotations deleted successfully
54+
55+ Examples
56+ --------
57+ from label_studio_sdk import LabelStudio
58+
59+ client = LabelStudio(
60+ api_key="YOUR_API_KEY",
61+ )
62+ client.annotations.delete_bulk(
63+ ids=[1],
64+ project=1,
65+ )
66+ """
67+ _response = self ._raw_client .delete_bulk (ids = ids , project = project , request_options = request_options )
68+ return _response .data
69+
3470 def create_bulk (
3571 self ,
3672 * ,
@@ -160,32 +196,6 @@ def create_bulk(
160196 )
161197 return _response .data
162198
163- def delete_bulk (self , * , request_options : typing .Optional [RequestOptions ] = None ) -> DeleteBulkAnnotationsResponse :
164- """
165- Delete multiple annotations by their IDs. The deletion is processed synchronously. Returns the count of deleted annotations in the response.
166-
167- Parameters
168- ----------
169- request_options : typing.Optional[RequestOptions]
170- Request-specific configuration.
171-
172- Returns
173- -------
174- DeleteBulkAnnotationsResponse
175- Annotations deleted successfully
176-
177- Examples
178- --------
179- from label_studio_sdk import LabelStudio
180-
181- client = LabelStudio(
182- api_key="YOUR_API_KEY",
183- )
184- client.annotations.delete_bulk()
185- """
186- _response = self ._raw_client .delete_bulk (request_options = request_options )
187- return _response .data
188-
189199 def get (self , id : int , * , request_options : typing .Optional [RequestOptions ] = None ) -> Annotation :
190200 """
191201 Retrieve a specific annotation for a task using the annotation result ID.
@@ -509,6 +519,50 @@ def with_raw_response(self) -> AsyncRawAnnotationsClient:
509519 """
510520 return self ._raw_client
511521
522+ async def delete_bulk (
523+ self , * , ids : typing .Sequence [int ], project : int , request_options : typing .Optional [RequestOptions ] = None
524+ ) -> DeleteBulkAnnotationsResponse :
525+ """
526+ Delete multiple annotations by their IDs. The deletion is processed synchronously. Returns the count of deleted annotations in the response.
527+
528+ Parameters
529+ ----------
530+ ids : typing.Sequence[int]
531+ List of annotation IDs to delete
532+
533+ project : int
534+
535+ request_options : typing.Optional[RequestOptions]
536+ Request-specific configuration.
537+
538+ Returns
539+ -------
540+ DeleteBulkAnnotationsResponse
541+ Annotations deleted successfully
542+
543+ Examples
544+ --------
545+ import asyncio
546+
547+ from label_studio_sdk import AsyncLabelStudio
548+
549+ client = AsyncLabelStudio(
550+ api_key="YOUR_API_KEY",
551+ )
552+
553+
554+ async def main() -> None:
555+ await client.annotations.delete_bulk(
556+ ids=[1],
557+ project=1,
558+ )
559+
560+
561+ asyncio.run(main())
562+ """
563+ _response = await self ._raw_client .delete_bulk (ids = ids , project = project , request_options = request_options )
564+ return _response .data
565+
512566 async def create_bulk (
513567 self ,
514568 * ,
@@ -646,42 +700,6 @@ async def main() -> None:
646700 )
647701 return _response .data
648702
649- async def delete_bulk (
650- self , * , request_options : typing .Optional [RequestOptions ] = None
651- ) -> DeleteBulkAnnotationsResponse :
652- """
653- Delete multiple annotations by their IDs. The deletion is processed synchronously. Returns the count of deleted annotations in the response.
654-
655- Parameters
656- ----------
657- request_options : typing.Optional[RequestOptions]
658- Request-specific configuration.
659-
660- Returns
661- -------
662- DeleteBulkAnnotationsResponse
663- Annotations deleted successfully
664-
665- Examples
666- --------
667- import asyncio
668-
669- from label_studio_sdk import AsyncLabelStudio
670-
671- client = AsyncLabelStudio(
672- api_key="YOUR_API_KEY",
673- )
674-
675-
676- async def main() -> None:
677- await client.annotations.delete_bulk()
678-
679-
680- asyncio.run(main())
681- """
682- _response = await self ._raw_client .delete_bulk (request_options = request_options )
683- return _response .data
684-
685703 async def get (self , id : int , * , request_options : typing .Optional [RequestOptions ] = None ) -> Annotation :
686704 """
687705 Retrieve a specific annotation for a task using the annotation result ID.
0 commit comments