ommlds 0.0.0.dev330__tar.gz → 0.0.0.dev331__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.
- {ommlds-0.0.0.dev330/ommlds.egg-info → ommlds-0.0.0.dev331}/PKG-INFO +3 -3
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/.manifests.json +31 -31
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/sessions/chat.py +13 -13
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/sessions/completion.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/sessions/embedding.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/__init__.py +4 -11
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/anthropic/chat.py +3 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/duckduckgo.py +3 -6
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/google/chat.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/google/search.py +1 -1
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/llamacpp/chat.py +4 -5
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/llamacpp/completion.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/llamacpp/streaming.py +9 -17
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/mistral.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/mlx/chat.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/openai/chat.py +4 -11
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/openai/completion.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/openai/embedding.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/openai/format.py +1 -1
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/openai/streaming.py +11 -18
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/tinygrad/chat.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/transformers/sentence.py +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/transformers/transformers.py +4 -4
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/chat/history.py +3 -3
- ommlds-0.0.0.dev331/ommlds/minichain/chat/services.py +39 -0
- ommlds-0.0.0.dev331/ommlds/minichain/chat/streaming.py +24 -0
- ommlds-0.0.0.dev331/ommlds/minichain/chat/types.py +15 -0
- ommlds-0.0.0.dev331/ommlds/minichain/completion.py +47 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/llms/services.py +2 -2
- ommlds-0.0.0.dev331/ommlds/minichain/registry.py +238 -0
- ommlds-0.0.0.dev331/ommlds/minichain/resources.py +156 -0
- ommlds-0.0.0.dev331/ommlds/minichain/search.py +58 -0
- ommlds-0.0.0.dev331/ommlds/minichain/services/__init__.py +28 -0
- ommlds-0.0.0.dev331/ommlds/minichain/services/_marshal.py +99 -0
- ommlds-0.0.0.dev331/ommlds/minichain/services/_origclasses.py +45 -0
- ommlds-0.0.0.dev331/ommlds/minichain/services/_typedvalues.py +136 -0
- ommlds-0.0.0.dev331/ommlds/minichain/services/facades.py +76 -0
- ommlds-0.0.0.dev331/ommlds/minichain/services/requests.py +52 -0
- ommlds-0.0.0.dev331/ommlds/minichain/services/responses.py +52 -0
- ommlds-0.0.0.dev331/ommlds/minichain/services/services.py +13 -0
- ommlds-0.0.0.dev331/ommlds/minichain/vectors/embeddings.py +41 -0
- ommlds-0.0.0.dev331/ommlds/minichain/vectors/index.py +50 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/vectors/search.py +10 -26
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/server/server.py +4 -4
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/tools/git.py +6 -6
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331/ommlds.egg-info}/PKG-INFO +3 -3
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds.egg-info/SOURCES.txt +9 -3
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds.egg-info/requires.txt +2 -2
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/pyproject.toml +3 -3
- ommlds-0.0.0.dev330/ommlds/minichain/backends/manifests.py +0 -138
- ommlds-0.0.0.dev330/ommlds/minichain/chat/services.py +0 -59
- ommlds-0.0.0.dev330/ommlds/minichain/chat/streaming.py +0 -62
- ommlds-0.0.0.dev330/ommlds/minichain/chat/types.py +0 -15
- ommlds-0.0.0.dev330/ommlds/minichain/completion.py +0 -68
- ommlds-0.0.0.dev330/ommlds/minichain/resources.py +0 -121
- ommlds-0.0.0.dev330/ommlds/minichain/search.py +0 -74
- ommlds-0.0.0.dev330/ommlds/minichain/services.py +0 -259
- ommlds-0.0.0.dev330/ommlds/minichain/streaming.py +0 -28
- ommlds-0.0.0.dev330/ommlds/minichain/vectors/embeddings.py +0 -54
- ommlds-0.0.0.dev330/ommlds/minichain/vectors/index.py +0 -65
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/LICENSE +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/MANIFEST.in +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/README.md +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/__about__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/llamacpp/buildwheel.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/llamacpp/logging.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/__main__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/caching.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/cli.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/generation.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/limits.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/loading.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/LICENSE +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/detokenization/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/detokenization/base.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/detokenization/bpe.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/detokenization/naive.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/detokenization/spm.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/loading.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/tokenization.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/mlx/tokenization/types.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/LICENSE +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/__main__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/attention.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/fetch.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/llm.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/loading.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/quantization.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/repl.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/sampling.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/tokenization.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/llama3/transformer.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/sdxl/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/sdxl/__main__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/sdxl/cli.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/sdxl/clip.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/sdxl/sdxl.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/models/sdxl/unet.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/tinygrad/tinygrad.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/torch/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/torch/backends.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/torch/devices.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/backends/torch/purge.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/__main__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/inject.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/main.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/sessions/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/sessions/base.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/sessions/inject.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/state.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/tools/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/tools/inject.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/cli/tools/tools.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/datasets/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/datasets/library/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/datasets/library/movies.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/hacks/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/hacks/patches.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/huggingface.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/_abc.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/anthropic/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/google/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/huggingface.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/llamacpp/format.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/mlx/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/openai/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/sentencepiece/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/sentencepiece/tokens.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/sqlite.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/tinygrad/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/tokenizers/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/tokenizers/tokens.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/transformers/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/transformers/tokens.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/chat/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/chat/choices.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/chat/formats.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/chat/marshal.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/chat/messages.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/chat/templating.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/chat/tools.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/configs.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/content/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/content/content.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/content/images.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/content/marshal.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/content/rendering.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/content/transforms.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/docs/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/docs/docs.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/docs/dtypes.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/docs/filters.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/envs.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/json.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/llms/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/llms/marshal.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/llms/tokens.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/standard.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/applypatch.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/toolparsing/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/toolparsing/base.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/toolparsing/dumb.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/toolparsing/llamacpp/LICENSE +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/toolparsing/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/toolparsing/llamacpp/hermes2.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/toolparsing/llamacpp/llama31.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/toolparsing/llamacpp/types.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/text/toolparsing/llamacpp/utils.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tokens/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tokens/specials.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tokens/tokenizers.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tokens/types.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tokens/vocabs.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tools/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tools/jsonschema.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tools/marshal.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tools/reflection.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/tools/types.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/vectors/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/vectors/similarity.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/vectors/stores.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/vectors/types.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/server/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/server/__main__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/server/cli.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/server/client.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/server/service.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/tools/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/tools/ocr.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/analyze.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/convert.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/models.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/text/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/text/mfh.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/text/wtp.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/utils/__init__.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/utils/io.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/utils/progress.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/utils/xml.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/wiki/xml.py +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds.egg-info/dependency_links.txt +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds.egg-info/entry_points.txt +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds.egg-info/top_level.txt +0 -0
- {ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/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.dev331
|
|
4
4
|
Summary: ommlds
|
|
5
5
|
Author: wrmsr
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Classifier: Operating System :: POSIX
|
|
13
13
|
Requires-Python: >=3.12
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: omdev==0.0.0.
|
|
16
|
-
Requires-Dist: omlish==0.0.0.
|
|
15
|
+
Requires-Dist: omdev==0.0.0.dev331
|
|
16
|
+
Requires-Dist: omlish==0.0.0.dev331
|
|
17
17
|
Provides-Extra: all
|
|
18
18
|
Requires-Dist: llama-cpp-python~=0.3; extra == "all"
|
|
19
19
|
Requires-Dist: mlx~=0.26; extra == "all"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"file": "ommlds/minichain/backends/anthropic/chat.py",
|
|
21
21
|
"line": 30,
|
|
22
22
|
"value": {
|
|
23
|
-
"$.minichain.
|
|
23
|
+
"$.minichain.registry.RegistryManifest": {
|
|
24
24
|
"mod_name": "ommlds.minichain.backends.anthropic.chat",
|
|
25
25
|
"attr_name": "AnthropicChatService",
|
|
26
26
|
"name": "anthropic",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"file": "ommlds/minichain/backends/duckduckgo.py",
|
|
36
36
|
"line": 21,
|
|
37
37
|
"value": {
|
|
38
|
-
"$.minichain.
|
|
38
|
+
"$.minichain.registry.RegistryManifest": {
|
|
39
39
|
"mod_name": "ommlds.minichain.backends.duckduckgo",
|
|
40
40
|
"attr_name": "DuckduckgoSearchService",
|
|
41
41
|
"name": "duckduckgo",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"file": "ommlds/minichain/backends/google/chat.py",
|
|
53
53
|
"line": 26,
|
|
54
54
|
"value": {
|
|
55
|
-
"$.minichain.
|
|
55
|
+
"$.minichain.registry.RegistryManifest": {
|
|
56
56
|
"mod_name": "ommlds.minichain.backends.google.chat",
|
|
57
57
|
"attr_name": "GoogleChatService",
|
|
58
58
|
"name": "google",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"module": ".minichain.backends.llamacpp.chat",
|
|
66
66
|
"attr": null,
|
|
67
67
|
"file": "ommlds/minichain/backends/llamacpp/chat.py",
|
|
68
|
-
"line":
|
|
68
|
+
"line": 32,
|
|
69
69
|
"value": {
|
|
70
|
-
"$.minichain.
|
|
70
|
+
"$.minichain.registry.RegistryManifest": {
|
|
71
71
|
"mod_name": "ommlds.minichain.backends.llamacpp.chat",
|
|
72
72
|
"attr_name": "LlamacppChatService",
|
|
73
73
|
"name": "llamacpp",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"file": "ommlds/minichain/backends/llamacpp/completion.py",
|
|
83
83
|
"line": 25,
|
|
84
84
|
"value": {
|
|
85
|
-
"$.minichain.
|
|
85
|
+
"$.minichain.registry.RegistryManifest": {
|
|
86
86
|
"mod_name": "ommlds.minichain.backends.llamacpp.completion",
|
|
87
87
|
"attr_name": "LlamacppCompletionService",
|
|
88
88
|
"name": "llamacpp",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"file": "ommlds/minichain/backends/llamacpp/streaming.py",
|
|
98
98
|
"line": 26,
|
|
99
99
|
"value": {
|
|
100
|
-
"$.minichain.
|
|
100
|
+
"$.minichain.registry.RegistryManifest": {
|
|
101
101
|
"mod_name": "ommlds.minichain.backends.llamacpp.streaming",
|
|
102
102
|
"attr_name": "LlamacppChatStreamService",
|
|
103
103
|
"name": "llamacpp",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"file": "ommlds/minichain/backends/mistral.py",
|
|
113
113
|
"line": 24,
|
|
114
114
|
"value": {
|
|
115
|
-
"$.minichain.
|
|
115
|
+
"$.minichain.registry.RegistryManifest": {
|
|
116
116
|
"mod_name": "ommlds.minichain.backends.mistral",
|
|
117
117
|
"attr_name": "MistralChatService",
|
|
118
118
|
"name": "mistral",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"file": "ommlds/minichain/backends/mlx/chat.py",
|
|
128
128
|
"line": 28,
|
|
129
129
|
"value": {
|
|
130
|
-
"$.minichain.
|
|
130
|
+
"$.minichain.registry.RegistryManifest": {
|
|
131
131
|
"mod_name": "ommlds.minichain.backends.mlx.chat",
|
|
132
132
|
"attr_name": "MlxChatService",
|
|
133
133
|
"name": "mlx",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"file": "ommlds/minichain/backends/openai/chat.py",
|
|
143
143
|
"line": 34,
|
|
144
144
|
"value": {
|
|
145
|
-
"$.minichain.
|
|
145
|
+
"$.minichain.registry.RegistryManifest": {
|
|
146
146
|
"mod_name": "ommlds.minichain.backends.openai.chat",
|
|
147
147
|
"attr_name": "OpenaiChatService",
|
|
148
148
|
"name": "openai",
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
"file": "ommlds/minichain/backends/openai/completion.py",
|
|
158
158
|
"line": 18,
|
|
159
159
|
"value": {
|
|
160
|
-
"$.minichain.
|
|
160
|
+
"$.minichain.registry.RegistryManifest": {
|
|
161
161
|
"mod_name": "ommlds.minichain.backends.openai.completion",
|
|
162
162
|
"attr_name": "OpenaiCompletionService",
|
|
163
163
|
"name": "openai",
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"file": "ommlds/minichain/backends/openai/embedding.py",
|
|
173
173
|
"line": 17,
|
|
174
174
|
"value": {
|
|
175
|
-
"$.minichain.
|
|
175
|
+
"$.minichain.registry.RegistryManifest": {
|
|
176
176
|
"mod_name": "ommlds.minichain.backends.openai.embedding",
|
|
177
177
|
"attr_name": "OpenaiEmbeddingService",
|
|
178
178
|
"name": "openai",
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
"file": "ommlds/minichain/backends/openai/streaming.py",
|
|
188
188
|
"line": 27,
|
|
189
189
|
"value": {
|
|
190
|
-
"$.minichain.
|
|
190
|
+
"$.minichain.registry.RegistryManifest": {
|
|
191
191
|
"mod_name": "ommlds.minichain.backends.openai.streaming",
|
|
192
192
|
"attr_name": "OpenaiChatStreamService",
|
|
193
193
|
"name": "openai",
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
"file": "ommlds/minichain/backends/tinygrad/chat.py",
|
|
203
203
|
"line": 19,
|
|
204
204
|
"value": {
|
|
205
|
-
"$.minichain.
|
|
205
|
+
"$.minichain.registry.RegistryManifest": {
|
|
206
206
|
"mod_name": "ommlds.minichain.backends.tinygrad.chat",
|
|
207
207
|
"attr_name": "TinygradLlama3ChatService",
|
|
208
208
|
"name": "tinygrad_llama3",
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
"file": "ommlds/minichain/backends/transformers/sentence.py",
|
|
218
218
|
"line": 18,
|
|
219
219
|
"value": {
|
|
220
|
-
"$.minichain.
|
|
220
|
+
"$.minichain.registry.RegistryManifest": {
|
|
221
221
|
"mod_name": "ommlds.minichain.backends.transformers.sentence",
|
|
222
222
|
"attr_name": "SentenceTransformersEmbeddingService",
|
|
223
223
|
"name": "sentence_transformers",
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
"file": "ommlds/minichain/backends/transformers/transformers.py",
|
|
235
235
|
"line": 41,
|
|
236
236
|
"value": {
|
|
237
|
-
"$.minichain.
|
|
237
|
+
"$.minichain.registry.RegistryManifest": {
|
|
238
238
|
"mod_name": "ommlds.minichain.backends.transformers.transformers",
|
|
239
239
|
"attr_name": "TransformersCompletionService",
|
|
240
240
|
"name": "transformers",
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
"file": "ommlds/minichain/backends/transformers/transformers.py",
|
|
252
252
|
"line": 124,
|
|
253
253
|
"value": {
|
|
254
|
-
"$.minichain.
|
|
254
|
+
"$.minichain.registry.RegistryManifest": {
|
|
255
255
|
"mod_name": "ommlds.minichain.backends.transformers.transformers",
|
|
256
256
|
"attr_name": "TransformersChatService",
|
|
257
257
|
"name": "transformers",
|
|
@@ -266,9 +266,9 @@
|
|
|
266
266
|
"module": ".minichain.chat.services",
|
|
267
267
|
"attr": null,
|
|
268
268
|
"file": "ommlds/minichain/chat/services.py",
|
|
269
|
-
"line":
|
|
269
|
+
"line": 36,
|
|
270
270
|
"value": {
|
|
271
|
-
"$.minichain.
|
|
271
|
+
"$.minichain.registry.RegistryTypeManifest": {
|
|
272
272
|
"mod_name": "ommlds.minichain.chat.services",
|
|
273
273
|
"attr_name": "ChatService"
|
|
274
274
|
}
|
|
@@ -278,9 +278,9 @@
|
|
|
278
278
|
"module": ".minichain.chat.streaming",
|
|
279
279
|
"attr": null,
|
|
280
280
|
"file": "ommlds/minichain/chat/streaming.py",
|
|
281
|
-
"line":
|
|
281
|
+
"line": 21,
|
|
282
282
|
"value": {
|
|
283
|
-
"$.minichain.
|
|
283
|
+
"$.minichain.registry.RegistryTypeManifest": {
|
|
284
284
|
"mod_name": "ommlds.minichain.chat.streaming",
|
|
285
285
|
"attr_name": "ChatStreamService"
|
|
286
286
|
}
|
|
@@ -290,9 +290,9 @@
|
|
|
290
290
|
"module": ".minichain.completion",
|
|
291
291
|
"attr": null,
|
|
292
292
|
"file": "ommlds/minichain/completion.py",
|
|
293
|
-
"line":
|
|
293
|
+
"line": 44,
|
|
294
294
|
"value": {
|
|
295
|
-
"$.minichain.
|
|
295
|
+
"$.minichain.registry.RegistryTypeManifest": {
|
|
296
296
|
"mod_name": "ommlds.minichain.completion",
|
|
297
297
|
"attr_name": "CompletionService"
|
|
298
298
|
}
|
|
@@ -302,9 +302,9 @@
|
|
|
302
302
|
"module": ".minichain.search",
|
|
303
303
|
"attr": null,
|
|
304
304
|
"file": "ommlds/minichain/search.py",
|
|
305
|
-
"line":
|
|
305
|
+
"line": 55,
|
|
306
306
|
"value": {
|
|
307
|
-
"$.minichain.
|
|
307
|
+
"$.minichain.registry.RegistryTypeManifest": {
|
|
308
308
|
"mod_name": "ommlds.minichain.search",
|
|
309
309
|
"attr_name": "SearchService"
|
|
310
310
|
}
|
|
@@ -314,9 +314,9 @@
|
|
|
314
314
|
"module": ".minichain.vectors.embeddings",
|
|
315
315
|
"attr": null,
|
|
316
316
|
"file": "ommlds/minichain/vectors/embeddings.py",
|
|
317
|
-
"line":
|
|
317
|
+
"line": 38,
|
|
318
318
|
"value": {
|
|
319
|
-
"$.minichain.
|
|
319
|
+
"$.minichain.registry.RegistryTypeManifest": {
|
|
320
320
|
"mod_name": "ommlds.minichain.vectors.embeddings",
|
|
321
321
|
"attr_name": "EmbeddingService"
|
|
322
322
|
}
|
|
@@ -326,9 +326,9 @@
|
|
|
326
326
|
"module": ".minichain.vectors.index",
|
|
327
327
|
"attr": null,
|
|
328
328
|
"file": "ommlds/minichain/vectors/index.py",
|
|
329
|
-
"line":
|
|
329
|
+
"line": 47,
|
|
330
330
|
"value": {
|
|
331
|
-
"$.minichain.
|
|
331
|
+
"$.minichain.registry.RegistryTypeManifest": {
|
|
332
332
|
"mod_name": "ommlds.minichain.vectors.index",
|
|
333
333
|
"attr_name": "VectorIndexService"
|
|
334
334
|
}
|
|
@@ -338,9 +338,9 @@
|
|
|
338
338
|
"module": ".minichain.vectors.search",
|
|
339
339
|
"attr": null,
|
|
340
340
|
"file": "ommlds/minichain/vectors/search.py",
|
|
341
|
-
"line":
|
|
341
|
+
"line": 67,
|
|
342
342
|
"value": {
|
|
343
|
-
"$.minichain.
|
|
343
|
+
"$.minichain.registry.RegistryTypeManifest": {
|
|
344
344
|
"mod_name": "ommlds.minichain.vectors.search",
|
|
345
345
|
"attr_name": "VectorSearchService"
|
|
346
346
|
}
|
|
@@ -118,11 +118,11 @@ class PromptChatSession(Session['PromptChatSession.Config']):
|
|
|
118
118
|
]
|
|
119
119
|
|
|
120
120
|
if self._config.stream:
|
|
121
|
-
with lang.maybe_managing(mc.
|
|
122
|
-
with st_mdl.invoke(mc.
|
|
121
|
+
with lang.maybe_managing(mc.registry_of[mc.ChatStreamService].new('openai')) as st_mdl:
|
|
122
|
+
with st_mdl.invoke(mc.ChatRequest(
|
|
123
123
|
chat,
|
|
124
|
-
|
|
125
|
-
)) as st_resp:
|
|
124
|
+
(self._chat_options or []),
|
|
125
|
+
)).v as st_resp:
|
|
126
126
|
resp_s = ''
|
|
127
127
|
for o in st_resp:
|
|
128
128
|
o_s = check.isinstance(o[0].m.s, str)
|
|
@@ -137,12 +137,12 @@ class PromptChatSession(Session['PromptChatSession.Config']):
|
|
|
137
137
|
with lang.maybe_managing(CHAT_MODEL_BACKENDS[self._config.backend or DEFAULT_CHAT_MODEL_BACKEND]()(
|
|
138
138
|
*([mc.ModelName(mn)] if (mn := self._config.model_name) is not None else []),
|
|
139
139
|
)) as mdl:
|
|
140
|
-
response = mdl.invoke(mc.ChatRequest
|
|
140
|
+
response = mdl.invoke(mc.ChatRequest(
|
|
141
141
|
chat,
|
|
142
|
-
|
|
142
|
+
(self._chat_options or []),
|
|
143
143
|
))
|
|
144
144
|
|
|
145
|
-
resp_m = response.
|
|
145
|
+
resp_m = response.v[0].m
|
|
146
146
|
chat.append(resp_m)
|
|
147
147
|
|
|
148
148
|
if (trs := resp_m.tool_exec_requests):
|
|
@@ -164,12 +164,12 @@ class PromptChatSession(Session['PromptChatSession.Config']):
|
|
|
164
164
|
tool_res = tool.fn(**tr.args)
|
|
165
165
|
chat.append(mc.ToolExecResultMessage(tr.id, tr.spec.name, json.dumps(tool_res)))
|
|
166
166
|
|
|
167
|
-
response = mdl.invoke(mc.ChatRequest
|
|
167
|
+
response = mdl.invoke(mc.ChatRequest(
|
|
168
168
|
chat,
|
|
169
|
-
|
|
169
|
+
(self._chat_options or []),
|
|
170
170
|
))
|
|
171
171
|
|
|
172
|
-
resp_m = response.
|
|
172
|
+
resp_m = response.v[0].m
|
|
173
173
|
chat.append(resp_m)
|
|
174
174
|
|
|
175
175
|
resp_s = check.isinstance(resp_m.s, str).strip()
|
|
@@ -237,14 +237,14 @@ class InteractiveChatSession(Session['InteractiveChatSession.Config']):
|
|
|
237
237
|
*([mc.ModelName(mn)] if (mn := self._config.model_name) is not None else []),
|
|
238
238
|
)
|
|
239
239
|
|
|
240
|
-
response = mdl.invoke(mc.ChatRequest
|
|
241
|
-
print(check.isinstance(response.
|
|
240
|
+
response = mdl.invoke(mc.ChatRequest(state.chat))
|
|
241
|
+
print(check.isinstance(response.v[0].m.s, str).strip())
|
|
242
242
|
|
|
243
243
|
state = dc.replace(
|
|
244
244
|
state,
|
|
245
245
|
chat=[
|
|
246
246
|
*state.chat,
|
|
247
|
-
response.
|
|
247
|
+
response.v[0].m,
|
|
248
248
|
],
|
|
249
249
|
updated_at=lang.utcnow(),
|
|
250
250
|
)
|
|
@@ -50,5 +50,5 @@ class CompletionSession(Session['CompletionSession.Config']):
|
|
|
50
50
|
with lang.maybe_managing(
|
|
51
51
|
COMPLETION_MODEL_BACKENDS[self._config.backend or DEFAULT_COMPLETION_MODEL_BACKEND]()(),
|
|
52
52
|
) as mdl:
|
|
53
|
-
response = mdl.invoke(mc.CompletionRequest
|
|
54
|
-
print(response.
|
|
53
|
+
response = mdl.invoke(mc.CompletionRequest(prompt))
|
|
54
|
+
print(response.v.strip())
|
|
@@ -45,5 +45,5 @@ class EmbeddingSession(Session['EmbeddingSession.Config']):
|
|
|
45
45
|
with lang.maybe_managing(
|
|
46
46
|
EMBEDDING_MODEL_BACKENDS[self._config.backend or DEFAULT_EMBEDDING_MODEL_BACKEND]()(),
|
|
47
47
|
) as mdl:
|
|
48
|
-
response = mdl.invoke(mc.EmbeddingRequest
|
|
49
|
-
print(json.dumps_compact(response.
|
|
48
|
+
response = mdl.invoke(mc.EmbeddingRequest(self._config.content))
|
|
49
|
+
print(json.dumps_compact(response.v))
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# fmt: off
|
|
2
2
|
|
|
3
|
-
from .
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
from .registry import ( # noqa
|
|
4
|
+
register_type,
|
|
5
|
+
registry_new,
|
|
6
|
+
registry_of,
|
|
6
7
|
)
|
|
7
8
|
|
|
8
9
|
from .chat.formats import ( # noqa
|
|
@@ -37,15 +38,12 @@ from .chat.services import ( # noqa
|
|
|
37
38
|
ChatRequest,
|
|
38
39
|
ChatResponse,
|
|
39
40
|
ChatService,
|
|
40
|
-
ChatService_,
|
|
41
41
|
)
|
|
42
42
|
|
|
43
43
|
from .chat.streaming import ( # noqa
|
|
44
|
-
ChatStreamRequest,
|
|
45
44
|
ChatStreamResponse,
|
|
46
45
|
|
|
47
46
|
ChatStreamService,
|
|
48
|
-
ChatStreamService_,
|
|
49
47
|
)
|
|
50
48
|
|
|
51
49
|
from .chat.templating import ( # noqa
|
|
@@ -133,7 +131,6 @@ from .services import ( # noqa
|
|
|
133
131
|
Response,
|
|
134
132
|
ResponseOutput,
|
|
135
133
|
Service,
|
|
136
|
-
Service_,
|
|
137
134
|
)
|
|
138
135
|
|
|
139
136
|
from .standard import ( # noqa
|
|
@@ -146,10 +143,6 @@ from .standard import ( # noqa
|
|
|
146
143
|
DefaultRequestOptions,
|
|
147
144
|
)
|
|
148
145
|
|
|
149
|
-
from .streaming import ( # noqa
|
|
150
|
-
StreamResponse,
|
|
151
|
-
)
|
|
152
|
-
|
|
153
146
|
from .tools.jsonschema import ( # noqa
|
|
154
147
|
build_tool_spec_json_schema,
|
|
155
148
|
)
|
|
@@ -27,7 +27,7 @@ from ...chat.services import ChatService
|
|
|
27
27
|
##
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
# @omlish-manifest ommlds.minichain.
|
|
30
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='anthropic', type='ChatService')
|
|
31
31
|
class AnthropicChatService(ChatService):
|
|
32
32
|
model: ta.ClassVar[str] = (
|
|
33
33
|
'claude-3-5-sonnet-20241022'
|
|
@@ -46,6 +46,7 @@ class AnthropicChatService(ChatService):
|
|
|
46
46
|
api_key: Secret | str | None = None,
|
|
47
47
|
) -> None:
|
|
48
48
|
super().__init__()
|
|
49
|
+
|
|
49
50
|
self._api_key = Secret.of(api_key if api_key is not None else os.environ['ANTHROPIC_API_KEY'])
|
|
50
51
|
|
|
51
52
|
def _get_msg_content(self, m: Message) -> str | None:
|
|
@@ -66,7 +67,7 @@ class AnthropicChatService(ChatService):
|
|
|
66
67
|
) -> ChatResponse:
|
|
67
68
|
messages = []
|
|
68
69
|
system: str | None = None
|
|
69
|
-
for i, m in enumerate(request.
|
|
70
|
+
for i, m in enumerate(request.v):
|
|
70
71
|
if isinstance(m, SystemMessage):
|
|
71
72
|
if i != 0 or system is not None:
|
|
72
73
|
raise Exception('Only supports one system message and must be first')
|
|
@@ -18,18 +18,15 @@ else:
|
|
|
18
18
|
##
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
# @omlish-manifest ommlds.minichain.
|
|
21
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(
|
|
22
22
|
# name='duckduckgo',
|
|
23
23
|
# aliases=['ddg'],
|
|
24
24
|
# type='SearchService',
|
|
25
25
|
# )
|
|
26
26
|
class DuckduckgoSearchService(SearchService):
|
|
27
|
-
def invoke(
|
|
28
|
-
self,
|
|
29
|
-
request: SearchRequest,
|
|
30
|
-
) -> SearchResponse:
|
|
27
|
+
def invoke(self, request: SearchRequest) -> SearchResponse:
|
|
31
28
|
ddgs = duckduckgo_search.DDGS()
|
|
32
|
-
res = ddgs.text(request.
|
|
29
|
+
res = ddgs.text(request.v)
|
|
33
30
|
return SearchResponse(SearchHits(
|
|
34
31
|
l=[
|
|
35
32
|
SearchHit(
|
|
@@ -23,7 +23,7 @@ from ...standard import ModelName
|
|
|
23
23
|
##
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
# @omlish-manifest ommlds.minichain.
|
|
26
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='google', type='ChatService')
|
|
27
27
|
class GoogleChatService(ChatService):
|
|
28
28
|
DEFAULT_MODEL_NAME: ta.ClassVar[str] = (
|
|
29
29
|
'gemini-2.0-flash'
|
|
@@ -70,7 +70,7 @@ class GoogleChatService(ChatService):
|
|
|
70
70
|
},
|
|
71
71
|
],
|
|
72
72
|
}
|
|
73
|
-
for m in request.
|
|
73
|
+
for m in request.v
|
|
74
74
|
],
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -94,7 +94,7 @@ class CseSearchService(SearchService):
|
|
|
94
94
|
qs = urllib.parse.urlencode(dict(
|
|
95
95
|
key=check.non_empty_str(self._cse_api_key),
|
|
96
96
|
cx=check.non_empty_str(self._cse_id),
|
|
97
|
-
q=request.
|
|
97
|
+
q=request.v,
|
|
98
98
|
))
|
|
99
99
|
resp = http.request(
|
|
100
100
|
f'https://www.googleapis.com/customsearch/v1?{qs}',
|
|
@@ -12,13 +12,12 @@ from ....backends import llamacpp as lcu
|
|
|
12
12
|
from ...chat.choices import AiChoice
|
|
13
13
|
from ...chat.messages import AiMessage
|
|
14
14
|
from ...chat.services import ChatRequest
|
|
15
|
+
from ...chat.services import ChatRequestOptions
|
|
15
16
|
from ...chat.services import ChatResponse
|
|
16
17
|
from ...chat.services import ChatService
|
|
17
18
|
from ...chat.tools import Tool
|
|
18
|
-
from ...completion import CompletionRequestOption
|
|
19
19
|
from ...configs import Config
|
|
20
20
|
from ...configs import consume_configs
|
|
21
|
-
from ...llms.services import LlmRequestOption
|
|
22
21
|
from ...llms.services import MaxTokens
|
|
23
22
|
from ...llms.services import Temperature
|
|
24
23
|
from ...standard import ModelPath
|
|
@@ -30,7 +29,7 @@ from .format import get_msg_content
|
|
|
30
29
|
##
|
|
31
30
|
|
|
32
31
|
|
|
33
|
-
# @omlish-manifest ommlds.minichain.
|
|
32
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='llamacpp', type='ChatService')
|
|
34
33
|
class LlamacppChatService(ChatService):
|
|
35
34
|
DEFAULT_MODEL_PATH: ta.ClassVar[str] = os.path.join(
|
|
36
35
|
os.path.expanduser('~/.cache/huggingface/hub'),
|
|
@@ -45,7 +44,7 @@ class LlamacppChatService(ChatService):
|
|
|
45
44
|
with consume_configs(*configs) as cc:
|
|
46
45
|
self._model_path = cc.pop(ModelPath(self.DEFAULT_MODEL_PATH))
|
|
47
46
|
|
|
48
|
-
_OPTION_KWARG_NAMES_MAP: ta.ClassVar[ta.Mapping[str, type[
|
|
47
|
+
_OPTION_KWARG_NAMES_MAP: ta.ClassVar[ta.Mapping[str, type[ChatRequestOptions]]] = dict(
|
|
49
48
|
max_tokens=MaxTokens,
|
|
50
49
|
temperatur=Temperature,
|
|
51
50
|
)
|
|
@@ -100,7 +99,7 @@ class LlamacppChatService(ChatService):
|
|
|
100
99
|
role=ROLES_MAP[type(m)],
|
|
101
100
|
content=get_msg_content(m),
|
|
102
101
|
)
|
|
103
|
-
for m in request.
|
|
102
|
+
for m in request.v
|
|
104
103
|
],
|
|
105
104
|
**kwargs,
|
|
106
105
|
)
|
{ommlds-0.0.0.dev330 → ommlds-0.0.0.dev331}/ommlds/minichain/backends/llamacpp/completion.py
RENAMED
|
@@ -22,7 +22,7 @@ from ...standard import ModelPath
|
|
|
22
22
|
##
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
# @omlish-manifest ommlds.minichain.
|
|
25
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='llamacpp', type='CompletionService')
|
|
26
26
|
class LlamacppCompletionService(CompletionService):
|
|
27
27
|
# hf.hf_hub_download(
|
|
28
28
|
# revision='1ca85c857dce892b673b988ad0aa83f2cb1bbd19',
|
|
@@ -67,7 +67,7 @@ class LlamacppCompletionService(CompletionService):
|
|
|
67
67
|
)))
|
|
68
68
|
|
|
69
69
|
output = llm.create_completion(
|
|
70
|
-
request.
|
|
70
|
+
request.v,
|
|
71
71
|
**kwargs,
|
|
72
72
|
)
|
|
73
73
|
|
|
@@ -11,9 +11,9 @@ from ....backends import llamacpp as lcu
|
|
|
11
11
|
from ...chat.choices import AiChoice
|
|
12
12
|
from ...chat.choices import AiChoices
|
|
13
13
|
from ...chat.messages import AiMessage
|
|
14
|
-
from ...chat.
|
|
14
|
+
from ...chat.services import ChatRequest
|
|
15
15
|
from ...chat.streaming import ChatStreamResponse
|
|
16
|
-
from ...chat.streaming import
|
|
16
|
+
from ...chat.streaming import ChatStreamService
|
|
17
17
|
from ...resources import Resources
|
|
18
18
|
from .chat import LlamacppChatService
|
|
19
19
|
from .format import ROLES_MAP
|
|
@@ -23,8 +23,8 @@ from .format import get_msg_content
|
|
|
23
23
|
##
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
# @omlish-manifest ommlds.minichain.
|
|
27
|
-
class LlamacppChatStreamService(
|
|
26
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='llamacpp', type='ChatStreamService')
|
|
27
|
+
class LlamacppChatStreamService(ChatStreamService, lang.ExitStacked):
|
|
28
28
|
def __init__(self) -> None:
|
|
29
29
|
super().__init__()
|
|
30
30
|
|
|
@@ -37,11 +37,10 @@ class LlamacppChatStreamService(ChatStreamService_, lang.ExitStacked):
|
|
|
37
37
|
verbose=False,
|
|
38
38
|
)))
|
|
39
39
|
|
|
40
|
-
def invoke(self, request:
|
|
40
|
+
def invoke(self, request: ChatRequest) -> ChatStreamResponse:
|
|
41
41
|
lcu.install_logging_hook()
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
try:
|
|
43
|
+
with Resources.new() as rs:
|
|
45
44
|
rs.enter_context(self._lock)
|
|
46
45
|
|
|
47
46
|
output = self._load_model().create_chat_completion(
|
|
@@ -50,14 +49,14 @@ class LlamacppChatStreamService(ChatStreamService_, lang.ExitStacked):
|
|
|
50
49
|
role=ROLES_MAP[type(m)],
|
|
51
50
|
content=get_msg_content(m), # noqa
|
|
52
51
|
)
|
|
53
|
-
for m in request.
|
|
52
|
+
for m in request.v
|
|
54
53
|
],
|
|
55
54
|
max_tokens=1024,
|
|
56
55
|
stream=True,
|
|
57
56
|
)
|
|
58
57
|
|
|
59
58
|
def close_output():
|
|
60
|
-
output.close()
|
|
59
|
+
output.close() # noqa
|
|
61
60
|
|
|
62
61
|
rs.enter_context(lang.defer(close_output))
|
|
63
62
|
|
|
@@ -74,11 +73,4 @@ class LlamacppChatStreamService(ChatStreamService_, lang.ExitStacked):
|
|
|
74
73
|
l.append(AiChoice(AiMessage(content))) # type: ignore
|
|
75
74
|
yield l
|
|
76
75
|
|
|
77
|
-
return ChatStreamResponse(
|
|
78
|
-
_iterator=iter(lang.flatmap(handle_chunk, output)),
|
|
79
|
-
_resources=rs,
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
except Exception:
|
|
83
|
-
rs.close()
|
|
84
|
-
raise
|
|
76
|
+
return ChatStreamResponse(rs.new_managed(iter(lang.flatmap(handle_chunk, output))))
|
|
@@ -21,7 +21,7 @@ from ..chat.services import ChatService
|
|
|
21
21
|
##
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
# @omlish-manifest ommlds.minichain.
|
|
24
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='mistral', type='ChatService')
|
|
25
25
|
class MistralChatService(ChatService):
|
|
26
26
|
model: ta.ClassVar[str] = 'mistral-large-latest'
|
|
27
27
|
|
|
@@ -59,7 +59,7 @@ class MistralChatService(ChatService):
|
|
|
59
59
|
'role': self.ROLES_MAP[type(m)],
|
|
60
60
|
'content': self._get_msg_content(m),
|
|
61
61
|
}
|
|
62
|
-
for m in request.
|
|
62
|
+
for m in request.v
|
|
63
63
|
],
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -25,7 +25,7 @@ from ...standard import ModelName
|
|
|
25
25
|
##
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
# @omlish-manifest ommlds.minichain.
|
|
28
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='mlx', type='ChatService')
|
|
29
29
|
class MlxChatService(ChatService, lang.ExitStacked):
|
|
30
30
|
DEFAULT_MODEL_NAME: ta.ClassVar[str] = (
|
|
31
31
|
# 'mlx-community/DeepSeek-Coder-V2-Lite-Instruct-8bit'
|
|
@@ -94,7 +94,7 @@ class MlxChatService(ChatService, lang.ExitStacked):
|
|
|
94
94
|
role=self.ROLES_MAP[type(m)],
|
|
95
95
|
content=self._get_msg_content(m),
|
|
96
96
|
)
|
|
97
|
-
for m in request.
|
|
97
|
+
for m in request.v
|
|
98
98
|
],
|
|
99
99
|
tokenize=False,
|
|
100
100
|
add_generation_prompt=True,
|
|
@@ -31,15 +31,8 @@ from .format import OpenaiChatRequestHandler
|
|
|
31
31
|
##
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
# @omlish-manifest ommlds.minichain.
|
|
35
|
-
class OpenaiChatService(
|
|
36
|
-
ChatService[
|
|
37
|
-
ChatRequest,
|
|
38
|
-
ChatResponse,
|
|
39
|
-
],
|
|
40
|
-
request=ChatRequest,
|
|
41
|
-
response=ChatResponse,
|
|
42
|
-
):
|
|
34
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='openai', type='ChatService')
|
|
35
|
+
class OpenaiChatService(ChatService):
|
|
43
36
|
DEFAULT_MODEL_NAME: ta.ClassVar[str] = (
|
|
44
37
|
'gpt-4o'
|
|
45
38
|
# 'gpt-4o-mini'
|
|
@@ -54,10 +47,10 @@ class OpenaiChatService(
|
|
|
54
47
|
self._default_options: tv.TypedValues = DefaultRequestOptions.pop(cc)
|
|
55
48
|
|
|
56
49
|
def invoke(self, request: ChatRequest) -> ChatResponse:
|
|
57
|
-
check.isinstance(request, ChatRequest)
|
|
50
|
+
# check.isinstance(request, ChatRequest)
|
|
58
51
|
|
|
59
52
|
rh = OpenaiChatRequestHandler(
|
|
60
|
-
request.
|
|
53
|
+
request.v,
|
|
61
54
|
*tv.TypedValues(
|
|
62
55
|
*self._default_options,
|
|
63
56
|
*request.options,
|