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.
Files changed (265) hide show
  1. {ommlds-0.0.0.dev373/ommlds.egg-info → ommlds-0.0.0.dev375}/PKG-INFO +3 -3
  2. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/chat.py +3 -3
  3. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/__init__.py +1 -5
  4. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/chat.py +1 -1
  5. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/format.py +3 -3
  6. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/transformers/transformers.py +1 -1
  7. ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/execution/context.py +65 -0
  8. ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/execution/executors.py +60 -0
  9. ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/execution/messages.py +25 -0
  10. ommlds-0.0.0.dev373/ommlds/minichain/chat/tools.py → ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/types.py +2 -2
  11. ommlds-0.0.0.dev375/ommlds/minichain/tools/fns.py +88 -0
  12. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tools/types.py +1 -1
  13. ommlds-0.0.0.dev375/ommlds/wiki/text/__init__.py +0 -0
  14. ommlds-0.0.0.dev375/ommlds/wiki/utils/__init__.py +0 -0
  15. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375/ommlds.egg-info}/PKG-INFO +3 -3
  16. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/SOURCES.txt +7 -2
  17. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/requires.txt +2 -2
  18. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/pyproject.toml +3 -3
  19. ommlds-0.0.0.dev373/ommlds/minichain/content/rendering.py +0 -36
  20. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/LICENSE +0 -0
  21. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/MANIFEST.in +0 -0
  22. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/README.md +0 -0
  23. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/.manifests.json +0 -0
  24. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/__about__.py +0 -0
  25. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/__init__.py +0 -0
  26. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/__init__.py +0 -0
  27. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/__init__.py +0 -0
  28. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/__init__.py +0 -0
  29. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/marshal.py +0 -0
  30. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/__init__.py +0 -0
  31. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/assemble.py +0 -0
  32. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/events.py +0 -0
  33. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/sse/marshal.py +0 -0
  34. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/anthropic/protocol/types.py +0 -0
  35. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/llamacpp/__init__.py +0 -0
  36. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/llamacpp/buildwheel.py +0 -0
  37. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/llamacpp/logging.py +0 -0
  38. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/__init__.py +0 -0
  39. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/__main__.py +0 -0
  40. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/caching.py +0 -0
  41. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/cli.py +0 -0
  42. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/generation.py +0 -0
  43. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/limits.py +0 -0
  44. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/loading.py +0 -0
  45. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/LICENSE +0 -0
  46. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/__init__.py +0 -0
  47. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/__init__.py +0 -0
  48. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/base.py +0 -0
  49. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/bpe.py +0 -0
  50. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/naive.py +0 -0
  51. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/detokenization/spm.py +0 -0
  52. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/loading.py +0 -0
  53. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/tokenization.py +0 -0
  54. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/mlx/tokenization/types.py +0 -0
  55. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/__init__.py +0 -0
  56. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/__init__.py +0 -0
  57. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/__init__.py +0 -0
  58. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/chunk.py +0 -0
  59. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/contentpart.py +0 -0
  60. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/message.py +0 -0
  61. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/request.py +0 -0
  62. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/response.py +0 -0
  63. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/responseformat.py +0 -0
  64. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/chatcompletion/tokenlogprob.py +0 -0
  65. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/openai/protocol/completionusage.py +0 -0
  66. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/__init__.py +0 -0
  67. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/LICENSE +0 -0
  68. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/__init__.py +0 -0
  69. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/__init__.py +0 -0
  70. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/__main__.py +0 -0
  71. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/attention.py +0 -0
  72. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/cli.py +0 -0
  73. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/fetch.py +0 -0
  74. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/llm.py +0 -0
  75. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/loading.py +0 -0
  76. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/quantization.py +0 -0
  77. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/sampling.py +0 -0
  78. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/tokenization.py +0 -0
  79. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/llama3/transformer.py +0 -0
  80. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/__init__.py +0 -0
  81. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/__main__.py +0 -0
  82. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/cli.py +0 -0
  83. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/clip.py +0 -0
  84. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/sdxl.py +0 -0
  85. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/models/sdxl/unet.py +0 -0
  86. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/tinygrad/tinygrad.py +0 -0
  87. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/torch/__init__.py +0 -0
  88. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/torch/backends.py +0 -0
  89. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/torch/devices.py +0 -0
  90. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/backends/torch/purge.py +0 -0
  91. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/__init__.py +0 -0
  92. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/__main__.py +0 -0
  93. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/inject.py +0 -0
  94. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/main.py +0 -0
  95. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/__init__.py +0 -0
  96. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/base.py +0 -0
  97. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/completion.py +0 -0
  98. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/embedding.py +0 -0
  99. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/sessions/inject.py +0 -0
  100. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/state.py +0 -0
  101. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/tools/__init__.py +0 -0
  102. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/tools/inject.py +0 -0
  103. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/cli/tools/tools.py +0 -0
  104. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/datasets/__init__.py +0 -0
  105. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/datasets/library/__init__.py +0 -0
  106. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/datasets/library/movies.py +0 -0
  107. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/hacks/__init__.py +0 -0
  108. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/hacks/patches.py +0 -0
  109. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/huggingface.py +0 -0
  110. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/_abc.py +0 -0
  111. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/_typedvalues.py +0 -0
  112. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/__init__.py +0 -0
  113. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/anthropic/__init__.py +0 -0
  114. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/anthropic/chat.py +0 -0
  115. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/duckduckgo.py +0 -0
  116. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/google/__init__.py +0 -0
  117. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/google/chat.py +0 -0
  118. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/google/search.py +0 -0
  119. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/huggingface.py +0 -0
  120. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/__init__.py +0 -0
  121. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/completion.py +0 -0
  122. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/format.py +0 -0
  123. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/llamacpp/stream.py +0 -0
  124. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/mistral.py +0 -0
  125. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/mlx/__init__.py +0 -0
  126. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/mlx/chat.py +0 -0
  127. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/__init__.py +0 -0
  128. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/chat.py +0 -0
  129. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/completion.py +0 -0
  130. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/embedding.py +0 -0
  131. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/openai/stream.py +0 -0
  132. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/sentencepiece/__init__.py +0 -0
  133. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/sentencepiece/tokens.py +0 -0
  134. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/sqlite.py +0 -0
  135. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/tinygrad/__init__.py +0 -0
  136. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/tinygrad/chat.py +0 -0
  137. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/tokenizers/__init__.py +0 -0
  138. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/tokenizers/tokens.py +0 -0
  139. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/transformers/__init__.py +0 -0
  140. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/transformers/sentence.py +0 -0
  141. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/backends/transformers/tokens.py +0 -0
  142. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/__init__.py +0 -0
  143. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/_marshal.py +0 -0
  144. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/choices/__init__.py +0 -0
  145. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/choices/adapters.py +0 -0
  146. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/choices/services.py +0 -0
  147. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/choices/types.py +0 -0
  148. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/formats.py +0 -0
  149. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/history.py +0 -0
  150. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/messages.py +0 -0
  151. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/metadata.py +0 -0
  152. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/services.py +0 -0
  153. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/stream/__init__.py +0 -0
  154. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/stream/adapters.py +0 -0
  155. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/stream/services.py +0 -0
  156. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/stream/types.py +0 -0
  157. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/templating.py +0 -0
  158. {ommlds-0.0.0.dev373/ommlds/minichain/chat/transforms → ommlds-0.0.0.dev375/ommlds/minichain/chat/tools}/__init__.py +0 -0
  159. {ommlds-0.0.0.dev373/ommlds/minichain/content → ommlds-0.0.0.dev375/ommlds/minichain/chat/tools/execution}/__init__.py +0 -0
  160. {ommlds-0.0.0.dev373/ommlds/minichain/content → ommlds-0.0.0.dev375/ommlds/minichain/chat}/transforms/__init__.py +0 -0
  161. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/transforms/base.py +0 -0
  162. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/transforms/uuids.py +0 -0
  163. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/chat/types.py +0 -0
  164. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/completion.py +0 -0
  165. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/configs.py +0 -0
  166. {ommlds-0.0.0.dev373/ommlds/minichain/lib → ommlds-0.0.0.dev375/ommlds/minichain/content}/__init__.py +0 -0
  167. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/_marshal.py +0 -0
  168. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/images.py +0 -0
  169. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/materialize.py +0 -0
  170. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/metadata.py +0 -0
  171. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/namespaces.py +0 -0
  172. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/placeholders.py +0 -0
  173. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/prepare.py +0 -0
  174. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/sequence.py +0 -0
  175. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/simple.py +0 -0
  176. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/text.py +0 -0
  177. {ommlds-0.0.0.dev373/ommlds/minichain/lib/fs → ommlds-0.0.0.dev375/ommlds/minichain/content/transforms}/__init__.py +0 -0
  178. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/base.py +0 -0
  179. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/interleave.py +0 -0
  180. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/squeeze.py +0 -0
  181. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/stringify.py +0 -0
  182. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/transforms/strings.py +0 -0
  183. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/content/types.py +0 -0
  184. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/docs/__init__.py +0 -0
  185. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/docs/docs.py +0 -0
  186. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/docs/dtypes.py +0 -0
  187. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/docs/filters.py +0 -0
  188. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/envs.py +0 -0
  189. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/json.py +0 -0
  190. {ommlds-0.0.0.dev373/ommlds/minichain/lib/fs/ls → ommlds-0.0.0.dev375/ommlds/minichain/lib}/__init__.py +0 -0
  191. {ommlds-0.0.0.dev373/ommlds/minichain/llms → ommlds-0.0.0.dev375/ommlds/minichain/lib/fs}/__init__.py +0 -0
  192. {ommlds-0.0.0.dev373/ommlds/minichain/stream → ommlds-0.0.0.dev375/ommlds/minichain/lib/fs/ls}/__init__.py +0 -0
  193. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/lib/fs/ls/rendering.py +0 -0
  194. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/lib/fs/ls/running.py +0 -0
  195. {ommlds-0.0.0.dev373/ommlds/minichain/text → ommlds-0.0.0.dev375/ommlds/minichain/llms}/__init__.py +0 -0
  196. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/llms/_marshal.py +0 -0
  197. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/llms/tokens.py +0 -0
  198. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/llms/types.py +0 -0
  199. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/metadata.py +0 -0
  200. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/registry.py +0 -0
  201. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/resources.py +0 -0
  202. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/search.py +0 -0
  203. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/__init__.py +0 -0
  204. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/_marshal.py +0 -0
  205. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/_origclasses.py +0 -0
  206. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/_typedvalues.py +0 -0
  207. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/facades.py +0 -0
  208. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/requests.py +0 -0
  209. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/responses.py +0 -0
  210. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/services/services.py +0 -0
  211. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/standard.py +0 -0
  212. {ommlds-0.0.0.dev373/ommlds/minichain/text/toolparsing → ommlds-0.0.0.dev375/ommlds/minichain/stream}/__init__.py +0 -0
  213. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/stream/services.py +0 -0
  214. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/stream/wrap.py +0 -0
  215. {ommlds-0.0.0.dev373/ommlds/minichain/tools → ommlds-0.0.0.dev375/ommlds/minichain/text}/__init__.py +0 -0
  216. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/applypatch.py +0 -0
  217. {ommlds-0.0.0.dev373/ommlds/minichain/vectors → ommlds-0.0.0.dev375/ommlds/minichain/text/toolparsing}/__init__.py +0 -0
  218. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/base.py +0 -0
  219. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/dumb.py +0 -0
  220. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/LICENSE +0 -0
  221. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/__init__.py +0 -0
  222. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/hermes2.py +0 -0
  223. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/llama31.py +0 -0
  224. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/types.py +0 -0
  225. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/text/toolparsing/llamacpp/utils.py +0 -0
  226. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/__init__.py +0 -0
  227. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/specials.py +0 -0
  228. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/tokenizers.py +0 -0
  229. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/types.py +0 -0
  230. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tokens/vocabs.py +0 -0
  231. {ommlds-0.0.0.dev373/ommlds/server → ommlds-0.0.0.dev375/ommlds/minichain/tools}/__init__.py +0 -0
  232. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tools/_marshal.py +0 -0
  233. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tools/jsonschema.py +0 -0
  234. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/tools/reflect.py +0 -0
  235. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/types.py +0 -0
  236. {ommlds-0.0.0.dev373/ommlds/tools → ommlds-0.0.0.dev375/ommlds/minichain/vectors}/__init__.py +0 -0
  237. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/embeddings.py +0 -0
  238. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/index.py +0 -0
  239. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/search.py +0 -0
  240. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/similarity.py +0 -0
  241. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/stores.py +0 -0
  242. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/minichain/vectors/types.py +0 -0
  243. {ommlds-0.0.0.dev373/ommlds/wiki → ommlds-0.0.0.dev375/ommlds/server}/__init__.py +0 -0
  244. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/__main__.py +0 -0
  245. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/cli.py +0 -0
  246. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/client.py +0 -0
  247. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/server.py +0 -0
  248. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/server/service.py +0 -0
  249. {ommlds-0.0.0.dev373/ommlds/wiki/text → ommlds-0.0.0.dev375/ommlds/tools}/__init__.py +0 -0
  250. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/tools/git.py +0 -0
  251. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/tools/ocr.py +0 -0
  252. {ommlds-0.0.0.dev373/ommlds/wiki/utils → ommlds-0.0.0.dev375/ommlds/wiki}/__init__.py +0 -0
  253. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/analyze.py +0 -0
  254. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/convert.py +0 -0
  255. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/models.py +0 -0
  256. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/text/mfh.py +0 -0
  257. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/text/wtp.py +0 -0
  258. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/utils/io.py +0 -0
  259. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/utils/progress.py +0 -0
  260. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/utils/xml.py +0 -0
  261. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds/wiki/xml.py +0 -0
  262. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/dependency_links.txt +0 -0
  263. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/entry_points.txt +0 -0
  264. {ommlds-0.0.0.dev373 → ommlds-0.0.0.dev375}/ommlds.egg-info/top_level.txt +0 -0
  265. {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.dev373
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.dev373
16
- Requires-Dist: omlish==0.0.0.dev373
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.spec.name)]
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(tr.spec),
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.spec.name),
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.spec.name,
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
- spec=self._process_options().tools_by_name[tc['function']['name']],
172
+ name=tc['function']['name'],
173
173
  args=json.loads(tc['function']['arguments'] or '{}'),
174
174
  raw_args=tc['function']['arguments'],
175
175
  )
@@ -98,7 +98,7 @@ def build_chat_message(m: Message) -> ta.Mapping[str, ta.Any]:
98
98
  id=te.id,
99
99
  function=dict(
100
100
  arguments=te.args,
101
- name=te.spec.name,
101
+ name=te.name,
102
102
  ),
103
103
  type='function',
104
104
  )
@@ -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
+ )
@@ -1,8 +1,8 @@
1
1
  from omlish import dataclasses as dc
2
2
  from omlish import lang
3
3
 
4
- from ..tools.types import ToolSpec
5
- from .types import ChatOption
4
+ from ...tools.types import ToolSpec
5
+ from ..types import ChatOption
6
6
 
7
7
 
8
8
  ##
@@ -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
@@ -176,7 +176,7 @@ class ToolSpec:
176
176
  @dc.dataclass(frozen=True)
177
177
  class ToolExecRequest(lang.Final):
178
178
  id: str
179
- spec: ToolSpec
179
+ name: str
180
180
  args: ta.Mapping[str, ta.Any]
181
181
 
182
182
  _: dc.KW_ONLY
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.dev373
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.dev373
16
- Requires-Dist: omlish==0.0.0.dev373
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
@@ -1,5 +1,5 @@
1
- omdev==0.0.0.dev373
2
- omlish==0.0.0.dev373
1
+ omdev==0.0.0.dev375
2
+ omlish==0.0.0.dev375
3
3
 
4
4
  [all]
5
5
  llama-cpp-python~=0.3
@@ -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.dev373'
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.dev373',
26
- 'omlish == 0.0.0.dev373',
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