hammad-python 0.0.30__tar.gz → 0.0.32__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 (289) hide show
  1. {hammad_python-0.0.30 → hammad_python-0.0.32}/PKG-INFO +6 -32
  2. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/collection.py +2 -6
  3. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/formatting/__init__.py +2 -8
  4. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/a2a/__init__.py +2 -4
  5. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/agent.py +1 -1
  6. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/graphs/_utils.py +89 -62
  7. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/graphs/base.py +20 -12
  8. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/pyproject.toml +1 -1
  9. hammad_python-0.0.32/docs/fonts/zed-mono-extended.ttf +0 -0
  10. hammad_python-0.0.32/docs/fonts/zed-sans-extended.ttf +0 -0
  11. hammad_python-0.0.32/docs/stylesheets/extras.css +526 -0
  12. hammad_python-0.0.32/docs/stylesheets/icon.svg +1 -0
  13. hammad_python-0.0.32/ham/__init__.py +200 -0
  14. hammad_python-0.0.32/ham/py.typed +0 -0
  15. hammad_python-0.0.32/libs/hammad-python-core/LICENSE +21 -0
  16. hammad_python-0.0.32/libs/hammad-python-core/README.md +1 -0
  17. hammad_python-0.0.32/libs/hammad-python-core/ham/__init__.py +1 -0
  18. hammad_python-0.0.32/libs/hammad-python-core/ham/core/__init__.py +134 -0
  19. hammad_python-0.0.32/libs/hammad-python-core/ham/core/_internal/__init__.py +40 -0
  20. hammad_python-0.0.32/libs/hammad-python-core/ham/core/_internal/_import_utils.py +265 -0
  21. hammad_python-0.0.32/libs/hammad-python-core/ham/core/_internal/_logging.py +204 -0
  22. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cache/__init__.py +3 -3
  23. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cache/base_cache.py +1 -1
  24. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cache/cache.py +1 -1
  25. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cache/decorators.py +1 -1
  26. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cache/file_cache.py +1 -1
  27. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cache/ttl_cache.py +1 -1
  28. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cli/__init__.py +10 -3
  29. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cli/animations.py +2 -2
  30. hammad_python-0.0.32/libs/hammad-python-core/ham/core/cli/logs.py +765 -0
  31. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cli/plugins.py +11 -1
  32. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cli/styles/__init__.py +3 -3
  33. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cli/styles/settings.py +1 -1
  34. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cli/styles/types.py +1 -1
  35. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/cli/styles/utils.py +1 -1
  36. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/__init__.py +37 -0
  37. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/json/__init__.py +27 -0
  38. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/json/converters.py +158 -0
  39. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/models/__init__.py +1 -0
  40. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/models/converters.py +1167 -0
  41. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/pydantic/__init__.py +42 -0
  42. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/pydantic/converters.py +762 -0
  43. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/text/__init__.py +63 -0
  44. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/text/converters.py +722 -0
  45. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/text/markdown.py +131 -0
  46. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/yaml/__init__.py +26 -0
  47. hammad_python-0.0.32/libs/hammad-python-core/ham/core/conversion/yaml/converters.py +5 -0
  48. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/logging/__init__.py +16 -5
  49. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/logging/decorators.py +1 -1
  50. {hammad_python-0.0.30/hammad → hammad_python-0.0.32/libs/hammad-python-core/ham/core}/logging/logger.py +194 -1
  51. hammad_python-0.0.32/libs/hammad-python-core/ham/core/models/__init__.py +55 -0
  52. hammad_python-0.0.32/libs/hammad-python-core/ham/core/models/fields.py +546 -0
  53. hammad_python-0.0.32/libs/hammad-python-core/ham/core/models/model.py +1078 -0
  54. hammad_python-0.0.32/libs/hammad-python-core/ham/core/models/utils.py +280 -0
  55. hammad_python-0.0.32/libs/hammad-python-core/ham/core/runtime/__init__.py +32 -0
  56. hammad_python-0.0.32/libs/hammad-python-core/ham/core/runtime/decorators.py +142 -0
  57. hammad_python-0.0.32/libs/hammad-python-core/ham/core/runtime/run.py +299 -0
  58. hammad_python-0.0.32/libs/hammad-python-core/ham/core/types/__init__.py +51 -0
  59. hammad_python-0.0.32/libs/hammad-python-core/ham/core/types/audio.py +200 -0
  60. hammad_python-0.0.32/libs/hammad-python-core/ham/core/types/configuration.py +529 -0
  61. hammad_python-0.0.32/libs/hammad-python-core/ham/core/types/file.py +431 -0
  62. hammad_python-0.0.32/libs/hammad-python-core/ham/core/types/image.py +182 -0
  63. hammad_python-0.0.32/libs/hammad-python-core/ham/core/types/jsonrpc.py +182 -0
  64. hammad_python-0.0.32/libs/hammad-python-core/ham/core/types/text.py +1308 -0
  65. hammad_python-0.0.32/libs/hammad-python-core/ham/core/typing/__init__.py +435 -0
  66. hammad_python-0.0.32/libs/hammad-python-core/pyproject.toml +25 -0
  67. hammad_python-0.0.32/libs/hammad-python-data/LICENSE +21 -0
  68. hammad_python-0.0.32/libs/hammad-python-data/README.md +1 -0
  69. hammad_python-0.0.32/libs/hammad-python-data/ham/__init__.py +1 -0
  70. hammad_python-0.0.32/libs/hammad-python-data/ham/data/__init__.py +54 -0
  71. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/__init__.py +53 -0
  72. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/collection.py +326 -0
  73. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/indexes/__init__.py +41 -0
  74. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/indexes/qdrant/__init__.py +1 -0
  75. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/indexes/qdrant/index.py +732 -0
  76. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/indexes/qdrant/settings.py +94 -0
  77. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/indexes/qdrant/utils.py +210 -0
  78. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/indexes/tantivy/__init__.py +1 -0
  79. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/indexes/tantivy/index.py +426 -0
  80. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/indexes/tantivy/settings.py +40 -0
  81. hammad_python-0.0.32/libs/hammad-python-data/ham/data/collections/indexes/tantivy/utils.py +180 -0
  82. hammad_python-0.0.32/libs/hammad-python-data/ham/data/sql/__init__.py +24 -0
  83. hammad_python-0.0.32/libs/hammad-python-data/ham/data/sql/database.py +576 -0
  84. hammad_python-0.0.32/libs/hammad-python-data/ham/data/sql/types.py +127 -0
  85. hammad_python-0.0.32/libs/hammad-python-data/pyproject.toml +19 -0
  86. hammad_python-0.0.32/libs/hammad-python-genai/LICENSE +21 -0
  87. hammad_python-0.0.32/libs/hammad-python-genai/README.md +1 -0
  88. hammad_python-0.0.32/libs/hammad-python-genai/ham/__init__.py +1 -0
  89. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/__init__.py +258 -0
  90. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/a2a/__init__.py +34 -0
  91. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/a2a/workers.py +552 -0
  92. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/__init__.py +63 -0
  93. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/agent.py +1977 -0
  94. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/run.py +1024 -0
  95. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/types/__init__.py +46 -0
  96. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/types/agent_context.py +13 -0
  97. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/types/agent_event.py +128 -0
  98. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/types/agent_hooks.py +220 -0
  99. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/types/agent_messages.py +31 -0
  100. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/types/agent_response.py +129 -0
  101. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/agents/types/agent_stream.py +327 -0
  102. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/graphs/__init__.py +133 -0
  103. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/graphs/_utils.py +217 -0
  104. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/graphs/base.py +1840 -0
  105. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/graphs/plugins.py +319 -0
  106. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/graphs/types.py +642 -0
  107. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/__init__.py +26 -0
  108. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/embeddings/__init__.py +47 -0
  109. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/embeddings/model.py +230 -0
  110. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/embeddings/run.py +163 -0
  111. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/embeddings/types/__init__.py +41 -0
  112. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/embeddings/types/embedding_model_name.py +75 -0
  113. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/embeddings/types/embedding_model_response.py +76 -0
  114. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/embeddings/types/embedding_model_run_params.py +66 -0
  115. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/embeddings/types/embedding_model_settings.py +47 -0
  116. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/__init__.py +60 -0
  117. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/model.py +1106 -0
  118. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/run.py +878 -0
  119. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/types/__init__.py +44 -0
  120. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/types/language_model_instructor_mode.py +47 -0
  121. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/types/language_model_messages.py +28 -0
  122. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/types/language_model_name.py +302 -0
  123. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/types/language_model_request.py +127 -0
  124. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/types/language_model_response.py +221 -0
  125. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/types/language_model_response_chunk.py +56 -0
  126. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/types/language_model_settings.py +89 -0
  127. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/types/language_model_stream.py +599 -0
  128. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/utils/__init__.py +44 -0
  129. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/utils/requests.py +428 -0
  130. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/language/utils/structured_outputs.py +143 -0
  131. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/model_provider.py +4 -0
  132. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/multimodal.py +51 -0
  133. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/models/reranking.py +30 -0
  134. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/prompted/__init__.py +59 -0
  135. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/prompted/core.py +1328 -0
  136. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/prompted/selection.py +207 -0
  137. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/prompted/tools.py +88 -0
  138. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/types/__init__.py +22 -0
  139. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/types/base.py +215 -0
  140. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/types/history.py +290 -0
  141. hammad_python-0.0.32/libs/hammad-python-genai/ham/genai/types/tools.py +514 -0
  142. hammad_python-0.0.32/libs/hammad-python-genai/pyproject.toml +23 -0
  143. hammad_python-0.0.32/libs/hammad-python-http/LICENSE +21 -0
  144. hammad_python-0.0.32/libs/hammad-python-http/README.md +1 -0
  145. hammad_python-0.0.32/libs/hammad-python-http/ham/__init__.py +1 -0
  146. hammad_python-0.0.32/libs/hammad-python-http/ham/http/__init__.py +111 -0
  147. hammad_python-0.0.32/libs/hammad-python-http/ham/http/clients/__init__.py +35 -0
  148. hammad_python-0.0.32/libs/hammad-python-http/ham/http/clients/client.py +375 -0
  149. hammad_python-0.0.32/libs/hammad-python-http/ham/http/clients/http_client.py +944 -0
  150. hammad_python-0.0.32/libs/hammad-python-http/ham/http/clients/openapi_client.py +740 -0
  151. hammad_python-0.0.32/libs/hammad-python-http/ham/http/core.py +157 -0
  152. hammad_python-0.0.32/libs/hammad-python-http/ham/http/mcp/__init__.py +62 -0
  153. hammad_python-0.0.32/libs/hammad-python-http/ham/http/mcp/client/__init__.py +39 -0
  154. hammad_python-0.0.32/libs/hammad-python-http/ham/http/mcp/client/client.py +618 -0
  155. hammad_python-0.0.32/libs/hammad-python-http/ham/http/mcp/client/client_service.py +392 -0
  156. hammad_python-0.0.32/libs/hammad-python-http/ham/http/mcp/client/settings.py +178 -0
  157. hammad_python-0.0.32/libs/hammad-python-http/ham/http/mcp/servers/__init__.py +30 -0
  158. hammad_python-0.0.32/libs/hammad-python-http/ham/http/mcp/servers/launcher.py +1165 -0
  159. hammad_python-0.0.32/libs/hammad-python-http/ham/http/models.py +275 -0
  160. hammad_python-0.0.32/libs/hammad-python-http/ham/http/search/__init__.py +1 -0
  161. hammad_python-0.0.32/libs/hammad-python-http/ham/http/search/client.py +1023 -0
  162. hammad_python-0.0.32/libs/hammad-python-http/ham/http/server.py +399 -0
  163. hammad_python-0.0.32/libs/hammad-python-http/ham/http/service/__init__.py +53 -0
  164. hammad_python-0.0.32/libs/hammad-python-http/ham/http/service/create.py +539 -0
  165. hammad_python-0.0.32/libs/hammad-python-http/ham/http/service/decorators.py +296 -0
  166. hammad_python-0.0.32/libs/hammad-python-http/ham/http/utils.py +472 -0
  167. hammad_python-0.0.32/libs/hammad-python-http/pyproject.toml +24 -0
  168. hammad_python-0.0.32/pyproject.toml +50 -0
  169. hammad_python-0.0.32/scripts/deps.sh +114 -0
  170. hammad_python-0.0.32/scripts/publish.sh +119 -0
  171. hammad_python-0.0.32/tests/core/test_core_cache.py +75 -0
  172. hammad_python-0.0.32/tests/core/test_core_conversion.py +312 -0
  173. hammad_python-0.0.32/tests/core/test_core_internal_utils.py +26 -0
  174. hammad_python-0.0.32/tests/test_top_level_debug_tags.py +26 -0
  175. hammad_python-0.0.32/uv.lock +3370 -0
  176. {hammad_python-0.0.30 → hammad_python-0.0.32}/.gitignore +0 -0
  177. {hammad_python-0.0.30 → hammad_python-0.0.32}/LICENSE +0 -0
  178. {hammad_python-0.0.30 → hammad_python-0.0.32}/README.md +0 -0
  179. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/__init__.py +0 -0
  180. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/_internal.py +0 -0
  181. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/_main.py +0 -0
  182. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/__init__.py +0 -0
  183. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/__init__.py +0 -0
  184. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/indexes/__init__.py +0 -0
  185. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/indexes/qdrant/__init__.py +0 -0
  186. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/indexes/qdrant/index.py +0 -0
  187. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/indexes/qdrant/settings.py +0 -0
  188. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/indexes/qdrant/utils.py +0 -0
  189. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/indexes/tantivy/__init__.py +0 -0
  190. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/indexes/tantivy/index.py +0 -0
  191. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/indexes/tantivy/settings.py +0 -0
  192. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/collections/indexes/tantivy/utils.py +0 -0
  193. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/configurations/__init__.py +0 -0
  194. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/configurations/configuration.py +0 -0
  195. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/models/__init__.py +0 -0
  196. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/models/extensions/__init__.py +0 -0
  197. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/models/extensions/pydantic/__init__.py +0 -0
  198. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/models/extensions/pydantic/converters.py +0 -0
  199. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/models/fields.py +0 -0
  200. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/models/model.py +0 -0
  201. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/models/utils.py +0 -0
  202. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/sql/__init__.py +0 -0
  203. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/sql/database.py +0 -0
  204. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/sql/types.py +0 -0
  205. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/types/__init__.py +0 -0
  206. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/types/file.py +0 -0
  207. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/types/multimodal/__init__.py +0 -0
  208. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/types/multimodal/audio.py +0 -0
  209. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/types/multimodal/image.py +0 -0
  210. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/data/types/text.py +0 -0
  211. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/formatting/json/__init__.py +0 -0
  212. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/formatting/json/converters.py +0 -0
  213. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/formatting/text/__init__.py +0 -0
  214. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/formatting/text/converters.py +0 -0
  215. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/formatting/text/markdown.py +0 -0
  216. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/formatting/yaml/__init__.py +0 -0
  217. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/formatting/yaml/converters.py +0 -0
  218. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/__init__.py +0 -0
  219. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/a2a/workers.py +0 -0
  220. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/__init__.py +0 -0
  221. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/run.py +0 -0
  222. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/types/__init__.py +0 -0
  223. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/types/agent_context.py +0 -0
  224. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/types/agent_event.py +0 -0
  225. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/types/agent_hooks.py +0 -0
  226. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/types/agent_messages.py +0 -0
  227. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/types/agent_response.py +0 -0
  228. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/agents/types/agent_stream.py +0 -0
  229. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/graphs/__init__.py +0 -0
  230. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/graphs/plugins.py +0 -0
  231. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/graphs/types.py +0 -0
  232. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/__init__.py +0 -0
  233. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/embeddings/__init__.py +0 -0
  234. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/embeddings/model.py +0 -0
  235. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/embeddings/run.py +0 -0
  236. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/embeddings/types/__init__.py +0 -0
  237. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/embeddings/types/embedding_model_name.py +0 -0
  238. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/embeddings/types/embedding_model_response.py +0 -0
  239. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/embeddings/types/embedding_model_run_params.py +0 -0
  240. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/embeddings/types/embedding_model_settings.py +0 -0
  241. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/__init__.py +0 -0
  242. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/model.py +0 -0
  243. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/run.py +0 -0
  244. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/types/__init__.py +0 -0
  245. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/types/language_model_instructor_mode.py +0 -0
  246. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/types/language_model_messages.py +0 -0
  247. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/types/language_model_name.py +0 -0
  248. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/types/language_model_request.py +0 -0
  249. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/types/language_model_response.py +0 -0
  250. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/types/language_model_response_chunk.py +0 -0
  251. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/types/language_model_settings.py +0 -0
  252. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/types/language_model_stream.py +0 -0
  253. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/utils/__init__.py +0 -0
  254. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/utils/requests.py +0 -0
  255. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/language/utils/structured_outputs.py +0 -0
  256. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/model_provider.py +0 -0
  257. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/multimodal.py +0 -0
  258. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/models/reranking.py +0 -0
  259. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/types/__init__.py +0 -0
  260. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/types/base.py +0 -0
  261. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/types/history.py +0 -0
  262. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/genai/types/tools.py +0 -0
  263. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/mcp/__init__.py +0 -0
  264. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/mcp/client/__init__.py +0 -0
  265. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/mcp/client/client.py +0 -0
  266. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/mcp/client/client_service.py +0 -0
  267. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/mcp/client/settings.py +0 -0
  268. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/mcp/servers/__init__.py +0 -0
  269. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/mcp/servers/launcher.py +0 -0
  270. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/py.typed +0 -0
  271. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/runtime/__init__.py +0 -0
  272. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/runtime/decorators.py +0 -0
  273. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/runtime/run.py +0 -0
  274. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/service/__init__.py +0 -0
  275. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/service/create.py +0 -0
  276. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/service/decorators.py +0 -0
  277. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/types.py +0 -0
  278. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/typing/__init__.py +0 -0
  279. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/web/__init__.py +0 -0
  280. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/web/http/__init__.py +0 -0
  281. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/web/http/client.py +0 -0
  282. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/web/models.py +0 -0
  283. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/web/openapi/__init__.py +0 -0
  284. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/web/openapi/client.py +0 -0
  285. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/web/search/__init__.py +0 -0
  286. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/web/search/client.py +0 -0
  287. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/hammad/web/utils.py +0 -0
  288. {hammad_python-0.0.30 → hammad_python-0.0.32/deprecated}/uv.lock +0 -0
  289. {hammad_python-0.0.30 → hammad_python-0.0.32}/mkdocs.yml +0 -0
@@ -1,6 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hammad-python
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
+ Summary: Personal Python utilities and tools
4
5
  Author-email: Hammad Saeed <hammadaidev@gmail.com>
5
6
  License: MIT License
6
7
 
@@ -25,37 +26,10 @@ License: MIT License
25
26
  SOFTWARE.
26
27
  License-File: LICENSE
27
28
  Requires-Python: >=3.11
28
- Requires-Dist: ddgs>=9.0.0
29
- Requires-Dist: fasta2a>=0.5.0
30
- Requires-Dist: httpx>=0.28.1
31
- Requires-Dist: msgspec>=0.19.0
32
- Requires-Dist: nest-asyncio>=1.6.0
33
- Requires-Dist: pydantic>=2.11.7
34
- Requires-Dist: rich>=14.0.0
35
- Requires-Dist: selectolax>=0.3.31
36
- Requires-Dist: sqlalchemy>=2.0.41
37
- Requires-Dist: tantivy>=0.24.0
38
- Requires-Dist: tenacity>=8.2.3
39
- Requires-Dist: typing-inspect>=0.9.0
40
- Provides-Extra: ai
41
- Requires-Dist: instructor>=1.9.0; extra == 'ai'
42
- Requires-Dist: litellm>=1.73.6; extra == 'ai'
43
- Requires-Dist: qdrant-client>=1.14.3; extra == 'ai'
44
- Provides-Extra: genai
45
- Requires-Dist: fastapi>=0.115.6; extra == 'genai'
46
- Requires-Dist: instructor>=1.9.0; extra == 'genai'
47
- Requires-Dist: litellm>=1.73.6; extra == 'genai'
48
- Requires-Dist: mcp>=1.10.1; extra == 'genai'
49
- Requires-Dist: pydantic-graph>=0.4.2; extra == 'genai'
50
- Requires-Dist: qdrant-client>=1.14.3; extra == 'genai'
51
- Requires-Dist: uvicorn>=0.34.0; extra == 'genai'
52
- Provides-Extra: graph
53
- Requires-Dist: pydantic-graph>=0.4.2; extra == 'graph'
54
- Provides-Extra: mcp
55
- Requires-Dist: mcp>=1.10.1; extra == 'mcp'
56
- Provides-Extra: serve
57
- Requires-Dist: fastapi>=0.115.6; extra == 'serve'
58
- Requires-Dist: uvicorn>=0.34.0; extra == 'serve'
29
+ Requires-Dist: hammad-python-core>=0.0.2
30
+ Requires-Dist: hammad-python-data>=0.0.2
31
+ Requires-Dist: hammad-python-genai>=0.0.2
32
+ Requires-Dist: hammad-python-http>=0.0.2
59
33
  Description-Content-Type: text/markdown
60
34
 
61
35
  ## hammad-python
@@ -226,9 +226,7 @@ def create_collection(
226
226
  distance_metric: "DistanceMetric" = "dot",
227
227
  settings: Optional["QdrantCollectionIndexSettings"] = None,
228
228
  query_settings: Optional["QdrantCollectionIndexQuerySettings"] = None,
229
- embedding_model: Optional[
230
- "EmbeddingModelName"
231
- ] = "openai/text-embedding-3-small",
229
+ embedding_model: Optional["EmbeddingModelName"] = "openai/text-embedding-3-small",
232
230
  embedding_dimensions: Optional[int] = None,
233
231
  embedding_api_key: Optional[str] = None,
234
232
  embedding_base_url: Optional[str] = None,
@@ -260,9 +258,7 @@ def create_collection(
260
258
  ] = None,
261
259
  # Vector/Qdrant-specific parameters
262
260
  distance_metric: "DistanceMetric" = "dot",
263
- embedding_model: Optional[
264
- "EmbeddingModelName"
265
- ] = "openai/text-embedding-3-small",
261
+ embedding_model: Optional["EmbeddingModelName"] = "openai/text-embedding-3-small",
266
262
  embedding_dimensions: Optional[int] = None,
267
263
  embedding_api_key: Optional[str] = None,
268
264
  embedding_base_url: Optional[str] = None,
@@ -5,15 +5,9 @@ from .._internal import create_getattr_importer
5
5
 
6
6
  if TYPE_CHECKING:
7
7
  from . import json
8
- from .json import (
9
- convert_to_json_schema
10
- )
8
+ from .json import convert_to_json_schema
11
9
  from . import text
12
- from .text import (
13
- convert_to_text,
14
- convert_type_to_text,
15
- convert_docstring_to_text
16
- )
10
+ from .text import convert_to_text, convert_type_to_text, convert_docstring_to_text
17
11
  from . import yaml
18
12
 
19
13
  __all__ = (
@@ -5,9 +5,7 @@ from ..._internal import create_getattr_importer
5
5
 
6
6
 
7
7
  if TYPE_CHECKING:
8
- from fasta2a import (
9
- FastA2A
10
- )
8
+ from fasta2a import FastA2A
11
9
  from .workers import (
12
10
  as_a2a_app,
13
11
  GraphWorker,
@@ -29,4 +27,4 @@ __getattr__ = create_getattr_importer(__all__)
29
27
 
30
28
 
31
29
  def __dir__() -> list[str]:
32
- return list(__all__)
30
+ return list(__all__)
@@ -226,7 +226,7 @@ class Agent(BaseGenAIModel, Generic[T]):
226
226
  and maintain context across multiple conversation steps.
227
227
  """
228
228
 
229
- model: LanguageModelName | str = "openai/gpt-4o-mini"
229
+ model: LanguageModelName = "openai/gpt-4o-mini"
230
230
  """The language model to use for the agent."""
231
231
 
232
232
  name: str = "agent"
@@ -1,4 +1,3 @@
1
-
2
1
  from typing import TYPE_CHECKING
3
2
 
4
3
  if TYPE_CHECKING:
@@ -9,31 +8,39 @@ def visualize_base_graph(graph: "BaseGraph", filename: str) -> None:
9
8
  """Generate a visualization of the graph with clean, readable flow."""
10
9
  if not graph._action_nodes or not graph._start_action_name:
11
10
  raise ValueError("No actions defined in graph")
12
-
11
+
13
12
  # Build our own mermaid code for better control over layout
14
13
  mermaid_lines = ["graph TD"] # Top-Down layout
15
-
14
+
16
15
  # Track which nodes we've already added
17
16
  added_nodes = set()
18
-
17
+
19
18
  # Style definitions
20
19
  mermaid_lines.append(" %% Styles")
21
- mermaid_lines.append(" classDef startNode fill:#4CAF50,stroke:#333,stroke-width:2px,color:#fff")
22
- mermaid_lines.append(" classDef endNode fill:#f44336,stroke:#333,stroke-width:2px,color:#fff")
23
- mermaid_lines.append(" classDef defaultNode fill:#2196F3,stroke:#333,stroke-width:2px,color:#fff")
20
+ mermaid_lines.append(
21
+ " classDef startNode fill:#4CAF50,stroke:#333,stroke-width:2px,color:#fff"
22
+ )
23
+ mermaid_lines.append(
24
+ " classDef endNode fill:#f44336,stroke:#333,stroke-width:2px,color:#fff"
25
+ )
26
+ mermaid_lines.append(
27
+ " classDef defaultNode fill:#2196F3,stroke:#333,stroke-width:2px,color:#fff"
28
+ )
24
29
  mermaid_lines.append("")
25
-
30
+
26
31
  # Helper to get clean node ID
27
32
  def get_node_id(action_name: str) -> str:
28
33
  return action_name.replace(" ", "_").replace("-", "_")
29
-
34
+
30
35
  # Helper to add a node if not already added
31
- def add_node(action_name: str, is_start: bool = False, is_end: bool = False) -> None:
36
+ def add_node(
37
+ action_name: str, is_start: bool = False, is_end: bool = False
38
+ ) -> None:
32
39
  if action_name not in added_nodes:
33
40
  node_id = get_node_id(action_name)
34
41
  # Use the action name as the display label
35
42
  display_name = action_name
36
-
43
+
37
44
  if is_start:
38
45
  mermaid_lines.append(f" {node_id}[{display_name}]:::startNode")
39
46
  elif is_end:
@@ -41,32 +48,32 @@ def visualize_base_graph(graph: "BaseGraph", filename: str) -> None:
41
48
  else:
42
49
  mermaid_lines.append(f" {node_id}[{display_name}]:::defaultNode")
43
50
  added_nodes.add(action_name)
44
-
51
+
45
52
  # Add all nodes and connections
46
53
  mermaid_lines.append(" %% Nodes and connections")
47
-
54
+
48
55
  # Start with the start node
49
56
  add_node(graph._start_action_name, is_start=True)
50
-
57
+
51
58
  # Process all actions to find connections
52
59
  for action_name in graph._action_nodes:
53
60
  action_func = getattr(graph, action_name, None)
54
- if action_func and hasattr(action_func, '_action_settings'):
61
+ if action_func and hasattr(action_func, "_action_settings"):
55
62
  settings = action_func._action_settings
56
-
63
+
57
64
  # Add the node
58
65
  add_node(action_name, is_end=settings.terminates)
59
-
66
+
60
67
  # Add connections based on 'next' settings
61
68
  if settings.next:
62
69
  source_id = get_node_id(action_name)
63
-
70
+
64
71
  if isinstance(settings.next, str):
65
72
  # Simple string case
66
73
  target_id = get_node_id(settings.next)
67
74
  add_node(settings.next)
68
75
  mermaid_lines.append(f" {source_id} --> {target_id}")
69
-
76
+
70
77
  elif isinstance(settings.next, list):
71
78
  # List case - branches to multiple nodes
72
79
  for next_action in settings.next:
@@ -74,14 +81,19 @@ def visualize_base_graph(graph: "BaseGraph", filename: str) -> None:
74
81
  target_id = get_node_id(next_action)
75
82
  add_node(next_action)
76
83
  mermaid_lines.append(f" {source_id} --> {target_id}")
77
-
78
- elif hasattr(settings.next, '__class__') and settings.next.__class__.__name__ == 'SelectionStrategy':
84
+
85
+ elif (
86
+ hasattr(settings.next, "__class__")
87
+ and settings.next.__class__.__name__ == "SelectionStrategy"
88
+ ):
79
89
  # SelectionStrategy case
80
90
  if settings.next.actions:
81
91
  # Show all possible paths with a decision diamond
82
92
  decision_id = f"{source_id}_decision"
83
- mermaid_lines.append(f" {source_id} --> {decision_id}{{LLM Selection}}")
84
-
93
+ mermaid_lines.append(
94
+ f" {source_id} --> {decision_id}{{LLM Selection}}"
95
+ )
96
+
85
97
  for next_action in settings.next.actions:
86
98
  target_id = get_node_id(next_action)
87
99
  add_node(next_action)
@@ -90,101 +102,116 @@ def visualize_base_graph(graph: "BaseGraph", filename: str) -> None:
90
102
  # If no specific actions, it can go to any node
91
103
  # For visualization, show connections to all non-start nodes
92
104
  decision_id = f"{source_id}_decision"
93
- mermaid_lines.append(f" {source_id} --> {decision_id}{{LLM Selection}}")
94
-
105
+ mermaid_lines.append(
106
+ f" {source_id} --> {decision_id}{{LLM Selection}}"
107
+ )
108
+
95
109
  for other_action in graph._action_nodes:
96
- if other_action != action_name and other_action != graph._start_action_name:
110
+ if (
111
+ other_action != action_name
112
+ and other_action != graph._start_action_name
113
+ ):
97
114
  target_id = get_node_id(other_action)
98
115
  add_node(other_action)
99
- mermaid_lines.append(f" {decision_id} -.-> {target_id}")
100
-
116
+ mermaid_lines.append(
117
+ f" {decision_id} -.-> {target_id}"
118
+ )
119
+
101
120
  # If start node has no explicit next, but there are other nodes, show possible connections
102
121
  start_func = getattr(graph, graph._start_action_name, None)
103
- if start_func and hasattr(start_func, '_action_settings'):
122
+ if start_func and hasattr(start_func, "_action_settings"):
104
123
  if not start_func._action_settings.next and len(graph._action_nodes) > 1:
105
124
  source_id = get_node_id(graph._start_action_name)
106
125
  # Find end nodes (terminates=True) to connect to
107
126
  for action_name in graph._action_nodes:
108
127
  if action_name != graph._start_action_name:
109
128
  action_func = getattr(graph, action_name, None)
110
- if action_func and hasattr(action_func, '_action_settings'):
129
+ if action_func and hasattr(action_func, "_action_settings"):
111
130
  if action_func._action_settings.terminates:
112
131
  target_id = get_node_id(action_name)
113
132
  add_node(action_name, is_end=True)
114
133
  mermaid_lines.append(f" {source_id} --> {target_id}")
115
-
134
+
116
135
  # Join all lines
117
136
  mermaid_code = "\n".join(mermaid_lines)
118
-
137
+
119
138
  # Render the mermaid diagram and save it
120
139
  try:
121
140
  import subprocess
122
141
  import tempfile
123
142
  import os
124
143
  import shutil
125
-
144
+
126
145
  # Check if mmdc (mermaid CLI) is available
127
- if shutil.which('mmdc') is None:
128
- raise FileNotFoundError("mermaid-cli (mmdc) not found. Install with: npm install -g @mermaid-js/mermaid-cli")
129
-
146
+ if shutil.which("mmdc") is None:
147
+ raise FileNotFoundError(
148
+ "mermaid-cli (mmdc) not found. Install with: npm install -g @mermaid-js/mermaid-cli"
149
+ )
150
+
130
151
  # Create a temporary mermaid file
131
- with tempfile.NamedTemporaryFile(mode='w', suffix='.mmd', delete=False) as temp_file:
152
+ with tempfile.NamedTemporaryFile(
153
+ mode="w", suffix=".mmd", delete=False
154
+ ) as temp_file:
132
155
  temp_file.write(mermaid_code)
133
156
  temp_mmd_path = temp_file.name
134
-
157
+
135
158
  try:
136
159
  # Determine output format from filename extension
137
- output_format = 'png' # default
138
- if filename.lower().endswith('.svg'):
139
- output_format = 'svg'
140
- elif filename.lower().endswith('.pdf'):
141
- output_format = 'pdf'
142
-
160
+ output_format = "png" # default
161
+ if filename.lower().endswith(".svg"):
162
+ output_format = "svg"
163
+ elif filename.lower().endswith(".pdf"):
164
+ output_format = "pdf"
165
+
143
166
  # Use mermaid CLI to render the diagram
144
- cmd = ['mmdc', '-i', temp_mmd_path, '-o', filename]
145
-
167
+ cmd = ["mmdc", "-i", temp_mmd_path, "-o", filename]
168
+
146
169
  # Add format flag only if not PNG (PNG is default)
147
- if output_format != 'png':
148
- cmd.extend(['-f', output_format])
149
-
170
+ if output_format != "png":
171
+ cmd.extend(["-f", output_format])
172
+
150
173
  # Add theme and background color
151
- cmd.extend(['-t', 'default', '-b', 'transparent'])
152
-
174
+ cmd.extend(["-t", "default", "-b", "transparent"])
175
+
153
176
  result = subprocess.run(cmd, capture_output=True, text=True, check=True)
154
-
177
+
155
178
  if result.returncode == 0:
156
179
  print(f"Graph visualization saved to: {filename}")
157
180
  else:
158
- raise subprocess.CalledProcessError(result.returncode, result.args, result.stderr)
159
-
181
+ raise subprocess.CalledProcessError(
182
+ result.returncode, result.args, result.stderr
183
+ )
184
+
160
185
  finally:
161
186
  # Clean up temporary file
162
187
  if os.path.exists(temp_mmd_path):
163
188
  os.unlink(temp_mmd_path)
164
-
189
+
165
190
  except FileNotFoundError as e:
166
191
  # Provide helpful error message for missing mermaid CLI
167
192
  print(f"Warning: {e}")
168
193
  # Save as .mmd file instead
169
- mmd_filename = filename.rsplit('.', 1)[0] + '.mmd'
194
+ mmd_filename = filename.rsplit(".", 1)[0] + ".mmd"
170
195
  with open(mmd_filename, "w") as f:
171
196
  f.write(mermaid_code)
172
197
  print(f"Mermaid code saved to: {mmd_filename}")
173
- print("To render as PNG, install mermaid-cli: npm install -g @mermaid-js/mermaid-cli")
174
-
198
+ print(
199
+ "To render as PNG, install mermaid-cli: npm install -g @mermaid-js/mermaid-cli"
200
+ )
201
+
175
202
  except subprocess.CalledProcessError as e:
176
203
  # Handle mermaid CLI errors
177
204
  print(f"Error rendering mermaid diagram: {e.stderr if e.stderr else str(e)}")
178
205
  # Save as .mmd file as fallback
179
- mmd_filename = filename.rsplit('.', 1)[0] + '.mmd'
206
+ mmd_filename = filename.rsplit(".", 1)[0] + ".mmd"
180
207
  with open(mmd_filename, "w") as f:
181
208
  f.write(mermaid_code)
182
209
  print(f"Mermaid code saved to: {mmd_filename} (rendering failed)")
183
-
210
+
184
211
  except Exception as e:
185
212
  # General fallback: save the mermaid code
186
213
  print(f"Unexpected error: {e}")
187
- mmd_filename = filename.rsplit('.', 1)[0] + '.mmd'
214
+ mmd_filename = filename.rsplit(".", 1)[0] + ".mmd"
188
215
  with open(mmd_filename, "w") as f:
189
216
  f.write(mermaid_code)
190
- print(f"Mermaid code saved to: {mmd_filename}")
217
+ print(f"Mermaid code saved to: {mmd_filename}")
@@ -826,13 +826,21 @@ class ActionDecorator:
826
826
 
827
827
  def decorator(f: Callable) -> Callable:
828
828
  action_name = name or f.__name__
829
-
829
+
830
830
  # Check if action name is reserved
831
831
  reserved_names = {
832
- 'run', 'async_run', 'iter', 'async_iter',
833
- 'visualize', 'builder', 'as_a2a',
834
- '_initialize', '_collect_state_class', '_collect_actions',
835
- '_create_pydantic_graph', '_get_start_action_signature'
832
+ "run",
833
+ "async_run",
834
+ "iter",
835
+ "async_iter",
836
+ "visualize",
837
+ "builder",
838
+ "as_a2a",
839
+ "_initialize",
840
+ "_collect_state_class",
841
+ "_collect_actions",
842
+ "_create_pydantic_graph",
843
+ "_get_start_action_signature",
836
844
  }
837
845
  if action_name in reserved_names:
838
846
  raise ValueError(
@@ -840,10 +848,10 @@ class ActionDecorator:
840
848
  f"Reserved names include: {', '.join(sorted(reserved_names))}. "
841
849
  "Please choose a different name for your action."
842
850
  )
843
-
851
+
844
852
  # Check that the action has at least one parameter besides 'self'
845
853
  sig = inspect.signature(f)
846
- params = [p for p in sig.parameters if p != 'self']
854
+ params = [p for p in sig.parameters if p != "self"]
847
855
  if not params:
848
856
  raise ValueError(
849
857
  f"Action '{action_name}' must have at least one parameter besides 'self'. "
@@ -1184,7 +1192,7 @@ class BaseGraph(Generic[StateT, T]):
1184
1192
  # Merge global settings with provided kwargs
1185
1193
  merged_settings = self._global_settings.copy()
1186
1194
  merged_settings.update(language_model_kwargs)
1187
-
1195
+
1188
1196
  # Include the global model if it's set and not overridden
1189
1197
  if self._global_model and "model" not in merged_settings:
1190
1198
  merged_settings["model"] = self._global_model
@@ -1357,7 +1365,7 @@ class BaseGraph(Generic[StateT, T]):
1357
1365
  # Merge global settings with provided kwargs
1358
1366
  merged_settings = self._global_settings.copy()
1359
1367
  merged_settings.update(language_model_kwargs)
1360
-
1368
+
1361
1369
  # Include the global model if it's set and not overridden
1362
1370
  if self._global_model and "model" not in merged_settings:
1363
1371
  merged_settings["model"] = self._global_model
@@ -1498,7 +1506,7 @@ class BaseGraph(Generic[StateT, T]):
1498
1506
  # Merge global settings with provided kwargs
1499
1507
  merged_settings = self._global_settings.copy()
1500
1508
  merged_settings.update(language_model_kwargs)
1501
-
1509
+
1502
1510
  # Include the global model if it's set and not overridden
1503
1511
  if self._global_model and "model" not in merged_settings:
1504
1512
  merged_settings["model"] = self._global_model
@@ -1670,7 +1678,7 @@ class BaseGraph(Generic[StateT, T]):
1670
1678
  # Merge global settings with provided kwargs
1671
1679
  merged_settings = self._global_settings.copy()
1672
1680
  merged_settings.update(language_model_kwargs)
1673
-
1681
+
1674
1682
  # Include the global model if it's set and not overridden
1675
1683
  if self._global_model and "model" not in merged_settings:
1676
1684
  merged_settings["model"] = self._global_model
@@ -1825,4 +1833,4 @@ class BaseGraph(Generic[StateT, T]):
1825
1833
  None
1826
1834
 
1827
1835
  """
1828
- visualize_base_graph(self, filename)
1836
+ visualize_base_graph(self, filename)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hammad-python"
3
- version = "0.0.30"
3
+ version = "0.0.29"
4
4
  license = {file = "LICENSE"}
5
5
  readme = "README.md"
6
6
  authors = [{name = "Hammad Saeed", email = "hammadaidev@gmail.com"}]