kodexa 7.4.413041815779__py3-none-any.whl → 7.4.413043039367__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 +14 -4
- {kodexa-7.4.413041815779.dist-info → kodexa-7.4.413043039367.dist-info}/METADATA +1 -1
- {kodexa-7.4.413041815779.dist-info → kodexa-7.4.413043039367.dist-info}/RECORD +5 -5
- {kodexa-7.4.413041815779.dist-info → kodexa-7.4.413043039367.dist-info}/LICENSE +0 -0
- {kodexa-7.4.413041815779.dist-info → kodexa-7.4.413043039367.dist-info}/WHEEL +0 -0
kodexa/dataclasses/__init__.py
CHANGED
@@ -173,10 +173,20 @@ class LLMDataObject(BaseModel):
|
|
173
173
|
value = getattr(self, field)
|
174
174
|
|
175
175
|
if isinstance(value, list) and len(value) > 0:
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
176
|
+
if isinstance(value[0], LLMDataObject):
|
177
|
+
# We need to find the first field of the object that is a LLMDataAttribute
|
178
|
+
# and use that to derive the taxon path of the LLMDataObject
|
179
|
+
data_attribute = None
|
180
|
+
for child_field in value[0].__fields__:
|
181
|
+
child_attr = getattr(value[0], child_field)
|
182
|
+
if isinstance(child_attr, LLMDataAttribute):
|
183
|
+
data_attribute = child_attr
|
184
|
+
break
|
185
|
+
if data_attribute is not None:
|
186
|
+
taxon_path = data_attribute.taxon_path.rsplit('/', 1)[0]
|
187
|
+
target_taxon = taxonomy.get_taxon_by_path(taxon_path)
|
188
|
+
if target_taxon is not None:
|
189
|
+
result[target_taxon.external_name] = [item.to_dict(taxonomy) for item in value if isinstance(item, (LLMDataObject, LLMDataAttribute))]
|
180
190
|
elif isinstance(value, LLMDataAttribute):
|
181
191
|
result.update(value.to_dict(taxonomy))
|
182
192
|
elif isinstance(value, LLMDataObject):
|
@@ -3,7 +3,7 @@ kodexa/assistant/__init__.py,sha256=nlXm_YnV_50hgn0TIT2Fkc2fQ-86OjmctY_j8My9nc4,
|
|
3
3
|
kodexa/assistant/assistant.py,sha256=5KFdbqFSLIZJyDRyZdpcfr448fT-CW4JhYu9A6B9DGY,14663
|
4
4
|
kodexa/connectors/__init__.py,sha256=WF6G_MUeU32TlKSUKkpNoNX7dq8iBPliFMep4E8BmZc,328
|
5
5
|
kodexa/connectors/connectors.py,sha256=FpUZDkSyHld2b9eYRuVOWzaFtuGoaRuPXXicJB7THbc,10413
|
6
|
-
kodexa/dataclasses/__init__.py,sha256=
|
6
|
+
kodexa/dataclasses/__init__.py,sha256=l1bpG3wyGEwq9SpdD9uVFuIep1A9x0si1eqxCmyWH68,20641
|
7
7
|
kodexa/dataclasses/templates/llm_data_class.j2,sha256=YWjStW136chV_59JM3AYis3i-0jdrqDvLXsISUW9zDU,660
|
8
8
|
kodexa/model/__init__.py,sha256=rtLXYJBxB-rnukhslN9rlqoB3--1H3253HyHGbD_Gc8,796
|
9
9
|
kodexa/model/base.py,sha256=CaZK8nMhT1LdCpt4aLhebJGcorjq9qRID1FjnXnP14M,521
|
@@ -44,7 +44,7 @@ kodexa/testing/test_utils.py,sha256=v44p__gE7ia67W7WeHN2HBFCWSCUrCZt7G4xBNCmwf8,
|
|
44
44
|
kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
|
45
45
|
kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
46
46
|
kodexa/utils/__init__.py,sha256=Pnim1o9_db5YEnNvDTxpM7HG-qTlL6n8JwFwOafU9wo,5928
|
47
|
-
kodexa-7.4.
|
48
|
-
kodexa-7.4.
|
49
|
-
kodexa-7.4.
|
50
|
-
kodexa-7.4.
|
47
|
+
kodexa-7.4.413043039367.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
48
|
+
kodexa-7.4.413043039367.dist-info/METADATA,sha256=aa3-sNE-ktkE70ZaLJsO84gFpsv9hq20NtfYPRl9_PY,3528
|
49
|
+
kodexa-7.4.413043039367.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
50
|
+
kodexa-7.4.413043039367.dist-info/RECORD,,
|
File without changes
|
File without changes
|