ommlds 0.0.0.dev462__tar.gz → 0.0.0.dev464__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 ommlds might be problematic. Click here for more details.
- {ommlds-0.0.0.dev462/ommlds.egg-info → ommlds-0.0.0.dev464}/PKG-INFO +3 -3
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/loading.py +58 -1
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/inject.py +0 -5
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/main.py +26 -38
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/backends/catalog.py +56 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/backends/inject.py +37 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/backends/injection.py +16 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/backends/types.py +36 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/ai/inject.py +81 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/ai/injection.py +14 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/ai/rendering.py +70 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/ai/services.py +81 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/ai/tools.py +44 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/ai/types.py +28 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/state/inject.py +40 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/state/inmemory.py +34 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/state/storage.py +53 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/state/types.py +38 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/user/inject.py +61 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/user/interactive.py +29 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/user/oneshot.py +25 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/user/types.py +15 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/configs.py +36 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/content/messages.py +34 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/content/strings.py +42 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/driver.py +43 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/inject.py +72 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/phases/inject.py +27 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/phases/injection.py +14 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/phases/manager.py +29 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/phases/types.py +29 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/rendering/inject.py +32 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/rendering/markdown.py +52 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/rendering/raw.py +73 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/rendering/types.py +21 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/session.py +27 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/tools/confirmation.py +46 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/tools/execution.py +66 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/tools/inject.py +145 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/tools/injection.py +29 -0
- ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/tools/rendering.py +58 -0
- {ommlds-0.0.0.dev462/ommlds/cli → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat}/tools/weather.py +1 -1
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/sessions/inject.py +3 -3
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/state.py +40 -23
- ommlds-0.0.0.dev464/ommlds/minichain/tools/__init__.py +0 -0
- ommlds-0.0.0.dev464/ommlds/minichain/tools/execution/__init__.py +0 -0
- ommlds-0.0.0.dev464/ommlds/minichain/vectors/__init__.py +0 -0
- ommlds-0.0.0.dev464/ommlds/server/__init__.py +0 -0
- ommlds-0.0.0.dev464/ommlds/tools/__init__.py +0 -0
- ommlds-0.0.0.dev464/ommlds/wiki/__init__.py +0 -0
- ommlds-0.0.0.dev464/ommlds/wiki/text/__init__.py +0 -0
- ommlds-0.0.0.dev464/ommlds/wiki/utils/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464/ommlds.egg-info}/PKG-INFO +3 -3
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds.egg-info/SOURCES.txt +46 -11
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds.egg-info/requires.txt +2 -2
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/pyproject.toml +3 -3
- ommlds-0.0.0.dev462/ommlds/cli/sessions/chat/base.py +0 -42
- ommlds-0.0.0.dev462/ommlds/cli/sessions/chat/code.py +0 -125
- ommlds-0.0.0.dev462/ommlds/cli/sessions/chat/inject.py +0 -98
- ommlds-0.0.0.dev462/ommlds/cli/sessions/chat/interactive.py +0 -70
- ommlds-0.0.0.dev462/ommlds/cli/sessions/chat/printing.py +0 -126
- ommlds-0.0.0.dev462/ommlds/cli/sessions/chat/prompt.py +0 -161
- ommlds-0.0.0.dev462/ommlds/cli/sessions/chat/state.py +0 -110
- ommlds-0.0.0.dev462/ommlds/cli/sessions/chat/tools.py +0 -97
- ommlds-0.0.0.dev462/ommlds/cli/tools/config.py +0 -14
- ommlds-0.0.0.dev462/ommlds/cli/tools/inject.py +0 -75
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/LICENSE +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/MANIFEST.in +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/README.md +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/.omlish-manifests.json +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/__about__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/_hacks/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/_hacks/patches.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/anthropic/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/anthropic/protocol/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/anthropic/protocol/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/anthropic/protocol/sse/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/anthropic/protocol/sse/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/anthropic/protocol/sse/assemble.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/anthropic/protocol/sse/events.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/anthropic/protocol/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/google/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/google/protocol/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/google/protocol/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/google/protocol/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/llamacpp/buildwheel.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/llamacpp/logging.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/__main__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/caching.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/cli.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/generation.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/limits.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/LICENSE +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/detokenization/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/detokenization/base.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/detokenization/bpe.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/detokenization/naive.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/detokenization/spm.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/loading.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/tokenization.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/mlx/tokenization/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/_common.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/chatcompletion/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/chatcompletion/chunk.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/chatcompletion/contentpart.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/chatcompletion/message.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/chatcompletion/request.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/chatcompletion/response.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/chatcompletion/responseformat.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/chatcompletion/tokenlogprob.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/openai/protocol/completionusage.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/LICENSE +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/__main__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/attention.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/cli.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/fetch.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/llm.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/loading.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/quantization.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/sampling.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/tokenization.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/llama3/transformer.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/sdxl/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/sdxl/__main__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/sdxl/cli.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/sdxl/clip.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/sdxl/sdxl.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/models/sdxl/unet.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/tinygrad/tinygrad.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/torch/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/torch/backends.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/torch/devices.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/backends/torch/purge.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/__main__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/backends/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/backends/inject.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/backends/standard.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/sessions/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/sessions/base.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/sessions/chat/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/cli/sessions/completion → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/backends}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/cli/sessions/embedding → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/cli/tools → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/ai}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/datasets → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/state}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/datasets/lib → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/chat/user}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/content}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/catalogs → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/phases}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/rendering}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/anthropic → ommlds-0.0.0.dev464/ommlds/cli/sessions/chat/tools}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/duckduckgo → ommlds-0.0.0.dev464/ommlds/cli/sessions/completion}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/sessions/completion/completion.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/google → ommlds-0.0.0.dev464/ommlds/cli/sessions/embedding}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/cli/sessions/embedding/embedding.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/huggingface → ommlds-0.0.0.dev464/ommlds/datasets}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/llamacpp → ommlds-0.0.0.dev464/ommlds/datasets/lib}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/datasets/lib/movies.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/huggingface.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/_typedvalues.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/mlx → ommlds-0.0.0.dev464/ommlds/minichain/backends}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/openai → ommlds-0.0.0.dev464/ommlds/minichain/backends/catalogs}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/catalogs/base.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/catalogs/simple.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/catalogs/strings.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/sentencepiece → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls}/__init__.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/tinygrad → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/anthropic}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/anthropic/chat.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/anthropic/names.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/anthropic/stream.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/tokenizers → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/duckduckgo}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/duckduckgo/search.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/impls/transformers → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/google}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/google/chat.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/google/names.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/google/search.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/google/stream.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/google/tools.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/backends/strings → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/huggingface}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/huggingface/configs.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/huggingface/repos.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/chat → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/llamacpp}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/llamacpp/chat.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/llamacpp/completion.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/llamacpp/format.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/llamacpp/stream.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/mistral.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/chat/choices → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/mlx}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/mlx/chat.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/chat/stream → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/openai}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/openai/chat.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/openai/completion.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/openai/embedding.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/openai/format.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/openai/format2.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/openai/names.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/openai/stream.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/chat/tools → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/sentencepiece}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/sentencepiece/tokens.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/sqlite.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/chat/transforms → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/tinygrad}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/tinygrad/chat.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/content/transforms → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/tokenizers}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/tokenizers/tokens.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/lib → ommlds-0.0.0.dev464/ommlds/minichain/backends/impls/transformers}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/transformers/sentence.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/transformers/tokens.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/impls/transformers/transformers.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/lib/code → ommlds-0.0.0.dev464/ommlds/minichain/backends/strings}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/strings/manifests.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/strings/parsing.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/backends/strings/resolving.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/lib/fs → ommlds-0.0.0.dev464/ommlds/minichain/chat}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/_marshal.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/lib/fs/tools → ommlds-0.0.0.dev464/ommlds/minichain/chat/choices}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/choices/adapters.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/choices/services.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/choices/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/formats.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/history.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/messages.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/metadata.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/services.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/lib/fs/tools/recursivels → ommlds-0.0.0.dev464/ommlds/minichain/chat/stream}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/stream/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/stream/adapters.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/stream/services.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/stream/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/templating.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/lib/todo → ommlds-0.0.0.dev464/ommlds/minichain/chat/tools}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/tools/execution.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/tools/ids.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/tools/parsing.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/tools/types.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/lib/todo/tools → ommlds-0.0.0.dev464/ommlds/minichain/chat/transforms}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/transforms/base.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/transforms/metadata.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/transforms/services.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/chat/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/completion.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/configs.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/images.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/json.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/materialize.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/metadata.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/namespaces.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/placeholders.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/prepare.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/sequence.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/simple.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/text.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/llms → ommlds-0.0.0.dev464/ommlds/minichain/content/transforms}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/transforms/base.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/transforms/interleave.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/transforms/squeeze.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/transforms/stringify.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/transforms/strings.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/content/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/docs/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/docs/docs.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/docs/dtypes.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/docs/filters.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/envs.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/json.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/models → ommlds-0.0.0.dev464/ommlds/minichain/lib}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/bash.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/models/repos → ommlds-0.0.0.dev464/ommlds/minichain/lib/code}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/code/prompts.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/registries → ommlds-0.0.0.dev464/ommlds/minichain/lib/fs}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/binfiles.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/context.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/errors.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/suggestions.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/stream → ommlds-0.0.0.dev464/ommlds/minichain/lib/fs/tools}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/tools/edit.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/tools/ls.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/tools/read.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/text → ommlds-0.0.0.dev464/ommlds/minichain/lib/fs/tools/recursivels}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/tools/recursivels/execution.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/tools/recursivels/rendering.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/fs/tools/recursivels/running.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/text/toolparsing → ommlds-0.0.0.dev464/ommlds/minichain/lib/todo}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/todo/context.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain → ommlds-0.0.0.dev464/ommlds/minichain/lib/todo}/tools/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/todo/tools/read.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/todo/tools/write.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/lib/todo/types.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/tools/execution → ommlds-0.0.0.dev464/ommlds/minichain/llms}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/llms/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/llms/tokens.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/llms/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/metadata.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/minichain/vectors → ommlds-0.0.0.dev464/ommlds/minichain/models}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/models/configs.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/models/names.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/server → ommlds-0.0.0.dev464/ommlds/minichain/models/repos}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/models/repos/resolving.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/tools → ommlds-0.0.0.dev464/ommlds/minichain/registries}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/registries/globals.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/registries/manifests.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/registries/registry.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/resources.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/search.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/services/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/services/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/services/_origclasses.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/services/_typedvalues.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/services/facades.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/services/requests.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/services/responses.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/services/services.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/standard.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/wiki → ommlds-0.0.0.dev464/ommlds/minichain/stream}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/stream/services.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/stream/wrap.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/wiki → ommlds-0.0.0.dev464/ommlds/minichain}/text/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/text/applypatch.py +0 -0
- {ommlds-0.0.0.dev462/ommlds/wiki/utils → ommlds-0.0.0.dev464/ommlds/minichain/text/toolparsing}/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/text/toolparsing/base.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/text/toolparsing/dumb.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/text/toolparsing/llamacpp/LICENSE +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/text/toolparsing/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/text/toolparsing/llamacpp/hermes2.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/text/toolparsing/llamacpp/llama31.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/text/toolparsing/llamacpp/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/text/toolparsing/llamacpp/utils.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tokens/__init__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tokens/specials.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tokens/tokenizers.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tokens/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tokens/vocabs.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/execution/catalog.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/execution/context.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/execution/errors.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/execution/executors.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/execution/reflect.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/fns.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/jsonschema.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/reflect.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/tools/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/utils.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/vectors/_marshal.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/vectors/embeddings.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/vectors/index.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/vectors/search.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/vectors/similarity.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/vectors/stores.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/minichain/vectors/types.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/server/__main__.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/server/cli.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/server/client.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/server/server.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/server/service.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/tools/git.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/tools/ocr.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/wiki/analyze.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/wiki/convert.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/wiki/models.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/wiki/text/mfh.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/wiki/text/wtp.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/wiki/utils/io.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/wiki/utils/progress.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/wiki/utils/xml.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds/wiki/xml.py +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds.egg-info/dependency_links.txt +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds.egg-info/entry_points.txt +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/ommlds.egg-info/top_level.txt +0 -0
- {ommlds-0.0.0.dev462 → ommlds-0.0.0.dev464}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ommlds
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev464
|
|
4
4
|
Summary: ommlds
|
|
5
5
|
Author: wrmsr
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
@@ -14,8 +14,8 @@ 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.
|
|
18
|
-
Requires-Dist: omlish==0.0.0.
|
|
17
|
+
Requires-Dist: omdev==0.0.0.dev464
|
|
18
|
+
Requires-Dist: omlish==0.0.0.dev464
|
|
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"
|
|
@@ -15,6 +15,63 @@ from .tokenization import load_tokenization
|
|
|
15
15
|
##
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
def get_model_path(
|
|
19
|
+
path_or_hf_repo: str,
|
|
20
|
+
revision: str | None = None,
|
|
21
|
+
) -> tuple[pathlib.Path, str | None]:
|
|
22
|
+
"""
|
|
23
|
+
Ensures the model is available locally. If the path does not exist locally,
|
|
24
|
+
it is downloaded from the Hugging Face Hub.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
path_or_hf_repo (str): The local path or Hugging Face repository ID of the model.
|
|
28
|
+
revision (str, optional): A revision id which can be a branch name, a tag, or a commit hash.
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
Tuple[Path, str]: A tuple containing the local file path and the Hugging Face repo ID.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
model_path = pathlib.Path(path_or_hf_repo)
|
|
35
|
+
|
|
36
|
+
if not model_path.exists():
|
|
37
|
+
from huggingface_hub import snapshot_download
|
|
38
|
+
hf_path = path_or_hf_repo
|
|
39
|
+
model_path = pathlib.Path(
|
|
40
|
+
snapshot_download(
|
|
41
|
+
path_or_hf_repo,
|
|
42
|
+
revision=revision,
|
|
43
|
+
allow_patterns=[
|
|
44
|
+
'*.jinja',
|
|
45
|
+
'*.json',
|
|
46
|
+
'*.jsonl',
|
|
47
|
+
'*.py',
|
|
48
|
+
'*.txt',
|
|
49
|
+
|
|
50
|
+
'model*.safetensors',
|
|
51
|
+
|
|
52
|
+
'*.tiktoken',
|
|
53
|
+
'tiktoken.model',
|
|
54
|
+
'tokenizer.model',
|
|
55
|
+
],
|
|
56
|
+
),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
else:
|
|
60
|
+
from huggingface_hub import ModelCard
|
|
61
|
+
|
|
62
|
+
card_path = model_path / 'README.md'
|
|
63
|
+
if card_path.is_file():
|
|
64
|
+
card = ModelCard.load(card_path)
|
|
65
|
+
hf_path = card.data.base_model
|
|
66
|
+
else:
|
|
67
|
+
hf_path = None
|
|
68
|
+
|
|
69
|
+
return model_path, hf_path
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
##
|
|
73
|
+
|
|
74
|
+
|
|
18
75
|
@dc.dataclass(frozen=True, kw_only=True)
|
|
19
76
|
class LoadedModel:
|
|
20
77
|
path: pathlib.Path
|
|
@@ -46,7 +103,7 @@ def load_model(
|
|
|
46
103
|
) -> LoadedModel:
|
|
47
104
|
# FIXME: get_model_path return annotation is wrong:
|
|
48
105
|
# https://github.com/ml-explore/mlx-lm/blob/9ee2b7358f5e258af7b31a8561acfbbe56ad5085/mlx_lm/utils.py#L82
|
|
49
|
-
model_path_res = ta.cast(ta.Any,
|
|
106
|
+
model_path_res = ta.cast(ta.Any, get_model_path(path_or_hf_repo))
|
|
50
107
|
if isinstance(model_path_res, tuple):
|
|
51
108
|
model_path = check.isinstance(model_path_res[0], pathlib.Path)
|
|
52
109
|
else:
|
|
@@ -10,8 +10,6 @@ with lang.auto_proxy_import(globals()):
|
|
|
10
10
|
from .backends import inject as backends_inj
|
|
11
11
|
from .sessions import base as sessions_base
|
|
12
12
|
from .sessions import inject as sessions_inj
|
|
13
|
-
from .tools import config as tools_cfg
|
|
14
|
-
from .tools import inject as tools_inj
|
|
15
13
|
|
|
16
14
|
|
|
17
15
|
##
|
|
@@ -33,7 +31,6 @@ def _provide_state_storage() -> 'state.StateStorage':
|
|
|
33
31
|
def bind_main(
|
|
34
32
|
*,
|
|
35
33
|
session_cfg: 'sessions_base.Session.Config',
|
|
36
|
-
tools_config: 'tools_cfg.ToolsConfig',
|
|
37
34
|
enable_backend_strings: bool = False,
|
|
38
35
|
) -> inj.Elements:
|
|
39
36
|
els: list[inj.Elemental] = [
|
|
@@ -42,8 +39,6 @@ def bind_main(
|
|
|
42
39
|
),
|
|
43
40
|
|
|
44
41
|
sessions_inj.bind_sessions(session_cfg),
|
|
45
|
-
|
|
46
|
-
tools_inj.bind_tools(tools_config),
|
|
47
42
|
]
|
|
48
43
|
|
|
49
44
|
#
|
|
@@ -24,12 +24,9 @@ from omlish.subprocesses.sync import subprocesses
|
|
|
24
24
|
from .. import minichain as mc
|
|
25
25
|
from .inject import bind_main
|
|
26
26
|
from .sessions.base import Session
|
|
27
|
-
from .sessions.chat.
|
|
28
|
-
from .sessions.chat.interactive import InteractiveChatSession
|
|
29
|
-
from .sessions.chat.prompt import PromptChatSession
|
|
27
|
+
from .sessions.chat.session import ChatSession
|
|
30
28
|
from .sessions.completion.completion import CompletionSession
|
|
31
29
|
from .sessions.embedding.embedding import EmbeddingSession
|
|
32
|
-
from .tools.config import ToolsConfig
|
|
33
30
|
|
|
34
31
|
|
|
35
32
|
if ta.TYPE_CHECKING:
|
|
@@ -56,6 +53,7 @@ async def _a_main(args: ta.Any = None) -> None:
|
|
|
56
53
|
parser.add_argument('-C', '--completion', action='store_true')
|
|
57
54
|
|
|
58
55
|
parser.add_argument('-n', '--new', action='store_true')
|
|
56
|
+
parser.add_argument('--ephemeral', action='store_true')
|
|
59
57
|
|
|
60
58
|
parser.add_argument('-e', '--editor', action='store_true')
|
|
61
59
|
parser.add_argument('-i', '--interactive', action='store_true')
|
|
@@ -90,6 +88,7 @@ async def _a_main(args: ta.Any = None) -> None:
|
|
|
90
88
|
elif args.interactive:
|
|
91
89
|
if args.prompt:
|
|
92
90
|
raise ValueError('Must not provide prompt')
|
|
91
|
+
content = None
|
|
93
92
|
|
|
94
93
|
elif args.code:
|
|
95
94
|
if args.prompt:
|
|
@@ -128,25 +127,7 @@ async def _a_main(args: ta.Any = None) -> None:
|
|
|
128
127
|
|
|
129
128
|
session_cfg: Session.Config
|
|
130
129
|
|
|
131
|
-
if args.
|
|
132
|
-
session_cfg = InteractiveChatSession.Config(
|
|
133
|
-
backend=args.backend,
|
|
134
|
-
model_name=args.model_name,
|
|
135
|
-
new=bool(args.new),
|
|
136
|
-
dangerous_no_tool_confirmation=bool(args.dangerous_no_tool_confirmation),
|
|
137
|
-
)
|
|
138
|
-
|
|
139
|
-
elif args.code:
|
|
140
|
-
session_cfg = CodeChatSession.Config(
|
|
141
|
-
backend=args.backend,
|
|
142
|
-
model_name=args.model_name,
|
|
143
|
-
new=bool(args.new),
|
|
144
|
-
dangerous_no_tool_confirmation=bool(args.dangerous_no_tool_confirmation),
|
|
145
|
-
initial_message=content, # noqa
|
|
146
|
-
markdown=bool(args.markdown),
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
elif args.embed:
|
|
130
|
+
if args.embed:
|
|
150
131
|
session_cfg = EmbeddingSession.Config(
|
|
151
132
|
check.not_none(content), # noqa
|
|
152
133
|
backend=args.backend,
|
|
@@ -159,31 +140,38 @@ async def _a_main(args: ta.Any = None) -> None:
|
|
|
159
140
|
)
|
|
160
141
|
|
|
161
142
|
else:
|
|
162
|
-
|
|
163
|
-
|
|
143
|
+
from ..minichain.lib.code.prompts import CODE_AGENT_SYSTEM_PROMPT
|
|
144
|
+
|
|
145
|
+
session_cfg = ChatSession.Config(
|
|
164
146
|
backend=args.backend,
|
|
165
147
|
model_name=args.model_name,
|
|
166
|
-
|
|
167
|
-
|
|
148
|
+
state='ephemeral' if args.ephemeral else 'new' if args.new else 'continue',
|
|
149
|
+
initial_system_content=CODE_AGENT_SYSTEM_PROMPT if args.new and args.code else None,
|
|
150
|
+
initial_user_content=content, # noqa
|
|
151
|
+
interactive=args.interactive,
|
|
168
152
|
markdown=bool(args.markdown),
|
|
153
|
+
stream=bool(args.stream),
|
|
154
|
+
enable_tools=(
|
|
155
|
+
args.enable_fs_tools or
|
|
156
|
+
args.enable_todo_tools or
|
|
157
|
+
args.enable_unsafe_tools_do_not_use_lol or
|
|
158
|
+
args.enable_test_weather_tool or
|
|
159
|
+
args.code
|
|
160
|
+
),
|
|
161
|
+
enabled_tools={
|
|
162
|
+
*(['fs'] if args.enable_fs_tools else []),
|
|
163
|
+
*(['todo'] if args.enable_todo_tools else []),
|
|
164
|
+
*(['weather'] if args.enable_test_weather_tool else []),
|
|
165
|
+
# FIXME: enable_unsafe_tools_do_not_use_lol
|
|
166
|
+
},
|
|
169
167
|
dangerous_no_tool_confirmation=bool(args.dangerous_no_tool_confirmation),
|
|
170
168
|
)
|
|
171
169
|
|
|
172
170
|
#
|
|
173
171
|
|
|
174
|
-
tools_config = ToolsConfig(
|
|
175
|
-
enable_fs_tools=args.enable_fs_tools or args.code,
|
|
176
|
-
enable_todo_tools=args.enable_todo_tools or args.code,
|
|
177
|
-
enable_unsafe_tools_do_not_use_lol=args.enable_unsafe_tools_do_not_use_lol,
|
|
178
|
-
enable_test_weather_tool=args.enable_test_weather_tool,
|
|
179
|
-
)
|
|
180
|
-
|
|
181
|
-
#
|
|
182
|
-
|
|
183
172
|
with inj.create_managed_injector(bind_main(
|
|
184
173
|
session_cfg=session_cfg,
|
|
185
|
-
|
|
186
|
-
enable_backend_strings=isinstance(session_cfg, (PromptChatSession.Config, CodeChatSession.Config)),
|
|
174
|
+
enable_backend_strings=isinstance(session_cfg, ChatSession.Config),
|
|
187
175
|
)) as injector:
|
|
188
176
|
await injector[Session].run()
|
|
189
177
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import contextlib
|
|
2
|
+
import typing as ta
|
|
3
|
+
|
|
4
|
+
from omlish import lang
|
|
5
|
+
|
|
6
|
+
from ..... import minichain as mc
|
|
7
|
+
from .types import BackendConfigs
|
|
8
|
+
from .types import BackendName
|
|
9
|
+
from .types import BackendProvider
|
|
10
|
+
from .types import ChatChoicesServiceBackendProvider
|
|
11
|
+
from .types import ChatChoicesStreamServiceBackendProvider
|
|
12
|
+
from .types import ServiceT
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
##
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class _CatalogBackendProvider(BackendProvider[ServiceT], lang.Abstract):
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
*,
|
|
22
|
+
name: BackendName,
|
|
23
|
+
catalog: 'mc.BackendCatalog',
|
|
24
|
+
configs: BackendConfigs | None = None,
|
|
25
|
+
) -> None:
|
|
26
|
+
super().__init__()
|
|
27
|
+
|
|
28
|
+
self._name = name
|
|
29
|
+
self._catalog = catalog
|
|
30
|
+
self._configs = configs
|
|
31
|
+
|
|
32
|
+
@contextlib.asynccontextmanager
|
|
33
|
+
async def _provide_backend(self, cls: type[ServiceT]) -> ta.AsyncIterator[ServiceT]:
|
|
34
|
+
service: ServiceT
|
|
35
|
+
async with lang.async_maybe_managing(self._catalog.get_backend(
|
|
36
|
+
cls,
|
|
37
|
+
self._name,
|
|
38
|
+
*(self._configs or []),
|
|
39
|
+
)) as service:
|
|
40
|
+
yield service
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class CatalogChatChoicesServiceBackendProvider(
|
|
44
|
+
_CatalogBackendProvider['mc.ChatChoicesService'],
|
|
45
|
+
ChatChoicesServiceBackendProvider,
|
|
46
|
+
):
|
|
47
|
+
def provide_backend(self) -> ta.AsyncContextManager['mc.ChatChoicesService']:
|
|
48
|
+
return self._provide_backend(mc.ChatChoicesService) # type: ignore[type-abstract]
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class CatalogChatChoicesStreamServiceBackendProvider(
|
|
52
|
+
_CatalogBackendProvider['mc.ChatChoicesStreamService'],
|
|
53
|
+
ChatChoicesStreamServiceBackendProvider,
|
|
54
|
+
):
|
|
55
|
+
def provide_backend(self) -> ta.AsyncContextManager['mc.ChatChoicesStreamService']:
|
|
56
|
+
return self._provide_backend(mc.ChatChoicesStreamService) # type: ignore[type-abstract]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from omlish import inject as inj
|
|
2
|
+
from omlish import lang
|
|
3
|
+
|
|
4
|
+
from .injection import backend_configs
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
with lang.auto_proxy_import(globals()):
|
|
8
|
+
from . import catalog as _catalog
|
|
9
|
+
from . import types as _types
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
##
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def bind_backends(
|
|
16
|
+
*,
|
|
17
|
+
backend: str | None = None,
|
|
18
|
+
) -> inj.Elements:
|
|
19
|
+
els: list[inj.Elemental] = []
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
|
|
23
|
+
els.append(backend_configs().bind_items_provider(singleton=True))
|
|
24
|
+
|
|
25
|
+
#
|
|
26
|
+
|
|
27
|
+
if backend is not None:
|
|
28
|
+
els.append(inj.bind(_types.BackendName, to_const=backend))
|
|
29
|
+
|
|
30
|
+
els.extend([
|
|
31
|
+
inj.bind(_types.ChatChoicesServiceBackendProvider, to_ctor=_catalog.CatalogChatChoicesServiceBackendProvider, singleton=True), # noqa
|
|
32
|
+
inj.bind(_types.ChatChoicesStreamServiceBackendProvider, to_ctor=_catalog.CatalogChatChoicesStreamServiceBackendProvider, singleton=True), # noqa
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
#
|
|
36
|
+
|
|
37
|
+
return inj.as_elements(*els)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from omlish import inject as inj
|
|
2
|
+
from omlish import lang
|
|
3
|
+
|
|
4
|
+
from ..... import minichain as mc
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
with lang.auto_proxy_import(globals()):
|
|
8
|
+
from . import types as _types
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
##
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@lang.cached_function
|
|
15
|
+
def backend_configs() -> 'inj.ItemsBinderHelper[mc.Config]':
|
|
16
|
+
return inj.items_binder_helper[mc.Config](_types.BackendConfigs)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
import typing as ta
|
|
3
|
+
|
|
4
|
+
from omlish import lang
|
|
5
|
+
|
|
6
|
+
from ..... import minichain as mc
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
ServiceT = ta.TypeVar('ServiceT', bound=mc.Service)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
##
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
BackendName = ta.NewType('BackendName', str)
|
|
16
|
+
BackendConfigs = ta.NewType('BackendConfigs', ta.Sequence['mc.Config'])
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
##
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class BackendProvider(lang.Abstract, ta.Generic[ServiceT]):
|
|
23
|
+
@abc.abstractmethod
|
|
24
|
+
def provide_backend(self) -> ta.AsyncContextManager[ServiceT]:
|
|
25
|
+
raise NotImplementedError
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
##
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ChatChoicesServiceBackendProvider(BackendProvider['mc.ChatChoicesService'], lang.Abstract):
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ChatChoicesStreamServiceBackendProvider(BackendProvider['mc.ChatChoicesStreamService'], lang.Abstract):
|
|
36
|
+
pass
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from omlish import inject as inj
|
|
2
|
+
from omlish import lang
|
|
3
|
+
|
|
4
|
+
from ...... import minichain as mc
|
|
5
|
+
from .injection import chat_options_providers
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
with lang.auto_proxy_import(globals()):
|
|
9
|
+
from . import rendering as _rendering
|
|
10
|
+
from . import services as _services
|
|
11
|
+
from . import tools as _tools
|
|
12
|
+
from . import types as _types
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
##
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def bind_ai(
|
|
19
|
+
*,
|
|
20
|
+
stream: bool = False,
|
|
21
|
+
silent: bool = False,
|
|
22
|
+
enable_tools: bool = False,
|
|
23
|
+
) -> inj.Elements:
|
|
24
|
+
els: list[inj.Elemental] = []
|
|
25
|
+
|
|
26
|
+
#
|
|
27
|
+
|
|
28
|
+
els.append(chat_options_providers().bind_items_provider(singleton=True))
|
|
29
|
+
|
|
30
|
+
def _provide_chat_choices_options_provider(
|
|
31
|
+
ps: _services.ChatChoicesServiceOptionsProviders,
|
|
32
|
+
) -> _services.ChatChoicesServiceOptionsProvider:
|
|
33
|
+
return _services.ChatChoicesServiceOptionsProvider(lambda: [o for p in ps for o in p()])
|
|
34
|
+
|
|
35
|
+
els.append(inj.bind(_provide_chat_choices_options_provider, singleton=True))
|
|
36
|
+
|
|
37
|
+
#
|
|
38
|
+
|
|
39
|
+
if stream:
|
|
40
|
+
ai_stack = inj.wrapper_binder_helper(_types.StreamAiChatGenerator)
|
|
41
|
+
|
|
42
|
+
els.append(ai_stack.push_bind(to_ctor=_services.ChatChoicesStreamServiceStreamAiChatGenerator, singleton=True))
|
|
43
|
+
|
|
44
|
+
if not silent:
|
|
45
|
+
els.append(ai_stack.push_bind(to_ctor=_rendering.RenderingStreamAiChatGenerator, singleton=True))
|
|
46
|
+
|
|
47
|
+
if enable_tools:
|
|
48
|
+
raise NotImplementedError
|
|
49
|
+
|
|
50
|
+
els.extend([
|
|
51
|
+
inj.bind(_types.StreamAiChatGenerator, to_key=ai_stack.top),
|
|
52
|
+
inj.bind(_types.AiChatGenerator, to_key=_types.StreamAiChatGenerator),
|
|
53
|
+
])
|
|
54
|
+
|
|
55
|
+
else:
|
|
56
|
+
ai_stack = inj.wrapper_binder_helper(_types.AiChatGenerator)
|
|
57
|
+
|
|
58
|
+
els.append(ai_stack.push_bind(to_ctor=_services.ChatChoicesServiceAiChatGenerator, singleton=True))
|
|
59
|
+
|
|
60
|
+
if not silent:
|
|
61
|
+
els.append(ai_stack.push_bind(to_ctor=_rendering.RenderingAiChatGenerator, singleton=True))
|
|
62
|
+
|
|
63
|
+
if enable_tools:
|
|
64
|
+
els.append(ai_stack.push_bind(to_ctor=_tools.ToolExecutingAiChatGenerator, singleton=True))
|
|
65
|
+
|
|
66
|
+
els.append(inj.bind(_types.AiChatGenerator, to_key=ai_stack.top))
|
|
67
|
+
|
|
68
|
+
#
|
|
69
|
+
|
|
70
|
+
if enable_tools:
|
|
71
|
+
def _provide_tools_chat_choices_options_provider(tc: mc.ToolCatalog) -> _services.ChatChoicesServiceOptionsProvider: # noqa
|
|
72
|
+
return _services.ChatChoicesServiceOptionsProvider(lambda: [
|
|
73
|
+
mc.Tool(tce.spec)
|
|
74
|
+
for tce in tc.by_name.values()
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
els.append(chat_options_providers().bind_item(to_fn=_provide_tools_chat_choices_options_provider, singleton=True)) # noqa
|
|
78
|
+
|
|
79
|
+
#
|
|
80
|
+
|
|
81
|
+
return inj.as_elements(*els)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from omlish import inject as inj
|
|
2
|
+
from omlish import lang
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
with lang.auto_proxy_import(globals()):
|
|
6
|
+
from . import services as _services
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
##
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@lang.cached_function
|
|
13
|
+
def chat_options_providers() -> 'inj.ItemsBinderHelper[_services.ChatChoicesServiceOptionsProvider]':
|
|
14
|
+
return inj.items_binder_helper[_services.ChatChoicesServiceOptionsProvider](_services.ChatChoicesServiceOptionsProviders) # noqa
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import typing as ta
|
|
2
|
+
|
|
3
|
+
from ...... import minichain as mc
|
|
4
|
+
from ...content.messages import MessageContentExtractor
|
|
5
|
+
from ...content.messages import MessageContentExtractorImpl
|
|
6
|
+
from ...rendering.types import ContentRendering
|
|
7
|
+
from ...rendering.types import StreamContentRendering
|
|
8
|
+
from .types import AiChatGenerator
|
|
9
|
+
from .types import StreamAiChatGenerator
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
##
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RenderingAiChatGenerator(AiChatGenerator):
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
*,
|
|
19
|
+
wrapped: AiChatGenerator,
|
|
20
|
+
extractor: MessageContentExtractor | None = None,
|
|
21
|
+
renderer: ContentRendering,
|
|
22
|
+
) -> None:
|
|
23
|
+
super().__init__()
|
|
24
|
+
|
|
25
|
+
self._wrapped = wrapped
|
|
26
|
+
if extractor is None:
|
|
27
|
+
extractor = MessageContentExtractorImpl()
|
|
28
|
+
self._extractor = extractor
|
|
29
|
+
self._renderer = renderer
|
|
30
|
+
|
|
31
|
+
async def get_next_ai_messages(self, chat: 'mc.Chat') -> 'mc.Chat':
|
|
32
|
+
out = await self._wrapped.get_next_ai_messages(chat)
|
|
33
|
+
|
|
34
|
+
for msg in out:
|
|
35
|
+
if (c := self._extractor.extract_message_content(msg)) is not None:
|
|
36
|
+
await self._renderer.render_content(c)
|
|
37
|
+
|
|
38
|
+
return out
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class RenderingStreamAiChatGenerator(StreamAiChatGenerator):
|
|
42
|
+
def __init__(
|
|
43
|
+
self,
|
|
44
|
+
*,
|
|
45
|
+
wrapped: StreamAiChatGenerator,
|
|
46
|
+
extractor: MessageContentExtractor | None = None,
|
|
47
|
+
renderer: StreamContentRendering,
|
|
48
|
+
) -> None:
|
|
49
|
+
super().__init__()
|
|
50
|
+
|
|
51
|
+
self._wrapped = wrapped
|
|
52
|
+
if extractor is None:
|
|
53
|
+
extractor = MessageContentExtractorImpl()
|
|
54
|
+
self._extractor = extractor
|
|
55
|
+
self._renderer = renderer
|
|
56
|
+
|
|
57
|
+
async def get_next_ai_messages_streamed(
|
|
58
|
+
self,
|
|
59
|
+
chat: 'mc.Chat',
|
|
60
|
+
delta_callback: ta.Callable[['mc.AiChoiceDelta'], ta.Awaitable[None]] | None = None,
|
|
61
|
+
) -> mc.Chat:
|
|
62
|
+
async with self._renderer.create_context() as renderer:
|
|
63
|
+
async def inner(delta: mc.AiChoiceDelta) -> None:
|
|
64
|
+
if isinstance(delta, mc.ContentAiChoiceDelta):
|
|
65
|
+
await renderer.render_content(delta.c)
|
|
66
|
+
|
|
67
|
+
if delta_callback is not None:
|
|
68
|
+
await delta_callback(delta)
|
|
69
|
+
|
|
70
|
+
return await self._wrapped.get_next_ai_messages_streamed(chat, delta_callback=inner)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import typing as ta
|
|
2
|
+
|
|
3
|
+
from omlish import check
|
|
4
|
+
from omlish import lang
|
|
5
|
+
|
|
6
|
+
from ...... import minichain as mc
|
|
7
|
+
from ...backends.types import ChatChoicesServiceBackendProvider
|
|
8
|
+
from ...backends.types import ChatChoicesStreamServiceBackendProvider
|
|
9
|
+
from .types import AiChatGenerator
|
|
10
|
+
from .types import StreamAiChatGenerator
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
##
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ChatChoicesServiceOptionsProvider(lang.Func0[ta.Sequence['mc.ChatChoicesOptions']]):
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
ChatChoicesServiceOptionsProviders = ta.NewType('ChatChoicesServiceOptionsProviders', ta.Sequence[ChatChoicesServiceOptionsProvider]) # noqa
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
##
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ChatChoicesServiceAiChatGenerator(AiChatGenerator):
|
|
27
|
+
def __init__(
|
|
28
|
+
self,
|
|
29
|
+
service_provider: ChatChoicesServiceBackendProvider,
|
|
30
|
+
*,
|
|
31
|
+
options: ChatChoicesServiceOptionsProvider | None = None,
|
|
32
|
+
) -> None:
|
|
33
|
+
super().__init__()
|
|
34
|
+
|
|
35
|
+
self._service_provider = service_provider
|
|
36
|
+
self._options = options
|
|
37
|
+
|
|
38
|
+
async def get_next_ai_messages(self, chat: 'mc.Chat') -> 'mc.Chat':
|
|
39
|
+
opts = self._options() if self._options is not None else []
|
|
40
|
+
|
|
41
|
+
async with self._service_provider.provide_backend() as service:
|
|
42
|
+
resp = await service.invoke(mc.ChatChoicesRequest(chat, opts))
|
|
43
|
+
|
|
44
|
+
return check.single(resp.v).ms
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ChatChoicesStreamServiceStreamAiChatGenerator(StreamAiChatGenerator):
|
|
48
|
+
def __init__(
|
|
49
|
+
self,
|
|
50
|
+
service_provider: ChatChoicesStreamServiceBackendProvider,
|
|
51
|
+
*,
|
|
52
|
+
options: ChatChoicesServiceOptionsProvider | None = None,
|
|
53
|
+
) -> None:
|
|
54
|
+
super().__init__()
|
|
55
|
+
|
|
56
|
+
self._service_provider = service_provider
|
|
57
|
+
self._options = options
|
|
58
|
+
|
|
59
|
+
async def get_next_ai_messages_streamed(
|
|
60
|
+
self,
|
|
61
|
+
chat: 'mc.Chat',
|
|
62
|
+
delta_callback: ta.Callable[['mc.AiChoiceDelta'], ta.Awaitable[None]] | None = None,
|
|
63
|
+
) -> mc.AiChat:
|
|
64
|
+
opts = self._options() if self._options is not None else []
|
|
65
|
+
|
|
66
|
+
lst: list[str] = []
|
|
67
|
+
|
|
68
|
+
async with self._service_provider.provide_backend() as service:
|
|
69
|
+
async with (await service.invoke(mc.ChatChoicesStreamRequest(chat, opts))).v as st_resp:
|
|
70
|
+
async for o in st_resp:
|
|
71
|
+
choice = check.single(o.choices)
|
|
72
|
+
|
|
73
|
+
for delta in choice.deltas:
|
|
74
|
+
if delta_callback is not None:
|
|
75
|
+
await delta_callback(delta)
|
|
76
|
+
|
|
77
|
+
c = check.isinstance(delta, mc.ContentAiChoiceDelta).c # noqa
|
|
78
|
+
if c is not None:
|
|
79
|
+
lst.append(check.isinstance(c, str))
|
|
80
|
+
|
|
81
|
+
return [mc.AiMessage(''.join(lst))]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from ...... import minichain as mc
|
|
2
|
+
from ...tools.execution import ToolUseExecutor
|
|
3
|
+
from .types import AiChatGenerator
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
##
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ToolExecutingAiChatGenerator(AiChatGenerator):
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
*,
|
|
13
|
+
wrapped: AiChatGenerator,
|
|
14
|
+
executor: ToolUseExecutor,
|
|
15
|
+
) -> None:
|
|
16
|
+
super().__init__()
|
|
17
|
+
|
|
18
|
+
self._wrapped = wrapped
|
|
19
|
+
self._executor = executor
|
|
20
|
+
|
|
21
|
+
async def get_next_ai_messages(self, chat: 'mc.Chat') -> 'mc.Chat':
|
|
22
|
+
out: list[mc.Message] = []
|
|
23
|
+
|
|
24
|
+
while True:
|
|
25
|
+
new = await self._wrapped.get_next_ai_messages([*chat, *out])
|
|
26
|
+
|
|
27
|
+
out.extend(new)
|
|
28
|
+
|
|
29
|
+
cont = False
|
|
30
|
+
|
|
31
|
+
for msg in new:
|
|
32
|
+
if isinstance(msg, mc.ToolUseMessage):
|
|
33
|
+
trm = await self._executor.execute_tool_use(
|
|
34
|
+
msg.tu,
|
|
35
|
+
# fs_tool_context,
|
|
36
|
+
# todo_tool_context, # noqa
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
out.append(trm)
|
|
40
|
+
|
|
41
|
+
cont = True
|
|
42
|
+
|
|
43
|
+
if not cont:
|
|
44
|
+
return out
|