Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: DIA-1748: 'Generate labels with AI' button in Project, in SC #372

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ dist/
.mypy_cache/
__pycache__/
poetry.toml
.idea/
1 change: 1 addition & 0 deletions .mock/definition/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ types:
type: optional<boolean>
docs: Show annotation history to annotator
organization: optional<integer>
prompt: optional<Prompt>
color:
type: optional<string>
validation:
Expand Down
20 changes: 20 additions & 0 deletions .mock/definition/projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ service:
enable_empty_annotation: true
show_annotation_history: true
organization: 1
prompt:
title: title
input_fields:
- input_fields
output_classes:
- output_classes
color: color
maximum_annotations: 1
is_published: true
Expand Down Expand Up @@ -423,6 +429,20 @@ service:
enable_empty_annotation: true
show_annotation_history: true
organization: 1
prompt:
title: title
description: description
created_by: 1
created_at: '2024-01-15T09:30:00Z'
updated_at: '2024-01-15T09:30:00Z'
organization: 1
input_fields:
- input_fields
output_classes:
- output_classes
associated_projects:
- 1
skill_name: skill_name
color: '#FF0000'
maximum_annotations: 1
is_published: true
Expand Down
16 changes: 16 additions & 0 deletions .mock/definition/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,22 @@ service:
date_joined: '2024-01-15T09:30:00Z'
audiences:
- public
get_product_tour:
path: /api/current-user/product-tour
method: GET
auth: true
examples:
- {}
audiences:
- internal
update_product_tour:
path: /api/current-user/product-tour
method: PATCH
auth: true
examples:
- {}
audiences:
- internal
source:
openapi: openapi/openapi.yaml
imports:
Expand Down
3 changes: 3 additions & 0 deletions .mock/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8982,6 +8982,9 @@ components:
title: Organization
type: integer
nullable: true
prompt:
$ref: "#/components/schemas/Prompt"
nullable: true
color:
title: Color
type: string
Expand Down
1,020 changes: 536 additions & 484 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "label-studio-sdk"
version = "1.0.9.dev"
version = "1.0.9"
description = ""
readme = "README.md"
authors = []
Expand Down Expand Up @@ -37,6 +37,7 @@ appdirs = ">=1.4.3"
datamodel-code-generator = "0.26.1"
httpx = ">=0.21.2"
ijson = ">=3.2.3"
jsf = "^0.11.2"
jsonschema = ">=4.23.0"
lxml = ">=4.2.5"
nltk = "^3.9.1"
Expand All @@ -49,7 +50,6 @@ typing_extensions = ">= 4.0.0"
ujson = ">=5.8.0"
xmljson = "0.2.1"

jsf = "^0.11.2"
[tool.poetry.dev-dependencies]
mypy = "1.0.1"
pytest = "^7.4.0"
Expand Down
2 changes: 2 additions & 0 deletions src/label_studio_sdk/types/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
from .project_sampling import ProjectSampling
from .project_skip_queue import ProjectSkipQueue
from .prompt import Prompt
from .user_simple import UserSimple


Expand Down Expand Up @@ -53,6 +54,7 @@ class Project(pydantic_v1.BaseModel):
"""

organization: typing.Optional[int] = None
prompt: typing.Optional[Prompt] = None
color: typing.Optional[str] = None
maximum_annotations: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Expand Down
24 changes: 24 additions & 0 deletions tests/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ async def test_get(client: LabelStudio, async_client: AsyncLabelStudio) -> None:
"enable_empty_annotation": True,
"show_annotation_history": True,
"organization": 1,
"prompt": {
"title": "title",
"description": "description",
"created_by": 1,
"created_at": "2024-01-15T09:30:00Z",
"updated_at": "2024-01-15T09:30:00Z",
"organization": 1,
"input_fields": ["input_fields"],
"output_classes": ["output_classes"],
"associated_projects": [1],
"skill_name": "skill_name",
},
"color": "#FF0000",
"maximum_annotations": 1,
"is_published": True,
Expand Down Expand Up @@ -110,6 +122,18 @@ async def test_get(client: LabelStudio, async_client: AsyncLabelStudio) -> None:
"enable_empty_annotation": None,
"show_annotation_history": None,
"organization": "integer",
"prompt": {
"title": None,
"description": None,
"created_by": "integer",
"created_at": "datetime",
"updated_at": "datetime",
"organization": "integer",
"input_fields": ("list", {0: None}),
"output_classes": ("list", {0: None}),
"associated_projects": ("list", {0: "integer"}),
"skill_name": None,
},
"color": None,
"maximum_annotations": "integer",
"is_published": None,
Expand Down
Loading