ommlds 0.0.0.dev458__py3-none-any.whl → 0.0.0.dev460__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 ommlds might be problematic. Click here for more details.

@@ -592,7 +592,7 @@
592
592
  "module": ".tools.git",
593
593
  "attr": null,
594
594
  "file": "ommlds/tools/git.py",
595
- "line": 188,
595
+ "line": 186,
596
596
  "value": {
597
597
  "!omdev.tools.git.messages.GitMessageGeneratorManifest": {
598
598
  "module": "ommlds.tools.git",
@@ -606,7 +606,7 @@
606
606
  "module": ".tools.ocr",
607
607
  "attr": "_CLI_MODULE",
608
608
  "file": "ommlds/tools/ocr.py",
609
- "line": 89,
609
+ "line": 82,
610
610
  "value": {
611
611
  "!omdev.cli.types.CliModule": {
612
612
  "name": "ocr",
ommlds/__about__.py CHANGED
@@ -23,7 +23,7 @@ class Project(ProjectBase):
23
23
 
24
24
  # 'sentencepiece ~= 0.2', # FIXME: https://github.com/google/sentencepiece/issues/1121
25
25
 
26
- 'tiktoken ~= 0.11',
26
+ 'tiktoken ~= 0.12',
27
27
 
28
28
  # 'tinygrad @ git+https://github.com/tinygrad/tinygrad',
29
29
  'tinygrad ~= 0.11',
@@ -38,7 +38,7 @@ class Project(ProjectBase):
38
38
 
39
39
  'huggingface': [
40
40
  'huggingface-hub ~= 0.35',
41
- 'datasets ~= 4.1',
41
+ 'datasets ~= 4.2',
42
42
  ],
43
43
 
44
44
  'numpy': [
@@ -63,9 +63,10 @@ class AnthropicSseMessageAssembler(
63
63
  while True:
64
64
  ae: ta.Any = check.not_none((yield from self._next_event()))
65
65
  if isinstance(ae, AnthropicSseDecoderEvents.ContentBlockStart):
66
- check.equal(ae.index, len(content))
66
+ # check.equal(ae.index, len(content))
67
67
  c = yield from self._do_content_block(ae)
68
- content.append(check.isinstance(c, Content))
68
+ if c is not None:
69
+ content.append(check.isinstance(c, Content))
69
70
  elif isinstance(ae, AnthropicSseDecoderEvents.MessageDelta):
70
71
  for k in ('stop_reason', 'stop_sequence'):
71
72
  if (v := getattr(ae.delta, k)) is not None:
@@ -92,6 +93,8 @@ class AnthropicSseMessageAssembler(
92
93
  return (yield from self._do_text_content_block(cbs))
93
94
  elif isinstance(cbs.content_block, AnthropicSseDecoderEvents.ContentBlockStart.ToolUse):
94
95
  return (yield from self._do_tool_use_content_block(cbs))
96
+ elif isinstance(cbs.content_block, AnthropicSseDecoderEvents.ContentBlockStart.Thinking):
97
+ return (yield from self._do_thinking_content_block(cbs))
95
98
  else:
96
99
  raise TypeError(cbs.content_block)
97
100
 
@@ -101,11 +104,11 @@ class AnthropicSseMessageAssembler(
101
104
  while True:
102
105
  ae: ta.Any = check.not_none((yield from self._next_event()))
103
106
  if isinstance(ae, AnthropicSseDecoderEvents.ContentBlockDelta):
104
- check.equal(ae.index, cbs.index)
107
+ # check.equal(ae.index, cbs.index)
105
108
  cdc = check.isinstance(ae.delta, AnthropicSseDecoderEvents.ContentBlockDelta.TextDelta)
106
109
  parts.append(cdc.text)
107
110
  elif isinstance(ae, AnthropicSseDecoderEvents.ContentBlockStop):
108
- check.equal(ae.index, cbs.index)
111
+ # check.equal(ae.index, cbs.index)
109
112
  return Text(''.join(parts))
110
113
  else:
111
114
  raise TypeError(ae)
@@ -119,11 +122,11 @@ class AnthropicSseMessageAssembler(
119
122
  while True:
120
123
  ae: ta.Any = check.not_none((yield from self._next_event()))
121
124
  if isinstance(ae, AnthropicSseDecoderEvents.ContentBlockDelta):
122
- check.equal(ae.index, cbs.index)
125
+ # check.equal(ae.index, cbs.index)
123
126
  cdc = check.isinstance(ae.delta, AnthropicSseDecoderEvents.ContentBlockDelta.InputJsonDelta)
124
127
  json_parts.append(cdc.partial_json)
125
128
  elif isinstance(ae, AnthropicSseDecoderEvents.ContentBlockStop):
126
- check.equal(ae.index, cbs.index)
129
+ # check.equal(ae.index, cbs.index)
127
130
  dj = ''.join(json_parts).strip()
128
131
  if dj:
129
132
  dd = check.isinstance(json.loads(dj), ta.Mapping)
@@ -138,3 +141,16 @@ class AnthropicSseMessageAssembler(
138
141
  )
139
142
  else:
140
143
  raise TypeError(ae)
144
+
145
+ def _do_thinking_content_block(self, cbs: AnthropicSseDecoderEvents.ContentBlockStart) -> ta.Any:
146
+ # csc = check.isinstance(cbs.content_block, AnthropicSseDecoderEvents.ContentBlockStart.Thinking)
147
+ while True:
148
+ ae: ta.Any = check.not_none((yield from self._next_event()))
149
+ if isinstance(ae, AnthropicSseDecoderEvents.ContentBlockDelta):
150
+ pass
151
+ elif isinstance(ae, AnthropicSseDecoderEvents.ContentBlockStop):
152
+ return None
153
+ else:
154
+ raise TypeError(ae)
155
+ return # type: ignore # noqa
156
+ yield # noqa
@@ -80,6 +80,11 @@ class AnthropicSseDecoderEvents(lang.Namespace):
80
80
  name: str
81
81
  input: ta.Any
82
82
 
83
+ @dc.dataclass(frozen=True)
84
+ class Thinking(ContentBlock):
85
+ signature: str
86
+ thinking: str
87
+
83
88
  content_block: ContentBlock
84
89
  index: int
85
90
 
@@ -96,6 +101,14 @@ class AnthropicSseDecoderEvents(lang.Namespace):
96
101
  class InputJsonDelta(Delta):
97
102
  partial_json: str
98
103
 
104
+ @dc.dataclass(frozen=True)
105
+ class ThinkingDelta(Delta):
106
+ thinking: str
107
+
108
+ @dc.dataclass(frozen=True)
109
+ class SignatureDelta(Delta):
110
+ signature: str
111
+
99
112
  delta: Delta
100
113
  index: int
101
114
 
@@ -583,6 +583,7 @@ class GenerateContentResponse(lang.Final):
583
583
  class Candidate(lang.Final):
584
584
  content: Content | None = None
585
585
  finish_reason: FinishReason | None = None
586
+ finish_message: str | None = None
586
587
  # safety_ratings: ta.Sequence[SafetyRating] | None = None
587
588
  # citation_metadata: CitationMetadata | None = None
588
589
  token_count: int | None = None
ommlds/tools/git.py CHANGED
@@ -23,10 +23,8 @@ from ..minichain.backends.impls.openai.chat import OpenaiChatChoicesService
23
23
  from ..server.client import McServerClient
24
24
 
25
25
 
26
- if ta.TYPE_CHECKING:
26
+ with lang.auto_proxy_import(globals()):
27
27
  from ..minichain.backends.impls.mlx import chat as mc_mlx_chat
28
- else:
29
- mc_mlx_chat = lang.proxy_import('..minichain.backends.impls.mlx.chat', __package__)
30
28
 
31
29
 
32
30
  GitAiBackendConfigT = ta.TypeVar('GitAiBackendConfigT', bound='GitAiBackend.Config')
ommlds/tools/ocr.py CHANGED
@@ -13,20 +13,13 @@ from omlish import check
13
13
  from omlish import lang
14
14
 
15
15
 
16
- if ta.TYPE_CHECKING:
16
+ with lang.auto_proxy_import(globals()):
17
17
  import pytesseract
18
18
  import rapidocr_onnxruntime as rapidocr
19
19
  from PIL import Image
20
20
 
21
21
  from omdev.clipboard import darwin_cf as darwin_clipboard
22
22
 
23
- else:
24
- pytesseract = lang.proxy_import('pytesseract')
25
- rapidocr = lang.proxy_import('rapidocr_onnxruntime')
26
- Image = lang.proxy_import('PIL.Image')
27
-
28
- darwin_clipboard = lang.proxy_import('omdev.clipboard.darwin_cf')
29
-
30
23
 
31
24
  ##
32
25
 
ommlds/wiki/text/mfh.py CHANGED
@@ -13,14 +13,10 @@ from omlish import lang
13
13
  from omlish import marshal as msh
14
14
 
15
15
 
16
- if ta.TYPE_CHECKING:
16
+ with lang.auto_proxy_import(globals()):
17
17
  import mwparserfromhell as mfh
18
18
  import mwparserfromhell.nodes as mfn
19
19
 
20
- else:
21
- mfh = lang.proxy_import('mwparserfromhell')
22
- mfn = lang.proxy_import('mwparserfromhell.nodes')
23
-
24
20
 
25
21
  Wikicode: ta.TypeAlias = 'mfh.wikicode.Wikicode'
26
22
 
ommlds/wiki/text/wtp.py CHANGED
@@ -26,10 +26,8 @@ from omlish import cached
26
26
  from omlish import lang
27
27
 
28
28
 
29
- if ta.TYPE_CHECKING:
29
+ with lang.auto_proxy_import(globals()):
30
30
  import wikitextparser as wtp
31
- else:
32
- wtp = lang.proxy_import('wikitextparser')
33
31
 
34
32
 
35
33
  WikiText: ta.TypeAlias = 'wtp.WikiText'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ommlds
3
- Version: 0.0.0.dev458
3
+ Version: 0.0.0.dev460
4
4
  Summary: ommlds
5
5
  Author: wrmsr
6
6
  License-Expression: BSD-3-Clause
@@ -14,20 +14,20 @@ Classifier: Programming Language :: Python :: 3.13
14
14
  Requires-Python: >=3.13
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: omdev==0.0.0.dev458
18
- Requires-Dist: omlish==0.0.0.dev458
17
+ Requires-Dist: omdev==0.0.0.dev460
18
+ Requires-Dist: omlish==0.0.0.dev460
19
19
  Provides-Extra: all
20
20
  Requires-Dist: llama-cpp-python~=0.3; extra == "all"
21
21
  Requires-Dist: mlx~=0.29; extra == "all"
22
22
  Requires-Dist: mlx-lm~=0.28; sys_platform == "darwin" and extra == "all"
23
- Requires-Dist: tiktoken~=0.11; extra == "all"
23
+ Requires-Dist: tiktoken~=0.12; extra == "all"
24
24
  Requires-Dist: tinygrad~=0.11; extra == "all"
25
25
  Requires-Dist: tokenizers~=0.22; extra == "all"
26
26
  Requires-Dist: torch~=2.8; extra == "all"
27
27
  Requires-Dist: transformers~=4.57; extra == "all"
28
28
  Requires-Dist: sentence-transformers~=5.1; extra == "all"
29
29
  Requires-Dist: huggingface-hub~=0.35; extra == "all"
30
- Requires-Dist: datasets~=4.1; extra == "all"
30
+ Requires-Dist: datasets~=4.2; extra == "all"
31
31
  Requires-Dist: numpy>=1.26; extra == "all"
32
32
  Requires-Dist: pytesseract~=0.3; extra == "all"
33
33
  Requires-Dist: rapidocr-onnxruntime~=1.4; extra == "all"
@@ -40,7 +40,7 @@ Provides-Extra: backends
40
40
  Requires-Dist: llama-cpp-python~=0.3; extra == "backends"
41
41
  Requires-Dist: mlx~=0.29; extra == "backends"
42
42
  Requires-Dist: mlx-lm~=0.28; sys_platform == "darwin" and extra == "backends"
43
- Requires-Dist: tiktoken~=0.11; extra == "backends"
43
+ Requires-Dist: tiktoken~=0.12; extra == "backends"
44
44
  Requires-Dist: tinygrad~=0.11; extra == "backends"
45
45
  Requires-Dist: tokenizers~=0.22; extra == "backends"
46
46
  Requires-Dist: torch~=2.8; extra == "backends"
@@ -48,7 +48,7 @@ Requires-Dist: transformers~=4.57; extra == "backends"
48
48
  Requires-Dist: sentence-transformers~=5.1; extra == "backends"
49
49
  Provides-Extra: huggingface
50
50
  Requires-Dist: huggingface-hub~=0.35; extra == "huggingface"
51
- Requires-Dist: datasets~=4.1; extra == "huggingface"
51
+ Requires-Dist: datasets~=4.2; extra == "huggingface"
52
52
  Provides-Extra: numpy
53
53
  Requires-Dist: numpy>=1.26; extra == "numpy"
54
54
  Provides-Extra: ocr
@@ -1,5 +1,5 @@
1
- ommlds/.omlish-manifests.json,sha256=B8lb6DKPpx-lvUmJJObifPZx-fy273KUbjQoHImyb7o,17992
2
- ommlds/__about__.py,sha256=XNUdE90MuxGmrq-8fqOcmIDOlrcApuoObzGrDUnxxMM,1759
1
+ ommlds/.omlish-manifests.json,sha256=rrjnJ9Ux5kxBEZc3jHSKc_BRwyiV0OW11sIVQRFUkf8,17992
2
+ ommlds/__about__.py,sha256=ihOSwOzbSqpYjC0oisAXE8bAnknrAKuDPQ8RI2y0n7U,1759
3
3
  ommlds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  ommlds/huggingface.py,sha256=JfEyfKOxU3-SY_ojtXBJFNeD-NIuKjvMe3GL3e93wNA,1175
5
5
  ommlds/_hacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -11,12 +11,12 @@ ommlds/backends/anthropic/protocol/_marshal.py,sha256=RHbwekaw21lTS_1KBX9z6dLpbm
11
11
  ommlds/backends/anthropic/protocol/types.py,sha256=f-_VXg_-KlhGIKp0R8vL50Rg_ZxqiBvQUGexQaDf8HY,2761
12
12
  ommlds/backends/anthropic/protocol/sse/__init__.py,sha256=LpijqXk0ceMDcgwOvZ8iLoh0I328JSfG8V0JalcZD3I,98
13
13
  ommlds/backends/anthropic/protocol/sse/_marshal.py,sha256=2No-qWRKV9ilOhC5NqHAA92DJF0fAcr4-OPvEP0KOjQ,627
14
- ommlds/backends/anthropic/protocol/sse/assemble.py,sha256=-DFdPfPYVOLws4iinQVwP9R9ZkDgZjER4KWvGIsWVRk,5718
15
- ommlds/backends/anthropic/protocol/sse/events.py,sha256=7k5Vl44dMbyK5TSzEfh9eHdsVwNN9syVOhTCfTka7FE,2182
14
+ ommlds/backends/anthropic/protocol/sse/assemble.py,sha256=MVpA0iSU2LNMXy4VpIVV8Oe7nj3dgmXpfLe-7nnA5QE,6552
15
+ ommlds/backends/anthropic/protocol/sse/events.py,sha256=pLscyLFpxcrtOijNPRgivrxYBFpE270oDW1dECjGtFg,2507
16
16
  ommlds/backends/google/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  ommlds/backends/google/protocol/__init__.py,sha256=OWmhuCS_sZ08ZaBtSSDRIudHKzkzgmqxY-3jgQxTidw,105
18
18
  ommlds/backends/google/protocol/_marshal.py,sha256=LWikcdMDrKQ0lMtclNXwK9qamijUBzK62nrEVo2OFtc,305
19
- ommlds/backends/google/protocol/types.py,sha256=keJGINgvsDy38tfeBsThvnOKOC-aJN1eNvJUdEzzT_4,17452
19
+ ommlds/backends/google/protocol/types.py,sha256=-szndCfo4h4TnfWY23B-_ksgDO0W_Qnu958h4NEWJFw,17494
20
20
  ommlds/backends/llamacpp/__init__.py,sha256=zXFpLXE4a2vEl0jcPDyKlPHHfZ3Z8Dz0twhEIyZ8-vg,59
21
21
  ommlds/backends/llamacpp/buildwheel.py,sha256=q9ghCLVbm8Jm6syrZlBP-x1qNDd0wSl15B2OXBtDBQ8,3813
22
22
  ommlds/backends/llamacpp/logging.py,sha256=nCEC6ASEuTpJqx47DMLhnbr5KelDlbxhM0nKQt4bc3w,773
@@ -311,23 +311,23 @@ ommlds/server/client.py,sha256=4CeYj43nHwUmuxwD4lkAZjcaPlrWw7MDdenldj377IU,1735
311
311
  ommlds/server/server.py,sha256=8l6jPEvUMrTd7iLUOGcUUzXWYA7l1ZzI2lkA8XqGOBA,4205
312
312
  ommlds/server/service.py,sha256=WleUNyWqcnvZ_CNk6h1WVSTy1_xT9wJg4dduiJilGDY,2282
313
313
  ommlds/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
314
- ommlds/tools/git.py,sha256=3VW5KXpuHIg0Xz7h5Z4tXIKWwhpb4rafEfZ2BzK_adU,8170
315
- ommlds/tools/ocr.py,sha256=CjN2lKhQCQNMwR2wdEpzZhaJJ9c8P9Dv1HmiQju7jeQ,2049
314
+ ommlds/tools/git.py,sha256=3MWI5cZ9ZmsjNMEoQXwj-AZNYyzA2xp1srFjzUv7U1Y,8095
315
+ ommlds/tools/ocr.py,sha256=UP2XK4-ELyhK2BnuBr7-DwUbkDIcX9xdvfXVimM19Y8,1839
316
316
  ommlds/wiki/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
317
317
  ommlds/wiki/analyze.py,sha256=38SvHF0X_z8OkjvbBc5tLj35e9pvqi53yg9tls-ay5A,9544
318
318
  ommlds/wiki/convert.py,sha256=4UqEKMWW03HwrfxYTn0wmXobYVrTSK2x9Lx-2MeJW8M,2531
319
319
  ommlds/wiki/models.py,sha256=MV7WqEqJJ_JTwIhaPNbQnRa_w7tO7mJggPu0xitJyLM,2473
320
320
  ommlds/wiki/xml.py,sha256=8Xt4roJ9cyOlZMxT4L5NHbkaeMlgXt3wmjiArmiMh28,2925
321
321
  ommlds/wiki/text/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
322
- ommlds/wiki/text/mfh.py,sha256=pQTRVYDouI9z1UevHL8jVC8s4mscQMrw3dyOvBlXWzA,6792
323
- ommlds/wiki/text/wtp.py,sha256=M4HVq0Fl7yVc9rlftqo8SfapU9MmW0hhqssqGIN6Ofk,2233
322
+ ommlds/wiki/text/mfh.py,sha256=Qk2WjmtZgoEMgZtBbYjKnWZhusx_VA5CIDSbUatfIAk,6702
323
+ ommlds/wiki/text/wtp.py,sha256=Ga4dGfUsLwbS2i9LJd4xwSbHAAnwnReWGQgOrRIcedQ,2200
324
324
  ommlds/wiki/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
325
325
  ommlds/wiki/utils/io.py,sha256=UKgDJGtmpnWvIqVd2mJc2QNPOqlToEY1GEveNp6_pMo,7088
326
326
  ommlds/wiki/utils/progress.py,sha256=EhvKcMFYtsarCQhIahlO6f0SboyAKP3UwUyrnVnP-Vk,3222
327
327
  ommlds/wiki/utils/xml.py,sha256=vVV8Ctn13aaRM9eYfs9Wd6rHn5WOCEUzQ44fIhOvJdg,3754
328
- ommlds-0.0.0.dev458.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
329
- ommlds-0.0.0.dev458.dist-info/METADATA,sha256=b8d8j6_YrLFPOasPpJ4NyVqc5lNOuHC0S1We79UNN68,3224
330
- ommlds-0.0.0.dev458.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
331
- ommlds-0.0.0.dev458.dist-info/entry_points.txt,sha256=Z5YWtX7ClfiCKdW-dd_CSVvM0h4yQpJPi-2G3q6gNFo,35
332
- ommlds-0.0.0.dev458.dist-info/top_level.txt,sha256=Rbnk5d5wi58vnAXx13WFZqdQ4VX8hBCS2hEL3WeXOhY,7
333
- ommlds-0.0.0.dev458.dist-info/RECORD,,
328
+ ommlds-0.0.0.dev460.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
329
+ ommlds-0.0.0.dev460.dist-info/METADATA,sha256=5845ATkqi5W-P5CrEj6n1JPkkp-cQ8CypPhcTMRzBfw,3224
330
+ ommlds-0.0.0.dev460.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
331
+ ommlds-0.0.0.dev460.dist-info/entry_points.txt,sha256=Z5YWtX7ClfiCKdW-dd_CSVvM0h4yQpJPi-2G3q6gNFo,35
332
+ ommlds-0.0.0.dev460.dist-info/top_level.txt,sha256=Rbnk5d5wi58vnAXx13WFZqdQ4VX8hBCS2hEL3WeXOhY,7
333
+ ommlds-0.0.0.dev460.dist-info/RECORD,,