fmtr.tools 1.3.14__tar.gz → 1.3.15__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.
Potentially problematic release.
This version of fmtr.tools might be problematic. Click here for more details.
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/PKG-INFO +44 -44
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/dns_tools/client.py +6 -2
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/dns_tools/dm.py +7 -8
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/dns_tools/proxy.py +13 -4
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/dns_tools/server.py +4 -4
- fmtr_tools-1.3.15/fmtr/tools/version +1 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr.tools.egg-info/PKG-INFO +44 -44
- fmtr_tools-1.3.14/fmtr/tools/version +0 -1
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/LICENSE +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/README.md +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/__init__.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/ai_tools/__init__.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/ai_tools/agentic_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/ai_tools/inference_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/api_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/async_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/augmentation_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/caching_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/constants.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/data_modelling_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/dataclass_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/datatype_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/debugging_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/dns_tools/__init__.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/docker_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/entrypoints/__init__.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/entrypoints/cache_hfh.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/entrypoints/ep_test.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/entrypoints/install_yamlscript.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/entrypoints/remote_debug_test.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/entrypoints/shell_debug.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/environment_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/function_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/google_api_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/hash_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/hfh_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/html_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/http_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/import_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/inspection_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/interface_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/iterator_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/json_fix_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/json_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/logging_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/merging_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/metric_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/name_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/netrc_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/openai_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/packaging_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/parallel_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/path_tools/__init__.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/path_tools/app_path_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/path_tools/path_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/path_tools/type_path_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/pattern_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/pdf_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/platform_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/process_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/profiling_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/random_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/semantic_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/settings_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/setup_tools/__init__.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/setup_tools/setup_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/spaces_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/string_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tabular_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tests/__init__.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tests/conftest.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tests/helpers.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tests/test_datatype.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tests/test_environment.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tests/test_json.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tests/test_path.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tests/test_yaml.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tokenization_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/unicode_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/version_tools/__init__.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/version_tools/version_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr/tools/yaml_tools.py +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr.tools.egg-info/SOURCES.txt +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr.tools.egg-info/dependency_links.txt +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr.tools.egg-info/entry_points.txt +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr.tools.egg-info/requires.txt +43 -43
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/fmtr.tools.egg-info/top_level.txt +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/pyproject.toml +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/setup.cfg +0 -0
- {fmtr_tools-1.3.14 → fmtr_tools-1.3.15}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.15
|
|
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:
|
|
130
|
-
Requires-Dist:
|
|
131
|
-
Requires-Dist: fastapi; extra == "all"
|
|
132
|
-
Requires-Dist: bokeh; extra == "all"
|
|
133
|
-
Requires-Dist: pydantic; extra == "all"
|
|
134
|
-
Requires-Dist: tabulate; extra == "all"
|
|
135
|
-
Requires-Dist: dask[bag]; extra == "all"
|
|
136
|
-
Requires-Dist: openpyxl; extra == "all"
|
|
137
|
-
Requires-Dist: filetype; extra == "all"
|
|
138
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
139
|
-
Requires-Dist: docker; extra == "all"
|
|
140
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
129
|
+
Requires-Dist: flet-video; extra == "all"
|
|
130
|
+
Requires-Dist: regex; extra == "all"
|
|
141
131
|
Requires-Dist: dnspython[doh]; extra == "all"
|
|
142
|
-
Requires-Dist:
|
|
132
|
+
Requires-Dist: distributed; extra == "all"
|
|
133
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
134
|
+
Requires-Dist: pandas; extra == "all"
|
|
143
135
|
Requires-Dist: contexttimer; extra == "all"
|
|
144
|
-
Requires-Dist:
|
|
145
|
-
Requires-Dist:
|
|
146
|
-
Requires-Dist:
|
|
136
|
+
Requires-Dist: peft; extra == "all"
|
|
137
|
+
Requires-Dist: pydantic; extra == "all"
|
|
138
|
+
Requires-Dist: google-auth; extra == "all"
|
|
139
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
140
|
+
Requires-Dist: diskcache; extra == "all"
|
|
147
141
|
Requires-Dist: cachetools; extra == "all"
|
|
148
|
-
Requires-Dist:
|
|
149
|
-
Requires-Dist:
|
|
142
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
143
|
+
Requires-Dist: bokeh; extra == "all"
|
|
144
|
+
Requires-Dist: tabulate; extra == "all"
|
|
145
|
+
Requires-Dist: ollama; extra == "all"
|
|
146
|
+
Requires-Dist: Unidecode; extra == "all"
|
|
147
|
+
Requires-Dist: logfire; extra == "all"
|
|
150
148
|
Requires-Dist: sre_yield; extra == "all"
|
|
151
|
-
Requires-Dist: html2text; extra == "all"
|
|
152
149
|
Requires-Dist: pyyaml; extra == "all"
|
|
153
|
-
Requires-Dist:
|
|
154
|
-
Requires-Dist:
|
|
155
|
-
Requires-Dist:
|
|
156
|
-
Requires-Dist: tokenizers; extra == "all"
|
|
150
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
151
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
152
|
+
Requires-Dist: openai; extra == "all"
|
|
157
153
|
Requires-Dist: sentence_transformers; extra == "all"
|
|
158
|
-
Requires-Dist:
|
|
159
|
-
Requires-Dist:
|
|
160
|
-
Requires-Dist:
|
|
154
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
155
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
156
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
161
157
|
Requires-Dist: pytest-cov; extra == "all"
|
|
162
|
-
Requires-Dist:
|
|
163
|
-
Requires-Dist: ollama; extra == "all"
|
|
164
|
-
Requires-Dist: faker; extra == "all"
|
|
158
|
+
Requires-Dist: torchvision; extra == "all"
|
|
165
159
|
Requires-Dist: torchaudio; extra == "all"
|
|
166
|
-
Requires-Dist:
|
|
167
|
-
Requires-Dist:
|
|
168
|
-
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
169
|
-
Requires-Dist: appdirs; extra == "all"
|
|
160
|
+
Requires-Dist: faker; extra == "all"
|
|
161
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
170
162
|
Requires-Dist: flet[all]; extra == "all"
|
|
171
|
-
Requires-Dist:
|
|
172
|
-
Requires-Dist:
|
|
163
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
164
|
+
Requires-Dist: json_repair; extra == "all"
|
|
165
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
166
|
+
Requires-Dist: fastapi; extra == "all"
|
|
173
167
|
Requires-Dist: yamlscript; extra == "all"
|
|
168
|
+
Requires-Dist: setuptools; extra == "all"
|
|
169
|
+
Requires-Dist: semver; extra == "all"
|
|
170
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
174
171
|
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
175
|
-
Requires-Dist:
|
|
176
|
-
Requires-Dist:
|
|
177
|
-
Requires-Dist: Unidecode; extra == "all"
|
|
172
|
+
Requires-Dist: appdirs; extra == "all"
|
|
173
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
178
174
|
Requires-Dist: pydantic-settings; extra == "all"
|
|
179
|
-
Requires-Dist:
|
|
180
|
-
Requires-Dist:
|
|
181
|
-
Requires-Dist:
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist:
|
|
175
|
+
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
176
|
+
Requires-Dist: httpx; extra == "all"
|
|
177
|
+
Requires-Dist: docker; extra == "all"
|
|
178
|
+
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
179
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
180
|
+
Requires-Dist: filetype; extra == "all"
|
|
181
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
182
|
+
Requires-Dist: html2text; 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,6 +3,7 @@ from dataclasses import dataclass
|
|
|
3
3
|
from dns import query
|
|
4
4
|
from functools import cached_property
|
|
5
5
|
from httpx_retries import Retry, RetryTransport
|
|
6
|
+
from typing import Optional
|
|
6
7
|
|
|
7
8
|
from fmtr.tools import http_tools as http
|
|
8
9
|
from fmtr.tools.dns_tools.dm import Exchange, Response
|
|
@@ -38,14 +39,17 @@ class Plain:
|
|
|
38
39
|
"""
|
|
39
40
|
host: str
|
|
40
41
|
port: int = 53
|
|
42
|
+
ttl_min: Optional[int] = None
|
|
41
43
|
|
|
42
44
|
def resolve(self, exchange: Exchange):
|
|
43
45
|
|
|
44
46
|
with logger.span(f'UDP {self.host}:{self.port}'):
|
|
45
47
|
response_plain = query.udp(q=exchange.query_last, where=self.host, port=self.port)
|
|
46
48
|
response = Response.from_message(response_plain)
|
|
49
|
+
for answer in response.message.answer:
|
|
50
|
+
answer.ttl = max(answer.ttl, self.ttl_min or answer.ttl)
|
|
47
51
|
|
|
48
|
-
exchange.response
|
|
52
|
+
exchange.response = response
|
|
49
53
|
|
|
50
54
|
|
|
51
55
|
@dataclass
|
|
@@ -86,7 +90,7 @@ class HTTP:
|
|
|
86
90
|
response_doh = self.CLIENT.post(url, headers=headers, content=exchange.query_last.to_wire())
|
|
87
91
|
response_doh.raise_for_status()
|
|
88
92
|
response = Response.from_http(response_doh)
|
|
89
|
-
exchange.response
|
|
93
|
+
exchange.response = response
|
|
90
94
|
|
|
91
95
|
except Exception as exception:
|
|
92
96
|
exchange.response.message.set_rcode(dnspython.rcode.SERVFAIL)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import dns
|
|
2
2
|
import httpx
|
|
3
|
-
from dataclasses import dataclass
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
4
|
from dns import rcode as dnsrcode
|
|
5
5
|
from dns import reversename
|
|
6
6
|
from dns.message import Message, QueryMessage
|
|
7
7
|
from dns.rrset import RRset
|
|
8
8
|
from functools import cached_property
|
|
9
|
-
from typing import Self, Optional
|
|
9
|
+
from typing import Self, Optional, List
|
|
10
10
|
|
|
11
11
|
from fmtr.tools.string_tools import join
|
|
12
12
|
|
|
@@ -37,7 +37,6 @@ class Response(BaseDNSData):
|
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
39
|
http: Optional[httpx.Response] = None
|
|
40
|
-
is_complete: bool = False
|
|
41
40
|
blocked_by: Optional[str] = None
|
|
42
41
|
|
|
43
42
|
@classmethod
|
|
@@ -144,9 +143,10 @@ class Exchange:
|
|
|
144
143
|
|
|
145
144
|
request: Request
|
|
146
145
|
response: Optional[Response] = None
|
|
146
|
+
answers_pre: List[RRset] = field(default_factory=list)
|
|
147
147
|
is_internal: bool = False
|
|
148
148
|
client_name: Optional[str] = None
|
|
149
|
-
|
|
149
|
+
is_complete: bool = False
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
@classmethod
|
|
@@ -166,8 +166,8 @@ class Exchange:
|
|
|
166
166
|
Contrive an RRset representing the latest/current question. This can be the original question - or a hybrid one if we've injected our own answers into the exchange.
|
|
167
167
|
|
|
168
168
|
"""
|
|
169
|
-
if self.
|
|
170
|
-
rrset = self.
|
|
169
|
+
if self.answers_pre:
|
|
170
|
+
rrset = self.answers_pre[-1]
|
|
171
171
|
ty = self.request.type
|
|
172
172
|
ttl = self.request.question.ttl
|
|
173
173
|
rdclass = self.request.question.rdclass
|
|
@@ -178,7 +178,6 @@ class Exchange:
|
|
|
178
178
|
ttl=ttl,
|
|
179
179
|
rdtype=ty,
|
|
180
180
|
rdclass=rdclass,
|
|
181
|
-
|
|
182
181
|
)
|
|
183
182
|
|
|
184
183
|
return rrset_contrived
|
|
@@ -194,7 +193,7 @@ class Exchange:
|
|
|
194
193
|
"""
|
|
195
194
|
|
|
196
195
|
question_last = self.question_last
|
|
197
|
-
query = dns.message.make_query(qname=question_last.name, rdclass=question_last.rdclass, rdtype=question_last.rdtype)
|
|
196
|
+
query = dns.message.make_query(qname=question_last.name, rdclass=question_last.rdclass, rdtype=question_last.rdtype, id=self.request.message.id)
|
|
198
197
|
return query
|
|
199
198
|
|
|
200
199
|
@property
|
|
@@ -31,6 +31,14 @@ class Proxy(server.Plain):
|
|
|
31
31
|
"""
|
|
32
32
|
return
|
|
33
33
|
|
|
34
|
+
def finalize(self, exchange: Exchange):
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
Finalize a still open exchange.
|
|
38
|
+
|
|
39
|
+
"""
|
|
40
|
+
exchange.is_complete = True
|
|
41
|
+
|
|
34
42
|
def resolve(self, exchange: Exchange) -> Exchange:
|
|
35
43
|
"""
|
|
36
44
|
|
|
@@ -38,20 +46,21 @@ class Proxy(server.Plain):
|
|
|
38
46
|
Subclasses can override the relevant processing methods to implement custom behaviour.
|
|
39
47
|
|
|
40
48
|
"""
|
|
41
|
-
|
|
42
49
|
with logger.span(f'Processing question...'):
|
|
43
50
|
self.process_question(exchange)
|
|
44
|
-
if exchange.
|
|
51
|
+
if exchange.is_complete:
|
|
45
52
|
return exchange
|
|
46
53
|
|
|
47
54
|
with logger.span(f'Making upstream request...'):
|
|
48
55
|
self.client.resolve(exchange)
|
|
49
|
-
if exchange.
|
|
56
|
+
if exchange.is_complete:
|
|
50
57
|
return exchange
|
|
51
58
|
|
|
52
59
|
with logger.span(f'Processing upstream response...'):
|
|
53
60
|
self.process_upstream(exchange)
|
|
54
|
-
if exchange.
|
|
61
|
+
if exchange.is_complete:
|
|
55
62
|
return exchange
|
|
56
63
|
|
|
64
|
+
self.finalize(exchange)
|
|
65
|
+
|
|
57
66
|
return exchange
|
|
@@ -66,7 +66,7 @@ class Plain:
|
|
|
66
66
|
logger.info(f'Request found in cache.')
|
|
67
67
|
exchange.response = self.cache[exchange.key]
|
|
68
68
|
exchange.response.message.id = exchange.request.message.id
|
|
69
|
-
exchange.
|
|
69
|
+
exchange.is_complete = True
|
|
70
70
|
|
|
71
71
|
def get_span(self, exchange: Exchange):
|
|
72
72
|
"""
|
|
@@ -90,7 +90,7 @@ class Plain:
|
|
|
90
90
|
response = exchange.response
|
|
91
91
|
|
|
92
92
|
logger.info(
|
|
93
|
-
f'Resolution complete {exchange.client_name=} {request.message.id=} {request.type_text} {request.name_text} {request.question=} {
|
|
93
|
+
f'Resolution complete {exchange.client_name=} {request.message.id=} {request.type_text} {request.name_text} {request.question=} {exchange.is_complete=} {response.rcode=} {response.rcode_text=} {response.answer=} {response.blocked_by=}...'
|
|
94
94
|
)
|
|
95
95
|
|
|
96
96
|
|
|
@@ -116,9 +116,9 @@ class Plain:
|
|
|
116
116
|
with logger.span(f'Checking cache...'):
|
|
117
117
|
self.check_cache(exchange)
|
|
118
118
|
|
|
119
|
-
if not exchange.
|
|
119
|
+
if not exchange.is_complete:
|
|
120
120
|
exchange = self.resolve(exchange)
|
|
121
|
-
exchange.
|
|
121
|
+
exchange.is_complete = True
|
|
122
122
|
|
|
123
123
|
self.cache[exchange.key] = exchange.response
|
|
124
124
|
self.log_response(exchange)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.3.15
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.15
|
|
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:
|
|
130
|
-
Requires-Dist:
|
|
131
|
-
Requires-Dist: fastapi; extra == "all"
|
|
132
|
-
Requires-Dist: bokeh; extra == "all"
|
|
133
|
-
Requires-Dist: pydantic; extra == "all"
|
|
134
|
-
Requires-Dist: tabulate; extra == "all"
|
|
135
|
-
Requires-Dist: dask[bag]; extra == "all"
|
|
136
|
-
Requires-Dist: openpyxl; extra == "all"
|
|
137
|
-
Requires-Dist: filetype; extra == "all"
|
|
138
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
139
|
-
Requires-Dist: docker; extra == "all"
|
|
140
|
-
Requires-Dist: flet-webview; extra == "all"
|
|
129
|
+
Requires-Dist: flet-video; extra == "all"
|
|
130
|
+
Requires-Dist: regex; extra == "all"
|
|
141
131
|
Requires-Dist: dnspython[doh]; extra == "all"
|
|
142
|
-
Requires-Dist:
|
|
132
|
+
Requires-Dist: distributed; extra == "all"
|
|
133
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
134
|
+
Requires-Dist: pandas; extra == "all"
|
|
143
135
|
Requires-Dist: contexttimer; extra == "all"
|
|
144
|
-
Requires-Dist:
|
|
145
|
-
Requires-Dist:
|
|
146
|
-
Requires-Dist:
|
|
136
|
+
Requires-Dist: peft; extra == "all"
|
|
137
|
+
Requires-Dist: pydantic; extra == "all"
|
|
138
|
+
Requires-Dist: google-auth; extra == "all"
|
|
139
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
140
|
+
Requires-Dist: diskcache; extra == "all"
|
|
147
141
|
Requires-Dist: cachetools; extra == "all"
|
|
148
|
-
Requires-Dist:
|
|
149
|
-
Requires-Dist:
|
|
142
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
143
|
+
Requires-Dist: bokeh; extra == "all"
|
|
144
|
+
Requires-Dist: tabulate; extra == "all"
|
|
145
|
+
Requires-Dist: ollama; extra == "all"
|
|
146
|
+
Requires-Dist: Unidecode; extra == "all"
|
|
147
|
+
Requires-Dist: logfire; extra == "all"
|
|
150
148
|
Requires-Dist: sre_yield; extra == "all"
|
|
151
|
-
Requires-Dist: html2text; extra == "all"
|
|
152
149
|
Requires-Dist: pyyaml; extra == "all"
|
|
153
|
-
Requires-Dist:
|
|
154
|
-
Requires-Dist:
|
|
155
|
-
Requires-Dist:
|
|
156
|
-
Requires-Dist: tokenizers; extra == "all"
|
|
150
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
151
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
152
|
+
Requires-Dist: openai; extra == "all"
|
|
157
153
|
Requires-Dist: sentence_transformers; extra == "all"
|
|
158
|
-
Requires-Dist:
|
|
159
|
-
Requires-Dist:
|
|
160
|
-
Requires-Dist:
|
|
154
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
155
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
156
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
161
157
|
Requires-Dist: pytest-cov; extra == "all"
|
|
162
|
-
Requires-Dist:
|
|
163
|
-
Requires-Dist: ollama; extra == "all"
|
|
164
|
-
Requires-Dist: faker; extra == "all"
|
|
158
|
+
Requires-Dist: torchvision; extra == "all"
|
|
165
159
|
Requires-Dist: torchaudio; extra == "all"
|
|
166
|
-
Requires-Dist:
|
|
167
|
-
Requires-Dist:
|
|
168
|
-
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
169
|
-
Requires-Dist: appdirs; extra == "all"
|
|
160
|
+
Requires-Dist: faker; extra == "all"
|
|
161
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
170
162
|
Requires-Dist: flet[all]; extra == "all"
|
|
171
|
-
Requires-Dist:
|
|
172
|
-
Requires-Dist:
|
|
163
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
164
|
+
Requires-Dist: json_repair; extra == "all"
|
|
165
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
166
|
+
Requires-Dist: fastapi; extra == "all"
|
|
173
167
|
Requires-Dist: yamlscript; extra == "all"
|
|
168
|
+
Requires-Dist: setuptools; extra == "all"
|
|
169
|
+
Requires-Dist: semver; extra == "all"
|
|
170
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
174
171
|
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
175
|
-
Requires-Dist:
|
|
176
|
-
Requires-Dist:
|
|
177
|
-
Requires-Dist: Unidecode; extra == "all"
|
|
172
|
+
Requires-Dist: appdirs; extra == "all"
|
|
173
|
+
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
178
174
|
Requires-Dist: pydantic-settings; extra == "all"
|
|
179
|
-
Requires-Dist:
|
|
180
|
-
Requires-Dist:
|
|
181
|
-
Requires-Dist:
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist:
|
|
175
|
+
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
176
|
+
Requires-Dist: httpx; extra == "all"
|
|
177
|
+
Requires-Dist: docker; extra == "all"
|
|
178
|
+
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
179
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
180
|
+
Requires-Dist: filetype; extra == "all"
|
|
181
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
182
|
+
Requires-Dist: html2text; extra == "all"
|
|
183
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
184
184
|
Dynamic: author
|
|
185
185
|
Dynamic: author-email
|
|
186
186
|
Dynamic: description
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.3.14
|
|
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
|
|
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
|
|
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
|
|
@@ -14,61 +14,61 @@ pydantic-ai[logfire,openai]
|
|
|
14
14
|
ollama
|
|
15
15
|
|
|
16
16
|
[all]
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
fastapi
|
|
20
|
-
bokeh
|
|
21
|
-
pydantic
|
|
22
|
-
tabulate
|
|
23
|
-
dask[bag]
|
|
24
|
-
openpyxl
|
|
25
|
-
filetype
|
|
26
|
-
pymupdf
|
|
27
|
-
docker
|
|
28
|
-
flet-webview
|
|
17
|
+
flet-video
|
|
18
|
+
regex
|
|
29
19
|
dnspython[doh]
|
|
30
|
-
|
|
20
|
+
distributed
|
|
21
|
+
tinynetrc
|
|
22
|
+
pandas
|
|
31
23
|
contexttimer
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
peft
|
|
25
|
+
pydantic
|
|
26
|
+
google-auth
|
|
27
|
+
tokenizers
|
|
28
|
+
diskcache
|
|
35
29
|
cachetools
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
pymupdf
|
|
31
|
+
bokeh
|
|
32
|
+
tabulate
|
|
33
|
+
ollama
|
|
34
|
+
Unidecode
|
|
35
|
+
logfire
|
|
38
36
|
sre_yield
|
|
39
|
-
html2text
|
|
40
37
|
pyyaml
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
tokenizers
|
|
38
|
+
deepmerge
|
|
39
|
+
huggingface_hub
|
|
40
|
+
openai
|
|
45
41
|
sentence_transformers
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
openpyxl
|
|
43
|
+
httpx_retries
|
|
44
|
+
flet-webview
|
|
49
45
|
pytest-cov
|
|
50
|
-
|
|
51
|
-
ollama
|
|
52
|
-
faker
|
|
46
|
+
torchvision
|
|
53
47
|
torchaudio
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
uvicorn[standard]
|
|
57
|
-
appdirs
|
|
48
|
+
faker
|
|
49
|
+
logfire[httpx]
|
|
58
50
|
flet[all]
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
google-api-python-client
|
|
52
|
+
json_repair
|
|
53
|
+
google-auth-oauthlib
|
|
54
|
+
fastapi
|
|
61
55
|
yamlscript
|
|
56
|
+
setuptools
|
|
57
|
+
semver
|
|
58
|
+
pymupdf4llm
|
|
62
59
|
pydevd-pycharm~=251.25410.159
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Unidecode
|
|
60
|
+
appdirs
|
|
61
|
+
google-auth-httplib2
|
|
66
62
|
pydantic-settings
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
uvicorn[standard]
|
|
64
|
+
httpx
|
|
65
|
+
docker
|
|
66
|
+
transformers[sentencepiece]
|
|
67
|
+
dask[bag]
|
|
68
|
+
filetype
|
|
69
|
+
logfire[fastapi]
|
|
70
|
+
html2text
|
|
71
|
+
pydantic-ai[logfire,openai]
|
|
72
72
|
|
|
73
73
|
[api]
|
|
74
74
|
fastapi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|