hammad-python 0.0.29__tar.gz → 0.0.31__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.
- {hammad_python-0.0.29 → hammad_python-0.0.31}/.gitignore +2 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31}/PKG-INFO +6 -32
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/collection.py +2 -6
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/formatting/__init__.py +2 -8
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/a2a/__init__.py +2 -4
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/graphs/_utils.py +89 -62
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/graphs/base.py +20 -12
- hammad_python-0.0.31/docs/fonts/zed-mono-extended.ttf +0 -0
- hammad_python-0.0.31/docs/fonts/zed-sans-extended.ttf +0 -0
- hammad_python-0.0.31/docs/stylesheets/extras.css +526 -0
- hammad_python-0.0.31/docs/stylesheets/icon.svg +1 -0
- hammad_python-0.0.31/ham/__init__.py +10 -0
- hammad_python-0.0.31/ham/py.typed +0 -0
- hammad_python-0.0.31/libs/hammad-python-core/LICENSE +21 -0
- hammad_python-0.0.31/libs/hammad-python-core/README.md +1 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/__init__.py +1 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/__init__.py +132 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/_internal/__init__.py +40 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/_internal/_import_utils.py +250 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/_internal/_logging.py +204 -0
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cache/__init__.py +3 -3
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cache/base_cache.py +1 -1
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cache/cache.py +1 -1
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cache/decorators.py +1 -1
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cache/file_cache.py +1 -1
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cache/ttl_cache.py +1 -1
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cli/__init__.py +10 -3
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cli/animations.py +2 -2
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/cli/logs.py +765 -0
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cli/plugins.py +11 -1
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cli/styles/__init__.py +3 -3
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cli/styles/settings.py +1 -1
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cli/styles/types.py +1 -1
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/cli/styles/utils.py +1 -1
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/__init__.py +33 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/json/__init__.py +27 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/json/converters.py +158 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/models/__init__.py +1 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/models/converters.py +1167 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/text/__init__.py +63 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/text/converters.py +722 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/text/markdown.py +131 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/yaml/__init__.py +26 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/conversion/yaml/converters.py +5 -0
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/logging/__init__.py +16 -5
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/logging/decorators.py +1 -1
- {hammad_python-0.0.29/hammad → hammad_python-0.0.31/libs/hammad-python-core/ham/core}/logging/logger.py +194 -1
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/models/__init__.py +55 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/models/fields.py +546 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/models/model.py +1078 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/models/utils.py +280 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/runtime/__init__.py +32 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/runtime/decorators.py +142 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/runtime/run.py +299 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/types/__init__.py +51 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/types/audio.py +200 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/types/configuration.py +529 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/types/file.py +431 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/types/image.py +182 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/types/jsonrpc.py +182 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/types/text.py +1308 -0
- hammad_python-0.0.31/libs/hammad-python-core/ham/core/typing/__init__.py +435 -0
- hammad_python-0.0.31/libs/hammad-python-core/pyproject.toml +25 -0
- hammad_python-0.0.31/libs/hammad-python-data/LICENSE +21 -0
- hammad_python-0.0.31/libs/hammad-python-data/README.md +1 -0
- hammad_python-0.0.31/libs/hammad-python-data/ham/__init__.py +1 -0
- hammad_python-0.0.31/libs/hammad-python-data/pyproject.toml +17 -0
- hammad_python-0.0.31/libs/hammad-python-genai/LICENSE +21 -0
- hammad_python-0.0.31/libs/hammad-python-genai/README.md +1 -0
- hammad_python-0.0.31/libs/hammad-python-genai/ham/__init__.py +1 -0
- hammad_python-0.0.31/libs/hammad-python-genai/pyproject.toml +17 -0
- hammad_python-0.0.31/libs/hammad-python-http/LICENSE +21 -0
- hammad_python-0.0.31/libs/hammad-python-http/README.md +1 -0
- hammad_python-0.0.31/libs/hammad-python-http/ham/__init__.py +1 -0
- hammad_python-0.0.31/libs/hammad-python-http/pyproject.toml +17 -0
- hammad_python-0.0.31/pyproject.toml +50 -0
- hammad_python-0.0.31/tests/core/test_core_cache.py +75 -0
- hammad_python-0.0.31/tests/core/test_core_conversion.py +312 -0
- hammad_python-0.0.31/tests/core/test_core_internal_utils.py +26 -0
- hammad_python-0.0.31/tests/test_top_level_debug_tags.py +26 -0
- hammad_python-0.0.31/uv.lock +2089 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31}/LICENSE +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31}/README.md +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/_internal.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/_main.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/indexes/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/indexes/qdrant/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/indexes/qdrant/index.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/indexes/qdrant/settings.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/indexes/qdrant/utils.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/indexes/tantivy/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/indexes/tantivy/index.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/indexes/tantivy/settings.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/indexes/tantivy/utils.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/configurations/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/configurations/configuration.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/models/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/models/extensions/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/models/extensions/pydantic/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/models/extensions/pydantic/converters.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/models/fields.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/models/model.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/models/utils.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/sql/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/sql/database.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/sql/types.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/types/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/types/file.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/types/multimodal/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/types/multimodal/audio.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/types/multimodal/image.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/types/text.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/formatting/json/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/formatting/json/converters.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/formatting/text/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/formatting/text/converters.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/formatting/text/markdown.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/formatting/yaml/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/formatting/yaml/converters.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/a2a/workers.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/agent.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/run.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/types/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/types/agent_context.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/types/agent_event.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/types/agent_hooks.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/types/agent_messages.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/types/agent_response.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/agents/types/agent_stream.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/graphs/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/graphs/plugins.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/graphs/types.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/embeddings/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/embeddings/model.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/embeddings/run.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/embeddings/types/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/embeddings/types/embedding_model_name.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/embeddings/types/embedding_model_response.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/embeddings/types/embedding_model_run_params.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/embeddings/types/embedding_model_settings.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/model.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/run.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/types/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/types/language_model_instructor_mode.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/types/language_model_messages.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/types/language_model_name.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/types/language_model_request.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/types/language_model_response.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/types/language_model_response_chunk.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/types/language_model_settings.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/types/language_model_stream.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/utils/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/utils/requests.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/language/utils/structured_outputs.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/model_provider.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/multimodal.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/models/reranking.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/types/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/types/base.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/types/history.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/genai/types/tools.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/mcp/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/mcp/client/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/mcp/client/client.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/mcp/client/client_service.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/mcp/client/settings.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/mcp/servers/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/mcp/servers/launcher.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/py.typed +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/runtime/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/runtime/decorators.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/runtime/run.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/service/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/service/create.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/service/decorators.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/types.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/typing/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/web/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/web/http/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/web/http/client.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/web/models.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/web/openapi/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/web/openapi/client.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/web/search/__init__.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/web/search/client.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/web/utils.py +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/pyproject.toml +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/uv.lock +0 -0
- {hammad_python-0.0.29 → hammad_python-0.0.31}/mkdocs.yml +0 -0
@@ -1,6 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hammad-python
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.31
|
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:
|
29
|
-
Requires-Dist:
|
30
|
-
Requires-Dist:
|
31
|
-
Requires-Dist:
|
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.1
|
30
|
+
Requires-Dist: hammad-python-data>=0.0.1
|
31
|
+
Requires-Dist: hammad-python-genai>=0.0.1
|
32
|
+
Requires-Dist: hammad-python-http>=0.0.1
|
59
33
|
Description-Content-Type: text/markdown
|
60
34
|
|
61
35
|
## hammad-python
|
{hammad_python-0.0.29 → hammad_python-0.0.31/deprecated}/hammad/data/collections/collection.py
RENAMED
@@ -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__)
|
@@ -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(
|
22
|
-
|
23
|
-
|
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(
|
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,
|
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
|
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(
|
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(
|
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
|
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(
|
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,
|
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,
|
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(
|
128
|
-
raise FileNotFoundError(
|
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(
|
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 =
|
138
|
-
if filename.lower().endswith(
|
139
|
-
output_format =
|
140
|
-
elif filename.lower().endswith(
|
141
|
-
output_format =
|
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 = [
|
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 !=
|
148
|
-
cmd.extend([
|
149
|
-
|
170
|
+
if output_format != "png":
|
171
|
+
cmd.extend(["-f", output_format])
|
172
|
+
|
150
173
|
# Add theme and background color
|
151
|
-
cmd.extend([
|
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(
|
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(
|
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(
|
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(
|
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(
|
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
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
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 !=
|
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)
|
Binary file
|
Binary file
|