ommlds 0.0.0.dev373__tar.gz → 0.0.0.dev375__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.dev373/ommlds.egg-info → ommlds-0.0.0.dev375}/PKG-INFO +3 -3
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/chat.py +3 -3
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/__init__.py +1 -5
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/chat.py +1 -1
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/format.py +3 -3
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/transformers/transformers.py +1 -1
- ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/execution/context.py +65 -0
- ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/execution/executors.py +60 -0
- ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/execution/messages.py +25 -0
- ommlds-0.0.0.dev373/ommlds/minichain/chat/tools.py → ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/types.py +2 -2
- ommlds-0.0.0.dev375/ommlds/minichain/tools/fns.py +88 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tools/types.py +1 -1
- ommlds-0.0.0.dev375/ommlds/wiki/text/__init__.py +0 -0
- ommlds-0.0.0.dev375/ommlds/wiki/utils/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375/ommlds.egg-info}/PKG-INFO +3 -3
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/SOURCES.txt +7 -2
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/requires.txt +2 -2
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/pyproject.toml +3 -3
- ommlds-0.0.0.dev373/ommlds/minichain/content/rendering.py +0 -36
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/LICENSE +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/MANIFEST.in +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/README.md +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/.manifests.json +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/__about__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/marshal.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/assemble.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/events.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/marshal.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/types.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/llamacpp/buildwheel.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/llamacpp/logging.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/__main__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/caching.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/cli.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/generation.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/limits.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/loading.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/LICENSE +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/base.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/bpe.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/naive.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/spm.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/loading.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/tokenization.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/types.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/chunk.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/contentpart.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/message.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/request.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/response.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/responseformat.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/tokenlogprob.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/completionusage.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/LICENSE +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/__main__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/attention.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/cli.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/fetch.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/llm.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/loading.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/quantization.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/sampling.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/tokenization.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/transformer.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/__main__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/cli.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/clip.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/sdxl.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/unet.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/tinygrad.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/torch/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/torch/backends.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/torch/devices.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/torch/purge.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/__main__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/inject.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/main.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/base.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/completion.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/embedding.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/inject.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/state.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/tools/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/tools/inject.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/tools/tools.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/datasets/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/datasets/library/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/datasets/library/movies.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/hacks/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/hacks/patches.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/huggingface.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/_abc.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/_typedvalues.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/anthropic/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/anthropic/chat.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/duckduckgo.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/google/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/google/chat.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/google/search.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/huggingface.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/completion.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/format.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/stream.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/mistral.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/mlx/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/mlx/chat.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/chat.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/completion.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/embedding.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/stream.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/sentencepiece/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/sentencepiece/tokens.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/sqlite.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/tinygrad/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/tinygrad/chat.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/tokenizers/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/tokenizers/tokens.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/transformers/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/transformers/sentence.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/transformers/tokens.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/_marshal.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/choices/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/choices/adapters.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/choices/services.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/choices/types.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/formats.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/history.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/messages.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/metadata.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/services.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/stream/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/stream/adapters.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/stream/services.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/stream/types.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/templating.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/chat/transforms → ommlds-0.0.0.dev375/ommlds/minichain/chat/tools}/__init__.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/content → ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/execution}/__init__.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/content → ommlds-0.0.0.dev375/ommlds/minichain/chat}/transforms/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/transforms/base.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/transforms/uuids.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/types.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/completion.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/configs.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/lib → ommlds-0.0.0.dev375/ommlds/minichain/content}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/_marshal.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/images.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/materialize.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/metadata.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/namespaces.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/placeholders.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/prepare.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/sequence.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/simple.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/text.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/lib/fs → ommlds-0.0.0.dev375/ommlds/minichain/content/transforms}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/base.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/interleave.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/squeeze.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/stringify.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/strings.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/types.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/docs/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/docs/docs.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/docs/dtypes.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/docs/filters.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/envs.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/json.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/lib/fs/ls → ommlds-0.0.0.dev375/ommlds/minichain/lib}/__init__.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/llms → ommlds-0.0.0.dev375/ommlds/minichain/lib/fs}/__init__.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/stream → ommlds-0.0.0.dev375/ommlds/minichain/lib/fs/ls}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/lib/fs/ls/rendering.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/lib/fs/ls/running.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/text → ommlds-0.0.0.dev375/ommlds/minichain/llms}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/llms/_marshal.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/llms/tokens.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/llms/types.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/metadata.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/registry.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/resources.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/search.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/_marshal.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/_origclasses.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/_typedvalues.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/facades.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/requests.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/responses.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/services.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/standard.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/text/toolparsing → ommlds-0.0.0.dev375/ommlds/minichain/stream}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/stream/services.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/stream/wrap.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/tools → ommlds-0.0.0.dev375/ommlds/minichain/text}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/applypatch.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/minichain/vectors → ommlds-0.0.0.dev375/ommlds/minichain/text/toolparsing}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/base.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/dumb.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/LICENSE +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/hermes2.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/llama31.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/types.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/utils.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/specials.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/tokenizers.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/types.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/vocabs.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/server → ommlds-0.0.0.dev375/ommlds/minichain/tools}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tools/_marshal.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tools/jsonschema.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tools/reflect.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/types.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/tools → ommlds-0.0.0.dev375/ommlds/minichain/vectors}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/embeddings.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/index.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/search.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/similarity.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/stores.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/types.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/wiki → ommlds-0.0.0.dev375/ommlds/server}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/__main__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/cli.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/client.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/server.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/service.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/wiki/text → ommlds-0.0.0.dev375/ommlds/tools}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/tools/git.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/tools/ocr.py +0 -0
- {ommlds-0.0.0.dev373/ommlds/wiki/utils → ommlds-0.0.0.dev375/ommlds/wiki}/__init__.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/analyze.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/convert.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/models.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/text/mfh.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/text/wtp.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/utils/io.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/utils/progress.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/utils/xml.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/xml.py +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/dependency_links.txt +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/entry_points.txt +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/top_level.txt +0 -0
- {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/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.dev375
|
|
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.13
|
|
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.dev375
|
|
16
|
+
Requires-Dist: omlish==0.0.0.dev375
|
|
17
17
|
Provides-Extra: all
|
|
18
18
|
Requires-Dist: llama-cpp-python~=0.3; extra == "all"
|
|
19
19
|
Requires-Dist: mlx~=0.27; extra == "all"
|
|
@@ -142,11 +142,11 @@ class PromptChatSession(Session['PromptChatSession.Config']):
|
|
|
142
142
|
check.state(resp_m.s is None)
|
|
143
143
|
|
|
144
144
|
tr: mc.ToolExecRequest = check.single(check.not_none(trs))
|
|
145
|
-
tool = check.not_none(self._tool_map)[check.non_empty_str(tr.
|
|
145
|
+
tool = check.not_none(self._tool_map)[check.non_empty_str(tr.name)]
|
|
146
146
|
|
|
147
147
|
tr_dct = dict(
|
|
148
148
|
id=tr.id,
|
|
149
|
-
spec=msh.marshal(
|
|
149
|
+
spec=msh.marshal(tool.spec),
|
|
150
150
|
args=tr.args,
|
|
151
151
|
)
|
|
152
152
|
cr = ptk.strict_confirm(f'Execute requested tool?\n\n{json.dumps_pretty(tr_dct)}\n\n')
|
|
@@ -157,7 +157,7 @@ class PromptChatSession(Session['PromptChatSession.Config']):
|
|
|
157
157
|
tool_res = tool.fn(**tr.args)
|
|
158
158
|
chat.append(mc.ToolExecResultMessage(
|
|
159
159
|
tr.id,
|
|
160
|
-
check.non_empty_str(tr.
|
|
160
|
+
check.non_empty_str(tr.name),
|
|
161
161
|
json.dumps(tool_res),
|
|
162
162
|
))
|
|
163
163
|
|
|
@@ -106,7 +106,7 @@ from .chat.templating import ( # noqa
|
|
|
106
106
|
ChatTemplater,
|
|
107
107
|
)
|
|
108
108
|
|
|
109
|
-
from .chat.tools import ( # noqa
|
|
109
|
+
from .chat.tools.types import ( # noqa
|
|
110
110
|
Tool,
|
|
111
111
|
)
|
|
112
112
|
|
|
@@ -156,10 +156,6 @@ from .content.prepare import ( # noqa
|
|
|
156
156
|
prepare_content_str,
|
|
157
157
|
)
|
|
158
158
|
|
|
159
|
-
from .content.rendering import ( # noqa
|
|
160
|
-
StringRenderer,
|
|
161
|
-
)
|
|
162
|
-
|
|
163
159
|
from .content.sequence import ( # noqa
|
|
164
160
|
BlockContent,
|
|
165
161
|
InlineContent,
|
|
@@ -15,7 +15,7 @@ from ...chat.choices.services import static_check_is_chat_choices_service
|
|
|
15
15
|
from ...chat.choices.types import AiChoice
|
|
16
16
|
from ...chat.choices.types import ChatChoicesOptions
|
|
17
17
|
from ...chat.messages import AiMessage
|
|
18
|
-
from ...chat.tools import Tool
|
|
18
|
+
from ...chat.tools.types import Tool
|
|
19
19
|
from ...configs import Config
|
|
20
20
|
from ...llms.types import MaxTokens
|
|
21
21
|
from ...llms.types import Temperature
|
|
@@ -16,7 +16,7 @@ from ...chat.messages import SystemMessage
|
|
|
16
16
|
from ...chat.messages import ToolExecResultMessage
|
|
17
17
|
from ...chat.messages import UserMessage
|
|
18
18
|
from ...chat.stream.types import AiMessageDelta
|
|
19
|
-
from ...chat.tools import Tool
|
|
19
|
+
from ...chat.tools.types import Tool
|
|
20
20
|
from ...content.prepare import prepare_content_str
|
|
21
21
|
from ...llms.types import MaxTokens
|
|
22
22
|
from ...llms.types import Temperature
|
|
@@ -47,7 +47,7 @@ def build_request_message(m: Message) -> ta.Mapping[str, ta.Any]:
|
|
|
47
47
|
id=te.id,
|
|
48
48
|
function=dict(
|
|
49
49
|
arguments=check.not_none(te.raw_args),
|
|
50
|
-
name=te.
|
|
50
|
+
name=te.name,
|
|
51
51
|
),
|
|
52
52
|
type='function',
|
|
53
53
|
)
|
|
@@ -169,7 +169,7 @@ class OpenaiChatRequestHandler:
|
|
|
169
169
|
tool_exec_requests=[
|
|
170
170
|
ToolExecRequest(
|
|
171
171
|
id=tc['id'],
|
|
172
|
-
|
|
172
|
+
name=tc['function']['name'],
|
|
173
173
|
args=json.loads(tc['function']['arguments'] or '{}'),
|
|
174
174
|
raw_args=tc['function']['arguments'],
|
|
175
175
|
)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import contextlib
|
|
2
|
+
import contextvars
|
|
3
|
+
import typing as ta
|
|
4
|
+
|
|
5
|
+
from omlish import collections as col
|
|
6
|
+
from omlish import dataclasses as dc
|
|
7
|
+
from omlish import lang
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
T = ta.TypeVar('T')
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
##
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dc.dataclass(frozen=True)
|
|
17
|
+
class ToolContext(lang.Final):
|
|
18
|
+
dct: col.TypeMap = col.TypeMap()
|
|
19
|
+
|
|
20
|
+
@classmethod
|
|
21
|
+
def new(cls, *objs: ta.Any) -> 'ToolContext':
|
|
22
|
+
return cls(col.TypeMap(objs))
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
|
|
26
|
+
def __len__(self) -> int:
|
|
27
|
+
return len(self.dct)
|
|
28
|
+
|
|
29
|
+
def __iter__(self) -> ta.Iterator[ta.Any]:
|
|
30
|
+
return iter(self.dct)
|
|
31
|
+
|
|
32
|
+
def get(self, ty: type[T]) -> T | None:
|
|
33
|
+
return self.dct.get(ty)
|
|
34
|
+
|
|
35
|
+
def __getitem__(self, cls: type[T]) -> T:
|
|
36
|
+
return self.dct[cls]
|
|
37
|
+
|
|
38
|
+
def get_any(self, cls: type | tuple[type, ...]) -> ta.Sequence[T]:
|
|
39
|
+
return self.dct.get_any(cls)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
##
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
_TOOL_CONTEXT: contextvars.ContextVar[ToolContext] = contextvars.ContextVar(f'{__name__}._TOOL_CONTEXT')
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@contextlib.contextmanager
|
|
49
|
+
def bind_tool_context(ctx: ToolContext) -> ta.Generator[ToolContext]:
|
|
50
|
+
try:
|
|
51
|
+
cur = _TOOL_CONTEXT.get()
|
|
52
|
+
except LookupError:
|
|
53
|
+
pass
|
|
54
|
+
else:
|
|
55
|
+
raise RuntimeError(f'Already bound: {cur}')
|
|
56
|
+
|
|
57
|
+
tok = _TOOL_CONTEXT.set(ctx)
|
|
58
|
+
try:
|
|
59
|
+
yield ctx
|
|
60
|
+
finally:
|
|
61
|
+
_TOOL_CONTEXT.reset(tok)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def tool_context() -> ToolContext:
|
|
65
|
+
return _TOOL_CONTEXT.get()
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
import typing as ta
|
|
3
|
+
|
|
4
|
+
from omlish import dataclasses as dc
|
|
5
|
+
from omlish import lang
|
|
6
|
+
|
|
7
|
+
from ....tools.fns import ToolFn
|
|
8
|
+
from ....tools.fns import execute_tool_fn
|
|
9
|
+
from .context import ToolContext
|
|
10
|
+
from .context import bind_tool_context
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
##
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ToolExecutor(lang.Abstract):
|
|
17
|
+
@abc.abstractmethod
|
|
18
|
+
def execute_tool(
|
|
19
|
+
self,
|
|
20
|
+
ctx: ToolContext,
|
|
21
|
+
name: str,
|
|
22
|
+
args: ta.Mapping[str, ta.Any],
|
|
23
|
+
) -> str:
|
|
24
|
+
raise NotImplementedError
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
##
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dc.dataclass(frozen=True)
|
|
31
|
+
class ToolFnToolExecutor(ToolExecutor):
|
|
32
|
+
tool_fn: ToolFn
|
|
33
|
+
|
|
34
|
+
def execute_tool(
|
|
35
|
+
self,
|
|
36
|
+
ctx: ToolContext,
|
|
37
|
+
name: str,
|
|
38
|
+
args: ta.Mapping[str, ta.Any],
|
|
39
|
+
) -> str:
|
|
40
|
+
with bind_tool_context(ctx):
|
|
41
|
+
return execute_tool_fn(
|
|
42
|
+
self.tool_fn,
|
|
43
|
+
args,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
##
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@dc.dataclass(frozen=True)
|
|
51
|
+
class NameSwitchedToolExecutor(ToolExecutor):
|
|
52
|
+
tool_executors_by_name: ta.Mapping[str, ToolExecutor]
|
|
53
|
+
|
|
54
|
+
def execute_tool(
|
|
55
|
+
self,
|
|
56
|
+
ctx: ToolContext,
|
|
57
|
+
name: str,
|
|
58
|
+
args: ta.Mapping[str, ta.Any],
|
|
59
|
+
) -> str:
|
|
60
|
+
return self.tool_executors_by_name[name].execute_tool(ctx, name, args)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from ...messages import ToolExecRequest
|
|
2
|
+
from ...messages import ToolExecResultMessage
|
|
3
|
+
from .context import ToolContext
|
|
4
|
+
from .executors import ToolExecutor
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
##
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def execute_tool_request(
|
|
11
|
+
ctx: ToolContext,
|
|
12
|
+
tex: ToolExecutor,
|
|
13
|
+
ter: ToolExecRequest,
|
|
14
|
+
) -> ToolExecResultMessage:
|
|
15
|
+
result_str = tex.execute_tool(
|
|
16
|
+
ctx,
|
|
17
|
+
ter.name,
|
|
18
|
+
ter.args,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
return ToolExecResultMessage(
|
|
22
|
+
ter.id,
|
|
23
|
+
ter.name,
|
|
24
|
+
result_str,
|
|
25
|
+
)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""
|
|
2
|
+
TODO:
|
|
3
|
+
- should really return Content conventionally
|
|
4
|
+
"""
|
|
5
|
+
import typing as ta
|
|
6
|
+
|
|
7
|
+
from omlish import check
|
|
8
|
+
from omlish import dataclasses as dc
|
|
9
|
+
from omlish import lang
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
D = ta.TypeVar('D')
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
##
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dc.dataclass(frozen=True)
|
|
19
|
+
class ToolFn(lang.Final):
|
|
20
|
+
fn: ta.Callable
|
|
21
|
+
|
|
22
|
+
#
|
|
23
|
+
|
|
24
|
+
@dc.dataclass(frozen=True)
|
|
25
|
+
class Input(lang.Sealed, lang.Abstract):
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
@dc.dataclass(frozen=True)
|
|
29
|
+
class DataclassInput(Input, lang.Final, ta.Generic[D]):
|
|
30
|
+
cls: type[D]
|
|
31
|
+
|
|
32
|
+
def __post_init__(self) -> None:
|
|
33
|
+
check.isinstance(self.cls, type)
|
|
34
|
+
check.arg(dc.is_dataclass(self.cls))
|
|
35
|
+
|
|
36
|
+
@dc.dataclass(frozen=True)
|
|
37
|
+
class KwargsInput(Input, lang.Final):
|
|
38
|
+
pass
|
|
39
|
+
|
|
40
|
+
input: Input
|
|
41
|
+
|
|
42
|
+
#
|
|
43
|
+
|
|
44
|
+
@dc.dataclass(frozen=True)
|
|
45
|
+
class Output(lang.Sealed, lang.Abstract):
|
|
46
|
+
pass
|
|
47
|
+
|
|
48
|
+
@dc.dataclass(frozen=True)
|
|
49
|
+
class DataclassOutput(Output, lang.Final, ta.Generic[D]):
|
|
50
|
+
cls: type[D]
|
|
51
|
+
|
|
52
|
+
def __post_init__(self) -> None:
|
|
53
|
+
check.isinstance(self.cls, type)
|
|
54
|
+
check.arg(dc.is_dataclass(self.cls))
|
|
55
|
+
|
|
56
|
+
@dc.dataclass(frozen=True)
|
|
57
|
+
class RawStringOutput(Output, lang.Final):
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
output: Output
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
##
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def execute_tool_fn(
|
|
67
|
+
tfn: ToolFn,
|
|
68
|
+
args: ta.Mapping[str, ta.Any],
|
|
69
|
+
) -> str:
|
|
70
|
+
fn = tfn.fn
|
|
71
|
+
|
|
72
|
+
out: ta.Any
|
|
73
|
+
if isinstance(tfn.input, ToolFn.DataclassInput):
|
|
74
|
+
raise NotImplementedError
|
|
75
|
+
elif isinstance(tfn.input, ToolFn.KwargsInput):
|
|
76
|
+
out = fn(**args)
|
|
77
|
+
else:
|
|
78
|
+
raise NotImplementedError
|
|
79
|
+
|
|
80
|
+
ret: str
|
|
81
|
+
if isinstance(tfn.output, ToolFn.DataclassOutput):
|
|
82
|
+
raise NotImplementedError
|
|
83
|
+
elif isinstance(tfn.output, ToolFn.RawStringOutput):
|
|
84
|
+
ret = check.isinstance(out, str)
|
|
85
|
+
else:
|
|
86
|
+
raise NotImplementedError
|
|
87
|
+
|
|
88
|
+
return ret
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ommlds
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev375
|
|
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.13
|
|
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.dev375
|
|
16
|
+
Requires-Dist: omlish==0.0.0.dev375
|
|
17
17
|
Provides-Extra: all
|
|
18
18
|
Requires-Dist: llama-cpp-python~=0.3; extra == "all"
|
|
19
19
|
Requires-Dist: mlx~=0.27; extra == "all"
|
|
@@ -150,7 +150,6 @@ ommlds/minichain/chat/messages.py
|
|
|
150
150
|
ommlds/minichain/chat/metadata.py
|
|
151
151
|
ommlds/minichain/chat/services.py
|
|
152
152
|
ommlds/minichain/chat/templating.py
|
|
153
|
-
ommlds/minichain/chat/tools.py
|
|
154
153
|
ommlds/minichain/chat/types.py
|
|
155
154
|
ommlds/minichain/chat/choices/__init__.py
|
|
156
155
|
ommlds/minichain/chat/choices/adapters.py
|
|
@@ -160,6 +159,12 @@ ommlds/minichain/chat/stream/__init__.py
|
|
|
160
159
|
ommlds/minichain/chat/stream/adapters.py
|
|
161
160
|
ommlds/minichain/chat/stream/services.py
|
|
162
161
|
ommlds/minichain/chat/stream/types.py
|
|
162
|
+
ommlds/minichain/chat/tools/__init__.py
|
|
163
|
+
ommlds/minichain/chat/tools/types.py
|
|
164
|
+
ommlds/minichain/chat/tools/execution/__init__.py
|
|
165
|
+
ommlds/minichain/chat/tools/execution/context.py
|
|
166
|
+
ommlds/minichain/chat/tools/execution/executors.py
|
|
167
|
+
ommlds/minichain/chat/tools/execution/messages.py
|
|
163
168
|
ommlds/minichain/chat/transforms/__init__.py
|
|
164
169
|
ommlds/minichain/chat/transforms/base.py
|
|
165
170
|
ommlds/minichain/chat/transforms/uuids.py
|
|
@@ -171,7 +176,6 @@ ommlds/minichain/content/metadata.py
|
|
|
171
176
|
ommlds/minichain/content/namespaces.py
|
|
172
177
|
ommlds/minichain/content/placeholders.py
|
|
173
178
|
ommlds/minichain/content/prepare.py
|
|
174
|
-
ommlds/minichain/content/rendering.py
|
|
175
179
|
ommlds/minichain/content/sequence.py
|
|
176
180
|
ommlds/minichain/content/simple.py
|
|
177
181
|
ommlds/minichain/content/text.py
|
|
@@ -224,6 +228,7 @@ ommlds/minichain/tokens/types.py
|
|
|
224
228
|
ommlds/minichain/tokens/vocabs.py
|
|
225
229
|
ommlds/minichain/tools/__init__.py
|
|
226
230
|
ommlds/minichain/tools/_marshal.py
|
|
231
|
+
ommlds/minichain/tools/fns.py
|
|
227
232
|
ommlds/minichain/tools/jsonschema.py
|
|
228
233
|
ommlds/minichain/tools/reflect.py
|
|
229
234
|
ommlds/minichain/tools/types.py
|
|
@@ -12,7 +12,7 @@ authors = [
|
|
|
12
12
|
urls = {source = 'https://github.com/wrmsr/omlish'}
|
|
13
13
|
license = {text = 'BSD-3-Clause'}
|
|
14
14
|
requires-python = '>=3.13'
|
|
15
|
-
version = '0.0.0.
|
|
15
|
+
version = '0.0.0.dev375'
|
|
16
16
|
classifiers = [
|
|
17
17
|
'License :: OSI Approved :: BSD License',
|
|
18
18
|
'Development Status :: 2 - Pre-Alpha',
|
|
@@ -22,8 +22,8 @@ classifiers = [
|
|
|
22
22
|
]
|
|
23
23
|
description = 'ommlds'
|
|
24
24
|
dependencies = [
|
|
25
|
-
'omdev == 0.0.0.
|
|
26
|
-
'omlish == 0.0.0.
|
|
25
|
+
'omdev == 0.0.0.dev375',
|
|
26
|
+
'omlish == 0.0.0.dev375',
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
[project.optional-dependencies]
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import collections.abc
|
|
2
|
-
import io
|
|
3
|
-
import typing as ta
|
|
4
|
-
|
|
5
|
-
from omlish import dispatch
|
|
6
|
-
|
|
7
|
-
from .types import Content
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class StringRenderer:
|
|
14
|
-
def __init__(self, out: ta.TextIO) -> None:
|
|
15
|
-
super().__init__()
|
|
16
|
-
|
|
17
|
-
self._out = out
|
|
18
|
-
|
|
19
|
-
@dispatch.method
|
|
20
|
-
def render(self, c: Content) -> None:
|
|
21
|
-
raise TypeError(c)
|
|
22
|
-
|
|
23
|
-
@render.register
|
|
24
|
-
def render_str(self, c: str) -> None:
|
|
25
|
-
self._out.write(c)
|
|
26
|
-
|
|
27
|
-
@render.register
|
|
28
|
-
def render_sequence(self, s: collections.abc.Sequence) -> None:
|
|
29
|
-
for e in s:
|
|
30
|
-
self.render(e)
|
|
31
|
-
|
|
32
|
-
@classmethod
|
|
33
|
-
def render_to_str(cls, c: Content) -> str:
|
|
34
|
-
out = io.StringIO()
|
|
35
|
-
cls(out).render(c)
|
|
36
|
-
return out.getvalue()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/__init__.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/assemble.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/events.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/marshal.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/base.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/bpe.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/naive.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/spm.py
RENAMED
|
File without changes
|
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/tokenization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/chunk.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/completionusage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/__init__.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/__main__.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/attention.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/loading.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/quantization.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/sampling.py
RENAMED
|
File without changes
|
{ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/tokenization.py
RENAMED
|
File without changes
|