ommlds 0.0.0.dev334__tar.gz → 0.0.0.dev336__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.dev334/ommlds.egg-info → ommlds-0.0.0.dev336}/PKG-INFO +5 -5
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/.manifests.json +46 -34
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/__about__.py +1 -1
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/sessions/chat.py +13 -13
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/__init__.py +35 -16
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/anthropic/chat.py +9 -9
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/google/chat.py +9 -9
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/llamacpp/chat.py +10 -10
- ommlds-0.0.0.dev334/ommlds/minichain/backends/llamacpp/streaming.py → ommlds-0.0.0.dev336/ommlds/minichain/backends/llamacpp/stream.py +14 -14
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/mistral.py +9 -9
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/mlx/chat.py +10 -11
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/openai/chat.py +6 -6
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/openai/format.py +7 -8
- ommlds-0.0.0.dev334/ommlds/minichain/backends/openai/streaming.py → ommlds-0.0.0.dev336/ommlds/minichain/backends/openai/stream.py +16 -15
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/tinygrad/chat.py +8 -8
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/transformers/transformers.py +7 -7
- ommlds-0.0.0.dev336/ommlds/minichain/chat/choices/services.py +59 -0
- ommlds-0.0.0.dev334/ommlds/minichain/chat/choices.py → ommlds-0.0.0.dev336/ommlds/minichain/chat/choices/types.py +1 -1
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/chat/formats.py +1 -1
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/chat/history.py +1 -1
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/chat/services.py +24 -4
- ommlds-0.0.0.dev336/ommlds/minichain/chat/stream/services.py +63 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/chat/tools.py +1 -1
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/server/server.py +6 -6
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/tools/git.py +5 -5
- ommlds-0.0.0.dev336/ommlds/wiki/text/__init__.py +0 -0
- ommlds-0.0.0.dev336/ommlds/wiki/utils/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336/ommlds.egg-info}/PKG-INFO +5 -5
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds.egg-info/SOURCES.txt +8 -6
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds.egg-info/requires.txt +4 -4
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/pyproject.toml +5 -5
- ommlds-0.0.0.dev334/ommlds/minichain/chat/streaming.py +0 -30
- ommlds-0.0.0.dev334/ommlds/minichain/chat/types.py +0 -15
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/LICENSE +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/MANIFEST.in +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/README.md +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/llamacpp/buildwheel.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/llamacpp/logging.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/__main__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/caching.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/cli.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/generation.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/limits.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/loading.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/LICENSE +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/detokenization/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/detokenization/base.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/detokenization/bpe.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/detokenization/naive.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/detokenization/spm.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/loading.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/tokenization.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/mlx/tokenization/types.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/chatcompletion/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/chatcompletion/chunk.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/chatcompletion/contentpart.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/chatcompletion/message.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/chatcompletion/request.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/chatcompletion/response.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/chatcompletion/responseformat.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/chatcompletion/tokenlogprob.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/openai/protocol/completionusage.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/LICENSE +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/__main__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/attention.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/cli.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/fetch.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/llm.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/loading.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/quantization.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/sampling.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/tokenization.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/llama3/transformer.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/sdxl/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/sdxl/__main__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/sdxl/cli.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/sdxl/clip.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/sdxl/sdxl.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/models/sdxl/unet.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/tinygrad/tinygrad.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/torch/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/torch/backends.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/torch/devices.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/backends/torch/purge.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/__main__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/inject.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/main.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/sessions/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/sessions/base.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/sessions/completion.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/sessions/embedding.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/sessions/inject.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/state.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/tools/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/tools/inject.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/cli/tools/tools.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/datasets/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/datasets/library/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/datasets/library/movies.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/hacks/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/hacks/patches.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/huggingface.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/_abc.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/_typedvalues.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/anthropic/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/duckduckgo.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/google/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/google/search.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/huggingface.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/llamacpp/completion.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/llamacpp/format.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/mlx/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/openai/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/openai/completion.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/openai/embedding.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/sentencepiece/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/sentencepiece/tokens.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/sqlite.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/tinygrad/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/tokenizers/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/tokenizers/tokens.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/transformers/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/transformers/sentence.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/backends/transformers/tokens.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/chat/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/chat/_marshal.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/minichain/content → ommlds-0.0.0.dev336/ommlds/minichain/chat/choices}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/chat/messages.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/chat/metadata.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/minichain/llms → ommlds-0.0.0.dev336/ommlds/minichain/chat/stream}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/chat/templating.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/completion.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/configs.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/minichain/text → ommlds-0.0.0.dev336/ommlds/minichain/content}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/content/_marshal.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/content/content.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/content/images.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/content/list.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/content/metadata.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/content/rendering.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/content/simple.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/content/text.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/content/transforms.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/docs/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/docs/docs.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/docs/dtypes.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/docs/filters.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/envs.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/json.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/minichain/text/toolparsing → ommlds-0.0.0.dev336/ommlds/minichain/llms}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/llms/_marshal.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/llms/services.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/llms/tokens.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/metadata.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/registry.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/resources.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/search.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/services/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/services/_marshal.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/services/_origclasses.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/services/_typedvalues.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/services/facades.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/services/requests.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/services/responses.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/services/services.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/standard.py +0 -0
- /ommlds-0.0.0.dev334/ommlds/minichain/streaming.py → /ommlds-0.0.0.dev336/ommlds/minichain/stream.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/minichain/tools → ommlds-0.0.0.dev336/ommlds/minichain/text}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/text/applypatch.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/minichain/vectors → ommlds-0.0.0.dev336/ommlds/minichain/text/toolparsing}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/text/toolparsing/base.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/text/toolparsing/dumb.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/text/toolparsing/llamacpp/LICENSE +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/text/toolparsing/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/text/toolparsing/llamacpp/hermes2.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/text/toolparsing/llamacpp/llama31.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/text/toolparsing/llamacpp/types.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/text/toolparsing/llamacpp/utils.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/tokens/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/tokens/specials.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/tokens/tokenizers.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/tokens/types.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/tokens/vocabs.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/server → ommlds-0.0.0.dev336/ommlds/minichain/tools}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/tools/_marshal.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/tools/jsonschema.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/tools/reflection.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/tools/types.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/tools → ommlds-0.0.0.dev336/ommlds/minichain/vectors}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/vectors/embeddings.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/vectors/index.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/vectors/search.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/vectors/similarity.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/vectors/stores.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/minichain/vectors/types.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/wiki → ommlds-0.0.0.dev336/ommlds/server}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/server/__main__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/server/cli.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/server/client.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/server/service.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/wiki/text → ommlds-0.0.0.dev336/ommlds/tools}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/tools/ocr.py +0 -0
- {ommlds-0.0.0.dev334/ommlds/wiki/utils → ommlds-0.0.0.dev336/ommlds/wiki}/__init__.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/wiki/analyze.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/wiki/convert.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/wiki/models.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/wiki/text/mfh.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/wiki/text/wtp.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/wiki/utils/io.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/wiki/utils/progress.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/wiki/utils/xml.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds/wiki/xml.py +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds.egg-info/dependency_links.txt +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds.egg-info/entry_points.txt +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/ommlds.egg-info/top_level.txt +0 -0
- {ommlds-0.0.0.dev334 → ommlds-0.0.0.dev336}/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.dev336
|
|
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.dev336
|
|
16
|
+
Requires-Dist: omlish==0.0.0.dev336
|
|
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"
|
|
@@ -25,7 +25,7 @@ Requires-Dist: tokenizers~=0.21; extra == "all"
|
|
|
25
25
|
Requires-Dist: torch~=2.7; extra == "all"
|
|
26
26
|
Requires-Dist: transformers~=4.52; extra == "all"
|
|
27
27
|
Requires-Dist: sentence-transformers~=4.1; extra == "all"
|
|
28
|
-
Requires-Dist: huggingface-hub~=0.
|
|
28
|
+
Requires-Dist: huggingface-hub~=0.33; extra == "all"
|
|
29
29
|
Requires-Dist: datasets~=3.6; extra == "all"
|
|
30
30
|
Requires-Dist: numpy>=1.26; extra == "all"
|
|
31
31
|
Requires-Dist: pytesseract~=0.3; extra == "all"
|
|
@@ -47,7 +47,7 @@ Requires-Dist: torch~=2.7; extra == "backends"
|
|
|
47
47
|
Requires-Dist: transformers~=4.52; extra == "backends"
|
|
48
48
|
Requires-Dist: sentence-transformers~=4.1; extra == "backends"
|
|
49
49
|
Provides-Extra: huggingface
|
|
50
|
-
Requires-Dist: huggingface-hub~=0.
|
|
50
|
+
Requires-Dist: huggingface-hub~=0.33; extra == "huggingface"
|
|
51
51
|
Requires-Dist: datasets~=3.6; extra == "huggingface"
|
|
52
52
|
Provides-Extra: numpy
|
|
53
53
|
Requires-Dist: numpy>=1.26; extra == "numpy"
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"value": {
|
|
23
23
|
"$.minichain.registry.RegistryManifest": {
|
|
24
24
|
"mod_name": "ommlds.minichain.backends.anthropic.chat",
|
|
25
|
-
"attr_name": "
|
|
25
|
+
"attr_name": "AnthropicChatChoicesService",
|
|
26
26
|
"name": "anthropic",
|
|
27
27
|
"aliases": null,
|
|
28
|
-
"type": "
|
|
28
|
+
"type": "ChatChoicesService"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
},
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"value": {
|
|
55
55
|
"$.minichain.registry.RegistryManifest": {
|
|
56
56
|
"mod_name": "ommlds.minichain.backends.google.chat",
|
|
57
|
-
"attr_name": "
|
|
57
|
+
"attr_name": "GoogleChatChoicesService",
|
|
58
58
|
"name": "google",
|
|
59
59
|
"aliases": null,
|
|
60
|
-
"type": "
|
|
60
|
+
"type": "ChatChoicesService"
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
},
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"value": {
|
|
70
70
|
"$.minichain.registry.RegistryManifest": {
|
|
71
71
|
"mod_name": "ommlds.minichain.backends.llamacpp.chat",
|
|
72
|
-
"attr_name": "
|
|
72
|
+
"attr_name": "LlamacppChatChoicesService",
|
|
73
73
|
"name": "llamacpp",
|
|
74
74
|
"aliases": null,
|
|
75
|
-
"type": "
|
|
75
|
+
"type": "ChatChoicesService"
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
},
|
|
@@ -92,17 +92,17 @@
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
"module": ".minichain.backends.llamacpp.
|
|
95
|
+
"module": ".minichain.backends.llamacpp.stream",
|
|
96
96
|
"attr": null,
|
|
97
|
-
"file": "ommlds/minichain/backends/llamacpp/
|
|
97
|
+
"file": "ommlds/minichain/backends/llamacpp/stream.py",
|
|
98
98
|
"line": 28,
|
|
99
99
|
"value": {
|
|
100
100
|
"$.minichain.registry.RegistryManifest": {
|
|
101
|
-
"mod_name": "ommlds.minichain.backends.llamacpp.
|
|
102
|
-
"attr_name": "
|
|
101
|
+
"mod_name": "ommlds.minichain.backends.llamacpp.stream",
|
|
102
|
+
"attr_name": "LlamacppChatChoicesStreamService",
|
|
103
103
|
"name": "llamacpp",
|
|
104
104
|
"aliases": null,
|
|
105
|
-
"type": "
|
|
105
|
+
"type": "ChatChoicesStreamService"
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
},
|
|
@@ -114,10 +114,10 @@
|
|
|
114
114
|
"value": {
|
|
115
115
|
"$.minichain.registry.RegistryManifest": {
|
|
116
116
|
"mod_name": "ommlds.minichain.backends.mistral",
|
|
117
|
-
"attr_name": "
|
|
117
|
+
"attr_name": "MistralChatChoicesService",
|
|
118
118
|
"name": "mistral",
|
|
119
119
|
"aliases": null,
|
|
120
|
-
"type": "
|
|
120
|
+
"type": "ChatChoicesService"
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
},
|
|
@@ -125,14 +125,14 @@
|
|
|
125
125
|
"module": ".minichain.backends.mlx.chat",
|
|
126
126
|
"attr": null,
|
|
127
127
|
"file": "ommlds/minichain/backends/mlx/chat.py",
|
|
128
|
-
"line":
|
|
128
|
+
"line": 27,
|
|
129
129
|
"value": {
|
|
130
130
|
"$.minichain.registry.RegistryManifest": {
|
|
131
131
|
"mod_name": "ommlds.minichain.backends.mlx.chat",
|
|
132
|
-
"attr_name": "
|
|
132
|
+
"attr_name": "MlxChatChoicesService",
|
|
133
133
|
"name": "mlx",
|
|
134
134
|
"aliases": null,
|
|
135
|
-
"type": "
|
|
135
|
+
"type": "ChatChoicesService"
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
},
|
|
@@ -144,10 +144,10 @@
|
|
|
144
144
|
"value": {
|
|
145
145
|
"$.minichain.registry.RegistryManifest": {
|
|
146
146
|
"mod_name": "ommlds.minichain.backends.openai.chat",
|
|
147
|
-
"attr_name": "
|
|
147
|
+
"attr_name": "OpenaiChatChoicesService",
|
|
148
148
|
"name": "openai",
|
|
149
149
|
"aliases": null,
|
|
150
|
-
"type": "
|
|
150
|
+
"type": "ChatChoicesService"
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
},
|
|
@@ -182,17 +182,17 @@
|
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
|
-
"module": ".minichain.backends.openai.
|
|
185
|
+
"module": ".minichain.backends.openai.stream",
|
|
186
186
|
"attr": null,
|
|
187
|
-
"file": "ommlds/minichain/backends/openai/
|
|
188
|
-
"line":
|
|
187
|
+
"file": "ommlds/minichain/backends/openai/stream.py",
|
|
188
|
+
"line": 29,
|
|
189
189
|
"value": {
|
|
190
190
|
"$.minichain.registry.RegistryManifest": {
|
|
191
|
-
"mod_name": "ommlds.minichain.backends.openai.
|
|
192
|
-
"attr_name": "
|
|
191
|
+
"mod_name": "ommlds.minichain.backends.openai.stream",
|
|
192
|
+
"attr_name": "OpenaiChatChoicesStreamService",
|
|
193
193
|
"name": "openai",
|
|
194
194
|
"aliases": null,
|
|
195
|
-
"type": "
|
|
195
|
+
"type": "ChatChoicesStreamService"
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
},
|
|
@@ -204,10 +204,10 @@
|
|
|
204
204
|
"value": {
|
|
205
205
|
"$.minichain.registry.RegistryManifest": {
|
|
206
206
|
"mod_name": "ommlds.minichain.backends.tinygrad.chat",
|
|
207
|
-
"attr_name": "
|
|
207
|
+
"attr_name": "TinygradLlama3ChatChoicesService",
|
|
208
208
|
"name": "tinygrad_llama3",
|
|
209
209
|
"aliases": null,
|
|
210
|
-
"type": "
|
|
210
|
+
"type": "ChatChoicesService"
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
},
|
|
@@ -253,12 +253,24 @@
|
|
|
253
253
|
"value": {
|
|
254
254
|
"$.minichain.registry.RegistryManifest": {
|
|
255
255
|
"mod_name": "ommlds.minichain.backends.transformers.transformers",
|
|
256
|
-
"attr_name": "
|
|
256
|
+
"attr_name": "TransformersChatChoicesService",
|
|
257
257
|
"name": "transformers",
|
|
258
258
|
"aliases": [
|
|
259
259
|
"tfm"
|
|
260
260
|
],
|
|
261
|
-
"type": "
|
|
261
|
+
"type": "ChatChoicesService"
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"module": ".minichain.chat.choices.services",
|
|
267
|
+
"attr": null,
|
|
268
|
+
"file": "ommlds/minichain/chat/choices/services.py",
|
|
269
|
+
"line": 47,
|
|
270
|
+
"value": {
|
|
271
|
+
"$.minichain.registry.RegistryTypeManifest": {
|
|
272
|
+
"mod_name": "ommlds.minichain.chat.choices.services",
|
|
273
|
+
"attr_name": "ChatChoicesService"
|
|
262
274
|
}
|
|
263
275
|
}
|
|
264
276
|
},
|
|
@@ -266,7 +278,7 @@
|
|
|
266
278
|
"module": ".minichain.chat.services",
|
|
267
279
|
"attr": null,
|
|
268
280
|
"file": "ommlds/minichain/chat/services.py",
|
|
269
|
-
"line":
|
|
281
|
+
"line": 47,
|
|
270
282
|
"value": {
|
|
271
283
|
"$.minichain.registry.RegistryTypeManifest": {
|
|
272
284
|
"mod_name": "ommlds.minichain.chat.services",
|
|
@@ -275,14 +287,14 @@
|
|
|
275
287
|
}
|
|
276
288
|
},
|
|
277
289
|
{
|
|
278
|
-
"module": ".minichain.chat.
|
|
290
|
+
"module": ".minichain.chat.stream.services",
|
|
279
291
|
"attr": null,
|
|
280
|
-
"file": "ommlds/minichain/chat/
|
|
281
|
-
"line":
|
|
292
|
+
"file": "ommlds/minichain/chat/stream/services.py",
|
|
293
|
+
"line": 51,
|
|
282
294
|
"value": {
|
|
283
295
|
"$.minichain.registry.RegistryTypeManifest": {
|
|
284
|
-
"mod_name": "ommlds.minichain.chat.
|
|
285
|
-
"attr_name": "
|
|
296
|
+
"mod_name": "ommlds.minichain.chat.stream.services",
|
|
297
|
+
"attr_name": "ChatChoicesStreamService"
|
|
286
298
|
}
|
|
287
299
|
}
|
|
288
300
|
},
|
|
@@ -41,13 +41,13 @@ class ChatState:
|
|
|
41
41
|
|
|
42
42
|
DEFAULT_CHAT_MODEL_BACKEND = 'openai'
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
CHAT_CHOICES_SERVICE_FACTORIES: ta.Mapping[str, ta.Callable[..., mc.ChatChoicesService]] = {}
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
##
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
ChatOption: ta.TypeAlias = mc.
|
|
50
|
+
ChatOption: ta.TypeAlias = mc.ChatChoicesRequestOptions
|
|
51
51
|
ChatOptions = ta.NewType('ChatOptions', ta.Sequence[ChatOption])
|
|
52
52
|
|
|
53
53
|
|
|
@@ -102,8 +102,8 @@ class PromptChatSession(Session['PromptChatSession.Config']):
|
|
|
102
102
|
backend = DEFAULT_CHAT_MODEL_BACKEND
|
|
103
103
|
|
|
104
104
|
if self._config.stream:
|
|
105
|
-
with lang.maybe_managing(mc.registry_of[mc.
|
|
106
|
-
with st_mdl.invoke(mc.
|
|
105
|
+
with lang.maybe_managing(mc.registry_of[mc.ChatChoicesStreamService].new(backend)) as st_mdl:
|
|
106
|
+
with st_mdl.invoke(mc.ChatChoicesStreamRequest(
|
|
107
107
|
chat,
|
|
108
108
|
(self._chat_options or []),
|
|
109
109
|
)).v as st_resp:
|
|
@@ -121,16 +121,16 @@ class PromptChatSession(Session['PromptChatSession.Config']):
|
|
|
121
121
|
chat.append(resp_m)
|
|
122
122
|
|
|
123
123
|
else:
|
|
124
|
-
csf: ta.Callable[..., mc.
|
|
125
|
-
if (bf :=
|
|
124
|
+
csf: ta.Callable[..., mc.ChatChoicesService]
|
|
125
|
+
if (bf := CHAT_CHOICES_SERVICE_FACTORIES.get(backend)) is not None:
|
|
126
126
|
csf = bf
|
|
127
127
|
else:
|
|
128
|
-
csf = functools.partial(mc.registry_of[mc.
|
|
128
|
+
csf = functools.partial(mc.registry_of[mc.ChatChoicesService].new, backend)
|
|
129
129
|
|
|
130
130
|
with lang.maybe_managing(csf(
|
|
131
131
|
*([mc.ModelName(mn)] if (mn := self._config.model_name) is not None else []),
|
|
132
132
|
)) as mdl:
|
|
133
|
-
response = mdl.invoke(mc.
|
|
133
|
+
response = mdl.invoke(mc.ChatChoicesRequest(
|
|
134
134
|
chat,
|
|
135
135
|
(self._chat_options or []),
|
|
136
136
|
))
|
|
@@ -157,7 +157,7 @@ class PromptChatSession(Session['PromptChatSession.Config']):
|
|
|
157
157
|
tool_res = tool.fn(**tr.args)
|
|
158
158
|
chat.append(mc.ToolExecResultMessage(tr.id, tr.spec.name, json.dumps(tool_res)))
|
|
159
159
|
|
|
160
|
-
response = mdl.invoke(mc.
|
|
160
|
+
response = mdl.invoke(mc.ChatChoicesRequest(
|
|
161
161
|
chat,
|
|
162
162
|
(self._chat_options or []),
|
|
163
163
|
))
|
|
@@ -219,11 +219,11 @@ class InteractiveChatSession(Session['InteractiveChatSession.Config']):
|
|
|
219
219
|
if backend is None:
|
|
220
220
|
backend = DEFAULT_CHAT_MODEL_BACKEND
|
|
221
221
|
|
|
222
|
-
csf: ta.Callable[..., mc.
|
|
223
|
-
if (bf :=
|
|
222
|
+
csf: ta.Callable[..., mc.ChatChoicesService]
|
|
223
|
+
if (bf := CHAT_CHOICES_SERVICE_FACTORIES.get(backend)) is not None:
|
|
224
224
|
csf = bf
|
|
225
225
|
else:
|
|
226
|
-
csf = functools.partial(mc.registry_of[mc.
|
|
226
|
+
csf = functools.partial(mc.registry_of[mc.ChatChoicesService].new, backend)
|
|
227
227
|
|
|
228
228
|
with lang.maybe_managing(csf(
|
|
229
229
|
*([mc.ModelName(mn)] if (mn := self._config.model_name) is not None else []),
|
|
@@ -239,7 +239,7 @@ class InteractiveChatSession(Session['InteractiveChatSession.Config']):
|
|
|
239
239
|
],
|
|
240
240
|
)
|
|
241
241
|
|
|
242
|
-
response = mdl.invoke(mc.
|
|
242
|
+
response = mdl.invoke(mc.ChatChoicesRequest(state.chat))
|
|
243
243
|
print(check.isinstance(response.v[0].m.s, str).strip())
|
|
244
244
|
|
|
245
245
|
state = dc.replace(
|
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
##
|
|
4
4
|
|
|
5
|
+
from .chat.choices.services import ( # noqa
|
|
6
|
+
ChatChoicesRequestOption,
|
|
7
|
+
ChatChoicesRequestOptions,
|
|
8
|
+
ChatChoicesRequest,
|
|
9
|
+
|
|
10
|
+
ChatChoicesResponseOutput,
|
|
11
|
+
ChatChoicesResponseOutputs,
|
|
12
|
+
ChatChoicesResponse,
|
|
13
|
+
|
|
14
|
+
ChatChoicesService,
|
|
15
|
+
|
|
16
|
+
AbstractChatChoicesService,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
from .chat.choices.types import ( # noqa
|
|
20
|
+
AiChoice,
|
|
21
|
+
AiChoices,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
from .chat.stream.services import ( # noqa
|
|
25
|
+
ChatChoicesStreamRequestOption,
|
|
26
|
+
ChatChoicesStreamRequestOptions,
|
|
27
|
+
ChatChoicesStreamRequest,
|
|
28
|
+
|
|
29
|
+
ChatChoicesStreamResponseOutput,
|
|
30
|
+
ChatChoicesStreamResponseOutputs,
|
|
31
|
+
ChatChoicesStreamResponse,
|
|
32
|
+
|
|
33
|
+
ChatChoicesStreamService,
|
|
34
|
+
|
|
35
|
+
AbstractChatChoicesStreamService,
|
|
36
|
+
)
|
|
37
|
+
|
|
5
38
|
from .chat.formats import ( # noqa
|
|
6
39
|
JSON_RESPONSE_FORMAT,
|
|
7
40
|
JsonResponseFormat,
|
|
@@ -25,11 +58,6 @@ from .chat.messages import ( # noqa
|
|
|
25
58
|
UserMessage,
|
|
26
59
|
)
|
|
27
60
|
|
|
28
|
-
from .chat.choices import ( # noqa
|
|
29
|
-
AiChoice,
|
|
30
|
-
AiChoices,
|
|
31
|
-
)
|
|
32
|
-
|
|
33
61
|
from .chat.services import ( # noqa
|
|
34
62
|
ChatRequestOption,
|
|
35
63
|
ChatRequestOptions,
|
|
@@ -40,12 +68,8 @@ from .chat.services import ( # noqa
|
|
|
40
68
|
ChatResponse,
|
|
41
69
|
|
|
42
70
|
ChatService,
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
from .chat.streaming import ( # noqa
|
|
46
|
-
ChatStreamResponse,
|
|
47
71
|
|
|
48
|
-
|
|
72
|
+
AbstractChatService,
|
|
49
73
|
)
|
|
50
74
|
|
|
51
75
|
from .chat.templating import ( # noqa
|
|
@@ -62,11 +86,6 @@ from .chat.tools import ( # noqa
|
|
|
62
86
|
Tool,
|
|
63
87
|
)
|
|
64
88
|
|
|
65
|
-
from .chat.types import ( # noqa
|
|
66
|
-
ChatRequestOption,
|
|
67
|
-
ChatResponseOutput,
|
|
68
|
-
)
|
|
69
|
-
|
|
70
89
|
##
|
|
71
90
|
|
|
72
91
|
from .content.content import ( # noqa
|
|
@@ -274,7 +293,7 @@ from .standard import ( # noqa
|
|
|
274
293
|
DefaultRequestOptions,
|
|
275
294
|
)
|
|
276
295
|
|
|
277
|
-
from .
|
|
296
|
+
from .stream import ( # noqa
|
|
278
297
|
ResponseGenerator,
|
|
279
298
|
|
|
280
299
|
StreamResponse,
|
|
@@ -14,21 +14,21 @@ from omlish.formats import json
|
|
|
14
14
|
from omlish.http import all as http
|
|
15
15
|
from omlish.secrets.secrets import Secret
|
|
16
16
|
|
|
17
|
-
from ...chat.choices import
|
|
17
|
+
from ...chat.choices.services import ChatChoicesRequest
|
|
18
|
+
from ...chat.choices.services import ChatChoicesResponse
|
|
19
|
+
from ...chat.choices.services import ChatChoicesService
|
|
20
|
+
from ...chat.choices.types import AiChoice
|
|
18
21
|
from ...chat.messages import AiMessage
|
|
19
22
|
from ...chat.messages import Message
|
|
20
23
|
from ...chat.messages import SystemMessage
|
|
21
24
|
from ...chat.messages import UserMessage
|
|
22
|
-
from ...chat.services import ChatRequest
|
|
23
|
-
from ...chat.services import ChatResponse
|
|
24
|
-
from ...chat.services import ChatService
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
##
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='anthropic', type='
|
|
31
|
-
class
|
|
30
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='anthropic', type='ChatChoicesService')
|
|
31
|
+
class AnthropicChatChoicesService(ChatChoicesService):
|
|
32
32
|
model: ta.ClassVar[str] = (
|
|
33
33
|
'claude-3-5-sonnet-20241022'
|
|
34
34
|
# 'claude-3-opus-20240229'
|
|
@@ -61,10 +61,10 @@ class AnthropicChatService(ChatService):
|
|
|
61
61
|
|
|
62
62
|
def invoke(
|
|
63
63
|
self,
|
|
64
|
-
request:
|
|
64
|
+
request: ChatChoicesRequest,
|
|
65
65
|
*,
|
|
66
66
|
max_tokens: int = 4096, # FIXME: ChatRequestOption
|
|
67
|
-
) ->
|
|
67
|
+
) -> ChatChoicesResponse:
|
|
68
68
|
messages = []
|
|
69
69
|
system: str | None = None
|
|
70
70
|
for i, m in enumerate(request.v):
|
|
@@ -97,6 +97,6 @@ class AnthropicChatService(ChatService):
|
|
|
97
97
|
|
|
98
98
|
response = json.loads(check.not_none(raw_response.data).decode('utf-8'))
|
|
99
99
|
|
|
100
|
-
return
|
|
100
|
+
return ChatChoicesResponse([
|
|
101
101
|
AiChoice(AiMessage(response['content'][0]['text'])), # noqa
|
|
102
102
|
])
|
|
@@ -7,14 +7,14 @@ from omlish import check
|
|
|
7
7
|
from omlish.formats import json
|
|
8
8
|
from omlish.http import all as http
|
|
9
9
|
|
|
10
|
-
from ...chat.choices import
|
|
10
|
+
from ...chat.choices.services import ChatChoicesRequest
|
|
11
|
+
from ...chat.choices.services import ChatChoicesResponse
|
|
12
|
+
from ...chat.choices.services import ChatChoicesService
|
|
13
|
+
from ...chat.choices.types import AiChoice
|
|
11
14
|
from ...chat.messages import AiMessage
|
|
12
15
|
from ...chat.messages import Message
|
|
13
16
|
from ...chat.messages import SystemMessage
|
|
14
17
|
from ...chat.messages import UserMessage
|
|
15
|
-
from ...chat.services import ChatRequest
|
|
16
|
-
from ...chat.services import ChatResponse
|
|
17
|
-
from ...chat.services import ChatService
|
|
18
18
|
from ...configs import consume_configs
|
|
19
19
|
from ...standard import ApiKey
|
|
20
20
|
from ...standard import ModelName
|
|
@@ -23,8 +23,8 @@ from ...standard import ModelName
|
|
|
23
23
|
##
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='google', type='
|
|
27
|
-
class
|
|
26
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='google', type='ChatChoicesService')
|
|
27
|
+
class GoogleChatChoicesService(ChatChoicesService):
|
|
28
28
|
DEFAULT_MODEL_NAME: ta.ClassVar[str] = (
|
|
29
29
|
'gemini-2.0-flash'
|
|
30
30
|
)
|
|
@@ -56,8 +56,8 @@ class GoogleChatService(ChatService):
|
|
|
56
56
|
|
|
57
57
|
def invoke(
|
|
58
58
|
self,
|
|
59
|
-
request:
|
|
60
|
-
) ->
|
|
59
|
+
request: ChatChoicesRequest,
|
|
60
|
+
) -> ChatChoicesResponse:
|
|
61
61
|
key = check.not_none(self._api_key).reveal()
|
|
62
62
|
|
|
63
63
|
req_dct = {
|
|
@@ -83,7 +83,7 @@ class GoogleChatService(ChatService):
|
|
|
83
83
|
|
|
84
84
|
resp_dct = json.loads(check.not_none(resp.data).decode('utf-8'))
|
|
85
85
|
|
|
86
|
-
return
|
|
86
|
+
return ChatChoicesResponse([
|
|
87
87
|
AiChoice(AiMessage(c['content']['parts'][0]['text']))
|
|
88
88
|
for c in resp_dct['candidates']
|
|
89
89
|
])
|
|
@@ -9,12 +9,12 @@ from omlish import lang
|
|
|
9
9
|
from omlish import typedvalues as tv
|
|
10
10
|
|
|
11
11
|
from ....backends import llamacpp as lcu
|
|
12
|
-
from ...chat.choices import
|
|
12
|
+
from ...chat.choices.services import ChatChoicesRequest
|
|
13
|
+
from ...chat.choices.services import ChatChoicesRequestOptions
|
|
14
|
+
from ...chat.choices.services import ChatChoicesResponse
|
|
15
|
+
from ...chat.choices.services import ChatChoicesService
|
|
16
|
+
from ...chat.choices.types import AiChoice
|
|
13
17
|
from ...chat.messages import AiMessage
|
|
14
|
-
from ...chat.services import ChatRequest
|
|
15
|
-
from ...chat.services import ChatRequestOptions
|
|
16
|
-
from ...chat.services import ChatResponse
|
|
17
|
-
from ...chat.services import ChatService
|
|
18
18
|
from ...chat.tools import Tool
|
|
19
19
|
from ...configs import Config
|
|
20
20
|
from ...configs import consume_configs
|
|
@@ -29,8 +29,8 @@ from .format import get_msg_content
|
|
|
29
29
|
##
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='llamacpp', type='
|
|
33
|
-
class
|
|
32
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='llamacpp', type='ChatChoicesService')
|
|
33
|
+
class LlamacppChatChoicesService(ChatChoicesService):
|
|
34
34
|
DEFAULT_MODEL_PATH: ta.ClassVar[str] = os.path.join(
|
|
35
35
|
os.path.expanduser('~/.cache/huggingface/hub'),
|
|
36
36
|
# 'models--meta-llama--Llama-3.2-3B-Instruct/snapshots/0cb88a4f764b7a12671c53f0838cd831a0843b95/llama-2-7b-chat.Q5_0.gguf', # noqa
|
|
@@ -44,12 +44,12 @@ class LlamacppChatService(ChatService):
|
|
|
44
44
|
with consume_configs(*configs) as cc:
|
|
45
45
|
self._model_path = cc.pop(ModelPath(self.DEFAULT_MODEL_PATH))
|
|
46
46
|
|
|
47
|
-
_OPTION_KWARG_NAMES_MAP: ta.ClassVar[ta.Mapping[str, type[
|
|
47
|
+
_OPTION_KWARG_NAMES_MAP: ta.ClassVar[ta.Mapping[str, type[ChatChoicesRequestOptions]]] = dict(
|
|
48
48
|
max_tokens=MaxTokens,
|
|
49
49
|
temperatur=Temperature,
|
|
50
50
|
)
|
|
51
51
|
|
|
52
|
-
def invoke(self, request:
|
|
52
|
+
def invoke(self, request: ChatChoicesRequest) -> ChatChoicesResponse:
|
|
53
53
|
kwargs: dict = dict(
|
|
54
54
|
# temperature=0,
|
|
55
55
|
max_tokens=1024,
|
|
@@ -104,7 +104,7 @@ class LlamacppChatService(ChatService):
|
|
|
104
104
|
**kwargs,
|
|
105
105
|
)
|
|
106
106
|
|
|
107
|
-
return
|
|
107
|
+
return ChatChoicesResponse([
|
|
108
108
|
AiChoice(AiMessage(c['message']['content'])) # noqa
|
|
109
109
|
for c in output['choices'] # type: ignore
|
|
110
110
|
])
|
|
@@ -8,16 +8,16 @@ from omlish import check
|
|
|
8
8
|
from omlish import lang
|
|
9
9
|
|
|
10
10
|
from ....backends import llamacpp as lcu
|
|
11
|
-
from ...chat.choices import
|
|
12
|
-
from ...chat.choices import
|
|
11
|
+
from ...chat.choices.services import ChatChoicesResponseOutputs
|
|
12
|
+
from ...chat.choices.types import AiChoice
|
|
13
|
+
from ...chat.choices.types import AiChoices
|
|
13
14
|
from ...chat.messages import AiMessage
|
|
14
|
-
from ...chat.services import
|
|
15
|
-
from ...chat.services import
|
|
16
|
-
from ...chat.
|
|
17
|
-
from ...chat.streaming import ChatStreamService
|
|
15
|
+
from ...chat.stream.services import ChatChoicesStreamRequest
|
|
16
|
+
from ...chat.stream.services import ChatChoicesStreamResponse
|
|
17
|
+
from ...chat.stream.services import ChatChoicesStreamService
|
|
18
18
|
from ...resources import Resources
|
|
19
|
-
from ...
|
|
20
|
-
from .chat import
|
|
19
|
+
from ...stream import ResponseGenerator
|
|
20
|
+
from .chat import LlamacppChatChoicesService
|
|
21
21
|
from .format import ROLES_MAP
|
|
22
22
|
from .format import get_msg_content
|
|
23
23
|
|
|
@@ -25,8 +25,8 @@ from .format import get_msg_content
|
|
|
25
25
|
##
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='llamacpp', type='
|
|
29
|
-
class
|
|
28
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='llamacpp', type='ChatChoicesStreamService')
|
|
29
|
+
class LlamacppChatChoicesStreamService(ChatChoicesStreamService, lang.ExitStacked):
|
|
30
30
|
def __init__(self) -> None:
|
|
31
31
|
super().__init__()
|
|
32
32
|
|
|
@@ -35,11 +35,11 @@ class LlamacppChatStreamService(ChatStreamService, lang.ExitStacked):
|
|
|
35
35
|
@lang.cached_function(transient=True)
|
|
36
36
|
def _load_model(self) -> 'lcc.Llama':
|
|
37
37
|
return self._enter_context(contextlib.closing(lcc.Llama(
|
|
38
|
-
model_path=
|
|
38
|
+
model_path=LlamacppChatChoicesService.DEFAULT_MODEL_PATH,
|
|
39
39
|
verbose=False,
|
|
40
40
|
)))
|
|
41
41
|
|
|
42
|
-
def invoke(self, request:
|
|
42
|
+
def invoke(self, request: ChatChoicesStreamRequest) -> ChatChoicesStreamResponse:
|
|
43
43
|
lcu.install_logging_hook()
|
|
44
44
|
|
|
45
45
|
with Resources.new() as rs:
|
|
@@ -62,7 +62,7 @@ class LlamacppChatStreamService(ChatStreamService, lang.ExitStacked):
|
|
|
62
62
|
|
|
63
63
|
rs.enter_context(lang.defer(close_output))
|
|
64
64
|
|
|
65
|
-
def yield_choices() -> ta.Generator[AiChoices, None, ta.Sequence[
|
|
65
|
+
def yield_choices() -> ta.Generator[AiChoices, None, ta.Sequence[ChatChoicesResponseOutputs] | None]:
|
|
66
66
|
for chunk in output:
|
|
67
67
|
check.state(chunk['object'] == 'chat.completion.chunk')
|
|
68
68
|
l: list[AiChoice] = []
|
|
@@ -77,4 +77,4 @@ class LlamacppChatStreamService(ChatStreamService, lang.ExitStacked):
|
|
|
77
77
|
yield l
|
|
78
78
|
return None
|
|
79
79
|
|
|
80
|
-
return
|
|
80
|
+
return ChatChoicesStreamResponse(rs.new_managed(ResponseGenerator(yield_choices())))
|
|
@@ -8,21 +8,21 @@ from omlish import check
|
|
|
8
8
|
from omlish.formats import json
|
|
9
9
|
from omlish.http import all as http
|
|
10
10
|
|
|
11
|
-
from ..chat.choices import
|
|
11
|
+
from ..chat.choices.services import ChatChoicesRequest
|
|
12
|
+
from ..chat.choices.services import ChatChoicesResponse
|
|
13
|
+
from ..chat.choices.services import ChatChoicesService
|
|
14
|
+
from ..chat.choices.types import AiChoice
|
|
12
15
|
from ..chat.messages import AiMessage
|
|
13
16
|
from ..chat.messages import Message
|
|
14
17
|
from ..chat.messages import SystemMessage
|
|
15
18
|
from ..chat.messages import UserMessage
|
|
16
|
-
from ..chat.services import ChatRequest
|
|
17
|
-
from ..chat.services import ChatResponse
|
|
18
|
-
from ..chat.services import ChatService
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
##
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='mistral', type='
|
|
25
|
-
class
|
|
24
|
+
# @omlish-manifest ommlds.minichain.registry.RegistryManifest(name='mistral', type='ChatChoicesService')
|
|
25
|
+
class MistralChatChoicesService(ChatChoicesService):
|
|
26
26
|
model: ta.ClassVar[str] = 'mistral-large-latest'
|
|
27
27
|
|
|
28
28
|
ROLES_MAP: ta.ClassVar[ta.Mapping[type[Message], str]] = {
|
|
@@ -47,8 +47,8 @@ class MistralChatService(ChatService):
|
|
|
47
47
|
|
|
48
48
|
def invoke(
|
|
49
49
|
self,
|
|
50
|
-
request:
|
|
51
|
-
) ->
|
|
50
|
+
request: ChatChoicesRequest,
|
|
51
|
+
) -> ChatChoicesResponse:
|
|
52
52
|
if not (key := self._api_key):
|
|
53
53
|
key = os.environ['MISTRAL_API_KEY']
|
|
54
54
|
|
|
@@ -76,7 +76,7 @@ class MistralChatService(ChatService):
|
|
|
76
76
|
|
|
77
77
|
resp_dct = json.loads(check.not_none(resp.data).decode('utf-8'))
|
|
78
78
|
|
|
79
|
-
return
|
|
79
|
+
return ChatChoicesResponse([
|
|
80
80
|
AiChoice(AiMessage(c['message']['content']))
|
|
81
81
|
for c in resp_dct['choices']
|
|
82
82
|
])
|