55import warnings
66from enum import Enum
77from typing import Annotated , Any , Dict , List , Optional , Type , Union
8+ from dataclasses import field
89
910from lbox .exceptions import InconsistentOntologyException
10- from pydantic import StringConstraints , Field
11+ from pydantic import StringConstraints , field
1112from pydantic .dataclasses import dataclass
1213
1314from labelbox .orm .db_object import DbObject
14- from labelbox .orm .model import Field as LB_Field , Relationship
15+ from labelbox .orm .model import Field , Relationship
1516from labelbox .schema .tool_building .step_reasoning_tool import StepReasoningTool
1617from labelbox .schema .tool_building .tool_type import ToolType
1718
@@ -35,9 +36,9 @@ def __str__(self):
3536
3637
3738class FeatureSchema (DbObject ):
38- name = LB_Field .String ("name" )
39- color = LB_Field .String ("name" )
40- normalized = LB_Field .Json ("normalized" )
39+ name = Field .String ("name" )
40+ color = Field .String ("name" )
41+ normalized = Field .Json ("normalized" )
4142
4243
4344@dataclass
@@ -64,7 +65,7 @@ class Option:
6465 feature_schema_id : Optional [FeatureSchemaId ] = None
6566 options : Union [
6667 List ["Classification" ], List ["PromptResponseClassification" ]
67- ] = Field (default_factory = list )
68+ ] = field (default_factory = list )
6869
6970 def __post_init__ (self ):
7071 if self .label is None :
@@ -160,7 +161,7 @@ class UIMode(Enum):
160161 name : Optional [str ] = None
161162 instructions : Optional [str ] = None
162163 required : bool = False
163- options : List [Option ] = Field (default_factory = list )
164+ options : List [Option ] = field (default_factory = list )
164165 schema_id : Optional [str ] = None
165166 feature_schema_id : Optional [str ] = None
166167 scope : Scope = None
@@ -344,7 +345,7 @@ class Type(Enum):
344345 name : Optional [str ] = None
345346 instructions : Optional [str ] = None
346347 required : bool = True
347- options : List [ResponseOption ] = Field (default_factory = list )
348+ options : List [ResponseOption ] = field (default_factory = list )
348349 character_min : Optional [int ] = None
349350 character_max : Optional [int ] = None
350351 schema_id : Optional [str ] = None
@@ -449,7 +450,7 @@ class Type(Enum):
449450 name : str
450451 required : bool = False
451452 color : Optional [str ] = None
452- classifications : List [Classification ] = Field (default_factory = list )
453+ classifications : List [Classification ] = field (default_factory = list )
453454 schema_id : Optional [str ] = None
454455 feature_schema_id : Optional [str ] = None
455456
@@ -517,13 +518,13 @@ class Ontology(DbObject):
517518 created_by (Relationship): `ToOne` relationship to User
518519 """
519520
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" )
521+ name = Field .String ("name" )
522+ description = Field .String ("description" )
523+ updated_at = Field .DateTime ("updated_at" )
524+ created_at = Field .DateTime ("created_at" )
525+ normalized = Field .Json ("normalized" )
526+ object_schema_count = Field .Int ("object_schema_count" )
527+ classification_schema_count = Field .Int ("classification_schema_count" )
527528
528529 projects = Relationship .ToMany ("Project" , True )
529530 created_by = Relationship .ToOne ("User" , False , "created_by" )
@@ -596,10 +597,10 @@ class OntologyBuilder:
596597
597598 """
598599
599- tools : List [Union [Tool , StepReasoningTool ]] = Field (default_factory = list )
600+ tools : List [Union [Tool , StepReasoningTool ]] = field (default_factory = list )
600601 classifications : List [
601602 Union [Classification , PromptResponseClassification ]
602- ] = Field (default_factory = list )
603+ ] = field (default_factory = list )
603604
604605 @classmethod
605606 def from_dict (cls , dictionary : Dict [str , Any ]) -> Dict [str , Any ]:
0 commit comments