kodexa 7.4.413039380629__py3-none-any.whl → 7.4.413041815779__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.
@@ -73,7 +73,11 @@ class LLMDataAttribute(BaseModel):
73
73
  def to_dict(self, taxonomy: Taxonomy) -> dict:
74
74
  """Convert attribute to JSON with normalized value"""
75
75
 
76
- taxon_external_name = taxonomy.get_taxon_by_path(self.taxon_path).external_name
76
+ target_taxon = taxonomy.get_taxon_by_path(self.taxon_path)
77
+ if target_taxon is None:
78
+ return {}
79
+
80
+ taxon_external_name = target_taxon.external_name
77
81
  return {
78
82
  taxon_external_name: self.normalized_text if self.normalized_text else self.value
79
83
  }
@@ -167,12 +171,18 @@ class LLMDataObject(BaseModel):
167
171
  result = {}
168
172
  for field in self.__fields__:
169
173
  value = getattr(self, field)
170
- if isinstance(value, list):
171
- result[field] = [item.to_dict(taxonomy) for item in value if isinstance(item, (LLMDataObject, LLMDataAttribute))]
174
+
175
+ if isinstance(value, list) and len(value) > 0:
176
+
177
+ target_taxon = taxonomy.get_taxon_by_path(value[0].taxon_path)
178
+ if target_taxon is not None:
179
+ result[target_taxon.external_name] = [item.to_dict(taxonomy) for item in value if isinstance(item, (LLMDataObject, LLMDataAttribute))]
172
180
  elif isinstance(value, LLMDataAttribute):
173
181
  result.update(value.to_dict(taxonomy))
174
182
  elif isinstance(value, LLMDataObject):
175
- result[field] = value.to_dict(taxonomy)
183
+ target_taxon = taxonomy.get_taxon_by_path(value.taxon_path)
184
+ if target_taxon is not None:
185
+ result[target_taxon.external_name] = value.to_dict(taxonomy)
176
186
  return result
177
187
 
178
188
  def to_review(self, page_number=None):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kodexa
3
- Version: 7.4.413039380629
3
+ Version: 7.4.413041815779
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -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=eDpw0--5S-Yb-EphiT7etwj47xzDk_bq13aaOf0jjtc,19526
6
+ kodexa/dataclasses/__init__.py,sha256=ZEP6vpMWPS-EEaTYHuxryq1l1SviTsh3M82jJOhOeMs,19934
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.413039380629.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
48
- kodexa-7.4.413039380629.dist-info/METADATA,sha256=Wcnv2okMVSG-8cB4M5w06sQphj8lOfQZeKt0Z9nf21w,3528
49
- kodexa-7.4.413039380629.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
50
- kodexa-7.4.413039380629.dist-info/RECORD,,
47
+ kodexa-7.4.413041815779.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
48
+ kodexa-7.4.413041815779.dist-info/METADATA,sha256=ujypSB3oqhg562am4-9zpAdrPq22HWxpS3dr3hKgJrA,3528
49
+ kodexa-7.4.413041815779.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
50
+ kodexa-7.4.413041815779.dist-info/RECORD,,