kodexa 7.4.416789395760__tar.gz → 7.4.416803490107__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 (51) hide show
  1. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/PKG-INFO +1 -1
  2. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/objects.py +22 -0
  3. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/platform/client.py +34 -0
  4. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/pyproject.toml +1 -1
  5. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/LICENSE +0 -0
  6. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/README.md +0 -0
  7. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/__init__.py +0 -0
  8. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/assistant/__init__.py +0 -0
  9. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/assistant/assistant.py +0 -0
  10. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/connectors/__init__.py +0 -0
  11. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/connectors/connectors.py +0 -0
  12. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/dataclasses/__init__.py +0 -0
  13. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/dataclasses/templates/llm_data_class.j2 +0 -0
  14. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/__init__.py +0 -0
  15. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/base.py +0 -0
  16. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/entities/__init__.py +0 -0
  17. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/entities/check_response.py +0 -0
  18. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/entities/product.py +0 -0
  19. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/entities/product_group.py +0 -0
  20. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/entities/product_subscription.py +0 -0
  21. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/model.py +0 -0
  22. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/persistence.py +0 -0
  23. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/model/utils.py +0 -0
  24. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/pipeline/__init__.py +0 -0
  25. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/pipeline/pipeline.py +0 -0
  26. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/platform/__init__.py +0 -0
  27. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/platform/interaction.py +0 -0
  28. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/platform/kodexa.py +0 -0
  29. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/platform/manifest.py +0 -0
  30. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/__init__.py +0 -0
  31. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/ast.py +0 -0
  32. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/core.py +0 -0
  33. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/lexrules.py +0 -0
  34. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/lextab.py +0 -0
  35. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/lextab.pyi +0 -0
  36. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/parserules.py +0 -0
  37. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/parserules.pyi +0 -0
  38. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/parsetab.py +0 -0
  39. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/selectors/parsetab.pyi +0 -0
  40. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/spatial/__init__.py +0 -0
  41. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/spatial/azure_models.py +0 -0
  42. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/spatial/bbox_common.py +0 -0
  43. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/spatial/table_form_common.py +0 -0
  44. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/steps/__init__.py +0 -0
  45. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/steps/common.py +0 -0
  46. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/testing/__init__.py +0 -0
  47. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/testing/test_components.py +0 -0
  48. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/testing/test_utils.py +0 -0
  49. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/training/__init__.py +0 -0
  50. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/training/train_utils.py +0 -0
  51. {kodexa-7.4.416789395760 → kodexa-7.4.416803490107}/kodexa/utils/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kodexa
3
- Version: 7.4.416789395760
3
+ Version: 7.4.416803490107
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ from decimal import Decimal
3
4
  from enum import Enum
4
5
  from typing import Optional, List, Dict, Any, Set
5
6
  from typing import Union
@@ -4873,6 +4874,27 @@ class ModelUsage(BaseModel):
4873
4874
  interactions: Optional[List[ModelInteraction]] = None
4874
4875
 
4875
4876
 
4877
+ class AggregatedModelCost(BaseModel):
4878
+ """
4879
+ Represents an aggregated view of model costs grouped by modelId.
4880
+ This class holds the sum of various token counts and other metrics.
4881
+ """
4882
+ model_config = ConfigDict(
4883
+ populate_by_name=True,
4884
+ use_enum_values=True,
4885
+ arbitrary_types_allowed=True,
4886
+ protected_namespaces=("model_config",),
4887
+ )
4888
+
4889
+ model_id: Optional[str] = Field(None, alias="modelId")
4890
+ total_input_tokens: Optional[int] = Field(None, alias="totalInputTokens")
4891
+ total_output_tokens: Optional[int] = Field(None, alias="totalOutputTokens")
4892
+ total_thinking_tokens: Optional[int] = Field(None, alias="totalThinkingTokens")
4893
+ total_cached_tokens: Optional[int] = Field(None, alias="totalCachedTokens")
4894
+ total_duration: Optional[int] = Field(None, alias="totalDuration")
4895
+ total_cost: Optional[Decimal] = Field(None, alias="totalCost")
4896
+
4897
+
4876
4898
  class ExecutionEvent(BaseModel):
4877
4899
  """
4878
4900
 
@@ -25,6 +25,7 @@ from pydantic_yaml import to_yaml_str
25
25
  from kodexa.model import Document
26
26
  from kodexa.model.model import Ref
27
27
  from kodexa.model.objects import (
28
+ AggregatedModelCost,
28
29
  PageUser,
29
30
  PageMembership,
30
31
  PageExecution,
@@ -6761,6 +6762,38 @@ class ExtractionEngineEndpoint:
6761
6762
  return response.text
6762
6763
 
6763
6764
 
6765
+ class ModelCostsEndpoint:
6766
+ """
6767
+ Provides endpoint access to the model costs.
6768
+
6769
+ Attributes:
6770
+ client (KodexaClient): The client to interact with the model costs.
6771
+ """
6772
+
6773
+ def __init__(self, client: "KodexaClient"):
6774
+ self.client = client
6775
+
6776
+ def get_model_costs(self, filters: Optional[List[str]] = None) -> List[AggregatedModelCost]:
6777
+ """
6778
+ Get aggregated model costs filtered by the provided query context.
6779
+ This endpoint aggregates the model costs by modelId.
6780
+
6781
+ Args:
6782
+ filters (Optional[List[str]]): The filters to apply to the model costs.
6783
+
6784
+ Returns:
6785
+ List[AggregatedModelCost]: A list of aggregated model costs.
6786
+ """
6787
+ params = {}
6788
+ if filters is not None:
6789
+ params["filter"] = filters
6790
+
6791
+ response = self.client.get("/api/modelCosts", params=params)
6792
+ return [
6793
+ AggregatedModelCost.model_validate(item)
6794
+ for item in response.json()
6795
+ ]
6796
+
6764
6797
  class KodexaClient:
6765
6798
  """
6766
6799
  A class to represent a Kodexa client.
@@ -6816,6 +6849,7 @@ class KodexaClient:
6816
6849
  self.workspaces = WorkspacesEndpoint(self)
6817
6850
  self.data_exceptions = DataExceptionsEndpoint(self)
6818
6851
  self.notes = NotesEndpoint(self)
6852
+ self.model_costs = ModelCostsEndpoint(self)
6819
6853
 
6820
6854
  @staticmethod
6821
6855
  def login(url, token):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kodexa"
3
- version = "7.4.416789395760"
3
+ version = "7.4.416803490107"
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"