ommlds 0.0.0.dev449__py3-none-any.whl → 0.0.0.dev451__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.
- ommlds/.omlish-manifests.json +3 -3
- ommlds/backends/anthropic/protocol/_marshal.py +1 -1
- ommlds/backends/anthropic/protocol/sse/_marshal.py +1 -1
- ommlds/backends/anthropic/protocol/sse/assemble.py +1 -1
- ommlds/backends/anthropic/protocol/types.py +30 -9
- ommlds/backends/google/protocol/__init__.py +3 -0
- ommlds/backends/google/protocol/_marshal.py +16 -0
- ommlds/backends/google/protocol/types.py +303 -76
- ommlds/backends/mlx/generation.py +1 -1
- ommlds/backends/openai/protocol/_marshal.py +1 -1
- ommlds/cli/main.py +29 -8
- ommlds/cli/sessions/chat/code.py +124 -0
- ommlds/cli/sessions/chat/interactive.py +2 -5
- ommlds/cli/sessions/chat/printing.py +5 -4
- ommlds/cli/sessions/chat/prompt.py +2 -2
- ommlds/cli/sessions/chat/state.py +1 -0
- ommlds/cli/sessions/chat/tools.py +3 -5
- ommlds/cli/tools/config.py +2 -1
- ommlds/cli/tools/inject.py +13 -3
- ommlds/minichain/__init__.py +12 -0
- ommlds/minichain/_marshal.py +39 -0
- ommlds/minichain/backends/impls/anthropic/chat.py +78 -10
- ommlds/minichain/backends/impls/google/chat.py +95 -12
- ommlds/minichain/backends/impls/google/tools.py +149 -0
- ommlds/minichain/chat/_marshal.py +1 -1
- ommlds/minichain/content/_marshal.py +24 -3
- ommlds/minichain/content/json.py +13 -0
- ommlds/minichain/content/materialize.py +13 -20
- ommlds/minichain/content/prepare.py +4 -0
- ommlds/minichain/json.py +20 -0
- ommlds/minichain/lib/code/prompts.py +6 -0
- ommlds/minichain/lib/fs/context.py +18 -4
- ommlds/minichain/lib/fs/errors.py +6 -0
- ommlds/minichain/lib/fs/tools/edit.py +104 -0
- ommlds/minichain/lib/fs/{catalog → tools}/ls.py +3 -3
- ommlds/minichain/lib/fs/{catalog → tools}/read.py +6 -6
- ommlds/minichain/lib/fs/tools/recursivels/__init__.py +0 -0
- ommlds/minichain/lib/fs/{catalog → tools}/recursivels/execution.py +2 -2
- ommlds/minichain/lib/todo/__init__.py +0 -0
- ommlds/minichain/lib/todo/context.py +54 -0
- ommlds/minichain/lib/todo/tools/__init__.py +0 -0
- ommlds/minichain/lib/todo/tools/read.py +44 -0
- ommlds/minichain/lib/todo/tools/write.py +335 -0
- ommlds/minichain/lib/todo/types.py +60 -0
- ommlds/minichain/llms/_marshal.py +1 -1
- ommlds/minichain/services/_marshal.py +1 -1
- ommlds/minichain/tools/_marshal.py +1 -1
- ommlds/minichain/tools/execution/catalog.py +2 -1
- ommlds/minichain/tools/execution/executors.py +8 -3
- ommlds/minichain/tools/execution/reflect.py +43 -5
- ommlds/minichain/tools/fns.py +46 -9
- ommlds/minichain/tools/jsonschema.py +11 -1
- ommlds/minichain/tools/reflect.py +9 -2
- ommlds/minichain/tools/types.py +9 -0
- ommlds/minichain/utils.py +27 -0
- ommlds/minichain/vectors/_marshal.py +1 -1
- ommlds/tools/ocr.py +7 -1
- {ommlds-0.0.0.dev449.dist-info → ommlds-0.0.0.dev451.dist-info}/METADATA +3 -3
- {ommlds-0.0.0.dev449.dist-info → ommlds-0.0.0.dev451.dist-info}/RECORD +67 -53
- /ommlds/minichain/lib/{fs/catalog → code}/__init__.py +0 -0
- /ommlds/minichain/lib/fs/{catalog/recursivels → tools}/__init__.py +0 -0
- /ommlds/minichain/lib/fs/{catalog → tools}/recursivels/rendering.py +0 -0
- /ommlds/minichain/lib/fs/{catalog → tools}/recursivels/running.py +0 -0
- {ommlds-0.0.0.dev449.dist-info → ommlds-0.0.0.dev451.dist-info}/WHEEL +0 -0
- {ommlds-0.0.0.dev449.dist-info → ommlds-0.0.0.dev451.dist-info}/entry_points.txt +0 -0
- {ommlds-0.0.0.dev449.dist-info → ommlds-0.0.0.dev451.dist-info}/licenses/LICENSE +0 -0
- {ommlds-0.0.0.dev449.dist-info → ommlds-0.0.0.dev451.dist-info}/top_level.txt +0 -0
ommlds/.omlish-manifests.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": ".minichain.backends.impls.anthropic.chat",
|
|
19
19
|
"attr": null,
|
|
20
20
|
"file": "ommlds/minichain/backends/impls/anthropic/chat.py",
|
|
21
|
-
"line":
|
|
21
|
+
"line": 37,
|
|
22
22
|
"value": {
|
|
23
23
|
"!.minichain.registries.manifests.RegistryManifest": {
|
|
24
24
|
"module": "ommlds.minichain.backends.impls.anthropic.chat",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"module": ".minichain.backends.impls.google.chat",
|
|
97
97
|
"attr": null,
|
|
98
98
|
"file": "ommlds/minichain/backends/impls/google/chat.py",
|
|
99
|
-
"line":
|
|
99
|
+
"line": 34,
|
|
100
100
|
"value": {
|
|
101
101
|
"!.minichain.registries.manifests.RegistryManifest": {
|
|
102
102
|
"module": "ommlds.minichain.backends.impls.google.chat",
|
|
@@ -606,7 +606,7 @@
|
|
|
606
606
|
"module": ".tools.ocr",
|
|
607
607
|
"attr": "_CLI_MODULE",
|
|
608
608
|
"file": "ommlds/tools/ocr.py",
|
|
609
|
-
"line":
|
|
609
|
+
"line": 89,
|
|
610
610
|
"value": {
|
|
611
611
|
"!omdev.cli.types.CliModule": {
|
|
612
612
|
"name": "ocr",
|
|
@@ -8,7 +8,7 @@ from .events import AnthropicSseDecoderEvents
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
@lang.static_init
|
|
11
|
-
def
|
|
11
|
+
def _install_standard_marshaling() -> None:
|
|
12
12
|
for root_cls in [
|
|
13
13
|
AnthropicSseDecoderEvents.Event,
|
|
14
14
|
AnthropicSseDecoderEvents.ContentBlockStart.ContentBlock,
|
|
@@ -76,7 +76,7 @@ class AnthropicSseMessageAssembler(
|
|
|
76
76
|
elif isinstance(ae, AnthropicSseDecoderEvents.MessageStop):
|
|
77
77
|
yield [Message(
|
|
78
78
|
id=ms.message.id,
|
|
79
|
-
role=ms.message.role,
|
|
79
|
+
role=ms.message.role, # type: ignore[arg-type]
|
|
80
80
|
model=ms.message.model,
|
|
81
81
|
content=content,
|
|
82
82
|
stop_reason=dct['stop_reason'],
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"""
|
|
2
|
+
https://docs.claude.com/en/api/messages
|
|
3
|
+
"""
|
|
1
4
|
import typing as ta
|
|
2
5
|
|
|
3
6
|
from omlish import dataclasses as dc
|
|
@@ -8,6 +11,22 @@ from omlish import marshal as msh
|
|
|
8
11
|
##
|
|
9
12
|
|
|
10
13
|
|
|
14
|
+
def _set_class_marshal_options(cls):
|
|
15
|
+
msh.update_object_metadata(
|
|
16
|
+
cls,
|
|
17
|
+
field_defaults=msh.FieldMetadata(
|
|
18
|
+
options=msh.FieldOptions(
|
|
19
|
+
omit_if=lang.is_none,
|
|
20
|
+
),
|
|
21
|
+
),
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
return cls
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
##
|
|
28
|
+
|
|
29
|
+
|
|
11
30
|
class Content(lang.Abstract, lang.Sealed):
|
|
12
31
|
class CacheControl(lang.Abstract, lang.Sealed):
|
|
13
32
|
"""https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching"""
|
|
@@ -18,7 +37,7 @@ class Content(lang.Abstract, lang.Sealed):
|
|
|
18
37
|
|
|
19
38
|
|
|
20
39
|
@dc.dataclass(frozen=True)
|
|
21
|
-
@
|
|
40
|
+
@_set_class_marshal_options
|
|
22
41
|
class Text(Content):
|
|
23
42
|
text: str
|
|
24
43
|
|
|
@@ -28,7 +47,7 @@ class Text(Content):
|
|
|
28
47
|
|
|
29
48
|
|
|
30
49
|
@dc.dataclass(frozen=True)
|
|
31
|
-
@
|
|
50
|
+
@_set_class_marshal_options
|
|
32
51
|
class ToolUse(Content):
|
|
33
52
|
id: str
|
|
34
53
|
name: str
|
|
@@ -40,6 +59,7 @@ class ToolUse(Content):
|
|
|
40
59
|
|
|
41
60
|
|
|
42
61
|
@dc.dataclass(frozen=True)
|
|
62
|
+
@_set_class_marshal_options
|
|
43
63
|
class ToolResult(Content):
|
|
44
64
|
tool_use_id: str
|
|
45
65
|
content: str
|
|
@@ -49,7 +69,7 @@ class ToolResult(Content):
|
|
|
49
69
|
|
|
50
70
|
|
|
51
71
|
@dc.dataclass(frozen=True, kw_only=True)
|
|
52
|
-
@
|
|
72
|
+
@_set_class_marshal_options
|
|
53
73
|
class CacheCreation:
|
|
54
74
|
ephemeral_5m_input_tokens: int | None = None
|
|
55
75
|
ephemeral_1h_input_tokens: int | None = None
|
|
@@ -59,7 +79,7 @@ class CacheCreation:
|
|
|
59
79
|
|
|
60
80
|
|
|
61
81
|
@dc.dataclass(frozen=True, kw_only=True)
|
|
62
|
-
@
|
|
82
|
+
@_set_class_marshal_options
|
|
63
83
|
class Usage:
|
|
64
84
|
input_tokens: int | None = None
|
|
65
85
|
output_tokens: int | None = None
|
|
@@ -75,15 +95,15 @@ class Usage:
|
|
|
75
95
|
|
|
76
96
|
|
|
77
97
|
@dc.dataclass(frozen=True, kw_only=True)
|
|
78
|
-
@
|
|
98
|
+
@_set_class_marshal_options
|
|
79
99
|
class Message:
|
|
80
100
|
id: str | None = None
|
|
81
101
|
|
|
82
|
-
role:
|
|
102
|
+
role: ta.Literal['user', 'assistant']
|
|
83
103
|
|
|
84
104
|
model: str | None = None
|
|
85
105
|
|
|
86
|
-
content: ta.Sequence[Content] | None = None
|
|
106
|
+
content: str | ta.Sequence[Content] | None = None
|
|
87
107
|
|
|
88
108
|
stop_reason: str | None = None
|
|
89
109
|
stop_sequence: str | None = None
|
|
@@ -95,6 +115,7 @@ class Message:
|
|
|
95
115
|
|
|
96
116
|
|
|
97
117
|
@dc.dataclass(frozen=True)
|
|
118
|
+
@_set_class_marshal_options
|
|
98
119
|
class ToolSpec:
|
|
99
120
|
name: str
|
|
100
121
|
description: str
|
|
@@ -105,7 +126,7 @@ class ToolSpec:
|
|
|
105
126
|
|
|
106
127
|
|
|
107
128
|
@dc.dataclass(frozen=True)
|
|
108
|
-
@
|
|
129
|
+
@_set_class_marshal_options
|
|
109
130
|
class MessagesRequest:
|
|
110
131
|
model: str
|
|
111
132
|
|
|
@@ -113,7 +134,7 @@ class MessagesRequest:
|
|
|
113
134
|
|
|
114
135
|
_: dc.KW_ONLY
|
|
115
136
|
|
|
116
|
-
system: ta.Sequence[Content] | None = None
|
|
137
|
+
system: str | ta.Sequence[Content] | None = None
|
|
117
138
|
|
|
118
139
|
tools: ta.Sequence[ToolSpec] | None = None
|
|
119
140
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from omlish import lang
|
|
2
|
+
from omlish import marshal as msh
|
|
3
|
+
|
|
4
|
+
from .types import Value
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
##
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@lang.static_init
|
|
11
|
+
def _install_standard_marshaling() -> None:
|
|
12
|
+
msh.install_standard_factories(
|
|
13
|
+
*msh.standard_polymorphism_factories(
|
|
14
|
+
msh.polymorphism_from_subclasses(Value),
|
|
15
|
+
),
|
|
16
|
+
)
|