kodexa 7.0.11218891327__py3-none-any.whl → 7.0.11233302476__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 +68 -7
- kodexa/platform/client.py +81 -3
- {kodexa-7.0.11218891327.dist-info → kodexa-7.0.11233302476.dist-info}/METADATA +1 -1
- {kodexa-7.0.11218891327.dist-info → kodexa-7.0.11233302476.dist-info}/RECORD +6 -6
- {kodexa-7.0.11218891327.dist-info → kodexa-7.0.11233302476.dist-info}/LICENSE +0 -0
- {kodexa-7.0.11218891327.dist-info → kodexa-7.0.11233302476.dist-info}/WHEEL +0 -0
kodexa/model/objects.py
CHANGED
@@ -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
|
|
@@ -4451,10 +4510,10 @@ class Guidance(BaseModel):
|
|
4451
4510
|
|
4452
4511
|
class GuidanceEmbeddingType(Enum):
|
4453
4512
|
SUMMARY = "SUMMARY"
|
4454
|
-
|
4455
|
-
CONTENT_NODE = "CONTENT_NODE"
|
4513
|
+
CONTENT = "CONTENT"
|
4456
4514
|
TFIDF = "TFIDF"
|
4457
4515
|
|
4516
|
+
|
4458
4517
|
class GuidanceSetStorage(BaseModel):
|
4459
4518
|
model_config = ConfigDict(
|
4460
4519
|
populate_by_name=True,
|
@@ -4468,6 +4527,7 @@ class GuidanceSetStorage(BaseModel):
|
|
4468
4527
|
embedding_model_id: Optional[str] = Field(None, alias="embeddingModelId")
|
4469
4528
|
embedding_types: List[GuidanceEmbeddingType] = Field(default_factory=list, alias="embeddingTypes")
|
4470
4529
|
|
4530
|
+
|
4471
4531
|
class GuidanceSet(ExtensionPackProvided):
|
4472
4532
|
"""
|
4473
4533
|
A guidance set is a list of guidance objects that can be applied to a taxonomy
|
@@ -4479,7 +4539,8 @@ class GuidanceSet(ExtensionPackProvided):
|
|
4479
4539
|
protected_namespaces=("model_config",),
|
4480
4540
|
)
|
4481
4541
|
|
4482
|
-
active_store: bool = Field(False, alias="activeStore",
|
4542
|
+
active_store: bool = Field(False, alias="activeStore",
|
4543
|
+
description="If true, allows guidance to be stored through the API")
|
4483
4544
|
storage: GuidanceSetStorage = Field(default_factory=GuidanceSetStorage)
|
4484
4545
|
guidance: List[Guidance] = Field(default_factory=list, description="The guidance in the set")
|
4485
4546
|
|
kodexa/platform/client.py
CHANGED
@@ -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.
|
@@ -12,12 +12,12 @@ kodexa/model/entities/check_response.py,sha256=eqBHxO6G2OAziL3p9bHGI-oiPkAG82H6C
|
|
12
12
|
kodexa/model/entities/product.py,sha256=ZDpHuBE_9FJ-klnkyBvTfPwYOqBkM1wraZMtHqNA8FQ,3526
|
13
13
|
kodexa/model/entities/product_subscription.py,sha256=UcmWR-qgLfdV7VCtJNwzgkanoS8nBSL6ngVuxQUK1M8,3810
|
14
14
|
kodexa/model/model.py,sha256=Ay3X9rsoJaUdG51WysSDPp2iy_cnz4eEYJgWdC25uio,118058
|
15
|
-
kodexa/model/objects.py,sha256=
|
15
|
+
kodexa/model/objects.py,sha256=eWQ2RIoP30fdiibjpy_NXC_0JZvbbfsVxTeFZSo5g5g,183324
|
16
16
|
kodexa/model/persistence.py,sha256=w4WGS_qH1iowH8-ZMawZBZ2RFW3bNvmFy5fgSwr6VmQ,66198
|
17
17
|
kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
|
18
18
|
kodexa/pipeline/pipeline.py,sha256=ZYpJAWcwV4YRK589DUhU0vXGQlkNSj4J2TsGbYqTLjo,25221
|
19
19
|
kodexa/platform/__init__.py,sha256=1O3oiWMg292NPL_NacKDnK1T3_R6cMorrPRue_9e-O4,216
|
20
|
-
kodexa/platform/client.py,sha256=
|
20
|
+
kodexa/platform/client.py,sha256=JoxNouMW1BAXOdL3muzTZRBrXTppSD2Jc0mgXpwmUc4,226487
|
21
21
|
kodexa/platform/interaction.py,sha256=6zpcwXKNZstUGNS6m4JsoRXAqCZPJHWI-ZN3co8nnF0,1055
|
22
22
|
kodexa/platform/kodexa.py,sha256=RVtArtzn1TVhBf3NGC4xe-ZO-VEVDIC3RjLhR06p-uU,34033
|
23
23
|
kodexa/selectors/__init__.py,sha256=xA9-4vpyaAZWPSk3bh2kvDLkdv6XEmm7PjFbpziiTIk,100
|
@@ -42,7 +42,7 @@ kodexa/testing/test_utils.py,sha256=DrLCkHxdb6AbZ-X3WmTMbQmnVIm55VEBL8MjtUK9POs,
|
|
42
42
|
kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
|
43
43
|
kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
44
|
kodexa/utils/__init__.py,sha256=Pnim1o9_db5YEnNvDTxpM7HG-qTlL6n8JwFwOafU9wo,5928
|
45
|
-
kodexa-7.0.
|
46
|
-
kodexa-7.0.
|
47
|
-
kodexa-7.0.
|
48
|
-
kodexa-7.0.
|
45
|
+
kodexa-7.0.11233302476.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
46
|
+
kodexa-7.0.11233302476.dist-info/METADATA,sha256=aWncI2XY0_xBOk0oDoC7TKdd8sV2hUzjuklEoa2a6tk,3529
|
47
|
+
kodexa-7.0.11233302476.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
48
|
+
kodexa-7.0.11233302476.dist-info/RECORD,,
|
File without changes
|
File without changes
|