kodexa 7.0.1a9987865527__py3-none-any.whl → 7.0.1a11915814268__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kodexa/dataclasses/__init__.py +464 -0
- kodexa/dataclasses/templates/llm_data_class.j2 +15 -0
- kodexa/model/model.py +72 -2
- kodexa/model/objects.py +409 -184
- kodexa/model/persistence.py +169 -6
- kodexa/platform/client.py +165 -13
- kodexa/platform/kodexa.py +23 -14
- kodexa/utils/__init__.py +178 -0
- {kodexa-7.0.1a9987865527.dist-info → kodexa-7.0.1a11915814268.dist-info}/METADATA +4 -4
- {kodexa-7.0.1a9987865527.dist-info → kodexa-7.0.1a11915814268.dist-info}/RECORD +12 -9
- {kodexa-7.0.1a9987865527.dist-info → kodexa-7.0.1a11915814268.dist-info}/LICENSE +0 -0
- {kodexa-7.0.1a9987865527.dist-info → kodexa-7.0.1a11915814268.dist-info}/WHEEL +0 -0
kodexa/model/objects.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
from enum import Enum
|
4
|
-
from typing import
|
4
|
+
from typing import Optional, List, Dict, Any
|
5
|
+
from typing import Union
|
5
6
|
|
6
7
|
from pydantic import AnyUrl, Field, RootModel, BaseModel, ConfigDict
|
7
8
|
|
@@ -628,9 +629,11 @@ class ProjectGuidance(BaseModel):
|
|
628
629
|
slug: Optional[str] = None
|
629
630
|
name: Optional[str] = None
|
630
631
|
description: Optional[str] = None
|
632
|
+
guidance: Optional[List[Guidance]] = Field(None)
|
633
|
+
active_store: bool = Field(False, alias="activeStore")
|
634
|
+
storage: GuidanceSetStorage = Field(None, description="The storage for the guidance set")
|
631
635
|
template_ref: Optional[str] = Field(None, alias="templateRef")
|
632
636
|
ref: Optional[str] = None
|
633
|
-
guidance: Optional[List[Guidance]] = Field(None, alias="guidance")
|
634
637
|
|
635
638
|
|
636
639
|
class ProjectDashboard(BaseModel):
|
@@ -705,9 +708,8 @@ class ProjectStore(BaseModel):
|
|
705
708
|
None, description="Show thumbnails in dtore", alias="showThumbnails"
|
706
709
|
)
|
707
710
|
|
708
|
-
|
709
|
-
|
710
|
-
)
|
711
|
+
document_properties: Optional[List[Option]] = Field(None, alias="documentProperties")
|
712
|
+
label_expressions: Optional[List[LabelExpression]] = Field(None, alias="labelExpressions")
|
711
713
|
|
712
714
|
allowDataEditing: Optional[bool] = Field(
|
713
715
|
None, description="Allow data editing", alias="allowDataEditing"
|
@@ -820,6 +822,7 @@ class SelectionOption(BaseModel):
|
|
820
822
|
label: Optional[str] = None
|
821
823
|
id: Optional[str] = None
|
822
824
|
description: Optional[str] = None
|
825
|
+
lexical_relations: Optional[List[LexicalRelation]] = Field([], alias="lexicalRelations")
|
823
826
|
|
824
827
|
|
825
828
|
class SlugBasedMetadata1(BaseModel):
|
@@ -986,6 +989,8 @@ class ValuePath(Enum):
|
|
986
989
|
script = "SCRIPT"
|
987
990
|
derived = "DERIVED"
|
988
991
|
formula = "FORMULA"
|
992
|
+
review = "REVIEW"
|
993
|
+
external = "EXTERNAL"
|
989
994
|
|
990
995
|
|
991
996
|
class MetadataValue(Enum):
|
@@ -1504,7 +1509,7 @@ class ProjectMetadata(BaseModel):
|
|
1504
1509
|
arbitrary_types_allowed=True,
|
1505
1510
|
protected_namespaces=("model_config",),
|
1506
1511
|
)
|
1507
|
-
tags: Optional[List[str]] = Field(default_factory=list
|
1512
|
+
tags: Optional[List[str]] = Field(default_factory=list)
|
1508
1513
|
|
1509
1514
|
|
1510
1515
|
class State1(Enum):
|
@@ -2269,7 +2274,7 @@ class DockerSource(ExtensionPackSource):
|
|
2269
2274
|
location: Optional[str] = None
|
2270
2275
|
|
2271
2276
|
|
2272
|
-
class
|
2277
|
+
class LabelExpression(BaseModel):
|
2273
2278
|
"""
|
2274
2279
|
|
2275
2280
|
"""
|
@@ -2279,9 +2284,22 @@ class DocumentMetadataDefaults(BaseModel):
|
|
2279
2284
|
arbitrary_types_allowed=True,
|
2280
2285
|
protected_namespaces=("model_config",),
|
2281
2286
|
)
|
2282
|
-
|
2283
|
-
|
2287
|
+
expression: Optional[str] = None
|
2288
|
+
label: Optional[str] = None
|
2289
|
+
|
2290
|
+
|
2291
|
+
class DocumentMetadataDefaults(BaseModel):
|
2292
|
+
"""
|
2293
|
+
|
2294
|
+
"""
|
2295
|
+
model_config = ConfigDict(
|
2296
|
+
populate_by_name=True,
|
2297
|
+
use_enum_values=True,
|
2298
|
+
arbitrary_types_allowed=True,
|
2299
|
+
protected_namespaces=("model_config",),
|
2284
2300
|
)
|
2301
|
+
document_properties: Optional[List[Option]] = Field(None, alias="documentProperties")
|
2302
|
+
label_expressions: Optional[List[LabelExpression]] = Field(None, alias="labelExpressions")
|
2285
2303
|
|
2286
2304
|
|
2287
2305
|
class ExtensionPackProvided(BaseModel):
|
@@ -2507,7 +2525,74 @@ class ProjectAssistant(BaseModel):
|
|
2507
2525
|
assistant_role: Optional[str] = Field(None, alias="assistantRole")
|
2508
2526
|
|
2509
2527
|
|
2528
|
+
class LexicalRelationType(Enum):
|
2529
|
+
SYNONYM = "SYNONYM"
|
2530
|
+
ANTONYM = "ANTONYM"
|
2531
|
+
HYPERNYM = "HYPERNYM"
|
2532
|
+
HYPONYM = "HYPONYM"
|
2533
|
+
MERONYM = "MERONYM"
|
2534
|
+
HOLONYM = "HOLONYM"
|
2535
|
+
ENTAILMENT = "ENTAILMENT"
|
2536
|
+
SIMILAR_TO = "SIMILAR_TO"
|
2537
|
+
OTHER = "OTHER"
|
2538
|
+
|
2539
|
+
|
2540
|
+
class LexicalRelation(BaseModel):
|
2541
|
+
type: Optional[LexicalRelationType] = None
|
2542
|
+
value: Optional[str] = None
|
2543
|
+
weight: Optional[float] = None
|
2544
|
+
|
2545
|
+
|
2546
|
+
class TaxonValuePath(Enum):
|
2547
|
+
VALUE_OR_ALL_CONTENT = "VALUE_OR_ALL_CONTENT"
|
2548
|
+
VALUE_ONLY = "VALUE_ONLY"
|
2549
|
+
ALL_CONTENT = "ALL_CONTENT"
|
2550
|
+
DATA_PATH = "DATA_PATH"
|
2551
|
+
METADATA = "METADATA"
|
2552
|
+
EXPRESSION = "EXPRESSION"
|
2553
|
+
SCRIPT = "SCRIPT"
|
2554
|
+
FORMULA = "FORMULA"
|
2555
|
+
DERIVED = "DERIVED"
|
2556
|
+
REVIEW = "REVIEW"
|
2557
|
+
EXTERNAL = "EXTERNAL"
|
2558
|
+
|
2559
|
+
|
2560
|
+
class TaxonCardinality(Enum):
|
2561
|
+
ONCE_PER_DOCUMENT = "ONCE_PER_DOCUMENT"
|
2562
|
+
MULTIPLE_PER_DOCUMENT = "MULTIPLE_PER_DOCUMENT"
|
2563
|
+
ONCE_PER_SEGMENT = "ONCE_PER_SEGMENT"
|
2564
|
+
MULTIPLE_PER_SEGMENT = "MULTIPLE_PER_SEGMENT"
|
2565
|
+
|
2566
|
+
|
2567
|
+
class TaxonAdditionContextType(str, Enum):
|
2568
|
+
RECORD_DEFINITION = "RECORD_DEFINITION"
|
2569
|
+
RECORD_SECTION_STARTER_MARKER = "RECORD_SECTION_STARTER_MARKER"
|
2570
|
+
RECORD_SECTION_END_MARKER = "RECORD_SECTION_END_MARKER"
|
2571
|
+
RECORD_START_MARKER = "RECORD_START_MARKER"
|
2572
|
+
RECORD_END_MARKER = "RECORD_END_MARKER"
|
2573
|
+
|
2574
|
+
|
2575
|
+
class TaxonAdditionContext(BaseModel):
|
2576
|
+
type: TaxonAdditionContextType
|
2577
|
+
context: str
|
2578
|
+
weight: Optional[float] = None
|
2579
|
+
negative: Optional[bool] = None
|
2580
|
+
|
2581
|
+
|
2582
|
+
class TaxonGuideProperties(BaseModel):
|
2583
|
+
guidance_key: Optional[bool] = Field(None, alias="guidanceKey")
|
2584
|
+
guidance_key_expression: Optional[str] = Field(None, alias="guidanceKeyExpression")
|
2585
|
+
use_guidance_for_classification: Optional[bool] = Field(None, alias="useGuidanceForClassification")
|
2586
|
+
if_present_required: Optional[bool] = Field(None, alias="ifPresentRequired")
|
2587
|
+
|
2510
2588
|
class TaxonConditionalFormat(BaseModel):
|
2589
|
+
type: Optional[str] = None
|
2590
|
+
condition: Optional[str] = None
|
2591
|
+
properties: Dict[str, Any] = Field(default_factory=dict)
|
2592
|
+
|
2593
|
+
|
2594
|
+
class TaxonValidation(BaseModel):
|
2595
|
+
|
2511
2596
|
model_config = ConfigDict(
|
2512
2597
|
populate_by_name=True,
|
2513
2598
|
use_enum_values=True,
|
@@ -2515,183 +2600,134 @@ class TaxonConditionalFormat(BaseModel):
|
|
2515
2600
|
protected_namespaces=("model_config",),
|
2516
2601
|
)
|
2517
2602
|
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2603
|
+
name: Optional[str] = Field(None)
|
2604
|
+
description: Optional[str] = Field(None)
|
2605
|
+
rule_formula: Optional[str] = Field(None, alias="ruleFormula")
|
2606
|
+
message_formula: Optional[str] = Field(None, alias="messageFormula")
|
2607
|
+
detail_formula: Optional[str] = Field(None, alias="detailFormula")
|
2608
|
+
exception_id: Optional[str] = Field(None, alias="exceptionId")
|
2609
|
+
support_article_id: Optional[str] = Field(None, alias="supportArticleId")
|
2610
|
+
overridable: Optional[bool] = None
|
2521
2611
|
|
2522
2612
|
|
2523
|
-
class
|
2524
|
-
once_per_document = "ONCE_PER_DOCUMENT"
|
2525
|
-
multiple_per_document = "MULTIPLE_PER_DOCUMENT"
|
2526
|
-
once_per_segment = "ONCE_PER_SEGMENT"
|
2527
|
-
multiple_per_segment = "MULTIPLE_PER_SEGMENT"
|
2613
|
+
class DocumentTaxonValidation(BaseModel):
|
2528
2614
|
|
2615
|
+
model_config = ConfigDict(
|
2616
|
+
populate_by_name=True,
|
2617
|
+
use_enum_values=True,
|
2618
|
+
arbitrary_types_allowed=True,
|
2619
|
+
protected_namespaces=("model_config",),
|
2620
|
+
)
|
2529
2621
|
|
2530
|
-
|
2531
|
-
""
|
2622
|
+
taxonomy_ref: Optional[str] = Field(None, alias="taxonomyRef")
|
2623
|
+
taxon_path: Optional[str] = Field(None, alias="taxonPath")
|
2624
|
+
validation: Optional[TaxonValidation] = None
|
2532
2625
|
|
2533
|
-
|
2626
|
+
|
2627
|
+
class Taxon(BaseModel):
|
2534
2628
|
model_config = ConfigDict(
|
2535
2629
|
populate_by_name=True,
|
2536
2630
|
use_enum_values=True,
|
2537
2631
|
arbitrary_types_allowed=True,
|
2538
2632
|
protected_namespaces=("model_config",),
|
2539
2633
|
)
|
2540
|
-
"""
|
2541
|
-
A taxon is an individual label within a taxonomy
|
2542
|
-
"""
|
2543
2634
|
|
2544
|
-
id: Optional[str] =
|
2545
|
-
label: Optional[str] =
|
2546
|
-
generate_name: Optional[bool] = Field(
|
2547
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
)
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2561
|
-
|
2562
|
-
)
|
2563
|
-
value_path: Optional[ValuePath] = Field(
|
2564
|
-
None,
|
2565
|
-
alias="valuePath",
|
2566
|
-
description="Where to get the value for this taxon when extracting",
|
2567
|
-
)
|
2568
|
-
metadata_value: Optional[MetadataValue] = Field(
|
2569
|
-
None,
|
2570
|
-
alias="metadataValue",
|
2571
|
-
description="If the type is metadata this will be the metadata option",
|
2572
|
-
)
|
2573
|
-
data_path: Optional[str] = Field(
|
2574
|
-
None,
|
2575
|
-
alias="dataPath",
|
2576
|
-
description="The path to the data, based on the data inside the label (tag) within the document",
|
2577
|
-
)
|
2578
|
-
expression: Optional[str] = Field(
|
2579
|
-
None,
|
2580
|
-
description="If the taxon is based on expression, this is the expression based on the available objects",
|
2581
|
-
)
|
2582
|
-
enable_fallback_expression: Optional[bool] = Field(
|
2583
|
-
None,
|
2584
|
-
alias="enableFallbackExpression",
|
2585
|
-
description="Allow for the use of a fallback expression if the taxon wasn't found",
|
2586
|
-
)
|
2587
|
-
fallback_expression: Optional[str] = Field(
|
2588
|
-
None,
|
2589
|
-
alias="fallbackExpression",
|
2590
|
-
description="Fallback expression if enabled, this is the expression based on the available objects",
|
2591
|
-
)
|
2592
|
-
nullable: Optional[bool] = Field(
|
2593
|
-
None, description="Determine if the value of the taxon can be null (unknown)"
|
2594
|
-
)
|
2595
|
-
null_value: Optional[str] = Field(
|
2596
|
-
None,
|
2597
|
-
alias="nullValue",
|
2598
|
-
description="Allows the setting of a value to replace null if the taxon is nullable",
|
2599
|
-
)
|
2600
|
-
description: Optional[str] = Field(None, description="The description of the taxon")
|
2635
|
+
id: Optional[str] = None
|
2636
|
+
label: Optional[str] = None
|
2637
|
+
generate_name: Optional[bool] = Field(None, alias="generateName")
|
2638
|
+
group: Optional[bool] = None
|
2639
|
+
name: str = Field(..., pattern=r"^[a-zA-Z0-9\-_]{0,255}$")
|
2640
|
+
select_weight: Optional[int] = Field(1, alias="selectWeight")
|
2641
|
+
external_name: Optional[str] = Field(None, alias="externalName")
|
2642
|
+
value_path: Optional[TaxonValuePath] = Field(None, alias="valuePath")
|
2643
|
+
metadata_value: Optional[MetadataValue] = Field(None, alias="metadataValue")
|
2644
|
+
data_path: Optional[str] = Field(None, alias="dataPath")
|
2645
|
+
expression: Optional[str] = None
|
2646
|
+
enable_fallback_expression: Optional[bool] = Field(None, alias="enableFallbackExpression")
|
2647
|
+
fallback_expression: Optional[str] = Field(None, alias="fallbackExpression")
|
2648
|
+
nullable: Optional[bool] = None
|
2649
|
+
null_value: Optional[str] = Field(None, alias="nullValue")
|
2650
|
+
denormalize_to_children: Optional[bool] = Field(False, alias="denormalizeToChildren")
|
2651
|
+
not_user_labelled: Optional[bool] = Field(False, alias="notUserLabelled")
|
2652
|
+
description: Optional[str] = None
|
2601
2653
|
overview_markdown: Optional[str] = Field(None, alias="overviewMarkdown")
|
2602
|
-
|
2603
|
-
|
2604
|
-
)
|
2605
|
-
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2609
|
-
|
2610
|
-
)
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2614
|
-
)
|
2615
|
-
|
2616
|
-
|
2617
|
-
|
2618
|
-
|
2619
|
-
|
2620
|
-
|
2621
|
-
None,
|
2622
|
-
alias="nodeTypes",
|
2623
|
-
description="A list of the node types that this taxon applies to (empty means everything), used in the UI",
|
2624
|
-
)
|
2625
|
-
taxon_type: Optional[TaxonType] = Field(
|
2626
|
-
None,
|
2627
|
-
alias="taxonType",
|
2628
|
-
description="Expected data type to coalesce to (defaults to STRING)",
|
2629
|
-
)
|
2630
|
-
selection_options: Optional[List[SelectionOption]] = Field(
|
2631
|
-
None,
|
2632
|
-
alias="selectionOptions",
|
2633
|
-
description="If data type is SELECTION, this is the list of available options",
|
2634
|
-
)
|
2635
|
-
type_features: Optional[Dict[str, Any]] = Field(
|
2636
|
-
None,
|
2637
|
-
alias="typeFeatures",
|
2638
|
-
description="Additional features for the type handling",
|
2639
|
-
)
|
2640
|
-
path: Optional[str] = Field(None, description="The path to the node")
|
2641
|
-
multi_value: Optional[bool] = Field(
|
2642
|
-
None, alias="multiValue", description="Does this taxon allow multiple values"
|
2643
|
-
)
|
2644
|
-
user_editable: Optional[bool] = Field(
|
2645
|
-
None,
|
2646
|
-
alias="userEditable",
|
2647
|
-
description="Can the value of this taxon be edited by a user",
|
2648
|
-
)
|
2649
|
-
denormalize_to_children: Optional[bool] = Field(
|
2650
|
-
None,
|
2651
|
-
alias="denormalizeToChildren",
|
2652
|
-
description="Should the value of this taxon be denormalized to the children",
|
2653
|
-
)
|
2654
|
-
not_user_labelled: Optional[bool] = Field(
|
2655
|
-
None,
|
2656
|
-
alias="notUserLabelled",
|
2657
|
-
description="The taxon is not user labelled",
|
2658
|
-
)
|
2659
|
-
use_post_expression: Optional[bool] = Field(
|
2660
|
-
None, alias="usePostExpression", description="Use a post extraction expression"
|
2661
|
-
)
|
2662
|
-
post_expression: Optional[str] = Field(
|
2663
|
-
None,
|
2664
|
-
alias="postExpression",
|
2665
|
-
description="An expression that is applied post extraction of the data",
|
2666
|
-
)
|
2667
|
-
semantic_definition: Optional[str] = Field(
|
2668
|
-
None,
|
2669
|
-
alias="semanticDefinition",
|
2670
|
-
description="The semantic definition of the taxon",
|
2671
|
-
)
|
2672
|
-
examples: Optional[List[GuidanceTagResult]] = Field(
|
2673
|
-
None,
|
2674
|
-
description="A list of examples of the taxon values, used to understand the taxon",
|
2675
|
-
)
|
2676
|
-
|
2677
|
-
synonyms: Optional[List[str]] = Field(
|
2678
|
-
None,
|
2679
|
-
description="A list of synonyms of the taxon values, used to understand the taxon",
|
2654
|
+
semantic_definition: Optional[str] = Field(None, alias="semanticDefinition")
|
2655
|
+
synonyms: Optional[List[str]] = None
|
2656
|
+
lexical_relations: Optional[List[LexicalRelation]] = Field([], alias="lexicalRelations")
|
2657
|
+
addition_contexts: Optional[List[TaxonAdditionContext]] = Field([], alias="additionContexts")
|
2658
|
+
guide_properties: Optional[TaxonGuideProperties] = Field(None, alias="guideProperties")
|
2659
|
+
enabled: Optional[bool] = True
|
2660
|
+
color: Optional[str] = None
|
2661
|
+
children: Optional[List['Taxon']] = Field(default_factory=list)
|
2662
|
+
options: Optional[List[Any]] = Field(default_factory=list)
|
2663
|
+
node_types: Optional[List[str]] = Field(default_factory=list, alias="nodeTypes")
|
2664
|
+
taxon_type: Optional[TaxonType] = Field("STRING", alias="taxonType")
|
2665
|
+
selection_options: Optional[List[SelectionOption]] = Field(default_factory=list, alias="selectionOptions")
|
2666
|
+
type_features: Optional[Dict[str, Any]] = Field(default_factory=dict, alias="typeFeatures")
|
2667
|
+
properties: Optional[Dict[str, Any]] = Field(default_factory=dict)
|
2668
|
+
conditional_formats: Optional[List[TaxonConditionalFormat]] = Field(default_factory=list,
|
2669
|
+
alias="conditionalFormats")
|
2670
|
+
validation_rules: List[TaxonValidation] = Field(
|
2671
|
+
default_factory=list,
|
2672
|
+
description="The validation rules for the taxon"
|
2680
2673
|
)
|
2681
2674
|
|
2682
2675
|
cardinality: Optional[TaxonCardinality] = None
|
2676
|
+
path: Optional[str] = None
|
2677
|
+
multi_value: Optional[bool] = Field(True, alias="multiValue")
|
2678
|
+
user_editable: Optional[bool] = Field(True, alias="userEditable")
|
2679
|
+
use_post_expression: Optional[bool] = Field(False, alias="usePostExpression")
|
2680
|
+
post_expression: Optional[str] = Field(None, alias="postExpression")
|
2681
|
+
|
2682
|
+
def update_path(self, parent_path=""):
|
2683
|
+
self.path = parent_path + "/" + self.name if parent_path else self.name
|
2684
|
+
if self.children:
|
2685
|
+
for child in self.children:
|
2686
|
+
child.update_path(self.path)
|
2683
2687
|
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2690
|
-
|
2691
|
-
self.path = parent_path + self.name
|
2692
|
-
if self.children is not None:
|
2688
|
+
def find_taxon(self, *path_parts):
|
2689
|
+
if not path_parts:
|
2690
|
+
return None
|
2691
|
+
if self.name == path_parts[0] and len(path_parts) == 1:
|
2692
|
+
return self
|
2693
|
+
else:
|
2694
|
+
remaining_parts = path_parts[1:]
|
2693
2695
|
for child in self.children:
|
2694
|
-
child.
|
2696
|
+
hit = child.find_taxon(*remaining_parts)
|
2697
|
+
if hit:
|
2698
|
+
return hit
|
2699
|
+
return None
|
2700
|
+
|
2701
|
+
def groups(self):
|
2702
|
+
groups = []
|
2703
|
+
if self.group:
|
2704
|
+
groups.append(self)
|
2705
|
+
for child in self.children:
|
2706
|
+
groups.extend(child.groups())
|
2707
|
+
return groups
|
2708
|
+
|
2709
|
+
def all_groups(self):
|
2710
|
+
groups = []
|
2711
|
+
if self.group:
|
2712
|
+
groups.append(self)
|
2713
|
+
for child in self.children:
|
2714
|
+
groups.extend(child.all_groups())
|
2715
|
+
return groups
|
2716
|
+
|
2717
|
+
def get_simplified_structure(self):
|
2718
|
+
structure = {
|
2719
|
+
"label": self.label,
|
2720
|
+
"description": self.description,
|
2721
|
+
}
|
2722
|
+
if self.group:
|
2723
|
+
structure["group"] = True
|
2724
|
+
structure["path"] = self.path
|
2725
|
+
structure["children"] = [child.get_simplified_structure() for child in self.children]
|
2726
|
+
else:
|
2727
|
+
structure["group"] = False
|
2728
|
+
structure["tag"] = self.name
|
2729
|
+
structure["taxonType"] = self.taxon_type
|
2730
|
+
return structure
|
2695
2731
|
|
2696
2732
|
|
2697
2733
|
class ContentObject(BaseModel):
|
@@ -2881,6 +2917,59 @@ class Project(BaseModel):
|
|
2881
2917
|
options: Optional[ProjectOptions] = Field(None, alias="options")
|
2882
2918
|
|
2883
2919
|
|
2920
|
+
class TaskStatus(str, Enum):
|
2921
|
+
TODO = "TODO"
|
2922
|
+
IN_PROGRESS = "IN_PROGRESS"
|
2923
|
+
DONE = "DONE"
|
2924
|
+
|
2925
|
+
|
2926
|
+
class TaskCheckItem(BaseModel):
|
2927
|
+
model_config = ConfigDict(
|
2928
|
+
populate_by_name=True,
|
2929
|
+
use_enum_values=True,
|
2930
|
+
arbitrary_types_allowed=True,
|
2931
|
+
protected_namespaces=("model_config",),
|
2932
|
+
)
|
2933
|
+
|
2934
|
+
name: str
|
2935
|
+
description: Optional[str] = None
|
2936
|
+
taxon_path: Optional[str] = Field(None, alias="taxonPath")
|
2937
|
+
taxonomy_ref: Optional[str] = Field(None, alias="taxonomyRef")
|
2938
|
+
|
2939
|
+
|
2940
|
+
class TaskMetadata(BaseModel):
|
2941
|
+
model_config = ConfigDict(
|
2942
|
+
populate_by_name=True,
|
2943
|
+
use_enum_values=True,
|
2944
|
+
arbitrary_types_allowed=True,
|
2945
|
+
protected_namespaces=("model_config",),
|
2946
|
+
)
|
2947
|
+
|
2948
|
+
field_values: Dict[str, Any] = Field(default_factory=dict)
|
2949
|
+
fields: List[Option] = Field(default_factory=list)
|
2950
|
+
check_items: List[TaskCheckItem] = Field(default_factory=list)
|
2951
|
+
document_store_ref: Optional[str] = None
|
2952
|
+
|
2953
|
+
|
2954
|
+
class Task(BaseModel):
|
2955
|
+
model_config = ConfigDict(
|
2956
|
+
populate_by_name=True,
|
2957
|
+
use_enum_values=True,
|
2958
|
+
arbitrary_types_allowed=True,
|
2959
|
+
protected_namespaces=("model_config",),
|
2960
|
+
)
|
2961
|
+
|
2962
|
+
project: Optional['Project'] = Field(None)
|
2963
|
+
title: Optional[str] = Field(None)
|
2964
|
+
template: Optional[bool] = Field(None)
|
2965
|
+
description: Optional[str] = Field(None)
|
2966
|
+
metadata: Optional['TaskMetadata'] = Field(None)
|
2967
|
+
due_date: Optional[StandardDateTime] = Field(None, alias="dueDate")
|
2968
|
+
completed_date: Optional[StandardDateTime] = Field(None, alias="completedDate")
|
2969
|
+
status: Optional['TaskStatus'] = Field(None)
|
2970
|
+
assignee: Optional['User'] = Field(None)
|
2971
|
+
|
2972
|
+
|
2884
2973
|
class FeatureSet(BaseModel):
|
2885
2974
|
"""
|
2886
2975
|
|
@@ -3377,6 +3466,28 @@ class PageProject(BaseModel):
|
|
3377
3466
|
empty: Optional[bool] = None
|
3378
3467
|
|
3379
3468
|
|
3469
|
+
class PageRetainedGuidance(BaseModel):
|
3470
|
+
"""
|
3471
|
+
|
3472
|
+
"""
|
3473
|
+
model_config = ConfigDict(
|
3474
|
+
populate_by_name=True,
|
3475
|
+
use_enum_values=True,
|
3476
|
+
arbitrary_types_allowed=True,
|
3477
|
+
protected_namespaces=("model_config",),
|
3478
|
+
)
|
3479
|
+
total_pages: Optional[int] = Field(None, alias="totalPages")
|
3480
|
+
total_elements: Optional[int] = Field(None, alias="totalElements")
|
3481
|
+
size: Optional[int] = None
|
3482
|
+
content: Optional[List[RetainedGuidance]] = None
|
3483
|
+
number: Optional[int] = None
|
3484
|
+
|
3485
|
+
number_of_elements: Optional[int] = Field(None, alias="numberOfElements")
|
3486
|
+
first: Optional[bool] = None
|
3487
|
+
last: Optional[bool] = None
|
3488
|
+
empty: Optional[bool] = None
|
3489
|
+
|
3490
|
+
|
3380
3491
|
class PageAssistant(BaseModel):
|
3381
3492
|
"""
|
3382
3493
|
|
@@ -3443,6 +3554,28 @@ class PageMessage(BaseModel):
|
|
3443
3554
|
empty: Optional[bool] = None
|
3444
3555
|
|
3445
3556
|
|
3557
|
+
class PageTask(BaseModel):
|
3558
|
+
"""
|
3559
|
+
|
3560
|
+
"""
|
3561
|
+
model_config = ConfigDict(
|
3562
|
+
populate_by_name=True,
|
3563
|
+
use_enum_values=True,
|
3564
|
+
arbitrary_types_allowed=True,
|
3565
|
+
protected_namespaces=("model_config",),
|
3566
|
+
)
|
3567
|
+
total_pages: Optional[int] = Field(None, alias="totalPages")
|
3568
|
+
total_elements: Optional[int] = Field(None, alias="totalElements")
|
3569
|
+
size: Optional[int] = None
|
3570
|
+
content: Optional[List[Task]] = None
|
3571
|
+
number: Optional[int] = None
|
3572
|
+
|
3573
|
+
number_of_elements: Optional[int] = Field(None, alias="numberOfElements")
|
3574
|
+
first: Optional[bool] = None
|
3575
|
+
last: Optional[bool] = None
|
3576
|
+
empty: Optional[bool] = None
|
3577
|
+
|
3578
|
+
|
3446
3579
|
class PageChannel(BaseModel):
|
3447
3580
|
"""
|
3448
3581
|
|
@@ -3882,6 +4015,45 @@ class DocumentExternalData(BaseModel):
|
|
3882
4015
|
document_family: Optional[DocumentFamily] = Field(None, alias="documentFamily")
|
3883
4016
|
|
3884
4017
|
|
4018
|
+
class RetainedGuidance(BaseModel):
|
4019
|
+
model_config = ConfigDict(
|
4020
|
+
populate_by_name=True,
|
4021
|
+
use_enum_values=True,
|
4022
|
+
arbitrary_types_allowed=True,
|
4023
|
+
protected_namespaces=("model_config",),
|
4024
|
+
)
|
4025
|
+
id: Optional[str] = Field(None)
|
4026
|
+
uuid: Optional[str] = None
|
4027
|
+
change_sequence: Optional[int] = Field(None, alias="changeSequence")
|
4028
|
+
created_on: Optional[StandardDateTime] = Field(None, alias="createdOn")
|
4029
|
+
updated_on: Optional[StandardDateTime] = Field(None, alias="updatedOn")
|
4030
|
+
guidance_embeddings: List["GuidanceEmbedding"] = Field(default_factory=list, alias="guidanceEmbeddings")
|
4031
|
+
guidance_set_ref: str = Field(..., alias="guidanceSetRef")
|
4032
|
+
guidance_type: Optional[str] = Field(None, alias="guidanceType")
|
4033
|
+
guidance_key: Optional[str] = Field(None, alias="guidanceKey")
|
4034
|
+
taxonomy_ref: Optional[str] = Field(None, alias="taxonomyRef")
|
4035
|
+
taxon_path: Optional[str] = Field(None, alias="taxonPath")
|
4036
|
+
document_family_id: Optional[str] = Field(None, alias="documentFamilyId")
|
4037
|
+
guidance_text: Optional[str] = Field(None, alias="guidanceText")
|
4038
|
+
summary: Optional[str] = None
|
4039
|
+
guidance_response: Dict[str, Any] = Field(default_factory=dict, alias="guidanceResponse")
|
4040
|
+
legacy_guidance: Optional[Guidance] = Field(None, alias="legacyGuidance")
|
4041
|
+
active: bool = True
|
4042
|
+
taxon_snapshots: List[Taxon] = Field(default_factory=list, alias="taxonSnapshots")
|
4043
|
+
|
4044
|
+
|
4045
|
+
class GuidanceEmbedding(BaseModel):
|
4046
|
+
model_config = ConfigDict(
|
4047
|
+
populate_by_name=True,
|
4048
|
+
use_enum_values=True,
|
4049
|
+
arbitrary_types_allowed=True,
|
4050
|
+
protected_namespaces=("model_config",),
|
4051
|
+
)
|
4052
|
+
|
4053
|
+
retained_guidance: Optional[RetainedGuidance] = Field(None, alias="retainedGuidance")
|
4054
|
+
# Add other fields as needed
|
4055
|
+
|
4056
|
+
|
3885
4057
|
class DocumentFamily(BaseModel):
|
3886
4058
|
"""
|
3887
4059
|
|
@@ -3964,6 +4136,11 @@ class DocumentFamily(BaseModel):
|
|
3964
4136
|
description="The statistics about the labels in the document family",
|
3965
4137
|
)
|
3966
4138
|
|
4139
|
+
guidance: Optional[bool] = Field(
|
4140
|
+
None,
|
4141
|
+
description="Indicates whether guidance is available for this document family",
|
4142
|
+
)
|
4143
|
+
|
3967
4144
|
|
3968
4145
|
class DocumentFamilyStatistics(BaseModel):
|
3969
4146
|
"""
|
@@ -4341,39 +4518,86 @@ class UserSelection(BaseModel):
|
|
4341
4518
|
line_uuid: Optional[str] = Field(None, alias="lineUuid")
|
4342
4519
|
|
4343
4520
|
|
4521
|
+
class GuidanceRelationEmbedding(BaseModel):
|
4522
|
+
|
4523
|
+
model_config = ConfigDict(
|
4524
|
+
populate_by_name=True,
|
4525
|
+
use_enum_values=True,
|
4526
|
+
arbitrary_types_allowed=True,
|
4527
|
+
protected_namespaces=("model_config",),
|
4528
|
+
)
|
4529
|
+
|
4530
|
+
relation: Optional[str] = None
|
4531
|
+
model_id: Optional[str] = Field(None, alias="modelId")
|
4532
|
+
embedding: Optional[List[float]] = None
|
4533
|
+
|
4534
|
+
|
4344
4535
|
class Guidance(BaseModel):
|
4345
4536
|
id: Optional[str] = Field(None, description="The ID of the guidance")
|
4346
4537
|
name: Optional[str] = None
|
4347
4538
|
guidance_type: Optional[str] = Field(None, alias="guidanceType")
|
4539
|
+
guidance_key: Optional[str] = Field(None, alias="guidanceKey")
|
4348
4540
|
taxonomy_ref: Optional[str] = Field(None, alias="taxonomyRef")
|
4541
|
+
taxon_path: Optional[str] = Field(None, alias="taxonPath")
|
4542
|
+
document_family_id: Optional[str] = Field(None, alias="documentFamilyId")
|
4349
4543
|
document_name: Optional[str] = Field(None, alias="documentName")
|
4350
|
-
document_type: Optional[str] = Field(None, alias="documentType")
|
4351
4544
|
document_page: Optional[int] = Field(None, alias="documentPage")
|
4352
|
-
|
4353
|
-
|
4354
|
-
|
4355
|
-
|
4545
|
+
guidance_text: Optional[str] = Field(None, alias="guidanceText")
|
4546
|
+
relation_embeddings: Optional[List[GuidanceRelationEmbedding]] = Field([], alias="relationEmbeddings")
|
4547
|
+
summary: Optional[str] = None
|
4548
|
+
guidance_response: Optional[Dict[str, Any]] = Field(None, alias="guidanceResponse")
|
4549
|
+
active: Optional[bool] = True
|
4356
4550
|
applicable_tags: Optional[List[str]] = Field(None, alias="applicableTags")
|
4551
|
+
required_tags: Optional[List[str]] = Field(None, alias="requiredTags")
|
4357
4552
|
priority: Optional[int] = 1
|
4358
4553
|
user_instructions: Optional[str] = Field(None, alias="userInstructions")
|
4359
4554
|
user_instructions_properties: Optional[Dict[str, Any]] = Field(None, alias="userInstructionsProperties")
|
4555
|
+
user_id: Optional[str] = Field(None, alias="userId")
|
4360
4556
|
created: Optional[StandardDateTime] = None
|
4361
4557
|
updated: Optional[StandardDateTime] = None
|
4362
|
-
userId: Optional[str] = Field(None, alias="userId")
|
4363
|
-
|
4364
|
-
# users selected text, text and line_uuid
|
4365
4558
|
user_selection: Optional[List[UserSelection]] = Field(None, alias="userSelection")
|
4366
|
-
|
4367
4559
|
compiled_guidance: Optional[Dict[str, Any]] = Field(None, alias="compiledGuidance")
|
4368
|
-
|
4369
4560
|
guidance_options: Optional[List[Option]] = Field(None, alias="guidanceOptions")
|
4370
4561
|
|
4371
4562
|
|
4563
|
+
class GuidanceEmbeddingType(Enum):
|
4564
|
+
SUMMARY = "SUMMARY"
|
4565
|
+
CONTENT = "CONTENT"
|
4566
|
+
TFIDF = "TFIDF"
|
4567
|
+
|
4568
|
+
|
4569
|
+
class GuidanceSetStorage(BaseModel):
|
4570
|
+
model_config = ConfigDict(
|
4571
|
+
populate_by_name=True,
|
4572
|
+
use_enum_values=True,
|
4573
|
+
arbitrary_types_allowed=True,
|
4574
|
+
protected_namespaces=("model_config",),
|
4575
|
+
)
|
4576
|
+
|
4577
|
+
summarize_model_id: Optional[str] = Field(None, alias="summarizeModelId")
|
4578
|
+
summarize_prompt: Optional[str] = Field(None, alias="summarizePrompt")
|
4579
|
+
embedding_model_id: Optional[str] = Field(None, alias="embeddingModelId")
|
4580
|
+
embedding_types: List[GuidanceEmbeddingType] = Field(default_factory=list, alias="embeddingTypes")
|
4581
|
+
|
4582
|
+
|
4372
4583
|
class GuidanceSet(ExtensionPackProvided):
|
4373
4584
|
"""
|
4374
|
-
|
4585
|
+
A guidance set is a list of guidance objects that can be applied to a taxonomy
|
4375
4586
|
"""
|
4376
|
-
|
4587
|
+
model_config = ConfigDict(
|
4588
|
+
populate_by_name=True,
|
4589
|
+
use_enum_values=True,
|
4590
|
+
arbitrary_types_allowed=True,
|
4591
|
+
protected_namespaces=("model_config",),
|
4592
|
+
)
|
4593
|
+
|
4594
|
+
active_store: bool = Field(False, alias="activeStore",
|
4595
|
+
description="If true, allows guidance to be stored through the API")
|
4596
|
+
storage: GuidanceSetStorage = Field(default_factory=GuidanceSetStorage)
|
4597
|
+
guidance: List[Guidance] = Field(default_factory=list, description="The guidance in the set")
|
4598
|
+
|
4599
|
+
def get_type(self) -> str:
|
4600
|
+
return "guidance"
|
4377
4601
|
|
4378
4602
|
|
4379
4603
|
class PageGuidanceSet(BaseModel):
|
@@ -5059,10 +5283,6 @@ class ModelContentMetadata(BaseModel):
|
|
5059
5283
|
None, alias="eventAware", description="Is this model event aware"
|
5060
5284
|
)
|
5061
5285
|
|
5062
|
-
atomic: Optional[bool] = Field(
|
5063
|
-
None, description="Is the model uploaded/downloaded atomically"
|
5064
|
-
)
|
5065
|
-
|
5066
5286
|
use_implementation_from_template: Optional[bool] = Field(
|
5067
5287
|
None,
|
5068
5288
|
alias="useImplementationFromTemplate",
|
@@ -5448,6 +5668,11 @@ class Taxonomy(ExtensionPackProvided):
|
|
5448
5668
|
alias="totalTaxons",
|
5449
5669
|
description="The total number of taxons in the taxonomy",
|
5450
5670
|
)
|
5671
|
+
external_data_taxonomy_refs: Optional[list[str]] = Field(
|
5672
|
+
None,
|
5673
|
+
alias="externalDataTaxonomyRefs",
|
5674
|
+
description="A list of references to an external data taxonomy",
|
5675
|
+
)
|
5451
5676
|
|
5452
5677
|
def update_paths(self):
|
5453
5678
|
for taxon in self.taxons:
|