kodexa 6.3.37340911498__py3-none-any.whl → 7.0.1a7664024353__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/model.py +17 -11
- kodexa/model/objects.py +1000 -77
- kodexa/model/persistence.py +3 -3
- kodexa/platform/client.py +174 -24
- {kodexa-6.3.37340911498.dist-info → kodexa-7.0.1a7664024353.dist-info}/METADATA +6 -5
- {kodexa-6.3.37340911498.dist-info → kodexa-7.0.1a7664024353.dist-info}/RECORD +8 -8
- {kodexa-6.3.37340911498.dist-info → kodexa-7.0.1a7664024353.dist-info}/LICENSE +0 -0
- {kodexa-6.3.37340911498.dist-info → kodexa-7.0.1a7664024353.dist-info}/WHEEL +0 -0
kodexa/model/persistence.py
CHANGED
@@ -935,9 +935,9 @@ class SqliteDocumentPersistence(object):
|
|
935
935
|
"""
|
936
936
|
content_nodes = []
|
937
937
|
if tag_uuid is None:
|
938
|
-
query = f"select cn_id from ft where f_type in (select id from f_type where name like 'tag:{tag}')"
|
938
|
+
query = f"select distinct(cn_id) from ft where f_type in (select id from f_type where name like 'tag:{tag}')"
|
939
939
|
else:
|
940
|
-
query = f"select cn_id from ft where f_type in (select id from f_type where name like 'tag:{tag}') and tag_uuid = '{tag_uuid}'"
|
940
|
+
query = f"select distinct(cn_id) from ft where f_type in (select id from f_type where name like 'tag:{tag}') and tag_uuid = '{tag_uuid}'"
|
941
941
|
for content_node_ids in self.cursor.execute(query).fetchall():
|
942
942
|
content_nodes.append(self.get_node(content_node_ids[0]))
|
943
943
|
|
@@ -1037,7 +1037,7 @@ class SqliteDocumentPersistence(object):
|
|
1037
1037
|
list: A list of all nodes with tags in the document.
|
1038
1038
|
"""
|
1039
1039
|
content_nodes = []
|
1040
|
-
query = "select cn_id from ft where f_type in (select id from f_type where name like 'tag:%')"
|
1040
|
+
query = "select distinct(cn_id) from ft where f_type in (select id from f_type where name like 'tag:%')"
|
1041
1041
|
for content_node_ids in self.cursor.execute(query).fetchall():
|
1042
1042
|
content_nodes.append(self.get_node(content_node_ids[0]))
|
1043
1043
|
|
kodexa/platform/client.py
CHANGED
@@ -85,7 +85,7 @@ from kodexa.model.objects import (
|
|
85
85
|
ReprocessRequest,
|
86
86
|
PageExtensionPack,
|
87
87
|
PageOrganization,
|
88
|
-
DocumentFamilyStatistics,
|
88
|
+
DocumentFamilyStatistics, MessageContext, PagePrompt, Prompt, GuidanceSet, PageGuidanceSet,
|
89
89
|
)
|
90
90
|
|
91
91
|
logger = logging.getLogger()
|
@@ -1988,6 +1988,58 @@ class ProjectDocumentStoresEndpoint(ProjectResourceEndpoint):
|
|
1988
1988
|
return DocumentStoreEndpoint
|
1989
1989
|
|
1990
1990
|
|
1991
|
+
class GuidanceSetEndpoint(ComponentInstanceEndpoint, GuidanceSet):
|
1992
|
+
|
1993
|
+
def get_type(self) -> str:
|
1994
|
+
"""
|
1995
|
+
Get the type of the endpoint.
|
1996
|
+
|
1997
|
+
Returns:
|
1998
|
+
str: The type of the endpoint, "guidance".
|
1999
|
+
"""
|
2000
|
+
return "guidance"
|
2001
|
+
|
2002
|
+
|
2003
|
+
class PageGuidanceSetEndpoint(PageGuidanceSet, PageEndpoint):
|
2004
|
+
"""Handles the endpoint for the Page GuidanceSetEndpoint
|
2005
|
+
|
2006
|
+
This class inherits from both the GuidanceSetEndpoint and PageEndpoint classes.
|
2007
|
+
Currently, it doesn't add any additional functionality to its parent classes.
|
2008
|
+
|
2009
|
+
Note:
|
2010
|
+
This class is currently a placeholder and may have additional methods and attributes
|
2011
|
+
added in the future.
|
2012
|
+
"""
|
2013
|
+
|
2014
|
+
pass
|
2015
|
+
|
2016
|
+
|
2017
|
+
class PromptEndpoint(ComponentInstanceEndpoint, Prompt):
|
2018
|
+
|
2019
|
+
def get_type(self) -> str:
|
2020
|
+
"""
|
2021
|
+
Get the type of the endpoint.
|
2022
|
+
|
2023
|
+
Returns:
|
2024
|
+
str: The type of the endpoint, "prompts".
|
2025
|
+
"""
|
2026
|
+
return "prompts"
|
2027
|
+
|
2028
|
+
|
2029
|
+
class PagePromptEndpoint(PagePrompt, PageEndpoint):
|
2030
|
+
"""Handles the endpoint for the Page Prompt
|
2031
|
+
|
2032
|
+
This class inherits from both the PromptEndpoint and PageEndpoint classes.
|
2033
|
+
Currently, it doesn't add any additional functionality to its parent classes.
|
2034
|
+
|
2035
|
+
Note:
|
2036
|
+
This class is currently a placeholder and may have additional methods and attributes
|
2037
|
+
added in the future.
|
2038
|
+
"""
|
2039
|
+
|
2040
|
+
pass
|
2041
|
+
|
2042
|
+
|
1991
2043
|
class ProjectTaxonomiesEndpoint(ProjectResourceEndpoint):
|
1992
2044
|
"""Represents a project taxonomies endpoint.
|
1993
2045
|
|
@@ -2779,6 +2831,90 @@ class StoresEndpoint(ComponentEndpoint, ClientEndpoint, OrganizationOwned):
|
|
2779
2831
|
raise ValueError(f"Unknown store type {object_dict['storeType']}")
|
2780
2832
|
|
2781
2833
|
|
2834
|
+
class GuidanceEndpoint(ComponentEndpoint, ClientEndpoint, OrganizationOwned):
|
2835
|
+
"""
|
2836
|
+
Represents a guidance endpoint.
|
2837
|
+
|
2838
|
+
This class is used to interact with the prompts endpoint of the API.
|
2839
|
+
It provides methods to get the type, page class, and instance class of the endpoint,
|
2840
|
+
as well as to deploy an extension pack from a URL.
|
2841
|
+
"""
|
2842
|
+
def get_type(self) -> str:
|
2843
|
+
"""
|
2844
|
+
Get the type of the endpoint.
|
2845
|
+
|
2846
|
+
Returns:
|
2847
|
+
str: The type of the endpoint, "prompts".
|
2848
|
+
"""
|
2849
|
+
return "guidance"
|
2850
|
+
|
2851
|
+
def get_page_class(self, object_dict=None):
|
2852
|
+
"""
|
2853
|
+
Get the page class of the endpoint.
|
2854
|
+
|
2855
|
+
Args:
|
2856
|
+
object_dict (dict, optional): An optional dictionary of objects.
|
2857
|
+
|
2858
|
+
Returns:
|
2859
|
+
PageGuidanceSetEndpoint: The page class of the endpoint.
|
2860
|
+
"""
|
2861
|
+
return PageGuidanceSetEndpoint
|
2862
|
+
|
2863
|
+
def get_instance_class(self, object_dict=None):
|
2864
|
+
"""
|
2865
|
+
Get the instance class of the endpoint.
|
2866
|
+
|
2867
|
+
Args:
|
2868
|
+
object_dict (dict, optional): An optional dictionary of objects.
|
2869
|
+
|
2870
|
+
Returns:
|
2871
|
+
GuidanceSetEndpoint: The instance class of the endpoint.
|
2872
|
+
"""
|
2873
|
+
return GuidanceSetEndpoint
|
2874
|
+
|
2875
|
+
|
2876
|
+
class PromptsEndpoint(ComponentEndpoint, ClientEndpoint, OrganizationOwned):
|
2877
|
+
"""
|
2878
|
+
Represents a prompts endpoint.
|
2879
|
+
|
2880
|
+
This class is used to interact with the prompts endpoint of the API.
|
2881
|
+
It provides methods to get the type, page class, and instance class of the endpoint,
|
2882
|
+
as well as to deploy an extension pack from a URL.
|
2883
|
+
"""
|
2884
|
+
def get_type(self) -> str:
|
2885
|
+
"""
|
2886
|
+
Get the type of the endpoint.
|
2887
|
+
|
2888
|
+
Returns:
|
2889
|
+
str: The type of the endpoint, "prompts".
|
2890
|
+
"""
|
2891
|
+
return "prompts"
|
2892
|
+
|
2893
|
+
def get_page_class(self, object_dict=None):
|
2894
|
+
"""
|
2895
|
+
Get the page class of the endpoint.
|
2896
|
+
|
2897
|
+
Args:
|
2898
|
+
object_dict (dict, optional): An optional dictionary of objects.
|
2899
|
+
|
2900
|
+
Returns:
|
2901
|
+
PagePromptEndpoint: The page class of the endpoint.
|
2902
|
+
"""
|
2903
|
+
return PagePromptEndpoint
|
2904
|
+
|
2905
|
+
def get_instance_class(self, object_dict=None):
|
2906
|
+
"""
|
2907
|
+
Get the instance class of the endpoint.
|
2908
|
+
|
2909
|
+
Args:
|
2910
|
+
object_dict (dict, optional): An optional dictionary of objects.
|
2911
|
+
|
2912
|
+
Returns:
|
2913
|
+
PromptEndpoint: The instance class of the endpoint.
|
2914
|
+
"""
|
2915
|
+
return PromptEndpoint
|
2916
|
+
|
2917
|
+
|
2782
2918
|
class ExtensionPacksEndpoint(ComponentEndpoint, ClientEndpoint, OrganizationOwned):
|
2783
2919
|
"""
|
2784
2920
|
Represents an extension packs endpoint.
|
@@ -3614,25 +3750,6 @@ class TaxonomyEndpoint(ComponentInstanceEndpoint, Taxonomy):
|
|
3614
3750
|
|
3615
3751
|
return find_taxon(self.taxons, path)
|
3616
3752
|
|
3617
|
-
def get_taxon_links(self):
|
3618
|
-
response = self.client.put(f"/api/taxonomies/{self.ref}/taxonLinks")
|
3619
|
-
process_response(response)
|
3620
|
-
return [TaxonLink.model_validate(taxon_link) for taxon_link in response.json()]
|
3621
|
-
|
3622
|
-
def add_taxon_link(self, taxon_link: TaxonLink):
|
3623
|
-
response = self.client.post(
|
3624
|
-
f"/api/taxonomies/{self.ref}/taxonLinks",
|
3625
|
-
body=taxon_link.model_dump(by_alias=True),
|
3626
|
-
)
|
3627
|
-
process_response(response)
|
3628
|
-
return TaxonLink.model_validate(response.json())
|
3629
|
-
|
3630
|
-
def delete_taxon_link(self, taxon_link: TaxonLink):
|
3631
|
-
response = self.client.delete(
|
3632
|
-
f"/api/taxonomies/{self.ref}/taxonLinks/{taxon_link.id}"
|
3633
|
-
)
|
3634
|
-
process_response(response)
|
3635
|
-
|
3636
3753
|
|
3637
3754
|
class MembershipEndpoint(Membership, EntityEndpoint):
|
3638
3755
|
"""Represents a membership endpoint.
|
@@ -4062,6 +4179,24 @@ class DocumentFamilyEndpoint(DocumentFamily, ClientEndpoint):
|
|
4062
4179
|
response = self.client.put(url, body=self.model_dump(mode="json", by_alias=True))
|
4063
4180
|
self.change_sequence = response.json()["changeSequence"]
|
4064
4181
|
|
4182
|
+
def set_active_assistant(self, assistant: Assistant):
|
4183
|
+
"""
|
4184
|
+
Set the active assistant.
|
4185
|
+
"""
|
4186
|
+
url = f"/api/stores/{self.store_ref.replace(':', '/')}/families/{self.id}/activeAssistant"
|
4187
|
+
response = self.client.put(url, body=assistant.model_dump(mode="json", by_alias=True))
|
4188
|
+
process_response(response)
|
4189
|
+
self.change_sequence = response.json()["changeSequence"]
|
4190
|
+
|
4191
|
+
def clear_active_assistant(self):
|
4192
|
+
"""
|
4193
|
+
Clear the active assistant.
|
4194
|
+
"""
|
4195
|
+
url = f"/api/stores/{self.store_ref.replace(':', '/')}/families/{self.id}/activeAssistant"
|
4196
|
+
response = self.client.delete(url)
|
4197
|
+
process_response(response)
|
4198
|
+
self.change_sequence = response.json()["changeSequence"]
|
4199
|
+
|
4065
4200
|
def lock(self):
|
4066
4201
|
"""
|
4067
4202
|
Lock the document family.
|
@@ -4310,8 +4445,8 @@ class DocumentFamilyEndpoint(DocumentFamily, ClientEndpoint):
|
|
4310
4445
|
content_object = self.content_objects[-1]
|
4311
4446
|
url = f"/api/stores/{self.store_ref.replace(':', '/')}/families/{self.id}/objects/{content_object.id}/_replaceTags"
|
4312
4447
|
self.client.put(
|
4313
|
-
url, params={'replaceData': replace_data},
|
4314
|
-
body=document.get_feature_set(owner_uri).
|
4448
|
+
url, params={'replaceData': replace_data, 'ownerUri': owner_uri},
|
4449
|
+
body=document.get_feature_set(owner_uri).model_dump(by_alias=True),
|
4315
4450
|
)
|
4316
4451
|
|
4317
4452
|
|
@@ -5648,7 +5783,7 @@ OBJECT_TYPES = {
|
|
5648
5783
|
},
|
5649
5784
|
"assistantDefinitions": {
|
5650
5785
|
"name": "assistantDefinition",
|
5651
|
-
"plural": "
|
5786
|
+
"plural": "assistantDefinitions",
|
5652
5787
|
"type": AssistantDefinitionEndpoint,
|
5653
5788
|
"endpoint": AssistantDefinitionsEndpoint,
|
5654
5789
|
},
|
@@ -5658,6 +5793,18 @@ OBJECT_TYPES = {
|
|
5658
5793
|
"type": ActionEndpoint,
|
5659
5794
|
"endpoint": ActionsEndpoint,
|
5660
5795
|
},
|
5796
|
+
"prompts": {
|
5797
|
+
"name": "prompt",
|
5798
|
+
"plural": "prompts",
|
5799
|
+
"type": PromptEndpoint,
|
5800
|
+
"endpoint": PromptsEndpoint,
|
5801
|
+
},
|
5802
|
+
"guidance": {
|
5803
|
+
"name": "guidance",
|
5804
|
+
"plural": "guidance",
|
5805
|
+
"type": GuidanceSetEndpoint,
|
5806
|
+
"endpoint": GuidanceEndpoint,
|
5807
|
+
},
|
5661
5808
|
"modelRuntimes": {
|
5662
5809
|
"name": "modelRuntime",
|
5663
5810
|
"plural": "modelRuntimes",
|
@@ -6459,7 +6606,10 @@ class KodexaClient:
|
|
6459
6606
|
"assistant": AssistantDefinitionEndpoint,
|
6460
6607
|
"exception": DataExceptionEndpoint,
|
6461
6608
|
"workspace": WorkspaceEndpoint,
|
6462
|
-
"message":
|
6609
|
+
"message": MessageEndpoint,
|
6610
|
+
"prompt": PromptEndpoint,
|
6611
|
+
"guidance": GuidanceSetEndpoint,
|
6612
|
+
"channel": ChannelEndpoint,
|
6463
6613
|
}
|
6464
6614
|
|
6465
6615
|
if component_type in known_components:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: kodexa
|
3
|
-
Version:
|
3
|
+
Version: 7.0.1a7664024353
|
4
4
|
Summary: Python SDK for the Kodexa Platform
|
5
5
|
Author: Austin Redenbaugh
|
6
6
|
Author-email: austin@kodexa.com
|
@@ -16,17 +16,18 @@ Classifier: Topic :: Software Development :: Libraries
|
|
16
16
|
Requires-Dist: addict (==2.4.0)
|
17
17
|
Requires-Dist: appdirs (>=1.4.4,<2.0.0)
|
18
18
|
Requires-Dist: better-exceptions (>=0.3.3,<0.4.0)
|
19
|
-
Requires-Dist:
|
20
|
-
Requires-Dist:
|
19
|
+
Requires-Dist: chevron (>=0.14.0,<0.15.0)
|
20
|
+
Requires-Dist: deepdiff (>=6.5.0,<7.0.0)
|
21
|
+
Requires-Dist: msgpack (>=1.0.6,<2.0.0)
|
21
22
|
Requires-Dist: ply (>=3.11,<4.0)
|
22
|
-
Requires-Dist: pydantic (
|
23
|
+
Requires-Dist: pydantic (>=2.5.3,<3.0.0)
|
23
24
|
Requires-Dist: pydantic-yaml (>=1.0.0,<2.0.0)
|
24
25
|
Requires-Dist: pyfunctional (>=1.4.3,<1.5.0)
|
25
26
|
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
|
26
27
|
Requires-Dist: pyyaml (>=6.0,<7.0)
|
27
28
|
Requires-Dist: requests (>=2.28.1,<3.0.0)
|
28
29
|
Requires-Dist: semver (>=3.0.1,<4.0.0)
|
29
|
-
Requires-Dist: urllib3 (>=
|
30
|
+
Requires-Dist: urllib3 (>=2.0.0,<3.0.0)
|
30
31
|
Description-Content-Type: text/markdown
|
31
32
|
|
32
33
|
# Kodexa
|
@@ -5,13 +5,13 @@ kodexa/connectors/__init__.py,sha256=WF6G_MUeU32TlKSUKkpNoNX7dq8iBPliFMep4E8BmZc
|
|
5
5
|
kodexa/connectors/connectors.py,sha256=FpUZDkSyHld2b9eYRuVOWzaFtuGoaRuPXXicJB7THbc,10413
|
6
6
|
kodexa/model/__init__.py,sha256=rtLXYJBxB-rnukhslN9rlqoB3--1H3253HyHGbD_Gc8,796
|
7
7
|
kodexa/model/base.py,sha256=CaZK8nMhT1LdCpt4aLhebJGcorjq9qRID1FjnXnP14M,521
|
8
|
-
kodexa/model/model.py,sha256=
|
9
|
-
kodexa/model/objects.py,sha256=
|
10
|
-
kodexa/model/persistence.py,sha256=
|
8
|
+
kodexa/model/model.py,sha256=2rbNYpBIrOXZ1Vz1d6JfFxYg-tXujjE765pzoGgTNT8,114447
|
9
|
+
kodexa/model/objects.py,sha256=3Qubq3wsU9QsziStUcCF-y1VfnDM80yxwLKEnyARYX0,170195
|
10
|
+
kodexa/model/persistence.py,sha256=Ekf276WAtY2MOkryug9IpcM_HwnJSPpSWEFZgiUODMc,57390
|
11
11
|
kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
|
12
12
|
kodexa/pipeline/pipeline.py,sha256=cIRFOoJkguIYgNzx6FYrODdBpcY25CM_SULsqSsHeXE,24323
|
13
13
|
kodexa/platform/__init__.py,sha256=1O3oiWMg292NPL_NacKDnK1T3_R6cMorrPRue_9e-O4,216
|
14
|
-
kodexa/platform/client.py,sha256=
|
14
|
+
kodexa/platform/client.py,sha256=OUpU7biBDJdl8WDfhmLjyEsCDGVQCaMo0zEXIWZvpsw,209250
|
15
15
|
kodexa/platform/kodexa.py,sha256=g9Vcp2CtPn6haCQLc7TEmQmROQ1x8Bdpxfx1iK1KTqU,32292
|
16
16
|
kodexa/selectors/__init__.py,sha256=xA9-4vpyaAZWPSk3bh2kvDLkdv6XEmm7PjFbpziiTIk,100
|
17
17
|
kodexa/selectors/ast.py,sha256=gG-1st841IntgBE5V7p3Cq9azaym2jV5lB_AIywQTCI,13269
|
@@ -34,7 +34,7 @@ kodexa/testing/test_components.py,sha256=4BnzCCOA5v__82mB1TIBPHfNIGJbkZz9PiTZiNK
|
|
34
34
|
kodexa/testing/test_utils.py,sha256=IWLKBvMHATzrsoO9PQFGcwoGcuZykhAS3QRddfzb_XE,14043
|
35
35
|
kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
|
36
36
|
kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
|
-
kodexa-
|
38
|
-
kodexa-
|
39
|
-
kodexa-
|
40
|
-
kodexa-
|
37
|
+
kodexa-7.0.1a7664024353.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
38
|
+
kodexa-7.0.1a7664024353.dist-info/METADATA,sha256=XrCoOjl3EeMzojLDBrmVUz56CTlF7_gO0or6e6rUbs8,4069
|
39
|
+
kodexa-7.0.1a7664024353.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
40
|
+
kodexa-7.0.1a7664024353.dist-info/RECORD,,
|
File without changes
|
File without changes
|