fmtr.tools 1.3.30__py3-none-any.whl → 1.3.31__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.

@@ -1,9 +1,11 @@
1
+ from typing import List, Optional, Any, Annotated
2
+
1
3
  import pydantic_ai
4
+ from pydantic import PlainValidator
2
5
  from pydantic_ai import RunContext, ModelRetry
3
6
  from pydantic_ai.agent import AgentRunResult, Agent
4
7
  from pydantic_ai.models.openai import OpenAIModel
5
8
  from pydantic_ai.providers.openai import OpenAIProvider
6
- from typing import List, Optional, Any
7
9
 
8
10
  from fmtr.tools import environment_tools as env
9
11
  from fmtr.tools.constants import Constants
@@ -131,6 +133,21 @@ class Task:
131
133
  """
132
134
  return f'{self.__class__.__name__}({repr(truncate_mid(self.SYSTEM_PROMPT_STATIC, 100))})'
133
135
 
136
+
137
+ def default_prompt_none_specified(text):
138
+ """
139
+
140
+ If the prompt is falsey, explicitly state None Specified
141
+
142
+ """
143
+ if not (text or '').strip():
144
+ return Constants.PROMPT_NONE_SPECIFIED
145
+ return text
146
+
147
+
148
+ StringDefaultNoneSpecified = Annotated[str, PlainValidator(default_prompt_none_specified)]
149
+
150
+
134
151
  if __name__ == '__main__':
135
152
  import asyncio
136
153
  from fmtr.tools import dm
fmtr/tools/constants.py CHANGED
@@ -52,4 +52,4 @@ class Constants:
52
52
 
53
53
  INFRA = 'infra'
54
54
 
55
- PROMPT_NOT_SPECIFIED = '[None Specified]'
55
+ PROMPT_NONE_SPECIFIED = '[None Specified]'
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.3.30
1
+ 1.3.31
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmtr.tools
3
- Version: 1.3.30
3
+ Version: 1.3.31
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
@@ -126,61 +126,61 @@ Requires-Dist: logfire[httpx]; extra == "http"
126
126
  Provides-Extra: setup
127
127
  Requires-Dist: setuptools; extra == "setup"
128
128
  Provides-Extra: all
129
+ Requires-Dist: sre_yield; extra == "all"
130
+ Requires-Dist: tinynetrc; extra == "all"
131
+ Requires-Dist: logfire[httpx]; extra == "all"
132
+ Requires-Dist: google-auth-httplib2; extra == "all"
133
+ Requires-Dist: pymupdf4llm; extra == "all"
134
+ Requires-Dist: ollama; extra == "all"
135
+ Requires-Dist: fastapi; extra == "all"
136
+ Requires-Dist: tabulate; extra == "all"
137
+ Requires-Dist: diskcache; extra == "all"
138
+ Requires-Dist: google-auth; extra == "all"
129
139
  Requires-Dist: cachetools; extra == "all"
140
+ Requires-Dist: appdirs; extra == "all"
141
+ Requires-Dist: html2text; extra == "all"
142
+ Requires-Dist: docker; extra == "all"
130
143
  Requires-Dist: Unidecode; extra == "all"
131
- Requires-Dist: httpx_retries; extra == "all"
132
- Requires-Dist: regex; extra == "all"
144
+ Requires-Dist: uvicorn[standard]; extra == "all"
133
145
  Requires-Dist: pymupdf; extra == "all"
134
- Requires-Dist: yamlscript; extra == "all"
135
- Requires-Dist: openpyxl; extra == "all"
136
- Requires-Dist: logfire[httpx]; extra == "all"
137
- Requires-Dist: sentence_transformers; extra == "all"
138
- Requires-Dist: filetype; extra == "all"
139
- Requires-Dist: google-api-python-client; extra == "all"
140
- Requires-Dist: pymupdf4llm; extra == "all"
141
- Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
146
+ Requires-Dist: distributed; extra == "all"
147
+ Requires-Dist: faker; extra == "all"
142
148
  Requires-Dist: dnspython[doh]; extra == "all"
149
+ Requires-Dist: filetype; extra == "all"
150
+ Requires-Dist: pyyaml; extra == "all"
151
+ Requires-Dist: sentence_transformers; extra == "all"
152
+ Requires-Dist: logfire; extra == "all"
153
+ Requires-Dist: flet-video; extra == "all"
154
+ Requires-Dist: tokenizers; extra == "all"
143
155
  Requires-Dist: pytest-cov; extra == "all"
144
- Requires-Dist: docker; extra == "all"
145
- Requires-Dist: pydantic-settings; extra == "all"
146
- Requires-Dist: google-auth-oauthlib; extra == "all"
147
- Requires-Dist: flet-webview; extra == "all"
148
156
  Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
149
- Requires-Dist: transformers[sentencepiece]; extra == "all"
150
- Requires-Dist: torchvision; extra == "all"
151
- Requires-Dist: appdirs; extra == "all"
152
- Requires-Dist: httpx; extra == "all"
153
- Requires-Dist: tinynetrc; extra == "all"
154
- Requires-Dist: tabulate; extra == "all"
157
+ Requires-Dist: semver; extra == "all"
158
+ Requires-Dist: flet-webview; extra == "all"
159
+ Requires-Dist: google-auth-oauthlib; extra == "all"
160
+ Requires-Dist: yamlscript; extra == "all"
155
161
  Requires-Dist: setuptools; extra == "all"
156
- Requires-Dist: faker; extra == "all"
157
- Requires-Dist: google-auth-httplib2; extra == "all"
162
+ Requires-Dist: huggingface_hub; extra == "all"
163
+ Requires-Dist: bokeh; extra == "all"
158
164
  Requires-Dist: peft; extra == "all"
159
- Requires-Dist: torchaudio; extra == "all"
160
- Requires-Dist: fastapi; extra == "all"
161
- Requires-Dist: pydantic; extra == "all"
162
165
  Requires-Dist: openai; extra == "all"
163
- Requires-Dist: flet-video; extra == "all"
164
- Requires-Dist: logfire; extra == "all"
165
- Requires-Dist: distributed; extra == "all"
166
+ Requires-Dist: openpyxl; extra == "all"
167
+ Requires-Dist: regex; extra == "all"
168
+ Requires-Dist: pydantic; extra == "all"
166
169
  Requires-Dist: dask[bag]; extra == "all"
167
- Requires-Dist: html2text; extra == "all"
168
- Requires-Dist: pyyaml; extra == "all"
169
170
  Requires-Dist: json_repair; extra == "all"
170
- Requires-Dist: diskcache; extra == "all"
171
- Requires-Dist: semver; extra == "all"
172
- Requires-Dist: sre_yield; extra == "all"
173
- Requires-Dist: flet[all]; extra == "all"
174
- Requires-Dist: google-auth; extra == "all"
175
- Requires-Dist: bokeh; extra == "all"
171
+ Requires-Dist: torchaudio; extra == "all"
176
172
  Requires-Dist: pandas; extra == "all"
177
- Requires-Dist: ollama; extra == "all"
178
173
  Requires-Dist: deepmerge; extra == "all"
179
- Requires-Dist: huggingface_hub; extra == "all"
180
- Requires-Dist: uvicorn[standard]; extra == "all"
174
+ Requires-Dist: pydantic-settings; extra == "all"
175
+ Requires-Dist: flet[all]; extra == "all"
176
+ Requires-Dist: httpx_retries; extra == "all"
181
177
  Requires-Dist: logfire[fastapi]; extra == "all"
182
- Requires-Dist: tokenizers; extra == "all"
178
+ Requires-Dist: torchvision; extra == "all"
179
+ Requires-Dist: httpx; extra == "all"
180
+ Requires-Dist: transformers[sentencepiece]; extra == "all"
183
181
  Requires-Dist: contexttimer; extra == "all"
182
+ Requires-Dist: google-api-python-client; extra == "all"
183
+ Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
184
184
  Dynamic: author
185
185
  Dynamic: author-email
186
186
  Dynamic: description
@@ -3,7 +3,7 @@ fmtr/tools/api_tools.py,sha256=RyZUlTefSQozfl-8feZGauyUkwcFd-jU0KtKHFxHea4,2272
3
3
  fmtr/tools/async_tools.py,sha256=ewz757WcveQJd-G5SVr2JDOQVbdLGecCgl-tsBGVZz4,284
4
4
  fmtr/tools/augmentation_tools.py,sha256=-6ESbO4CDlKqVOV1J1V6qBeoBMzbFIinkDHRHnCBej0,55
5
5
  fmtr/tools/caching_tools.py,sha256=74p7m2GLFfeP41LX69wxgfkilxEAoWkMIfFMjKsYpyg,4976
6
- fmtr/tools/constants.py,sha256=Fn2slqXD3H-aNRtAWlMC_917QLQE3j6EoluubluU7K0,1647
6
+ fmtr/tools/constants.py,sha256=iyn8cKNJ4tnX4BKpR0tWjD_U3RUa2THzU4jDhoWn17A,1648
7
7
  fmtr/tools/context_tools.py,sha256=4UvIHYgLqAh7dXMX9EBrLEpYp81qfzhSVrkffOSAoGA,350
8
8
  fmtr/tools/data_modelling_tools.py,sha256=0BFm-F_cYzVTxftWQwORkPd0FM2BTLVh9-s0-rTTFoo,1744
9
9
  fmtr/tools/dataclass_tools.py,sha256=0Gt6KeLhtPgubo_2tYkIVqB8oQ91Qzag8OAGZDdjvMU,1209
@@ -45,10 +45,10 @@ fmtr/tools/tabular_tools.py,sha256=tpIpZzYku1HcJrHZJL6BC39LmN3WUWVhFbK2N7nDVmE,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=YBoYNR9WchaLncc91xeTHbs6ppdY4HdAcbzle2w5d90,6
48
+ fmtr/tools/version,sha256=VVb3LiUlBjS5_S8NQl06zfsmOwyZ6VtToM0Y2ve-UNQ,6
49
49
  fmtr/tools/yaml_tools.py,sha256=Bhhyd6GQVKO72Lp8ky7bAUjIB_65Hdh0Q45SKIEe6S8,1901
50
50
  fmtr/tools/ai_tools/__init__.py,sha256=JZrLuOFNV1A3wvJgonxOgz_4WS-7MfCuowGWA5uYCjs,372
51
- fmtr/tools/ai_tools/agentic_tools.py,sha256=acSEPFS-aguDXanWGs3fAAlRyJSYPZW7L-Kb2qDLm-I,4300
51
+ fmtr/tools/ai_tools/agentic_tools.py,sha256=XwiI3K2w_bIawqrlmUpSdd5kGN6Dpr5ut6WPUHK_HC4,4660
52
52
  fmtr/tools/ai_tools/inference_tools.py,sha256=2UP2gXEyOJUjyyV6zmFIYmIxUsh1rXkRH0IbFvr2bRs,11908
53
53
  fmtr/tools/dns_tools/__init__.py,sha256=Mzaepy8lEdT0SJtUOCnF3IkpOt0vrZn-IOgOf4xfd8Q,258
54
54
  fmtr/tools/dns_tools/client.py,sha256=IBbd7Xgx9ExTn_EPoL7ts9JfXokHHuOiD9m4K6tl1Q0,2817
@@ -80,9 +80,9 @@ fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g
80
80
  fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
81
81
  fmtr/tools/version_tools/__init__.py,sha256=pg4iLtmIr5HtyEW_j0fMFoIdzqi_w9xH8-grQaXLB28,318
82
82
  fmtr/tools/version_tools/version_tools.py,sha256=Hcc6yferZS1hHbugRTdiHhSNmXEEG0hjCiTTXKna-YY,1127
83
- fmtr_tools-1.3.30.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
84
- fmtr_tools-1.3.30.dist-info/METADATA,sha256=3Y6GKGZBoESk3d08CtLk00Z81uweyiQK30uB-6lmfBY,15938
85
- fmtr_tools-1.3.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
86
- fmtr_tools-1.3.30.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
87
- fmtr_tools-1.3.30.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
88
- fmtr_tools-1.3.30.dist-info/RECORD,,
83
+ fmtr_tools-1.3.31.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
84
+ fmtr_tools-1.3.31.dist-info/METADATA,sha256=1_mrusaMKPO1ULMB8M9snIRRZHI7ipH5f3Tlh7qKwCM,15938
85
+ fmtr_tools-1.3.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
86
+ fmtr_tools-1.3.31.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
87
+ fmtr_tools-1.3.31.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
88
+ fmtr_tools-1.3.31.dist-info/RECORD,,