kodexa 7.0.1a10177063353__py3-none-any.whl → 7.0.1a11918232720__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/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 Any, Dict, List, Optional, Union
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
- showSearch: Optional[bool] = Field(
709
- None, description="Show search in store", alias="showSearch"
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, set=True)
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 DocumentMetadataDefaults(BaseModel):
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
- document_metadata_properties: Optional[List[DocumentMetadataProperty]] = Field(
2283
- None, alias="documentMetadataProperties"
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):
@@ -2402,7 +2420,6 @@ class Option(BaseModel):
2402
2420
  show_on_popup: Optional[bool] = Field(None, alias="showOnPopup")
2403
2421
  possible_values: Optional[List[PossibleValue]] = Field(None, alias="possibleValues")
2404
2422
  properties: Optional[Dict[str, Any]] = None
2405
- label_on_error: Optional[str] = None
2406
2423
 
2407
2424
 
2408
2425
  class Overlay(BaseModel):
@@ -2508,7 +2525,74 @@ class ProjectAssistant(BaseModel):
2508
2525
  assistant_role: Optional[str] = Field(None, alias="assistantRole")
2509
2526
 
2510
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
+
2511
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
+
2512
2596
  model_config = ConfigDict(
2513
2597
  populate_by_name=True,
2514
2598
  use_enum_values=True,
@@ -2516,183 +2600,134 @@ class TaxonConditionalFormat(BaseModel):
2516
2600
  protected_namespaces=("model_config",),
2517
2601
  )
2518
2602
 
2519
- type: Optional[str] = None
2520
- condition: Optional[str] = None
2521
- properties: Optional[Dict[str, Any]] = Field(default_factory=dict)
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
2522
2611
 
2523
2612
 
2524
- class TaxonCardinality(Enum):
2525
- once_per_document = "ONCE_PER_DOCUMENT"
2526
- multiple_per_document = "MULTIPLE_PER_DOCUMENT"
2527
- once_per_segment = "ONCE_PER_SEGMENT"
2528
- multiple_per_segment = "MULTIPLE_PER_SEGMENT"
2613
+ class DocumentTaxonValidation(BaseModel):
2529
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
+ )
2530
2621
 
2531
- class Taxon(BaseModel):
2532
- """
2622
+ taxonomy_ref: Optional[str] = Field(None, alias="taxonomyRef")
2623
+ taxon_path: Optional[str] = Field(None, alias="taxonPath")
2624
+ validation: Optional[TaxonValidation] = None
2533
2625
 
2534
- """
2626
+
2627
+ class Taxon(BaseModel):
2535
2628
  model_config = ConfigDict(
2536
2629
  populate_by_name=True,
2537
2630
  use_enum_values=True,
2538
2631
  arbitrary_types_allowed=True,
2539
2632
  protected_namespaces=("model_config",),
2540
2633
  )
2541
- """
2542
- A taxon is an individual label within a taxonomy
2543
- """
2544
2634
 
2545
- id: Optional[str] = Field(None, description="The ID of the taxon")
2546
- label: Optional[str] = Field(None, description="The text to display for this taxon")
2547
- generate_name: Optional[bool] = Field(
2548
- None,
2549
- alias="generateName",
2550
- description="Is the name generated, this allows that you can change displays without impacted existing content",
2551
- )
2552
- group: Optional[bool] = Field(
2553
- None,
2554
- description="Is this taxon a group, and therefore can't have a value, can only have children",
2555
- )
2556
- name: str = Field(
2557
- ..., description="The name to be used", pattern=r"^[a-zA-Z0-9\-_]{0,255}$"
2558
- )
2559
- external_name: Optional[str] = Field(
2560
- None,
2561
- alias="externalName",
2562
- description="The name to be used when we are publishing this taxon to external systems",
2563
- )
2564
- value_path: Optional[ValuePath] = Field(
2565
- None,
2566
- alias="valuePath",
2567
- description="Where to get the value for this taxon when extracting",
2568
- )
2569
- metadata_value: Optional[MetadataValue] = Field(
2570
- None,
2571
- alias="metadataValue",
2572
- description="If the type is metadata this will be the metadata option",
2573
- )
2574
- data_path: Optional[str] = Field(
2575
- None,
2576
- alias="dataPath",
2577
- description="The path to the data, based on the data inside the label (tag) within the document",
2578
- )
2579
- expression: Optional[str] = Field(
2580
- None,
2581
- description="If the taxon is based on expression, this is the expression based on the available objects",
2582
- )
2583
- enable_fallback_expression: Optional[bool] = Field(
2584
- None,
2585
- alias="enableFallbackExpression",
2586
- description="Allow for the use of a fallback expression if the taxon wasn't found",
2587
- )
2588
- fallback_expression: Optional[str] = Field(
2589
- None,
2590
- alias="fallbackExpression",
2591
- description="Fallback expression if enabled, this is the expression based on the available objects",
2592
- )
2593
- nullable: Optional[bool] = Field(
2594
- None, description="Determine if the value of the taxon can be null (unknown)"
2595
- )
2596
- null_value: Optional[str] = Field(
2597
- None,
2598
- alias="nullValue",
2599
- description="Allows the setting of a value to replace null if the taxon is nullable",
2600
- )
2601
- 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
2602
2653
  overview_markdown: Optional[str] = Field(None, alias="overviewMarkdown")
2603
- enabled: Optional[bool] = Field(
2604
- None, description="Is the taxon enabled (used in the UI)"
2605
- )
2606
- color: Optional[str] = Field(
2607
- None, description="Hex encoding of the color to use for the taxon"
2608
- )
2609
- children: Optional[List[Taxon]] = Field(
2610
- None, description="The children under this taxon"
2611
- )
2612
- options: Optional[List[Option]] = Field(
2613
- None,
2614
- description="Options that can be shown for the taxon (usually used in assistant taxonomies)",
2615
- )
2616
- related_taxons: Optional[List[RelatedTaxon]] = Field(
2617
- None,
2618
- alias="relatedTaxons",
2619
- description="A list of relationships to other taxons and the purpose of the relationship",
2620
- )
2621
- node_types: Optional[List[str]] = Field(
2622
- None,
2623
- alias="nodeTypes",
2624
- description="A list of the node types that this taxon applies to (empty means everything), used in the UI",
2625
- )
2626
- taxon_type: Optional[TaxonType] = Field(
2627
- None,
2628
- alias="taxonType",
2629
- description="Expected data type to coalesce to (defaults to STRING)",
2630
- )
2631
- selection_options: Optional[List[SelectionOption]] = Field(
2632
- None,
2633
- alias="selectionOptions",
2634
- description="If data type is SELECTION, this is the list of available options",
2635
- )
2636
- type_features: Optional[Dict[str, Any]] = Field(
2637
- None,
2638
- alias="typeFeatures",
2639
- description="Additional features for the type handling",
2640
- )
2641
- path: Optional[str] = Field(None, description="The path to the node")
2642
- multi_value: Optional[bool] = Field(
2643
- None, alias="multiValue", description="Does this taxon allow multiple values"
2644
- )
2645
- user_editable: Optional[bool] = Field(
2646
- None,
2647
- alias="userEditable",
2648
- description="Can the value of this taxon be edited by a user",
2649
- )
2650
- denormalize_to_children: Optional[bool] = Field(
2651
- None,
2652
- alias="denormalizeToChildren",
2653
- description="Should the value of this taxon be denormalized to the children",
2654
- )
2655
- not_user_labelled: Optional[bool] = Field(
2656
- None,
2657
- alias="notUserLabelled",
2658
- description="The taxon is not user labelled",
2659
- )
2660
- use_post_expression: Optional[bool] = Field(
2661
- None, alias="usePostExpression", description="Use a post extraction expression"
2662
- )
2663
- post_expression: Optional[str] = Field(
2664
- None,
2665
- alias="postExpression",
2666
- description="An expression that is applied post extraction of the data",
2667
- )
2668
- semantic_definition: Optional[str] = Field(
2669
- None,
2670
- alias="semanticDefinition",
2671
- description="The semantic definition of the taxon",
2672
- )
2673
- examples: Optional[List[GuidanceTagResult]] = Field(
2674
- None,
2675
- description="A list of examples of the taxon values, used to understand the taxon",
2676
- )
2677
-
2678
- synonyms: Optional[List[str]] = Field(
2679
- None,
2680
- 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"
2681
2673
  )
2682
2674
 
2683
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)
2684
2687
 
2685
- conditional_formats: Optional[List[TaxonConditionalFormat]] = Field(None, alias="conditionalFormats")
2686
-
2687
- checklist_definitions: Optional[List[ChecklistDefinition]] = Field(None, alias="checklistDefinitions")
2688
-
2689
- def update_path(self, parent_path=None):
2690
- if parent_path is None:
2691
- parent_path = ""
2692
- self.path = parent_path + self.name
2693
- 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:]
2694
2695
  for child in self.children:
2695
- child.update_path(self.path + "/")
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
2696
2731
 
2697
2732
 
2698
2733
  class ContentObject(BaseModel):
@@ -2882,6 +2917,59 @@ class Project(BaseModel):
2882
2917
  options: Optional[ProjectOptions] = Field(None, alias="options")
2883
2918
 
2884
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
+
2885
2973
  class FeatureSet(BaseModel):
2886
2974
  """
2887
2975
 
@@ -3378,6 +3466,28 @@ class PageProject(BaseModel):
3378
3466
  empty: Optional[bool] = None
3379
3467
 
3380
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
+
3381
3491
  class PageAssistant(BaseModel):
3382
3492
  """
3383
3493
 
@@ -3444,6 +3554,28 @@ class PageMessage(BaseModel):
3444
3554
  empty: Optional[bool] = None
3445
3555
 
3446
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
+
3447
3579
  class PageChannel(BaseModel):
3448
3580
  """
3449
3581
 
@@ -3883,6 +4015,45 @@ class DocumentExternalData(BaseModel):
3883
4015
  document_family: Optional[DocumentFamily] = Field(None, alias="documentFamily")
3884
4016
 
3885
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
+
3886
4057
  class DocumentFamily(BaseModel):
3887
4058
  """
3888
4059
 
@@ -3965,6 +4136,11 @@ class DocumentFamily(BaseModel):
3965
4136
  description="The statistics about the labels in the document family",
3966
4137
  )
3967
4138
 
4139
+ guidance: Optional[bool] = Field(
4140
+ None,
4141
+ description="Indicates whether guidance is available for this document family",
4142
+ )
4143
+
3968
4144
 
3969
4145
  class DocumentFamilyStatistics(BaseModel):
3970
4146
  """
@@ -4342,39 +4518,86 @@ class UserSelection(BaseModel):
4342
4518
  line_uuid: Optional[str] = Field(None, alias="lineUuid")
4343
4519
 
4344
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
+
4345
4535
  class Guidance(BaseModel):
4346
4536
  id: Optional[str] = Field(None, description="The ID of the guidance")
4347
4537
  name: Optional[str] = None
4348
4538
  guidance_type: Optional[str] = Field(None, alias="guidanceType")
4539
+ guidance_key: Optional[str] = Field(None, alias="guidanceKey")
4349
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")
4350
4543
  document_name: Optional[str] = Field(None, alias="documentName")
4351
- document_type: Optional[str] = Field(None, alias="documentType")
4352
4544
  document_page: Optional[int] = Field(None, alias="documentPage")
4353
- sample_text: Optional[str] = Field(None, alias="sampleText")
4354
- sample_result: Optional[Dict[str, List[GuidanceTagResult]]] = Field(None, alias="sampleResult")
4355
- section_markers: Optional[List[GuidanceTagResult]] = Field(None, alias="sectionMarkers")
4356
- active: Optional[bool] = None
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
4357
4550
  applicable_tags: Optional[List[str]] = Field(None, alias="applicableTags")
4551
+ required_tags: Optional[List[str]] = Field(None, alias="requiredTags")
4358
4552
  priority: Optional[int] = 1
4359
4553
  user_instructions: Optional[str] = Field(None, alias="userInstructions")
4360
4554
  user_instructions_properties: Optional[Dict[str, Any]] = Field(None, alias="userInstructionsProperties")
4555
+ user_id: Optional[str] = Field(None, alias="userId")
4361
4556
  created: Optional[StandardDateTime] = None
4362
4557
  updated: Optional[StandardDateTime] = None
4363
- userId: Optional[str] = Field(None, alias="userId")
4364
-
4365
- # users selected text, text and line_uuid
4366
4558
  user_selection: Optional[List[UserSelection]] = Field(None, alias="userSelection")
4367
-
4368
4559
  compiled_guidance: Optional[Dict[str, Any]] = Field(None, alias="compiledGuidance")
4369
-
4370
4560
  guidance_options: Optional[List[Option]] = Field(None, alias="guidanceOptions")
4371
4561
 
4372
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
+
4373
4583
  class GuidanceSet(ExtensionPackProvided):
4374
4584
  """
4375
-
4585
+ A guidance set is a list of guidance objects that can be applied to a taxonomy
4376
4586
  """
4377
- guidance: List[Guidance] = Field(None, description="The guidance in the set")
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"
4378
4601
 
4379
4602
 
4380
4603
  class PageGuidanceSet(BaseModel):
@@ -5060,10 +5283,6 @@ class ModelContentMetadata(BaseModel):
5060
5283
  None, alias="eventAware", description="Is this model event aware"
5061
5284
  )
5062
5285
 
5063
- atomic: Optional[bool] = Field(
5064
- None, description="Is the model uploaded/downloaded atomically"
5065
- )
5066
-
5067
5286
  use_implementation_from_template: Optional[bool] = Field(
5068
5287
  None,
5069
5288
  alias="useImplementationFromTemplate",
@@ -5449,6 +5668,11 @@ class Taxonomy(ExtensionPackProvided):
5449
5668
  alias="totalTaxons",
5450
5669
  description="The total number of taxons in the taxonomy",
5451
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
+ )
5452
5676
 
5453
5677
  def update_paths(self):
5454
5678
  for taxon in self.taxons: