kodexa 7.4.416789395760__tar.gz → 7.4.416807352183__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.
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/PKG-INFO +1 -1
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/objects.py +22 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/platform/client.py +37 -5
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/pyproject.toml +1 -1
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/LICENSE +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/README.md +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/assistant/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/assistant/assistant.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/connectors/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/connectors/connectors.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/dataclasses/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/dataclasses/templates/llm_data_class.j2 +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/base.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/entities/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/entities/check_response.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/entities/product.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/entities/product_group.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/entities/product_subscription.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/model.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/persistence.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/utils.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/pipeline/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/pipeline/pipeline.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/platform/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/platform/interaction.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/platform/kodexa.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/platform/manifest.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/ast.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/core.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/lexrules.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/lextab.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/lextab.pyi +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/parserules.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/parserules.pyi +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/parsetab.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/selectors/parsetab.pyi +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/spatial/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/spatial/azure_models.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/spatial/bbox_common.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/spatial/table_form_common.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/steps/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/steps/common.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/testing/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/testing/test_components.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/testing/test_utils.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/training/__init__.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/training/train_utils.py +0 -0
- {kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/utils/__init__.py +0 -0
@@ -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,
|
@@ -3253,7 +3254,7 @@ class ProjectsEndpoint(EntitiesEndpoint):
|
|
3253
3254
|
).set_client(self.client)
|
3254
3255
|
return None
|
3255
3256
|
|
3256
|
-
def stream_query(self, query: str = "*", sort=None, limit=None):
|
3257
|
+
def stream_query(self, query: str = "*", sort=None, limit=None, starting_offset = 0):
|
3257
3258
|
"""
|
3258
3259
|
Stream the query for the project endpoints.
|
3259
3260
|
|
@@ -3266,7 +3267,7 @@ class ProjectsEndpoint(EntitiesEndpoint):
|
|
3266
3267
|
ProjectEndpoint: A generator of the project endpoints.
|
3267
3268
|
"""
|
3268
3269
|
page_size = 5
|
3269
|
-
page = 1
|
3270
|
+
page = starting_offset // page_size + 1
|
3270
3271
|
counter = 0
|
3271
3272
|
|
3272
3273
|
if not sort:
|
@@ -5969,7 +5970,7 @@ class DocumentStoreEndpoint(StoreEndpoint):
|
|
5969
5970
|
page += 1
|
5970
5971
|
|
5971
5972
|
def filter(
|
5972
|
-
self, filter_string: str = "", page: int = 1, page_size: int = 100, sort=None
|
5973
|
+
self, filter_string: str = "", page: int = 1, page_size: int = 100, sort=None
|
5973
5974
|
) -> PageDocumentFamilyEndpoint:
|
5974
5975
|
"""
|
5975
5976
|
Filter the document family.
|
@@ -5979,11 +5980,9 @@ class DocumentStoreEndpoint(StoreEndpoint):
|
|
5979
5980
|
page (int, optional): The page number to get. Defaults to 1.
|
5980
5981
|
page_size (int, optional): The number of items per page. Defaults to 100.
|
5981
5982
|
sort (str, optional): Sorting order of the query. Defaults to None.
|
5982
|
-
starting_offset (int, optional): The starting offset for the filter (offset is 0-indexed, and over-rides the page parameter)
|
5983
5983
|
Returns:
|
5984
5984
|
PageDocumentFamilyEndpoint: The page of document families.
|
5985
5985
|
"""
|
5986
|
-
page = starting_offset // page_size + 1
|
5987
5986
|
params = {"page": page, "pageSize": page_size, "filter": filter_string}
|
5988
5987
|
|
5989
5988
|
if sort is not None:
|
@@ -6761,6 +6760,38 @@ class ExtractionEngineEndpoint:
|
|
6761
6760
|
return response.text
|
6762
6761
|
|
6763
6762
|
|
6763
|
+
class ModelCostsEndpoint:
|
6764
|
+
"""
|
6765
|
+
Provides endpoint access to the model costs.
|
6766
|
+
|
6767
|
+
Attributes:
|
6768
|
+
client (KodexaClient): The client to interact with the model costs.
|
6769
|
+
"""
|
6770
|
+
|
6771
|
+
def __init__(self, client: "KodexaClient"):
|
6772
|
+
self.client = client
|
6773
|
+
|
6774
|
+
def get_model_costs(self, filters: Optional[List[str]] = None) -> List[AggregatedModelCost]:
|
6775
|
+
"""
|
6776
|
+
Get aggregated model costs filtered by the provided query context.
|
6777
|
+
This endpoint aggregates the model costs by modelId.
|
6778
|
+
|
6779
|
+
Args:
|
6780
|
+
filters (Optional[List[str]]): The filters to apply to the model costs.
|
6781
|
+
|
6782
|
+
Returns:
|
6783
|
+
List[AggregatedModelCost]: A list of aggregated model costs.
|
6784
|
+
"""
|
6785
|
+
params = {}
|
6786
|
+
if filters is not None:
|
6787
|
+
params["filter"] = filters
|
6788
|
+
|
6789
|
+
response = self.client.get("/api/modelCosts", params=params)
|
6790
|
+
return [
|
6791
|
+
AggregatedModelCost.model_validate(item)
|
6792
|
+
for item in response.json()
|
6793
|
+
]
|
6794
|
+
|
6764
6795
|
class KodexaClient:
|
6765
6796
|
"""
|
6766
6797
|
A class to represent a Kodexa client.
|
@@ -6816,6 +6847,7 @@ class KodexaClient:
|
|
6816
6847
|
self.workspaces = WorkspacesEndpoint(self)
|
6817
6848
|
self.data_exceptions = DataExceptionsEndpoint(self)
|
6818
6849
|
self.notes = NotesEndpoint(self)
|
6850
|
+
self.model_costs = ModelCostsEndpoint(self)
|
6819
6851
|
|
6820
6852
|
@staticmethod
|
6821
6853
|
def login(url, token):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "kodexa"
|
3
|
-
version = "7.4.
|
3
|
+
version = "7.4.416807352183"
|
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"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/dataclasses/templates/llm_data_class.j2
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{kodexa-7.4.416789395760 → kodexa-7.4.416807352183}/kodexa/model/entities/product_subscription.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|