1
1
# type: ignore
2
-
2
+ from dataclasses import field
3
3
import colorsys
4
4
import json
5
5
import warnings
6
6
from enum import Enum
7
7
from typing import Annotated , Any , Dict , List , Optional , Type , Union
8
8
9
9
from lbox .exceptions import InconsistentOntologyException
10
- from pydantic import StringConstraints , Field
10
+ from pydantic import StringConstraints
11
11
from pydantic .dataclasses import dataclass
12
12
13
13
from labelbox .orm .db_object import DbObject
14
- from labelbox .orm .model import Field as LB_Field , Relationship
14
+ from labelbox .orm .model import Field , Relationship
15
15
from labelbox .schema .tool_building .step_reasoning_tool import StepReasoningTool
16
16
from labelbox .schema .tool_building .tool_type import ToolType
17
17
@@ -35,9 +35,9 @@ def __str__(self):
35
35
36
36
37
37
class FeatureSchema (DbObject ):
38
- name = LB_Field .String ("name" )
39
- color = LB_Field .String ("name" )
40
- normalized = LB_Field .Json ("normalized" )
38
+ name = Field .String ("name" )
39
+ color = Field .String ("name" )
40
+ normalized = Field .Json ("normalized" )
41
41
42
42
43
43
@dataclass
@@ -64,7 +64,7 @@ class Option:
64
64
feature_schema_id : Optional [FeatureSchemaId ] = None
65
65
options : Union [
66
66
List ["Classification" ], List ["PromptResponseClassification" ]
67
- ] = Field (default_factory = list )
67
+ ] = field (default_factory = list )
68
68
69
69
def __post_init__ (self ):
70
70
if self .label is None :
@@ -160,7 +160,7 @@ class UIMode(Enum):
160
160
name : Optional [str ] = None
161
161
instructions : Optional [str ] = None
162
162
required : bool = False
163
- options : List [Option ] = Field (default_factory = list )
163
+ options : List [Option ] = field (default_factory = list )
164
164
schema_id : Optional [str ] = None
165
165
feature_schema_id : Optional [str ] = None
166
166
scope : Scope = None
@@ -344,7 +344,7 @@ class Type(Enum):
344
344
name : Optional [str ] = None
345
345
instructions : Optional [str ] = None
346
346
required : bool = True
347
- options : List [ResponseOption ] = Field (default_factory = list )
347
+ options : List [ResponseOption ] = field (default_factory = list )
348
348
character_min : Optional [int ] = None
349
349
character_max : Optional [int ] = None
350
350
schema_id : Optional [str ] = None
@@ -449,7 +449,7 @@ class Type(Enum):
449
449
name : str
450
450
required : bool = False
451
451
color : Optional [str ] = None
452
- classifications : List [Classification ] = Field (default_factory = list )
452
+ classifications : List [Classification ] = field (default_factory = list )
453
453
schema_id : Optional [str ] = None
454
454
feature_schema_id : Optional [str ] = None
455
455
@@ -517,13 +517,13 @@ class Ontology(DbObject):
517
517
created_by (Relationship): `ToOne` relationship to User
518
518
"""
519
519
520
- name = LB_Field .String ("name" )
521
- description = LB_Field .String ("description" )
522
- updated_at = LB_Field .DateTime ("updated_at" )
523
- created_at = LB_Field .DateTime ("created_at" )
524
- normalized = LB_Field .Json ("normalized" )
525
- object_schema_count = LB_Field .Int ("object_schema_count" )
526
- classification_schema_count = LB_Field .Int ("classification_schema_count" )
520
+ name = Field .String ("name" )
521
+ description = Field .String ("description" )
522
+ updated_at = Field .DateTime ("updated_at" )
523
+ created_at = Field .DateTime ("created_at" )
524
+ normalized = Field .Json ("normalized" )
525
+ object_schema_count = Field .Int ("object_schema_count" )
526
+ classification_schema_count = Field .Int ("classification_schema_count" )
527
527
528
528
projects = Relationship .ToMany ("Project" , True )
529
529
created_by = Relationship .ToOne ("User" , False , "created_by" )
0 commit comments