kodexa 7.0.11219398096__tar.gz → 7.0.11233302476__tar.gz

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.
Files changed (48) hide show
  1. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/PKG-INFO +1 -1
  2. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/model/objects.py +67 -5
  3. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/platform/client.py +81 -3
  4. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/pyproject.toml +1 -1
  5. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/LICENSE +0 -0
  6. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/README.md +0 -0
  7. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/__init__.py +0 -0
  8. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/assistant/__init__.py +0 -0
  9. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/assistant/assistant.py +0 -0
  10. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/connectors/__init__.py +0 -0
  11. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/connectors/connectors.py +0 -0
  12. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/dataclasses/__init__.py +0 -0
  13. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/dataclasses/templates/llm_data_class.j2 +0 -0
  14. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/model/__init__.py +0 -0
  15. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/model/base.py +0 -0
  16. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/model/entities/__init__.py +0 -0
  17. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/model/entities/check_response.py +0 -0
  18. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/model/entities/product.py +0 -0
  19. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/model/entities/product_subscription.py +0 -0
  20. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/model/model.py +0 -0
  21. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/model/persistence.py +0 -0
  22. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/pipeline/__init__.py +0 -0
  23. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/pipeline/pipeline.py +0 -0
  24. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/platform/__init__.py +0 -0
  25. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/platform/interaction.py +0 -0
  26. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/platform/kodexa.py +0 -0
  27. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/__init__.py +0 -0
  28. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/ast.py +0 -0
  29. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/core.py +0 -0
  30. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/lexrules.py +0 -0
  31. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/lextab.py +0 -0
  32. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/lextab.pyi +0 -0
  33. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/parserules.py +0 -0
  34. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/parserules.pyi +0 -0
  35. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/parsetab.py +0 -0
  36. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/selectors/parsetab.pyi +0 -0
  37. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/spatial/__init__.py +0 -0
  38. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/spatial/azure_models.py +0 -0
  39. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/spatial/bbox_common.py +0 -0
  40. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/spatial/table_form_common.py +0 -0
  41. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/steps/__init__.py +0 -0
  42. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/steps/common.py +0 -0
  43. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/testing/__init__.py +0 -0
  44. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/testing/test_components.py +0 -0
  45. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/testing/test_utils.py +0 -0
  46. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/training/__init__.py +0 -0
  47. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/training/train_utils.py +0 -0
  48. {kodexa-7.0.11219398096 → kodexa-7.0.11233302476}/kodexa/utils/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kodexa
3
- Version: 7.0.11219398096
3
+ Version: 7.0.11233302476
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -1,8 +1,9 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import Union, Set
4
3
  from enum import Enum
5
4
  from typing import Optional, List, Dict, Any
5
+ from typing import Union
6
+
6
7
  from pydantic import AnyUrl, Field, RootModel, BaseModel, ConfigDict
7
8
 
8
9
  from kodexa.model.base import StandardDateTime
@@ -2550,6 +2551,7 @@ class TaxonCardinality(Enum):
2550
2551
  ONCE_PER_SEGMENT = "ONCE_PER_SEGMENT"
2551
2552
  MULTIPLE_PER_SEGMENT = "MULTIPLE_PER_SEGMENT"
2552
2553
 
2554
+
2553
2555
  class TaxonAdditionContextType(str, Enum):
2554
2556
  RECORD_DEFINITION = "RECORD_DEFINITION"
2555
2557
  RECORD_SECTION_STARTER_MARKER = "RECORD_SECTION_STARTER_MARKER"
@@ -2557,6 +2559,7 @@ class TaxonAdditionContextType(str, Enum):
2557
2559
  RECORD_START_MARKER = "RECORD_START_MARKER"
2558
2560
  RECORD_END_MARKER = "RECORD_END_MARKER"
2559
2561
 
2562
+
2560
2563
  class TaxonAdditionContext(BaseModel):
2561
2564
  type: TaxonAdditionContextType
2562
2565
  context: str
@@ -2881,7 +2884,6 @@ class TaskStatus(str, Enum):
2881
2884
 
2882
2885
 
2883
2886
  class TaskCheckItem(BaseModel):
2884
-
2885
2887
  model_config = ConfigDict(
2886
2888
  populate_by_name=True,
2887
2889
  use_enum_values=True,
@@ -2896,7 +2898,6 @@ class TaskCheckItem(BaseModel):
2896
2898
 
2897
2899
 
2898
2900
  class TaskMetadata(BaseModel):
2899
-
2900
2901
  model_config = ConfigDict(
2901
2902
  populate_by_name=True,
2902
2903
  use_enum_values=True,
@@ -2911,7 +2912,6 @@ class TaskMetadata(BaseModel):
2911
2912
 
2912
2913
 
2913
2914
  class Task(BaseModel):
2914
-
2915
2915
  model_config = ConfigDict(
2916
2916
  populate_by_name=True,
2917
2917
  use_enum_values=True,
@@ -3426,6 +3426,28 @@ class PageProject(BaseModel):
3426
3426
  empty: Optional[bool] = None
3427
3427
 
3428
3428
 
3429
+ class PageRetainedGuidance(BaseModel):
3430
+ """
3431
+
3432
+ """
3433
+ model_config = ConfigDict(
3434
+ populate_by_name=True,
3435
+ use_enum_values=True,
3436
+ arbitrary_types_allowed=True,
3437
+ protected_namespaces=("model_config",),
3438
+ )
3439
+ total_pages: Optional[int] = Field(None, alias="totalPages")
3440
+ total_elements: Optional[int] = Field(None, alias="totalElements")
3441
+ size: Optional[int] = None
3442
+ content: Optional[List[RetainedGuidance]] = None
3443
+ number: Optional[int] = None
3444
+
3445
+ number_of_elements: Optional[int] = Field(None, alias="numberOfElements")
3446
+ first: Optional[bool] = None
3447
+ last: Optional[bool] = None
3448
+ empty: Optional[bool] = None
3449
+
3450
+
3429
3451
  class PageAssistant(BaseModel):
3430
3452
  """
3431
3453
 
@@ -3952,6 +3974,42 @@ class DocumentExternalData(BaseModel):
3952
3974
  external_data: Optional[Dict[str, Any]] = Field(None, alias="externalData")
3953
3975
  document_family: Optional[DocumentFamily] = Field(None, alias="documentFamily")
3954
3976
 
3977
+
3978
+ class RetainedGuidance(BaseModel):
3979
+ model_config = ConfigDict(
3980
+ populate_by_name=True,
3981
+ use_enum_values=True,
3982
+ arbitrary_types_allowed=True,
3983
+ protected_namespaces=("model_config",),
3984
+ )
3985
+
3986
+ guidance_embeddings: List["GuidanceEmbedding"] = Field(default_factory=list, alias="guidanceEmbeddings")
3987
+ guidance_set_ref: str = Field(..., alias="guidanceSetRef")
3988
+ guidance_type: Optional[str] = Field(None, alias="guidanceType")
3989
+ guidance_key: Optional[str] = Field(None, alias="guidanceKey")
3990
+ taxonomy_ref: Optional[str] = Field(None, alias="taxonomyRef")
3991
+ taxon_path: Optional[str] = Field(None, alias="taxonPath")
3992
+ document_family_id: Optional[str] = Field(None, alias="documentFamilyId")
3993
+ guidance_text: Optional[str] = Field(None, alias="guidanceText")
3994
+ summary: Optional[str] = None
3995
+ guidance_response: Dict[str, Any] = Field(default_factory=dict, alias="guidanceResponse")
3996
+ legacy_guidance: Optional[Guidance] = Field(None, alias="legacyGuidance")
3997
+ active: bool = True
3998
+ taxon_snapshots: List[Taxon] = Field(default_factory=list, alias="taxonSnapshots")
3999
+
4000
+
4001
+ class GuidanceEmbedding(BaseModel):
4002
+ model_config = ConfigDict(
4003
+ populate_by_name=True,
4004
+ use_enum_values=True,
4005
+ arbitrary_types_allowed=True,
4006
+ protected_namespaces=("model_config",),
4007
+ )
4008
+
4009
+ retained_guidance: Optional[RetainedGuidance] = Field(None, alias="retainedGuidance")
4010
+ # Add other fields as needed
4011
+
4012
+
3955
4013
  class DocumentFamily(BaseModel):
3956
4014
  """
3957
4015
 
@@ -4039,6 +4097,7 @@ class DocumentFamily(BaseModel):
4039
4097
  description="Indicates whether guidance is available for this document family",
4040
4098
  )
4041
4099
 
4100
+
4042
4101
  class DocumentFamilyStatistics(BaseModel):
4043
4102
  """
4044
4103
 
@@ -4454,6 +4513,7 @@ class GuidanceEmbeddingType(Enum):
4454
4513
  CONTENT = "CONTENT"
4455
4514
  TFIDF = "TFIDF"
4456
4515
 
4516
+
4457
4517
  class GuidanceSetStorage(BaseModel):
4458
4518
  model_config = ConfigDict(
4459
4519
  populate_by_name=True,
@@ -4467,6 +4527,7 @@ class GuidanceSetStorage(BaseModel):
4467
4527
  embedding_model_id: Optional[str] = Field(None, alias="embeddingModelId")
4468
4528
  embedding_types: List[GuidanceEmbeddingType] = Field(default_factory=list, alias="embeddingTypes")
4469
4529
 
4530
+
4470
4531
  class GuidanceSet(ExtensionPackProvided):
4471
4532
  """
4472
4533
  A guidance set is a list of guidance objects that can be applied to a taxonomy
@@ -4478,7 +4539,8 @@ class GuidanceSet(ExtensionPackProvided):
4478
4539
  protected_namespaces=("model_config",),
4479
4540
  )
4480
4541
 
4481
- active_store: bool = Field(False, alias="activeStore", description="If true, allows guidance to be stored through the API")
4542
+ active_store: bool = Field(False, alias="activeStore",
4543
+ description="If true, allows guidance to be stored through the API")
4482
4544
  storage: GuidanceSetStorage = Field(default_factory=GuidanceSetStorage)
4483
4545
  guidance: List[Guidance] = Field(default_factory=list, description="The guidance in the set")
4484
4546
 
@@ -86,7 +86,7 @@ from kodexa.model.objects import (
86
86
  PageExtensionPack,
87
87
  PageOrganization,
88
88
  DocumentFamilyStatistics, MessageContext, PagePrompt, Prompt, GuidanceSet, PageGuidanceSet, DocumentEmbedding,
89
- DocumentExternalData, Task, PageTask,
89
+ DocumentExternalData, Task, PageTask, RetainedGuidance, PageRetainedGuidance,
90
90
  )
91
91
 
92
92
  logger = logging.getLogger()
@@ -1178,6 +1178,30 @@ class PageTaskEndpoint(PageTask, PageEndpoint):
1178
1178
  return "task"
1179
1179
 
1180
1180
 
1181
+ class PageRetainedGuidanceEndpoint(PageRetainedGuidance, PageEndpoint):
1182
+ """Represents a page retained guidance endpoint.
1183
+
1184
+ This class is used to represent a page retained guidance endpoint which is a
1185
+ combination of a page retained guidance and a page endpoint.
1186
+
1187
+ Attributes:
1188
+ None
1189
+ """
1190
+
1191
+ """Represents a page retained guidance endpoint"""
1192
+
1193
+ def get_type(self) -> Optional[str]:
1194
+ """Get the type of the endpoint.
1195
+
1196
+ This method is used to get the type of the endpoint. In this case,
1197
+ it will always return "retainedGuidance".
1198
+
1199
+ Returns:
1200
+ str: The type of the endpoint, which is "retainedGuidance".
1201
+ """
1202
+ return "retainedGuidance"
1203
+
1204
+
1181
1205
  class PageProjectEndpoint(PageProject, PageEndpoint):
1182
1206
  """Represents a page project endpoint.
1183
1207
 
@@ -2521,11 +2545,13 @@ class WorkspaceEndpoint(EntityEndpoint, Workspace):
2521
2545
  else:
2522
2546
  raise ValueError("Workspace has no channel")
2523
2547
 
2548
+
2524
2549
  class TaskEndpoint(EntityEndpoint, Task):
2525
2550
  """Represents a task endpoint.
2526
2551
 
2527
2552
  This class is used to interact with the task endpoint of the API.
2528
2553
  """
2554
+
2529
2555
  def get_type(self) -> str:
2530
2556
  """Get the type of the endpoint.
2531
2557
 
@@ -2535,11 +2561,27 @@ class TaskEndpoint(EntityEndpoint, Task):
2535
2561
  return "tasks"
2536
2562
 
2537
2563
 
2564
+ class RetainedGuidanceEndpoint(EntityEndpoint, RetainedGuidance):
2565
+ """Represents a retained guidance endpoint.
2566
+
2567
+ This class is used to interact with the retained guidance endpoint of the API.
2568
+ """
2569
+
2570
+ def get_type(self) -> str:
2571
+ """Get the type of the endpoint.
2572
+
2573
+ Returns:
2574
+ str: The type of the endpoint, in this case "retainedGuidance".
2575
+ """
2576
+ return "retainedGuidance"
2577
+
2578
+
2538
2579
  class ProjectEndpoint(EntityEndpoint, Project):
2539
2580
  """Represents a project endpoint.
2540
2581
 
2541
2582
  This class is used to interact with the project endpoint of the API.
2542
2583
  """
2584
+
2543
2585
  def get_type(self) -> str:
2544
2586
  """Get the type of the endpoint.
2545
2587
 
@@ -2897,6 +2939,39 @@ class TasksEndpoint(EntitiesEndpoint):
2897
2939
  return PageTaskEndpoint
2898
2940
 
2899
2941
 
2942
+ class RetainedGuidancesEndpoint(EntitiesEndpoint):
2943
+ """Represents a projects endpoint"""
2944
+
2945
+ """Represents a projects endpoint"""
2946
+
2947
+ def get_type(self) -> str:
2948
+ """
2949
+ Get the type of the endpoint.
2950
+
2951
+ Returns:
2952
+ str: The type of the endpoint.
2953
+ """
2954
+ return "retainedGuidance"
2955
+
2956
+ def get_instance_class(self, object_dict=None):
2957
+ """
2958
+ Get the instance class of the endpoint.
2959
+
2960
+ Returns:
2961
+ ProjectEndpoint: The instance class of the endpoint.
2962
+ """
2963
+ return RetainedGuidanceEndpoint
2964
+
2965
+ def get_page_class(self, object_dict=None):
2966
+ """
2967
+ Get the page class of the endpoint.
2968
+
2969
+ Returns:
2970
+ PageProjectEndpoint: The page class of the endpoint.
2971
+ """
2972
+ return PageRetainedGuidanceEndpoint
2973
+
2974
+
2900
2975
  class ProjectsEndpoint(EntitiesEndpoint):
2901
2976
  """Represents a projects endpoint"""
2902
2977
 
@@ -6400,6 +6475,10 @@ class KodexaClient:
6400
6475
  executions (ExecutionsEndpoint): An endpoint for executions.
6401
6476
  channels (ChannelsEndpoint): An endpoint for channels.
6402
6477
  messages (MessagesEndpoint): An endpoint for messages.
6478
+ assistants (AssistantsEndpoint): An endpoint for assistants.
6479
+ products (ProductsEndpoint): An endpoint for products.
6480
+ tasks (TasksEndpoint): An endpoint for tasks.
6481
+ retained_guidances (RetainedGuidancesEndpoint): An endpoint for retained guidances.
6403
6482
  """
6404
6483
 
6405
6484
  def __init__(self, url=None, access_token=None, profile=None):
@@ -6423,6 +6502,7 @@ class KodexaClient:
6423
6502
  from kodexa.model.entities.product import ProductsEndpoint
6424
6503
  self.products = ProductsEndpoint(self)
6425
6504
  self.tasks = TasksEndpoint(self)
6505
+ self.retained_guidances = RetainedGuidancesEndpoint(self)
6426
6506
 
6427
6507
  @staticmethod
6428
6508
  def login(url, token):
@@ -6439,7 +6519,6 @@ class KodexaClient:
6439
6519
  Raises:
6440
6520
  Exception: If the status code is not 200.
6441
6521
  """
6442
- from requests.auth import HTTPBasicAuth
6443
6522
 
6444
6523
  obj_response = requests.get(
6445
6524
  f"{url}/api/account/me",
@@ -6820,7 +6899,6 @@ class KodexaClient:
6820
6899
  )
6821
6900
  )
6822
6901
 
6823
-
6824
6902
  def import_project(self, organization: OrganizationEndpoint, import_path: str):
6825
6903
  """
6826
6904
  A method to import a project.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kodexa"
3
- version = "7.0.011219398096"
3
+ version = "7.0.011233302476"
4
4
  description = "Python SDK for the Kodexa Platform"
5
5
  authors = ["Austin Redenbaugh <austin@kodexa.com>", "Philip Dodds <philip@kodexa.com>", "Romar Cablao <rcablao@kodexa.com>", "Amadea Paula Dodds <amadeapaula@kodexa.com>"]
6
6
  readme = "README.md"