fmtr.tools 1.3.54__py3-none-any.whl → 1.3.56__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/agentic_tools.py +5 -2
- fmtr/tools/interface_tools/controls.py +127 -0
- fmtr/tools/version +1 -1
- {fmtr_tools-1.3.54.dist-info → fmtr_tools-1.3.56.dist-info}/METADATA +52 -52
- {fmtr_tools-1.3.54.dist-info → fmtr_tools-1.3.56.dist-info}/RECORD +9 -9
- {fmtr_tools-1.3.54.dist-info → fmtr_tools-1.3.56.dist-info}/WHEEL +0 -0
- {fmtr_tools-1.3.54.dist-info → fmtr_tools-1.3.56.dist-info}/entry_points.txt +0 -0
- {fmtr_tools-1.3.54.dist-info → fmtr_tools-1.3.56.dist-info}/licenses/LICENSE +0 -0
- {fmtr_tools-1.3.54.dist-info → fmtr_tools-1.3.56.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import List, Optional, Any, Annotated, Generic
|
|
2
|
+
|
|
1
3
|
import pydantic_ai
|
|
2
4
|
from pydantic import PlainValidator
|
|
3
5
|
from pydantic_ai import RunContext, ModelRetry
|
|
@@ -6,7 +8,6 @@ from pydantic_ai.agent import AgentRunResult, Agent
|
|
|
6
8
|
from pydantic_ai.models.openai import OpenAIModel
|
|
7
9
|
from pydantic_ai.providers.openai import OpenAIProvider
|
|
8
10
|
from pydantic_ai.tools import AgentDepsT
|
|
9
|
-
from typing import List, Optional, Any, Annotated, Generic
|
|
10
11
|
|
|
11
12
|
from fmtr.tools import environment_tools as env
|
|
12
13
|
from fmtr.tools.constants import Constants
|
|
@@ -27,6 +28,8 @@ class Validator:
|
|
|
27
28
|
raise NotImplementedError()
|
|
28
29
|
|
|
29
30
|
|
|
31
|
+
api_key = env.get(Constants.FMTR_OPENAI_API_KEY_KEY, None)
|
|
32
|
+
|
|
30
33
|
class Task(Generic[AgentDepsT, OutputDataT]):
|
|
31
34
|
"""
|
|
32
35
|
|
|
@@ -37,7 +40,7 @@ class Task(Generic[AgentDepsT, OutputDataT]):
|
|
|
37
40
|
TypeDeps = str
|
|
38
41
|
TypeOutput = str
|
|
39
42
|
|
|
40
|
-
PROVIDER = OpenAIProvider(api_key=
|
|
43
|
+
PROVIDER = OpenAIProvider(api_key=api_key) if api_key else None
|
|
41
44
|
|
|
42
45
|
API_HOST_FMTR = env.get(Constants.FMTR_AI_HOST_KEY, Constants.FMTR_AI_HOST_DEFAULT)
|
|
43
46
|
API_URL_FMTR = f'https://{API_HOST_FMTR}/v1'
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
import flet as ft
|
|
4
|
+
from flet.core.gesture_detector import TapEvent
|
|
5
|
+
|
|
6
|
+
from fmtr.tools.logging_tools import logger
|
|
7
|
+
|
|
2
8
|
|
|
3
9
|
class SliderSteps(ft.Slider):
|
|
4
10
|
"""
|
|
@@ -11,3 +17,124 @@ class SliderSteps(ft.Slider):
|
|
|
11
17
|
self.step = step
|
|
12
18
|
divisions = (max - min) // step
|
|
13
19
|
super().__init__(*args, min=min, max=max, divisions=divisions, **kwargs)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Cell(ft.DataCell):
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
Context-aware, clickable data cell.
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def __init__(self, series, column):
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
Store context
|
|
33
|
+
|
|
34
|
+
"""
|
|
35
|
+
self.series = series
|
|
36
|
+
self.column = column
|
|
37
|
+
self.value = series[column]
|
|
38
|
+
|
|
39
|
+
super().__init__(self.gesture_detector)
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def text(self):
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
Cell contents text
|
|
46
|
+
|
|
47
|
+
"""
|
|
48
|
+
return ft.Text(str(self.value))
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def gesture_detector(self):
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
Make arbitrary content clickable
|
|
55
|
+
|
|
56
|
+
"""
|
|
57
|
+
return ft.GestureDetector(content=self.text, on_tap=self.click_tap)
|
|
58
|
+
|
|
59
|
+
async def click_tap(self, event: TapEvent):
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
Default cell click behavior — override in subclass if needed
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
value = await self.click(event=event)
|
|
66
|
+
event.page.update()
|
|
67
|
+
return value
|
|
68
|
+
|
|
69
|
+
async def click(self, event: Optional[TapEvent] = None):
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
Default cell click behavior — override in subclass if needed
|
|
73
|
+
|
|
74
|
+
"""
|
|
75
|
+
logger.info(f"Clicked {self.column=} {self.series.id=} {self.value=}")
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class Row(ft.DataRow):
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
Instantiate a row from a series
|
|
82
|
+
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
TypeCell = Cell
|
|
86
|
+
|
|
87
|
+
def __init__(self, series):
|
|
88
|
+
self.series = series
|
|
89
|
+
cells = [self.TypeCell(series, col) for col in series.index]
|
|
90
|
+
super().__init__(cells)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class Column(ft.DataColumn):
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
Column stub
|
|
97
|
+
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
def __init__(self, col_name: str):
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
Store context
|
|
104
|
+
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
self.col_name = col_name
|
|
108
|
+
|
|
109
|
+
super().__init__(label=self.text)
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def text(self):
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
Cell contents text
|
|
116
|
+
|
|
117
|
+
"""
|
|
118
|
+
return ft.Text(str(self.col_name))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class Table(ft.DataTable):
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
Dataframe with clickable cells
|
|
125
|
+
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
TypeRow = Row
|
|
129
|
+
TypeColumn = Column
|
|
130
|
+
|
|
131
|
+
def __init__(self, df): # todo move to submodule with tabular deps
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
Set columns/rows using relevant types
|
|
135
|
+
|
|
136
|
+
"""
|
|
137
|
+
self.df = df
|
|
138
|
+
columns = [self.TypeColumn(col) for col in df.columns]
|
|
139
|
+
rows = [self.TypeRow(row) for _, row in df.iterrows()]
|
|
140
|
+
super().__init__(columns=columns, rows=rows)
|
fmtr/tools/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.3.
|
|
1
|
+
1.3.56
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.56
|
|
4
4
|
Summary: Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML
|
|
5
5
|
Home-page: https://github.com/fmtr/fmtr.tools
|
|
6
6
|
Author: Frontmatter
|
|
@@ -154,68 +154,68 @@ Provides-Extra: db-document
|
|
|
154
154
|
Requires-Dist: beanie[odm]; extra == "db-document"
|
|
155
155
|
Requires-Dist: motor; extra == "db-document"
|
|
156
156
|
Provides-Extra: all
|
|
157
|
-
Requires-Dist:
|
|
158
|
-
Requires-Dist:
|
|
159
|
-
Requires-Dist:
|
|
160
|
-
Requires-Dist:
|
|
161
|
-
Requires-Dist:
|
|
162
|
-
Requires-Dist:
|
|
163
|
-
Requires-Dist:
|
|
164
|
-
Requires-Dist:
|
|
165
|
-
Requires-Dist:
|
|
166
|
-
Requires-Dist:
|
|
167
|
-
Requires-Dist:
|
|
168
|
-
Requires-Dist: sre_yield; extra == "all"
|
|
169
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
170
|
-
Requires-Dist: setuptools; extra == "all"
|
|
171
|
-
Requires-Dist: motor; extra == "all"
|
|
157
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
158
|
+
Requires-Dist: peft; extra == "all"
|
|
159
|
+
Requires-Dist: beanie[odm]; extra == "all"
|
|
160
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
161
|
+
Requires-Dist: logfire; extra == "all"
|
|
162
|
+
Requires-Dist: Unidecode; extra == "all"
|
|
163
|
+
Requires-Dist: pydantic; extra == "all"
|
|
164
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
165
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
166
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
167
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
172
168
|
Requires-Dist: tinynetrc; extra == "all"
|
|
169
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
173
170
|
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
174
|
-
Requires-Dist:
|
|
175
|
-
Requires-Dist: pydantic; extra == "all"
|
|
176
|
-
Requires-Dist: bokeh; extra == "all"
|
|
177
|
-
Requires-Dist: pydantic-extra-types; extra == "all"
|
|
171
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
178
172
|
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
179
|
-
Requires-Dist:
|
|
180
|
-
Requires-Dist:
|
|
181
|
-
Requires-Dist:
|
|
173
|
+
Requires-Dist: flet-video; extra == "all"
|
|
174
|
+
Requires-Dist: pycountry; extra == "all"
|
|
175
|
+
Requires-Dist: odfpy; extra == "all"
|
|
176
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
177
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
178
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
179
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
180
|
+
Requires-Dist: ollama; extra == "all"
|
|
181
|
+
Requires-Dist: fastapi; extra == "all"
|
|
182
|
+
Requires-Dist: cachetools; extra == "all"
|
|
183
|
+
Requires-Dist: appdirs; extra == "all"
|
|
184
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
182
185
|
Requires-Dist: torchaudio; extra == "all"
|
|
186
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
187
|
+
Requires-Dist: deepdiff; extra == "all"
|
|
188
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
189
|
+
Requires-Dist: pandas; extra == "all"
|
|
190
|
+
Requires-Dist: playwright; extra == "all"
|
|
191
|
+
Requires-Dist: pydantic-extra-types; extra == "all"
|
|
192
|
+
Requires-Dist: html2text; extra == "all"
|
|
193
|
+
Requires-Dist: regex; extra == "all"
|
|
183
194
|
Requires-Dist: yamlscript; extra == "all"
|
|
184
|
-
Requires-Dist:
|
|
195
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
196
|
+
Requires-Dist: sre_yield; extra == "all"
|
|
197
|
+
Requires-Dist: python-on-whales; extra == "all"
|
|
198
|
+
Requires-Dist: semver; extra == "all"
|
|
185
199
|
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
186
|
-
Requires-Dist:
|
|
200
|
+
Requires-Dist: google-auth; extra == "all"
|
|
201
|
+
Requires-Dist: setuptools; extra == "all"
|
|
202
|
+
Requires-Dist: distributed; extra == "all"
|
|
187
203
|
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
188
|
-
Requires-Dist:
|
|
189
|
-
Requires-Dist:
|
|
190
|
-
Requires-Dist:
|
|
204
|
+
Requires-Dist: httpx; extra == "all"
|
|
205
|
+
Requires-Dist: flet[all]; extra == "all"
|
|
206
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
207
|
+
Requires-Dist: diskcache; extra == "all"
|
|
208
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
191
209
|
Requires-Dist: torchvision; extra == "all"
|
|
192
|
-
Requires-Dist:
|
|
210
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
193
211
|
Requires-Dist: json_repair; extra == "all"
|
|
194
|
-
Requires-Dist:
|
|
195
|
-
Requires-Dist:
|
|
196
|
-
Requires-Dist: beanie[odm]; extra == "all"
|
|
197
|
-
Requires-Dist: flet-video; extra == "all"
|
|
198
|
-
Requires-Dist: diskcache; extra == "all"
|
|
212
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
213
|
+
Requires-Dist: tabulate; extra == "all"
|
|
199
214
|
Requires-Dist: filetype; extra == "all"
|
|
200
|
-
Requires-Dist:
|
|
201
|
-
Requires-Dist:
|
|
202
|
-
Requires-Dist:
|
|
203
|
-
Requires-Dist: python-on-whales; extra == "all"
|
|
204
|
-
Requires-Dist: regex; extra == "all"
|
|
205
|
-
Requires-Dist: pycountry; extra == "all"
|
|
206
|
-
Requires-Dist: flet[all]; extra == "all"
|
|
207
|
-
Requires-Dist: peft; extra == "all"
|
|
208
|
-
Requires-Dist: pymupdf4llm; extra == "all"
|
|
209
|
-
Requires-Dist: httpx; extra == "all"
|
|
210
|
-
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
211
|
-
Requires-Dist: odfpy; extra == "all"
|
|
212
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
213
|
-
Requires-Dist: deepmerge; extra == "all"
|
|
215
|
+
Requires-Dist: faker; extra == "all"
|
|
216
|
+
Requires-Dist: motor; extra == "all"
|
|
217
|
+
Requires-Dist: bokeh; extra == "all"
|
|
214
218
|
Requires-Dist: openai; extra == "all"
|
|
215
|
-
Requires-Dist: sentence_transformers; extra == "all"
|
|
216
|
-
Requires-Dist: httpx_retries; extra == "all"
|
|
217
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
218
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
219
219
|
Dynamic: author
|
|
220
220
|
Dynamic: author-email
|
|
221
221
|
Dynamic: description
|
|
@@ -45,11 +45,11 @@ fmtr/tools/tabular_tools.py,sha256=mw6vOij1Ch-pVAyHMPtm5zj__ULZN_TKeBYOfj33wFM,1
|
|
|
45
45
|
fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
|
|
46
46
|
fmtr/tools/tools.py,sha256=CAsApa1YwVdNE6H66Vjivs_mXYvOas3rh7fPELAnTpk,795
|
|
47
47
|
fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
|
|
48
|
-
fmtr/tools/version,sha256=
|
|
48
|
+
fmtr/tools/version,sha256=YmsM01m3TYTUqp0ewpZSPr9_e7bbjInqRFi4MA7mVrY,6
|
|
49
49
|
fmtr/tools/webhook_tools.py,sha256=q3pVJ1NCem2SrMuFcLxiWd7DibFs7Q-uGtojfXd3Qcg,380
|
|
50
50
|
fmtr/tools/yaml_tools.py,sha256=Bhhyd6GQVKO72Lp8ky7bAUjIB_65Hdh0Q45SKIEe6S8,1901
|
|
51
51
|
fmtr/tools/ai_tools/__init__.py,sha256=O8VRlPnnQCncg2ZZ2l_VdWLJf4jkKH6dkZFVbv6o7IM,388
|
|
52
|
-
fmtr/tools/ai_tools/agentic_tools.py,sha256
|
|
52
|
+
fmtr/tools/ai_tools/agentic_tools.py,sha256=fRb5M3A2avICmrhTgLq-FpCVgWiSp3_Bn2j9yP6hxo0,5136
|
|
53
53
|
fmtr/tools/ai_tools/inference_tools.py,sha256=2UP2gXEyOJUjyyV6zmFIYmIxUsh1rXkRH0IbFvr2bRs,11908
|
|
54
54
|
fmtr/tools/database_tools/__init__.py,sha256=-YXEs3P4nwg7hdvALpaW4K2Pg9FIc49rD53smqnBgT4,221
|
|
55
55
|
fmtr/tools/database_tools/document.py,sha256=QLW-Ll2uVp1UTjA4leiJ3gtrUJHQPzwpFT_AZ3jow3A,812
|
|
@@ -67,7 +67,7 @@ fmtr/tools/entrypoints/remote_debug_test.py,sha256=wmKg9o2pQq7eqeHmaO8oviujNgtns
|
|
|
67
67
|
fmtr/tools/entrypoints/shell_debug.py,sha256=0No3tAg9Ri4_vvSlQCUtAY-11HR0nE45i0VVtiAViwY,106
|
|
68
68
|
fmtr/tools/interface_tools/__init__.py,sha256=_bgZRTqmygtYM75o6_zyQRhT_XZnDERZEHmsYVrzyxw,393
|
|
69
69
|
fmtr/tools/interface_tools/context.py,sha256=VpoR_ZCndDbwS0AzIPKi1hB2QckwJU5dJqAJavF3mqk,151
|
|
70
|
-
fmtr/tools/interface_tools/controls.py,sha256=
|
|
70
|
+
fmtr/tools/interface_tools/controls.py,sha256=rLa80ujAcwPEBRHjV_pAoSsVlmibtj0jeYyzznQRf-Q,2663
|
|
71
71
|
fmtr/tools/interface_tools/interface_tools.py,sha256=GXnBkSO_Y-F7E5sErJdyyEkO3PyTz97yQBXlTEw_Ufw,4295
|
|
72
72
|
fmtr/tools/path_tools/__init__.py,sha256=XrJXt7Zzo90tYUVksMlDfKkWt775zJ9OSi2NbhnqMDI,459
|
|
73
73
|
fmtr/tools/path_tools/app_path_tools.py,sha256=JrJvtTDd_gkCKcZtBCDTMktsM77PZwGV_hzQX0g5GU8,1722
|
|
@@ -85,9 +85,9 @@ fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g
|
|
|
85
85
|
fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
|
|
86
86
|
fmtr/tools/version_tools/__init__.py,sha256=cjE6nO6AoVOUp3RwgTbqL9wiw8J1l2pHJOz6Gn6bxjA,326
|
|
87
87
|
fmtr/tools/version_tools/version_tools.py,sha256=Hcc6yferZS1hHbugRTdiHhSNmXEEG0hjCiTTXKna-YY,1127
|
|
88
|
-
fmtr_tools-1.3.
|
|
89
|
-
fmtr_tools-1.3.
|
|
90
|
-
fmtr_tools-1.3.
|
|
91
|
-
fmtr_tools-1.3.
|
|
92
|
-
fmtr_tools-1.3.
|
|
93
|
-
fmtr_tools-1.3.
|
|
88
|
+
fmtr_tools-1.3.56.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
|
|
89
|
+
fmtr_tools-1.3.56.dist-info/METADATA,sha256=JAdKA-pmQCfi88M52e5iuCHo6w2fJ0-EDsQJdg_yOOU,17455
|
|
90
|
+
fmtr_tools-1.3.56.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
91
|
+
fmtr_tools-1.3.56.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
|
|
92
|
+
fmtr_tools-1.3.56.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
|
|
93
|
+
fmtr_tools-1.3.56.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|