Skip to content

Commit 9155723

Browse files
authored
Merge branch 'develop' into gu/pydantic_dataclasses
2 parents cf7e023 + fbd3b33 commit 9155723

38 files changed

+1378
-642
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Platform team's approval is required for all code changes (excluding notebook changes)
2-
* @Labelbox/platform
1+
# SDK team's approval is required for all code changes (excluding notebook changes)
2+
* @Labelbox/sdk
33
*.ipynb
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Fact Checking Tool
2+
===============================================================================================
3+
4+
.. automodule:: labelbox.schema.tool_building.fact_checking_tool
5+
:members:
6+
:show-inheritance:

docs/labelbox/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Labelbox Python SDK Documentation
1919
enums
2020
exceptions
2121
export-task
22+
fact-checking-tool
2223
foundry-client
2324
foundry-model
2425
identifiable
@@ -39,14 +40,15 @@ Labelbox Python SDK Documentation
3940
pagination
4041
project
4142
project-model-config
43+
prompt-issue-tool
4244
quality-mode
4345
request-client
4446
resource-tag
4547
review
4648
search-filters
4749
send-to-annotate-params
4850
slice
49-
step_reasoning_tool
51+
step-reasoning-tool
5052
task
5153
task-queue
5254
user
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Step Reasoning Tool
2+
===============================================================================================
3+
4+
.. automodule:: labelbox.schema.tool_building.prompt_issue_tool
5+
:members:
6+
:show-inheritance:
File renamed without changes.

libs/labelbox/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ dev-dependencies = [
7474
line-length = 80
7575

7676
[tool.ruff.lint]
77-
ignore = ["F841", "E722", "F811", "F402", "F601", "F403", "F821", "F541"]
77+
ignore = ["F841", "E722", "F811", "F403", "F821", "F541"]
7878
exclude = ["**/__init__.py"]
7979

8080
[tool.rye.scripts]

libs/labelbox/src/labelbox/__init__.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,14 @@
4646
from labelbox.schema.model_config import ModelConfig
4747
from labelbox.schema.model_run import DataSplit, ModelRun
4848
from labelbox.schema.ontology import (
49-
Classification,
5049
FeatureSchema,
5150
Ontology,
5251
OntologyBuilder,
53-
Option,
54-
PromptResponseClassification,
55-
ResponseOption,
5652
Tool,
5753
)
58-
from labelbox.schema.ontology import PromptResponseClassification
59-
from labelbox.schema.ontology import ResponseOption
54+
from labelbox.schema.tool_building.fact_checking_tool import FactCheckingTool
55+
from labelbox.schema.tool_building.step_reasoning_tool import StepReasoningTool
56+
from labelbox.schema.tool_building.prompt_issue_tool import PromptIssueTool
6057
from labelbox.schema.role import Role, ProjectRole
6158
from labelbox.schema.invite import Invite, InviteLimit
6259
from labelbox.schema.data_row_metadata import (
@@ -94,3 +91,10 @@
9491
from labelbox.schema.task_queue import TaskQueue
9592
from labelbox.schema.user import User
9693
from labelbox.schema.webhook import Webhook
94+
from labelbox.schema.tool_building.classification import (
95+
Classification,
96+
Option,
97+
ResponseOption,
98+
PromptResponseClassification,
99+
)
100+
from lbox.exceptions import *

libs/labelbox/src/labelbox/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ def _create_project(self, input: _CoreProjectInput) -> Project:
860860
extra_params = {k: v for k, v in extra_params.items() if v is not None}
861861
return self._create(Entity.Project, params, extra_params)
862862

863-
def get_roles(self) -> List[Role]:
863+
def get_roles(self) -> Dict[str, Role]:
864864
"""
865865
Returns:
866866
Roles: Provides information on available roles within an organization.

libs/labelbox/src/labelbox/schema/annotation_import.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Union,
1515
cast,
1616
)
17+
import warnings
1718

1819
import requests
1920
from google.api_core import retry
@@ -72,7 +73,7 @@ def errors(self) -> List[Dict[str, Any]]:
7273
See `AnnotationImport.statuses` for more details.
7374
* This information will expire after 24 hours.
7475
"""
75-
self.wait_until_done()
76+
self.wait_till_done()
7677
return self._fetch_remote_ndjson(self.error_file_url)
7778

7879
@property
@@ -101,15 +102,20 @@ def statuses(self) -> List[Dict[str, Any]]:
101102
102103
* This information will expire after 24 hours.
103104
"""
104-
self.wait_until_done()
105+
self.wait_till_done()
105106
return self._fetch_remote_ndjson(self.status_file_url)
106107

107-
def wait_till_done(
108+
def wait_until_done(
108109
self, sleep_time_seconds: int = 10, show_progress: bool = False
109110
) -> None:
110-
self.wait_until_done(sleep_time_seconds, show_progress)
111+
warnings.warn(
112+
"The method wait_until_done for AnnotationImport is deprecated and will be removed in the next major release. Use the wait_till_done method instead.",
113+
DeprecationWarning,
114+
stacklevel=2,
115+
)
116+
self.wait_till_done(sleep_time_seconds, show_progress)
111117

112-
def wait_until_done(
118+
def wait_till_done(
113119
self, sleep_time_seconds: int = 10, show_progress: bool = False
114120
) -> None:
115121
"""Blocks import job until certain conditions are met.
@@ -587,6 +593,20 @@ def parent_id(self) -> str:
587593
"""
588594
return self.project().uid
589595

596+
def delete(self) -> None:
597+
"""
598+
Deletes a MALPredictionImport job
599+
"""
600+
601+
query_string = """
602+
mutation deleteModelAssistedLabelingPredictionImportPyApi($id: ID!) {
603+
deleteModelAssistedLabelingPredictionImport(where: { id: $id }) {
604+
id
605+
}
606+
}
607+
"""
608+
self.client.execute(query_string, {"id": self.uid})
609+
590610
@classmethod
591611
def create_from_file(
592612
cls, client: "labelbox.Client", project_id: str, name: str, path: str

libs/labelbox/src/labelbox/schema/create_batches_task.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
from typing import TYPE_CHECKING, Callable, List, Optional, Dict, Any
3+
import warnings
34

45
from labelbox.orm.model import Entity
56

@@ -23,6 +24,11 @@ def __init__(
2324
]
2425

2526
def wait_until_done(self, timeout_seconds: int = 300) -> None:
27+
warnings.warn(
28+
"The method wait_until_done for CreateBatchesTask is deprecated and will be removed in the next major release. Use the wait_till_done method instead.",
29+
DeprecationWarning,
30+
stacklevel=2,
31+
)
2632
self.wait_till_done(timeout_seconds)
2733

2834
def wait_till_done(self, timeout_seconds: int = 300) -> None:

0 commit comments

Comments
 (0)