ommlds 0.0.0.dev331__tar.gz → 0.0.0.dev332__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 (218) hide show
  1. {ommlds-0.0.0.dev331/ommlds.egg-info → ommlds-0.0.0.dev332}/PKG-INFO +3 -3
  2. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/.manifests.json +3 -3
  3. ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/__init__.py +110 -0
  4. ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/chatcompletion/chunk.py +71 -0
  5. ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/chatcompletion/contentpart.py +77 -0
  6. ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/chatcompletion/message.py +91 -0
  7. ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/chatcompletion/request.py +140 -0
  8. ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/chatcompletion/response.py +90 -0
  9. ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/chatcompletion/responseformat.py +41 -0
  10. ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/chatcompletion/tokenlogprob.py +17 -0
  11. ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/completionusage.py +24 -0
  12. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/sessions/chat.py +57 -54
  13. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/__init__.py +19 -2
  14. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/llamacpp/streaming.py +18 -14
  15. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/openai/format.py +15 -14
  16. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/openai/streaming.py +12 -12
  17. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/streaming.py +9 -3
  18. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/resources.py +9 -2
  19. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/services/facades.py +17 -19
  20. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/services/requests.py +4 -0
  21. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/services/responses.py +4 -0
  22. ommlds-0.0.0.dev332/ommlds/minichain/streaming.py +63 -0
  23. ommlds-0.0.0.dev332/ommlds/wiki/text/__init__.py +0 -0
  24. ommlds-0.0.0.dev332/ommlds/wiki/utils/__init__.py +0 -0
  25. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332/ommlds.egg-info}/PKG-INFO +3 -3
  26. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds.egg-info/SOURCES.txt +12 -0
  27. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds.egg-info/requires.txt +2 -2
  28. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/pyproject.toml +3 -3
  29. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/LICENSE +0 -0
  30. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/MANIFEST.in +0 -0
  31. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/README.md +0 -0
  32. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/__about__.py +0 -0
  33. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/__init__.py +0 -0
  34. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/__init__.py +0 -0
  35. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/llamacpp/__init__.py +0 -0
  36. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/llamacpp/buildwheel.py +0 -0
  37. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/llamacpp/logging.py +0 -0
  38. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/__init__.py +0 -0
  39. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/__main__.py +0 -0
  40. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/caching.py +0 -0
  41. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/cli.py +0 -0
  42. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/generation.py +0 -0
  43. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/limits.py +0 -0
  44. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/loading.py +0 -0
  45. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/LICENSE +0 -0
  46. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/__init__.py +0 -0
  47. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/detokenization/__init__.py +0 -0
  48. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/detokenization/base.py +0 -0
  49. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/detokenization/bpe.py +0 -0
  50. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/detokenization/naive.py +0 -0
  51. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/detokenization/spm.py +0 -0
  52. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/loading.py +0 -0
  53. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/tokenization.py +0 -0
  54. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/mlx/tokenization/types.py +0 -0
  55. {ommlds-0.0.0.dev331/ommlds/backends/tinygrad → ommlds-0.0.0.dev332/ommlds/backends/openai}/__init__.py +0 -0
  56. {ommlds-0.0.0.dev331/ommlds/backends/tinygrad/models → ommlds-0.0.0.dev332/ommlds/backends/openai/protocol/chatcompletion}/__init__.py +0 -0
  57. {ommlds-0.0.0.dev331/ommlds/cli → ommlds-0.0.0.dev332/ommlds/backends/tinygrad}/__init__.py +0 -0
  58. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/LICENSE +0 -0
  59. {ommlds-0.0.0.dev331/ommlds/cli/sessions → ommlds-0.0.0.dev332/ommlds/backends/tinygrad/models}/__init__.py +0 -0
  60. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/__init__.py +0 -0
  61. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/__main__.py +0 -0
  62. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/attention.py +0 -0
  63. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/fetch.py +0 -0
  64. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/llm.py +0 -0
  65. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/loading.py +0 -0
  66. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/quantization.py +0 -0
  67. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/repl.py +0 -0
  68. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/sampling.py +0 -0
  69. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/tokenization.py +0 -0
  70. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/llama3/transformer.py +0 -0
  71. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/sdxl/__init__.py +0 -0
  72. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/sdxl/__main__.py +0 -0
  73. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/sdxl/cli.py +0 -0
  74. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/sdxl/clip.py +0 -0
  75. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/sdxl/sdxl.py +0 -0
  76. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/models/sdxl/unet.py +0 -0
  77. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/tinygrad/tinygrad.py +0 -0
  78. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/torch/__init__.py +0 -0
  79. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/torch/backends.py +0 -0
  80. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/torch/devices.py +0 -0
  81. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/backends/torch/purge.py +0 -0
  82. {ommlds-0.0.0.dev331/ommlds/cli/tools → ommlds-0.0.0.dev332/ommlds/cli}/__init__.py +0 -0
  83. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/__main__.py +0 -0
  84. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/inject.py +0 -0
  85. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/main.py +0 -0
  86. {ommlds-0.0.0.dev331/ommlds/datasets → ommlds-0.0.0.dev332/ommlds/cli/sessions}/__init__.py +0 -0
  87. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/sessions/base.py +0 -0
  88. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/sessions/completion.py +0 -0
  89. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/sessions/embedding.py +0 -0
  90. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/sessions/inject.py +0 -0
  91. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/state.py +0 -0
  92. {ommlds-0.0.0.dev331/ommlds/datasets/library → ommlds-0.0.0.dev332/ommlds/cli/tools}/__init__.py +0 -0
  93. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/tools/inject.py +0 -0
  94. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/cli/tools/tools.py +0 -0
  95. {ommlds-0.0.0.dev331/ommlds/hacks → ommlds-0.0.0.dev332/ommlds/datasets}/__init__.py +0 -0
  96. {ommlds-0.0.0.dev331/ommlds/minichain/backends → ommlds-0.0.0.dev332/ommlds/datasets/library}/__init__.py +0 -0
  97. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/datasets/library/movies.py +0 -0
  98. {ommlds-0.0.0.dev331/ommlds/minichain/backends/anthropic → ommlds-0.0.0.dev332/ommlds/hacks}/__init__.py +0 -0
  99. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/hacks/patches.py +0 -0
  100. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/huggingface.py +0 -0
  101. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/_abc.py +0 -0
  102. {ommlds-0.0.0.dev331/ommlds/minichain/backends/google → ommlds-0.0.0.dev332/ommlds/minichain/backends}/__init__.py +0 -0
  103. {ommlds-0.0.0.dev331/ommlds/minichain/backends/llamacpp → ommlds-0.0.0.dev332/ommlds/minichain/backends/anthropic}/__init__.py +0 -0
  104. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/anthropic/chat.py +0 -0
  105. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/duckduckgo.py +0 -0
  106. {ommlds-0.0.0.dev331/ommlds/minichain/backends/mlx → ommlds-0.0.0.dev332/ommlds/minichain/backends/google}/__init__.py +0 -0
  107. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/google/chat.py +0 -0
  108. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/google/search.py +0 -0
  109. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/huggingface.py +0 -0
  110. {ommlds-0.0.0.dev331/ommlds/minichain/backends/openai → ommlds-0.0.0.dev332/ommlds/minichain/backends/llamacpp}/__init__.py +0 -0
  111. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/llamacpp/chat.py +0 -0
  112. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/llamacpp/completion.py +0 -0
  113. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/llamacpp/format.py +0 -0
  114. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/mistral.py +0 -0
  115. {ommlds-0.0.0.dev331/ommlds/minichain/backends/sentencepiece → ommlds-0.0.0.dev332/ommlds/minichain/backends/mlx}/__init__.py +0 -0
  116. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/mlx/chat.py +0 -0
  117. {ommlds-0.0.0.dev331/ommlds/minichain/backends/tinygrad → ommlds-0.0.0.dev332/ommlds/minichain/backends/openai}/__init__.py +0 -0
  118. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/openai/chat.py +0 -0
  119. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/openai/completion.py +0 -0
  120. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/openai/embedding.py +0 -0
  121. {ommlds-0.0.0.dev331/ommlds/minichain/backends/tokenizers → ommlds-0.0.0.dev332/ommlds/minichain/backends/sentencepiece}/__init__.py +0 -0
  122. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/sentencepiece/tokens.py +0 -0
  123. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/sqlite.py +0 -0
  124. {ommlds-0.0.0.dev331/ommlds/minichain/backends/transformers → ommlds-0.0.0.dev332/ommlds/minichain/backends/tinygrad}/__init__.py +0 -0
  125. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/tinygrad/chat.py +0 -0
  126. {ommlds-0.0.0.dev331/ommlds/minichain/chat → ommlds-0.0.0.dev332/ommlds/minichain/backends/tokenizers}/__init__.py +0 -0
  127. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/tokenizers/tokens.py +0 -0
  128. {ommlds-0.0.0.dev331/ommlds/minichain/content → ommlds-0.0.0.dev332/ommlds/minichain/backends/transformers}/__init__.py +0 -0
  129. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/transformers/sentence.py +0 -0
  130. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/transformers/tokens.py +0 -0
  131. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/backends/transformers/transformers.py +0 -0
  132. {ommlds-0.0.0.dev331/ommlds/minichain/llms → ommlds-0.0.0.dev332/ommlds/minichain/chat}/__init__.py +0 -0
  133. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/choices.py +0 -0
  134. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/formats.py +0 -0
  135. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/history.py +0 -0
  136. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/marshal.py +0 -0
  137. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/messages.py +0 -0
  138. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/services.py +0 -0
  139. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/templating.py +0 -0
  140. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/tools.py +0 -0
  141. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/chat/types.py +0 -0
  142. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/completion.py +0 -0
  143. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/configs.py +0 -0
  144. {ommlds-0.0.0.dev331/ommlds/minichain/text → ommlds-0.0.0.dev332/ommlds/minichain/content}/__init__.py +0 -0
  145. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/content/content.py +0 -0
  146. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/content/images.py +0 -0
  147. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/content/marshal.py +0 -0
  148. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/content/rendering.py +0 -0
  149. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/content/transforms.py +0 -0
  150. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/docs/__init__.py +0 -0
  151. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/docs/docs.py +0 -0
  152. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/docs/dtypes.py +0 -0
  153. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/docs/filters.py +0 -0
  154. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/envs.py +0 -0
  155. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/json.py +0 -0
  156. {ommlds-0.0.0.dev331/ommlds/minichain/text/toolparsing → ommlds-0.0.0.dev332/ommlds/minichain/llms}/__init__.py +0 -0
  157. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/llms/marshal.py +0 -0
  158. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/llms/services.py +0 -0
  159. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/llms/tokens.py +0 -0
  160. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/registry.py +0 -0
  161. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/search.py +0 -0
  162. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/services/__init__.py +0 -0
  163. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/services/_marshal.py +0 -0
  164. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/services/_origclasses.py +0 -0
  165. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/services/_typedvalues.py +0 -0
  166. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/services/services.py +0 -0
  167. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/standard.py +0 -0
  168. {ommlds-0.0.0.dev331/ommlds/minichain/tools → ommlds-0.0.0.dev332/ommlds/minichain/text}/__init__.py +0 -0
  169. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/text/applypatch.py +0 -0
  170. {ommlds-0.0.0.dev331/ommlds/minichain/vectors → ommlds-0.0.0.dev332/ommlds/minichain/text/toolparsing}/__init__.py +0 -0
  171. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/text/toolparsing/base.py +0 -0
  172. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/text/toolparsing/dumb.py +0 -0
  173. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/text/toolparsing/llamacpp/LICENSE +0 -0
  174. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/text/toolparsing/llamacpp/__init__.py +0 -0
  175. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/text/toolparsing/llamacpp/hermes2.py +0 -0
  176. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/text/toolparsing/llamacpp/llama31.py +0 -0
  177. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/text/toolparsing/llamacpp/types.py +0 -0
  178. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/text/toolparsing/llamacpp/utils.py +0 -0
  179. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/tokens/__init__.py +0 -0
  180. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/tokens/specials.py +0 -0
  181. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/tokens/tokenizers.py +0 -0
  182. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/tokens/types.py +0 -0
  183. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/tokens/vocabs.py +0 -0
  184. {ommlds-0.0.0.dev331/ommlds/server → ommlds-0.0.0.dev332/ommlds/minichain/tools}/__init__.py +0 -0
  185. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/tools/jsonschema.py +0 -0
  186. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/tools/marshal.py +0 -0
  187. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/tools/reflection.py +0 -0
  188. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/tools/types.py +0 -0
  189. {ommlds-0.0.0.dev331/ommlds/tools → ommlds-0.0.0.dev332/ommlds/minichain/vectors}/__init__.py +0 -0
  190. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/vectors/embeddings.py +0 -0
  191. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/vectors/index.py +0 -0
  192. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/vectors/search.py +0 -0
  193. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/vectors/similarity.py +0 -0
  194. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/vectors/stores.py +0 -0
  195. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/minichain/vectors/types.py +0 -0
  196. {ommlds-0.0.0.dev331/ommlds/wiki → ommlds-0.0.0.dev332/ommlds/server}/__init__.py +0 -0
  197. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/server/__main__.py +0 -0
  198. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/server/cli.py +0 -0
  199. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/server/client.py +0 -0
  200. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/server/server.py +0 -0
  201. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/server/service.py +0 -0
  202. {ommlds-0.0.0.dev331/ommlds/wiki/text → ommlds-0.0.0.dev332/ommlds/tools}/__init__.py +0 -0
  203. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/tools/git.py +0 -0
  204. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/tools/ocr.py +0 -0
  205. {ommlds-0.0.0.dev331/ommlds/wiki/utils → ommlds-0.0.0.dev332/ommlds/wiki}/__init__.py +0 -0
  206. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/wiki/analyze.py +0 -0
  207. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/wiki/convert.py +0 -0
  208. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/wiki/models.py +0 -0
  209. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/wiki/text/mfh.py +0 -0
  210. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/wiki/text/wtp.py +0 -0
  211. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/wiki/utils/io.py +0 -0
  212. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/wiki/utils/progress.py +0 -0
  213. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/wiki/utils/xml.py +0 -0
  214. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds/wiki/xml.py +0 -0
  215. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds.egg-info/dependency_links.txt +0 -0
  216. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds.egg-info/entry_points.txt +0 -0
  217. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/ommlds.egg-info/top_level.txt +0 -0
  218. {ommlds-0.0.0.dev331 → ommlds-0.0.0.dev332}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ommlds
3
- Version: 0.0.0.dev331
3
+ Version: 0.0.0.dev332
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.dev331
16
- Requires-Dist: omlish==0.0.0.dev331
15
+ Requires-Dist: omdev==0.0.0.dev332
16
+ Requires-Dist: omlish==0.0.0.dev332
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"
@@ -95,7 +95,7 @@
95
95
  "module": ".minichain.backends.llamacpp.streaming",
96
96
  "attr": null,
97
97
  "file": "ommlds/minichain/backends/llamacpp/streaming.py",
98
- "line": 26,
98
+ "line": 28,
99
99
  "value": {
100
100
  "$.minichain.registry.RegistryManifest": {
101
101
  "mod_name": "ommlds.minichain.backends.llamacpp.streaming",
@@ -185,7 +185,7 @@
185
185
  "module": ".minichain.backends.openai.streaming",
186
186
  "attr": null,
187
187
  "file": "ommlds/minichain/backends/openai/streaming.py",
188
- "line": 27,
188
+ "line": 28,
189
189
  "value": {
190
190
  "$.minichain.registry.RegistryManifest": {
191
191
  "mod_name": "ommlds.minichain.backends.openai.streaming",
@@ -278,7 +278,7 @@
278
278
  "module": ".minichain.chat.streaming",
279
279
  "attr": null,
280
280
  "file": "ommlds/minichain/chat/streaming.py",
281
- "line": 21,
281
+ "line": 27,
282
282
  "value": {
283
283
  "$.minichain.registry.RegistryTypeManifest": {
284
284
  "mod_name": "ommlds.minichain.chat.streaming",
@@ -0,0 +1,110 @@
1
+ """
2
+ https://platform.openai.com/docs/api-reference/introduction
3
+ https://github.com/openai/openai-openapi/blob/master/openapi.yaml
4
+ """
5
+ # ruff: noqa: I001
6
+
7
+ from .chatcompletion.chunk import ( # noqa
8
+ ChatCompletionChunkChoiceDeltaToolCallFunction,
9
+ ChatCompletionChunkChoiceDeltaToolCall,
10
+ ChatCompletionChunkChoiceDelta,
11
+
12
+ ChatCompletionChunkChoiceLogprobs,
13
+ ChatCompletionChunkChoice,
14
+
15
+ ChatCompletionChunk,
16
+ )
17
+
18
+ from .chatcompletion.contentpart import ( # noqa
19
+ TextChatCompletionContentPart,
20
+
21
+ ImageChatCompletionContentPartImageUrl,
22
+ ImageChatCompletionContentPart,
23
+
24
+ FileChatCompletionContentPartFileInfo,
25
+ FileChatCompletionContentPart,
26
+
27
+ InputAudioChatCompletionContentPartInputAudio,
28
+ InputAudioChatCompletionContentPart,
29
+
30
+ RefusalChatCompletionContentPart,
31
+
32
+ ChatCompletionContentPart,
33
+ )
34
+
35
+ from .chatcompletion.message import ( # noqa
36
+ DeveloperChatCompletionMessage,
37
+
38
+ SystemChatCompletionMessage,
39
+
40
+ UserChatCompletionMessage,
41
+
42
+ AssistantChatCompletionMessageAudio,
43
+ AssistantChatCompletionMessageToolCallFunction,
44
+ AssistantChatCompletionMessageToolCall,
45
+ AssistantChatCompletionMessage,
46
+
47
+ ToolChatCompletionMessage,
48
+
49
+ FunctionChatCompletionMessage,
50
+
51
+ ChatCompletionMessage,
52
+ )
53
+
54
+ from .chatcompletion.request import ( # noqa
55
+ ChatCompletionRequestWebSearchOptionsUserLocationApproximate,
56
+ ChatCompletionRequestWebSearchOptionsUserLocation,
57
+ ChatCompletionRequestWebSearchOptions,
58
+
59
+ ChatCompletionRequestPrediction,
60
+
61
+ ChatCompletionRequestToolFunction,
62
+ ChatCompletionRequestTool,
63
+
64
+ ChatCompletionRequestStreamOptions,
65
+
66
+ ChatCompletionRequestNamedToolChoiceFunction,
67
+ ChatCompletionRequestNamedToolChoice,
68
+
69
+ ChatCompletionRequestAudio,
70
+
71
+ ChatCompletionRequest,
72
+ )
73
+
74
+ from .chatcompletion.response import ( # noqa
75
+ ChatCompletionResponseAnnotationUrlCitation,
76
+ ChatCompletionResponseAnnotation,
77
+
78
+ ChatCompletionResponseAudio,
79
+
80
+ ChatCompletionResponseMessageToolCallFunction,
81
+ ChatCompletionResponseMessageToolCall,
82
+ ChatCompletionResponseMessage,
83
+
84
+ ChatCompletionResponseChoiceLogprobs,
85
+ ChatCompletionResponseChoice,
86
+
87
+ ChatCompletionResponse,
88
+ )
89
+
90
+ from .chatcompletion.responseformat import ( # noqa
91
+ TextChatCompletionResponseFormat,
92
+
93
+ JsonSchemaChatCompletionResponseFormatJsonSchema,
94
+ JsonSchemaChatCompletionResponseFormat,
95
+
96
+ JsonObjectChatCompletionResponseFormat,
97
+
98
+ ChatCompletionResponseFormat,
99
+ )
100
+
101
+ from .chatcompletion.tokenlogprob import ( # noqa
102
+ ChatCompletionTokenLogprobTopLogprob,
103
+ ChatCompletionTokenLogprob,
104
+ )
105
+
106
+ from .completionusage import ( # noqa
107
+ CompletionUsageCompletionTokensDetails,
108
+ CompletionUsagePromptTokensDetails,
109
+ CompletionUsage,
110
+ )
@@ -0,0 +1,71 @@
1
+ import typing as ta
2
+
3
+ from .tokenlogprob import ChatCompletionTokenLogprob
4
+
5
+
6
+ ##
7
+
8
+
9
+ class ChatCompletionChunkChoiceDeltaToolCallFunction(ta.TypedDict, total=False):
10
+ arguments: str
11
+ name: str
12
+
13
+
14
+ class ChatCompletionChunkChoiceDeltaToolCall(ta.TypedDict):
15
+ index: int
16
+ id: ta.NotRequired[str]
17
+ function: ta.NotRequired[ChatCompletionChunkChoiceDeltaToolCallFunction]
18
+ type: ta.Literal['function']
19
+
20
+
21
+ #
22
+
23
+
24
+ class ChatCompletionChunkChoiceDelta(ta.TypedDict, total=False):
25
+ content: str
26
+ refusal: str
27
+ role: ta.Literal[
28
+ 'developer',
29
+ 'system',
30
+ 'user',
31
+ 'assistant',
32
+ 'tool',
33
+ ]
34
+ tool_calls: ta.Sequence[ChatCompletionChunkChoiceDeltaToolCall]
35
+
36
+
37
+ #
38
+
39
+
40
+ class ChatCompletionChunkChoiceLogprobs(ta.TypedDict, total=False):
41
+ content: ta.Sequence[ChatCompletionTokenLogprob]
42
+ refusal: ta.Sequence[ChatCompletionTokenLogprob]
43
+
44
+
45
+ class ChatCompletionChunkChoice(ta.TypedDict):
46
+ delta: ChatCompletionChunkChoiceDelta
47
+ finish_reason: ta.NotRequired[ta.Literal[
48
+ 'stop',
49
+ 'length',
50
+ 'tool_calls',
51
+ 'content_filter',
52
+ ]]
53
+ index: int
54
+ logprobs: ta.NotRequired[ChatCompletionChunkChoiceLogprobs]
55
+
56
+
57
+ #
58
+
59
+
60
+ class ChatCompletionChunk(ta.TypedDict):
61
+ id: str
62
+ choices: ta.Sequence[ChatCompletionChunkChoice]
63
+ created: int
64
+ model: str
65
+ object: ta.Literal['chat.completion.chunk']
66
+ service_tier: ta.NotRequired[ta.Literal[
67
+ 'auto',
68
+ 'default',
69
+ 'flex',
70
+ ]]
71
+ system_fingerprint: ta.NotRequired[str]
@@ -0,0 +1,77 @@
1
+ # ruff: noqa: UP007
2
+ import typing as ta
3
+
4
+
5
+ ##
6
+
7
+
8
+ class TextChatCompletionContentPart(ta.TypedDict):
9
+ text: str
10
+ type: ta.Literal['text']
11
+
12
+
13
+ #
14
+
15
+
16
+ class ImageChatCompletionContentPartImageUrl(ta.TypedDict):
17
+ url: ta.Required[str]
18
+ detail: ta.NotRequired[ta.Literal[
19
+ 'auto',
20
+ 'low',
21
+ 'high',
22
+ ]]
23
+
24
+
25
+ class ImageChatCompletionContentPart(ta.TypedDict):
26
+ image_url: ImageChatCompletionContentPartImageUrl
27
+ type: ta.Literal['image_url']
28
+
29
+
30
+ #
31
+
32
+
33
+ class FileChatCompletionContentPartFileInfo(ta.TypedDict, total=False):
34
+ file_data: str
35
+ file_id: str
36
+ filename: str
37
+
38
+
39
+ class FileChatCompletionContentPart(ta.TypedDict):
40
+ file: FileChatCompletionContentPartFileInfo
41
+ type: ta.Literal['file']
42
+
43
+
44
+ #
45
+
46
+
47
+ class InputAudioChatCompletionContentPartInputAudio(ta.TypedDict):
48
+ data: str
49
+ format: ta.Literal[
50
+ 'wav',
51
+ 'mp3',
52
+ ]
53
+
54
+
55
+ class InputAudioChatCompletionContentPart(ta.TypedDict):
56
+ input_audio: InputAudioChatCompletionContentPartInputAudio
57
+ type: ta.Literal['input_audio']
58
+
59
+
60
+ #
61
+
62
+
63
+ class RefusalChatCompletionContentPart(ta.TypedDict):
64
+ refusal: str
65
+ type: ta.Literal['refusal']
66
+
67
+
68
+ #
69
+
70
+
71
+ ChatCompletionContentPart: ta.TypeAlias = ta.Union[
72
+ TextChatCompletionContentPart,
73
+ ImageChatCompletionContentPart,
74
+ FileChatCompletionContentPart,
75
+ InputAudioChatCompletionContentPart,
76
+ RefusalChatCompletionContentPart,
77
+ ]
@@ -0,0 +1,91 @@
1
+ # ruff: noqa: UP007
2
+ import typing as ta
3
+
4
+ from .contentpart import ChatCompletionContentPart
5
+ from .contentpart import RefusalChatCompletionContentPart
6
+ from .contentpart import TextChatCompletionContentPart
7
+
8
+
9
+ ##
10
+
11
+
12
+ class DeveloperChatCompletionMessage(ta.TypedDict):
13
+ content: str | ta.Iterable[TextChatCompletionContentPart]
14
+ role: ta.Literal['developer']
15
+ name: ta.NotRequired[str]
16
+
17
+
18
+ #
19
+
20
+
21
+ class SystemChatCompletionMessage(ta.TypedDict):
22
+ content: str | ta.Iterable[TextChatCompletionContentPart]
23
+ role: ta.Literal['system']
24
+ name: ta.NotRequired[str]
25
+
26
+
27
+ #
28
+
29
+
30
+ class UserChatCompletionMessage(ta.TypedDict):
31
+ content: str | ta.Iterable[ChatCompletionContentPart]
32
+ role: ta.Literal['user']
33
+ name: ta.NotRequired[str]
34
+
35
+
36
+ #
37
+
38
+
39
+ class AssistantChatCompletionMessageAudio(ta.TypedDict):
40
+ id: str
41
+
42
+
43
+ class AssistantChatCompletionMessageToolCallFunction(ta.TypedDict):
44
+ arguments: str
45
+ name: str
46
+
47
+
48
+ class AssistantChatCompletionMessageToolCall(ta.TypedDict):
49
+ id: str
50
+ function: AssistantChatCompletionMessageToolCallFunction
51
+ type: ta.Literal['function']
52
+
53
+
54
+ class AssistantChatCompletionMessage(ta.TypedDict, total=False):
55
+ role: ta.Required[ta.Literal['assistant']]
56
+ audio: AssistantChatCompletionMessageAudio
57
+ content: str | ta.Iterable[TextChatCompletionContentPart | RefusalChatCompletionContentPart]
58
+ name: str
59
+ refusal: str
60
+ tool_calls: ta.Iterable[AssistantChatCompletionMessageToolCall]
61
+
62
+
63
+ #
64
+
65
+
66
+ class ToolChatCompletionMessage(ta.TypedDict):
67
+ content: str | ta.Iterable[TextChatCompletionContentPart]
68
+ role: ta.Literal['tool']
69
+ tool_call_id: str
70
+
71
+
72
+ #
73
+
74
+
75
+ class FunctionChatCompletionMessage(ta.TypedDict):
76
+ content: str | None
77
+ name: str
78
+ role: ta.Literal['function']
79
+
80
+
81
+ #
82
+
83
+
84
+ ChatCompletionMessage: ta.TypeAlias = ta.Union[
85
+ DeveloperChatCompletionMessage,
86
+ SystemChatCompletionMessage,
87
+ UserChatCompletionMessage,
88
+ AssistantChatCompletionMessage,
89
+ ToolChatCompletionMessage,
90
+ FunctionChatCompletionMessage,
91
+ ]
@@ -0,0 +1,140 @@
1
+ # ruff: noqa: UP007
2
+ import typing as ta
3
+
4
+ from .contentpart import TextChatCompletionContentPart
5
+ from .message import ChatCompletionMessage
6
+ from .responseformat import ChatCompletionResponseFormat
7
+
8
+
9
+ ##
10
+
11
+
12
+ class ChatCompletionRequestWebSearchOptionsUserLocationApproximate(ta.TypedDict, total=False):
13
+ city: str
14
+ country: str
15
+ region: str
16
+ timezone: str
17
+
18
+
19
+ class ChatCompletionRequestWebSearchOptionsUserLocation(ta.TypedDict):
20
+ approximate: ChatCompletionRequestWebSearchOptionsUserLocationApproximate
21
+ type: ta.Literal['approximate']
22
+
23
+
24
+ class ChatCompletionRequestWebSearchOptions(ta.TypedDict, total=False):
25
+ search_context_size: ta.Literal[
26
+ 'low',
27
+ 'medium',
28
+ 'high',
29
+ ]
30
+ user_location: ChatCompletionRequestWebSearchOptionsUserLocation
31
+
32
+
33
+ #
34
+
35
+
36
+ class ChatCompletionRequestPrediction(ta.TypedDict):
37
+ content: str | ta.Iterable[TextChatCompletionContentPart]
38
+ type: ta.Literal['content']
39
+
40
+
41
+ #
42
+
43
+
44
+ class ChatCompletionRequestToolFunction(ta.TypedDict, total=False):
45
+ name: ta.Required[str]
46
+ description: str
47
+ parameters: ta.Mapping[str, ta.Any]
48
+ strict: bool
49
+
50
+
51
+ class ChatCompletionRequestTool(ta.TypedDict):
52
+ function: ChatCompletionRequestToolFunction
53
+ type: ta.Literal['function']
54
+
55
+
56
+ #
57
+
58
+
59
+ class ChatCompletionRequestStreamOptions(ta.TypedDict, total=False):
60
+ include_usage: bool
61
+
62
+
63
+ #
64
+
65
+
66
+ class ChatCompletionRequestNamedToolChoiceFunction(ta.TypedDict):
67
+ name: str
68
+
69
+
70
+ class ChatCompletionRequestNamedToolChoice(ta.TypedDict):
71
+ function: ChatCompletionRequestNamedToolChoiceFunction
72
+ type: ta.Literal['function']
73
+
74
+
75
+ #
76
+
77
+
78
+ class ChatCompletionRequestAudio(ta.TypedDict):
79
+ format: ta.Literal[
80
+ 'wav',
81
+ 'aac',
82
+ 'mp3',
83
+ 'flac',
84
+ 'opus',
85
+ 'pcm16',
86
+ ]
87
+
88
+ voice: str
89
+
90
+
91
+ #
92
+
93
+
94
+ class ChatCompletionRequest(ta.TypedDict, total=False):
95
+ messages: ta.Required[ta.Iterable[ChatCompletionMessage]]
96
+ model: ta.Required[str]
97
+ audio: ChatCompletionRequestAudio
98
+ frequency_penalty: float
99
+ logit_bias: ta.Mapping[str, int]
100
+ logprobs: bool
101
+ max_completion_tokens: int
102
+ max_tokens: int
103
+ metadata: ta.Mapping[str, str]
104
+ modalities: ta.Sequence[ta.Literal[
105
+ 'text',
106
+ 'audio',
107
+ ]]
108
+ n: int
109
+ parallel_tool_calls: bool
110
+ prediction: ChatCompletionRequestPrediction
111
+ presence_penalty: float
112
+ reasoning_effort: ta.Literal[
113
+ 'low',
114
+ 'medium',
115
+ 'high',
116
+ ]
117
+ response_format: ChatCompletionResponseFormat
118
+ seed: int
119
+ service_tier: ta.Literal[
120
+ 'auto',
121
+ 'default',
122
+ 'flex',
123
+ ]
124
+ stop: ta.Union[str, ta.Sequence[str], None]
125
+ store: bool
126
+ stream_options: ChatCompletionRequestStreamOptions
127
+ temperature: float
128
+ tool_choice: ta.Union[
129
+ ta.Literal[
130
+ 'none',
131
+ 'auto',
132
+ 'required',
133
+ ],
134
+ ChatCompletionRequestNamedToolChoice,
135
+ ]
136
+ tools: ta.Iterable[ChatCompletionRequestTool]
137
+ top_logprobs: int
138
+ top_p: float
139
+ user: str
140
+ web_search_options: ChatCompletionRequestWebSearchOptions
@@ -0,0 +1,90 @@
1
+ import typing as ta
2
+
3
+ from ..completionusage import CompletionUsage
4
+ from .tokenlogprob import ChatCompletionTokenLogprob
5
+
6
+
7
+ ##
8
+
9
+
10
+ class ChatCompletionResponseAnnotationUrlCitation(ta.TypedDict):
11
+ end_index: int
12
+ start_index: int
13
+ title: str
14
+ url: str
15
+
16
+
17
+ class ChatCompletionResponseAnnotation(ta.TypedDict):
18
+ type: ta.Literal['url_citation']
19
+ url_citation: ChatCompletionResponseAnnotationUrlCitation
20
+
21
+
22
+ #
23
+
24
+
25
+ class ChatCompletionResponseAudio(ta.TypedDict):
26
+ id: str
27
+ data: str
28
+ expires_at: int
29
+ transcript: str
30
+
31
+
32
+ #
33
+
34
+
35
+ class ChatCompletionResponseMessageToolCallFunction(ta.TypedDict):
36
+ arguments: str
37
+ name: str
38
+
39
+
40
+ class ChatCompletionResponseMessageToolCall(ta.TypedDict):
41
+ id: str
42
+ function: ChatCompletionResponseMessageToolCallFunction
43
+ type: ta.Literal['function']
44
+
45
+
46
+ class ChatCompletionResponseMessage(ta.TypedDict, total=False):
47
+ content: str
48
+ refusal: str
49
+ role: ta.Required[ta.Literal['assistant']]
50
+ annotations: ta.Sequence[ChatCompletionResponseAnnotation]
51
+ audio: ChatCompletionResponseAudio
52
+ tool_calls: ta.Sequence[ChatCompletionResponseMessageToolCall]
53
+
54
+
55
+ #
56
+
57
+
58
+ class ChatCompletionResponseChoiceLogprobs(ta.TypedDict, total=False):
59
+ content: ta.Sequence[ChatCompletionTokenLogprob]
60
+ refusal: ta.Sequence[ChatCompletionTokenLogprob]
61
+
62
+
63
+ class ChatCompletionResponseChoice(ta.TypedDict):
64
+ finish_reason: ta.Literal[
65
+ 'stop',
66
+ 'length',
67
+ 'tool_calls',
68
+ 'content_filter',
69
+ ]
70
+ index: int
71
+ logprobs: ta.NotRequired[ChatCompletionResponseChoiceLogprobs]
72
+ message: ChatCompletionResponseMessage
73
+
74
+
75
+ #
76
+
77
+
78
+ class ChatCompletionResponse(ta.TypedDict):
79
+ id: str
80
+ choices: ta.Sequence[ChatCompletionResponseChoice]
81
+ created: int
82
+ model: str
83
+ object: ta.Literal['chat.completion']
84
+ service_tier: ta.NotRequired[ta.Literal[
85
+ 'auto',
86
+ 'default',
87
+ 'flex',
88
+ ]]
89
+ system_fingerprint: ta.NotRequired[str]
90
+ usage: ta.NotRequired[CompletionUsage]
@@ -0,0 +1,41 @@
1
+ # ruff: noqa: UP007
2
+ import typing as ta
3
+
4
+
5
+ ##
6
+
7
+
8
+ class TextChatCompletionResponseFormat(ta.TypedDict):
9
+ type: ta.Literal['text']
10
+
11
+
12
+ #
13
+
14
+
15
+ class JsonSchemaChatCompletionResponseFormatJsonSchema(ta.TypedDict, total=False):
16
+ name: ta.Required[str]
17
+ description: str
18
+ schema: ta.Mapping[str, ta.Any]
19
+ strict: bool
20
+
21
+
22
+ class JsonSchemaChatCompletionResponseFormat(ta.TypedDict):
23
+ json_schema: JsonSchemaChatCompletionResponseFormatJsonSchema
24
+ type: ta.Literal['json_schema']
25
+
26
+
27
+ #
28
+
29
+
30
+ class JsonObjectChatCompletionResponseFormat(ta.TypedDict):
31
+ type: ta.Literal['json_object']
32
+
33
+
34
+ #
35
+
36
+
37
+ ChatCompletionResponseFormat: ta.TypeAlias = ta.Union[
38
+ TextChatCompletionResponseFormat,
39
+ JsonSchemaChatCompletionResponseFormat,
40
+ JsonObjectChatCompletionResponseFormat,
41
+ ]
@@ -0,0 +1,17 @@
1
+ import typing as ta
2
+
3
+
4
+ ##
5
+
6
+
7
+ class ChatCompletionTokenLogprobTopLogprob(ta.TypedDict):
8
+ token: str
9
+ bytes: ta.NotRequired[ta.Sequence[int]]
10
+ logprob: float
11
+
12
+
13
+ class ChatCompletionTokenLogprob(ta.TypedDict):
14
+ token: str
15
+ bytes: ta.NotRequired[ta.Sequence[int]]
16
+ logprob: float
17
+ top_logprobs: ta.Sequence[ChatCompletionTokenLogprobTopLogprob]
@@ -0,0 +1,24 @@
1
+ import typing as ta
2
+
3
+
4
+ ##
5
+
6
+
7
+ class CompletionUsageCompletionTokensDetails(ta.TypedDict, total=False):
8
+ accepted_prediction_tokens: int
9
+ audio_tokens: int
10
+ reasoning_tokens: int
11
+ rejected_prediction_tokens: int
12
+
13
+
14
+ class CompletionUsagePromptTokensDetails(ta.TypedDict, total=False):
15
+ audio_tokens: int
16
+ cached_tokens: int
17
+
18
+
19
+ class CompletionUsage(ta.TypedDict):
20
+ completion_tokens: int
21
+ prompt_tokens: int
22
+ total_tokens: int
23
+ completion_tokens_details: ta.NotRequired[CompletionUsageCompletionTokensDetails]
24
+ prompt_tokens_details: ta.NotRequired[CompletionUsagePromptTokensDetails]