unique_toolkit 0.8.56__py3-none-any.whl → 0.8.57__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.
- unique_toolkit/_common/utils/write_configuration.py +51 -0
- {unique_toolkit-0.8.56.dist-info → unique_toolkit-0.8.57.dist-info}/METADATA +4 -1
- {unique_toolkit-0.8.56.dist-info → unique_toolkit-0.8.57.dist-info}/RECORD +5 -4
- {unique_toolkit-0.8.56.dist-info → unique_toolkit-0.8.57.dist-info}/LICENSE +0 -0
- {unique_toolkit-0.8.56.dist-info → unique_toolkit-0.8.57.dist-info}/WHEEL +0 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
import json
|
2
|
+
from pathlib import Path
|
3
|
+
|
4
|
+
from humps import kebabize, pascalize
|
5
|
+
from pydantic import BaseModel
|
6
|
+
|
7
|
+
|
8
|
+
def write_module_configuration_schema(
|
9
|
+
service_folderpath: Path,
|
10
|
+
write_folderpath: Path,
|
11
|
+
config: BaseModel,
|
12
|
+
sub_name: str = "",
|
13
|
+
):
|
14
|
+
filename_prefix = pascalize(service_folderpath.name)
|
15
|
+
|
16
|
+
filepath = (
|
17
|
+
write_folderpath
|
18
|
+
/ f"{filename_prefix}{f'-{sub_name}' if sub_name else ''}Schema.json"
|
19
|
+
)
|
20
|
+
|
21
|
+
with open(filepath, "w") as f:
|
22
|
+
json.dump(config.model_json_schema(by_alias=True), f, indent=4)
|
23
|
+
|
24
|
+
|
25
|
+
def write_service_configuration(
|
26
|
+
service_folderpath: Path,
|
27
|
+
write_folderpath: Path,
|
28
|
+
config: BaseModel,
|
29
|
+
sub_name: str = "",
|
30
|
+
):
|
31
|
+
filename_prefix = kebabize(service_folderpath.name)
|
32
|
+
|
33
|
+
filepath = (
|
34
|
+
write_folderpath
|
35
|
+
/ f"{filename_prefix}{f'-{sub_name}' if sub_name else ''}-configuration-schema.json"
|
36
|
+
)
|
37
|
+
|
38
|
+
with open(filepath, "w") as f:
|
39
|
+
json.dump(config.model_json_schema(by_alias=True), f, indent=4)
|
40
|
+
filepath = (
|
41
|
+
write_folderpath
|
42
|
+
/ f"{filename_prefix}{f'-{sub_name}' if sub_name else ''}-default-configuration.json"
|
43
|
+
)
|
44
|
+
|
45
|
+
# We exclude language_model_info as it is infered from language_model_name
|
46
|
+
with open(filepath, "w") as f:
|
47
|
+
f.write(
|
48
|
+
config.model_dump_json(
|
49
|
+
by_alias=True, indent=4, exclude=set(["language_model_info"])
|
50
|
+
)
|
51
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unique_toolkit
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.57
|
4
4
|
Summary:
|
5
5
|
License: Proprietary
|
6
6
|
Author: Cedric Klinkert
|
@@ -119,6 +119,9 @@ All notable changes to this project will be documented in this file.
|
|
119
119
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
120
120
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
121
121
|
|
122
|
+
## [0.8.57] - 2025-09-14
|
123
|
+
- Added more utils to commons
|
124
|
+
|
122
125
|
## [0.8.56] - 2025-09-12
|
123
126
|
- Fixed token counter in utils
|
124
127
|
|
@@ -16,6 +16,7 @@ unique_toolkit/_common/pydantic_helpers.py,sha256=4a8LPey31k4dCztYag1OBhYnGHREN0
|
|
16
16
|
unique_toolkit/_common/token/image_token_counting.py,sha256=VpFfZyY0GIH27q_Wy4YNjk2algqvbCtJyzuuROoFQPw,2189
|
17
17
|
unique_toolkit/_common/token/token_counting.py,sha256=gM4B_aUqKqEPvmStFNcvCWNMNNNNKbVaywBDxlbgIps,7121
|
18
18
|
unique_toolkit/_common/utils/structured_output/schema.py,sha256=Tp7kDYcmKtnUhcuRkH86TSYhylRff0ZZJYb2dLkISts,131
|
19
|
+
unique_toolkit/_common/utils/write_configuration.py,sha256=fzvr4C-XBL3OSM3Od9TbqIxeeDS9_d9CLEyTq6DDknY,1409
|
19
20
|
unique_toolkit/_common/validate_required_values.py,sha256=Y_M1ub9gIKP9qZ45F6Zq3ZHtuIqhmOjl8Z2Vd3avg8w,588
|
20
21
|
unique_toolkit/_common/validators.py,sha256=aZwbMho7XszN7lT5RtemaiXgC0WJ4u40oeVgsNGhF4U,2803
|
21
22
|
unique_toolkit/app/__init__.py,sha256=ETxYDpEizg_PKmi4JPX_P76ySq-us-xypfAIdKQ1QZU,1284
|
@@ -122,7 +123,7 @@ unique_toolkit/tools/utils/source_handling/__init__.py,sha256=47DEQpj8HBSa-_TImW
|
|
122
123
|
unique_toolkit/tools/utils/source_handling/schema.py,sha256=vzAyf6ZWNexjMO0OrnB8y2glGkvAilmGGQXd6zcDaKw,870
|
123
124
|
unique_toolkit/tools/utils/source_handling/source_formatting.py,sha256=C7uayNbdkNVJdEARA5CENnHtNY1SU6etlaqbgHNyxaQ,9152
|
124
125
|
unique_toolkit/tools/utils/source_handling/tests/test_source_formatting.py,sha256=oM5ZxEgzROrnX1229KViCAFjRxl9wCTzWZoinYSHleM,6979
|
125
|
-
unique_toolkit-0.8.
|
126
|
-
unique_toolkit-0.8.
|
127
|
-
unique_toolkit-0.8.
|
128
|
-
unique_toolkit-0.8.
|
126
|
+
unique_toolkit-0.8.57.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
127
|
+
unique_toolkit-0.8.57.dist-info/METADATA,sha256=1_R9STXImn9ikILyet9NHbiZACcY1V_RDn4HDHVMBJw,31933
|
128
|
+
unique_toolkit-0.8.57.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
129
|
+
unique_toolkit-0.8.57.dist-info/RECORD,,
|
File without changes
|
File without changes
|