fmtr.tools 1.0.39__py3-none-any.whl → 1.0.41__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.
Potentially problematic release.
This version of fmtr.tools might be problematic. Click here for more details.
- fmtr/tools/ai_tools/__init__.py +11 -0
- fmtr/tools/ai_tools/agentic_tools.py +11 -0
- fmtr/tools/{ai_tools.py → ai_tools/inference_tools.py} +2 -5
- fmtr/tools/data_modelling_tools.py +37 -2
- fmtr/tools/tabular_tools.py +1 -0
- fmtr/tools/version +1 -1
- {fmtr.tools-1.0.39.dist-info → fmtr.tools-1.0.41.dist-info}/METADATA +1 -1
- {fmtr.tools-1.0.39.dist-info → fmtr.tools-1.0.41.dist-info}/RECORD +12 -10
- {fmtr.tools-1.0.39.dist-info → fmtr.tools-1.0.41.dist-info}/LICENSE +0 -0
- {fmtr.tools-1.0.39.dist-info → fmtr.tools-1.0.41.dist-info}/WHEEL +0 -0
- {fmtr.tools-1.0.39.dist-info → fmtr.tools-1.0.41.dist-info}/entry_points.txt +0 -0
- {fmtr.tools-1.0.39.dist-info → fmtr.tools-1.0.41.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from fmtr.tools.import_tools import MissingExtraMockModule
|
|
2
|
+
|
|
3
|
+
try:
|
|
4
|
+
from fmtr.tools.ai_tools import inference_tools as infer
|
|
5
|
+
except ImportError as exception:
|
|
6
|
+
infer = MissingExtraMockModule('infer', exception)
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
from fmtr.tools.ai_tools import agentic_tools as agentic
|
|
10
|
+
except ImportError as exception:
|
|
11
|
+
agentic = MissingExtraMockModule('agentic', exception)
|
|
@@ -365,7 +365,7 @@ class ToolsCall(data_modelling_tools.Root):
|
|
|
365
365
|
def tst():
|
|
366
366
|
"""
|
|
367
367
|
|
|
368
|
-
Test with a large number of small input/outputs.
|
|
368
|
+
Test with a large number of small input/outputs. TODO: Unit tests.
|
|
369
369
|
|
|
370
370
|
"""
|
|
371
371
|
mask = 'Write out the following number as words: {}. Just the text please, no explanation or alternatives'
|
|
@@ -382,7 +382,7 @@ def tst():
|
|
|
382
382
|
def tst_tool():
|
|
383
383
|
"""
|
|
384
384
|
|
|
385
|
-
Test Tool usage
|
|
385
|
+
Test Tool usage: TODO: Unit tests.
|
|
386
386
|
|
|
387
387
|
"""
|
|
388
388
|
|
|
@@ -411,9 +411,6 @@ def tst_tool():
|
|
|
411
411
|
print(obj)
|
|
412
412
|
|
|
413
413
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
414
|
if __name__ == '__main__':
|
|
418
415
|
texts = tst_tool()
|
|
419
416
|
texts
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
from pydantic import BaseModel, RootModel
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
def to_df(*objs):
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
DataFrame representation of Data Models as rows.
|
|
8
|
+
|
|
9
|
+
"""
|
|
10
|
+
from fmtr.tools import tabular
|
|
11
|
+
rows = [obj.model_dump() for obj in objs]
|
|
12
|
+
df = tabular.DataFrame(rows)
|
|
13
|
+
return df
|
|
14
|
+
|
|
15
|
+
|
|
4
16
|
class MixinFromJson:
|
|
5
17
|
|
|
6
18
|
@classmethod
|
|
@@ -27,7 +39,22 @@ class Base(BaseModel, MixinFromJson):
|
|
|
27
39
|
Base model
|
|
28
40
|
|
|
29
41
|
"""
|
|
30
|
-
|
|
42
|
+
|
|
43
|
+
def to_df(self):
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
DataFrame representation with Fields as rows.
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
objs = []
|
|
51
|
+
for name in self.model_fields.keys():
|
|
52
|
+
val = getattr(self, name)
|
|
53
|
+
objs.append(val)
|
|
54
|
+
|
|
55
|
+
df = to_df(*objs)
|
|
56
|
+
df['id'] = list(self.model_fields.keys())
|
|
57
|
+
return df
|
|
31
58
|
|
|
32
59
|
|
|
33
60
|
class Root(RootModel, MixinFromJson):
|
|
@@ -36,4 +63,12 @@ class Root(RootModel, MixinFromJson):
|
|
|
36
63
|
Root (list) model
|
|
37
64
|
|
|
38
65
|
"""
|
|
39
|
-
|
|
66
|
+
|
|
67
|
+
def to_df(self):
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
DataFrame representation with items as rows.
|
|
71
|
+
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
return to_df(*self.items)
|
fmtr/tools/tabular_tools.py
CHANGED
fmtr/tools/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.41
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
fmtr/tools/__init__.py,sha256=KDtV85yhOj1vjNsJA0WElOaQnVFmkX70jX6XO9Dxasc,5336
|
|
2
|
-
fmtr/tools/ai_tools.py,sha256=hN7DzuATXfurCDHugaluUsbmF_PzeKu3BTc2WXhG59g,11806
|
|
3
2
|
fmtr/tools/api_tools.py,sha256=u5YEdKyKto8MKY8legULLU7xeJ7lY2Bgyaep_xa8iZg,2089
|
|
4
3
|
fmtr/tools/async_tools.py,sha256=ewz757WcveQJd-G5SVr2JDOQVbdLGecCgl-tsBGVZz4,284
|
|
5
4
|
fmtr/tools/augmentation_tools.py,sha256=-6ESbO4CDlKqVOV1J1V6qBeoBMzbFIinkDHRHnCBej0,55
|
|
@@ -7,7 +6,7 @@ fmtr/tools/caching_tools.py,sha256=UOCYUNvLQ-NofR_dhqBmZF96-HRPf4At5MmxVk3gAIk,2
|
|
|
7
6
|
fmtr/tools/config.py,sha256=5XllwShglvSqEl7Jt0EyObWHW4p-5QahkZjTAXdIXxc,715
|
|
8
7
|
fmtr/tools/config_tools.py,sha256=27PbPYj90ClIW4QcRoUoiFM3SbWeMIIZsZR32IPU4V8,805
|
|
9
8
|
fmtr/tools/console_script_tools.py,sha256=T968S6fL--84G5ALaKwcTAzUOFyVhTU7Ts6qbk8oaeE,65
|
|
10
|
-
fmtr/tools/data_modelling_tools.py,sha256=
|
|
9
|
+
fmtr/tools/data_modelling_tools.py,sha256=w0bnKbEJMFhWRMIof9mYsuSo-Vs8Tehw2_JY3NDL0VM,1242
|
|
11
10
|
fmtr/tools/dataclass_tools.py,sha256=0Gt6KeLhtPgubo_2tYkIVqB8oQ91Qzag8OAGZDdjvMU,1209
|
|
12
11
|
fmtr/tools/datatype_tools.py,sha256=3P4AWIFGkJ-UqvXlj0Jc9IvkIIgTOE9jRrOk3NVbpH8,1508
|
|
13
12
|
fmtr/tools/docker_tools.py,sha256=rdaZje2xhlmnfQqZnR7IHgRdWncTLjrJcViUTt5oEwk,617
|
|
@@ -39,13 +38,16 @@ fmtr/tools/random_tools.py,sha256=4VlQdk5THbR8ka4pZaLbk_ZO_4yy6PF_lHZes_rgenY,22
|
|
|
39
38
|
fmtr/tools/semantic_tools.py,sha256=cxY9NSAHWj4nEc6Oj4qA1omR3dWbl2OuH7_PkINc6_E,1386
|
|
40
39
|
fmtr/tools/spaces_tools.py,sha256=D_he3mve6DruB3OPS6QyzqD05ChHnRTb4buViKPe7To,1099
|
|
41
40
|
fmtr/tools/string_tools.py,sha256=0aAaLS7JPzCaanuyVT3YyonFbEZyimSAdesHRX_Ew6c,3362
|
|
42
|
-
fmtr/tools/tabular_tools.py,sha256=
|
|
41
|
+
fmtr/tools/tabular_tools.py,sha256=L0yNsU_c8dGTmsUlMFERfTt2a3aZv_pKr2YQc7C9OvA,65
|
|
43
42
|
fmtr/tools/tokenization_tools.py,sha256=9FP5vgPufWv0XA961eVKObFll0d_2mM0W3ut3rtZyeo,4329
|
|
44
43
|
fmtr/tools/tools.py,sha256=xnfUrOnrT4OxFYez6vV5tAhydzCICJFiGVnviiZDEQo,796
|
|
45
44
|
fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
|
|
46
|
-
fmtr/tools/version,sha256=
|
|
45
|
+
fmtr/tools/version,sha256=wefK8figGrSRjRC-32gDP5E57RhWCidTMLTU7dQsw8o,6
|
|
47
46
|
fmtr/tools/version_tools.py,sha256=axzzHBS9V1n6YuSacsDKG3VfAvRqR8qr6aENCibR8vs,1248
|
|
48
47
|
fmtr/tools/yaml_tools.py,sha256=Ol43ZwbnSXGnn1K98Uxx61KPGSqfC4axE-X2q1LKMwk,349
|
|
48
|
+
fmtr/tools/ai_tools/__init__.py,sha256=4VO4uyO2ZBzLVB63DYAVsv1qMT9NX39B9P5YCaPrfto,373
|
|
49
|
+
fmtr/tools/ai_tools/agentic_tools.py,sha256=Hwd8GuW1979fkgu8Gc_yJH2zS2gmqnYAxtstEDBsOqY,154
|
|
50
|
+
fmtr/tools/ai_tools/inference_tools.py,sha256=yF8Oxph0L8W2CnK_o-MVztBhWVwBpgOEkx9_m3uqQww,11840
|
|
49
51
|
fmtr/tools/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
52
|
fmtr/tools/tests/conftest.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
53
|
fmtr/tools/tests/helpers.py,sha256=N5sf9YoZV93a7tf_UxpLeyQ9vp6Ec0teNIimFDvc054,1091
|
|
@@ -54,9 +56,9 @@ fmtr/tools/tests/test_environment.py,sha256=iHaiMQfECYZPkPKwfuIZV9uHuWe3aE-p_dN_
|
|
|
54
56
|
fmtr/tools/tests/test_json.py,sha256=IeSP4ziPvRcmS8kq7k9tHonC9rN5YYq9GSNT2ul6Msk,287
|
|
55
57
|
fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g,2188
|
|
56
58
|
fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
|
|
57
|
-
fmtr.tools-1.0.
|
|
58
|
-
fmtr.tools-1.0.
|
|
59
|
-
fmtr.tools-1.0.
|
|
60
|
-
fmtr.tools-1.0.
|
|
61
|
-
fmtr.tools-1.0.
|
|
62
|
-
fmtr.tools-1.0.
|
|
59
|
+
fmtr.tools-1.0.41.dist-info/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
|
|
60
|
+
fmtr.tools-1.0.41.dist-info/METADATA,sha256=_L1_Chpq60KVEWiFYvKN43rFyD6t-_O5YzjGau9THjM,13859
|
|
61
|
+
fmtr.tools-1.0.41.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
62
|
+
fmtr.tools-1.0.41.dist-info/entry_points.txt,sha256=CEStVkwJ1mTFvhN1WV5RdW83SkNW1d5Syj-KZ6A19ng,72
|
|
63
|
+
fmtr.tools-1.0.41.dist-info/top_level.txt,sha256=t5341a8ii3n4RFizwTeXGmcq_pf4GqL1h9ylE5LIWRk,12
|
|
64
|
+
fmtr.tools-1.0.41.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|