nodetool-core 0.7.0__py3-none-any.whl
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.
- nodetool/config/__init__.py +0 -0
- nodetool/config/configuration.py +82 -0
- nodetool/config/env_guard.py +34 -0
- nodetool/config/environment.py +818 -0
- nodetool/config/logging_config.py +149 -0
- nodetool/config/settings.py +556 -0
- nodetool/integrations/__init__.py +0 -0
- nodetool/integrations/huggingface/__init__.py +0 -0
- nodetool/integrations/huggingface/artifact_inspector.py +319 -0
- nodetool/integrations/huggingface/async_downloader.py +498 -0
- nodetool/integrations/huggingface/gguf_models.json +312951 -0
- nodetool/integrations/huggingface/hf_auth.py +28 -0
- nodetool/integrations/huggingface/hf_cache.py +127 -0
- nodetool/integrations/huggingface/hf_fast_cache.py +721 -0
- nodetool/integrations/huggingface/hf_utils.py +23 -0
- nodetool/integrations/huggingface/huggingface_file.py +76 -0
- nodetool/integrations/huggingface/huggingface_models.py +2154 -0
- nodetool/integrations/huggingface/llama_cpp_download.py +202 -0
- nodetool/integrations/huggingface/mlx_models.json +34946 -0
- nodetool/integrations/huggingface/progress_download.py +579 -0
- nodetool/integrations/huggingface/safetensor_layout.py +124 -0
- nodetool/integrations/huggingface/safetensors_inspector.py +572 -0
- nodetool/integrations/vectorstores/__init__.py +0 -0
- nodetool/integrations/vectorstores/chroma/__init__.py +0 -0
- nodetool/integrations/vectorstores/chroma/async_chroma_client.py +225 -0
- nodetool/integrations/vectorstores/chroma/chroma_client.py +229 -0
- nodetool/integrations/vectorstores/chroma/provider_embedding_function.py +196 -0
- nodetool/io/__init__.py +0 -0
- nodetool/io/asset_utils.py +30 -0
- nodetool/io/get_files.py +59 -0
- nodetool/io/media_fetch.py +264 -0
- nodetool/io/path_utils.py +86 -0
- nodetool/io/uri_utils.py +29 -0
- nodetool/media/__init__.py +0 -0
- nodetool/media/audio/__init__.py +0 -0
- nodetool/media/audio/audio_helpers.py +318 -0
- nodetool/media/common/__init__.py +0 -0
- nodetool/media/common/media_constants.py +9 -0
- nodetool/media/common/media_utils.py +230 -0
- nodetool/media/image/__init__.py +0 -0
- nodetool/media/image/font_utils.py +97 -0
- nodetool/media/image/image_utils.py +166 -0
- nodetool/media/image/web_font_utils.py +417 -0
- nodetool/media/video/__init__.py +0 -0
- nodetool/media/video/video_utils.py +447 -0
- nodetool/metadata/__init__.py +0 -0
- nodetool/metadata/node_metadata.py +206 -0
- nodetool/metadata/tool_types.py +61 -0
- nodetool/metadata/type_metadata.py +306 -0
- nodetool/metadata/typecheck.py +249 -0
- nodetool/metadata/types.py +2752 -0
- nodetool/metadata/utils.py +136 -0
- nodetool/ml/__init__.py +0 -0
- nodetool/ml/core/__init__.py +0 -0
- nodetool/ml/core/model_manager.py +904 -0
- nodetool/ml/models/__init__.py +0 -0
- nodetool/ml/models/asr_models.py +42 -0
- nodetool/ml/models/image_models.py +47 -0
- nodetool/ml/models/language_models.py +61 -0
- nodetool/ml/models/model_cache.py +193 -0
- nodetool/ml/models/tts_models.py +61 -0
- nodetool/ml/models/video_models.py +40 -0
- nodetool/package_metadata/nodetool-core.json +9 -0
- nodetool/package_tools/__init__.py +9 -0
- nodetool/package_tools/__main__.py +101 -0
- nodetool/package_tools/enrich.py +135 -0
- nodetool/package_tools/scanner.py +294 -0
- nodetool/providers/README.md +14 -0
- nodetool/providers/__init__.py +187 -0
- nodetool/providers/base.py +1008 -0
- nodetool/providers/types.py +129 -0
- nodetool/py.typed +0 -0
- nodetool/runtime/__init__.py +6 -0
- nodetool/runtime/resources.py +138 -0
- nodetool/security/README.md +25 -0
- nodetool/security/__init__.py +16 -0
- nodetool/security/crypto.py +119 -0
- nodetool/security/master_key.py +245 -0
- nodetool/security/secret_helper.py +60 -0
- nodetool/storage/__init__.py +0 -0
- nodetool/storage/abstract_storage.py +15 -0
- nodetool/storage/file_storage.py +47 -0
- nodetool/storage/memory_storage.py +27 -0
- nodetool/types/api_graph.py +148 -0
- nodetool/types/content_types.py +181 -0
- nodetool/types/message_types.py +21 -0
- nodetool/types/model.py +67 -0
- nodetool/types/prediction.py +74 -0
- nodetool/types/wrap_primitive_types.py +23 -0
- nodetool/utils/__init__.py +0 -0
- nodetool/utils/message_parsing.py +118 -0
- nodetool/utils/network.py +47 -0
- nodetool/worker/__init__.py +15 -0
- nodetool/worker/__main__.py +75 -0
- nodetool/worker/context_stub.py +137 -0
- nodetool/worker/executor.py +439 -0
- nodetool/worker/node_loader.py +265 -0
- nodetool/worker/protocol.py +186 -0
- nodetool/worker/provider_handler.py +548 -0
- nodetool/worker/server.py +120 -0
- nodetool/worker/stdio_server.py +191 -0
- nodetool/worker/stdio_stdout_guard.py +68 -0
- nodetool/workflows/README.md +18 -0
- nodetool/workflows/__init__.py +1 -0
- nodetool/workflows/asset_storage.py +515 -0
- nodetool/workflows/base_node.py +2461 -0
- nodetool/workflows/channel.py +472 -0
- nodetool/workflows/graph.py +581 -0
- nodetool/workflows/inbox.py +472 -0
- nodetool/workflows/io.py +331 -0
- nodetool/workflows/memory_utils.py +933 -0
- nodetool/workflows/processing_context.py +2491 -0
- nodetool/workflows/processing_offload.py +279 -0
- nodetool/workflows/property.py +155 -0
- nodetool/workflows/torch_support.py +298 -0
- nodetool/workflows/types.py +382 -0
- nodetool_core-0.7.0.dist-info/METADATA +175 -0
- nodetool_core-0.7.0.dist-info/RECORD +121 -0
- nodetool_core-0.7.0.dist-info/WHEEL +4 -0
- nodetool_core-0.7.0.dist-info/entry_points.txt +2 -0
- nodetool_core-0.7.0.dist-info/licenses/LICENSE +661 -0
|
File without changes
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass
|
|
5
|
+
class Setting:
|
|
6
|
+
package_name: str
|
|
7
|
+
env_var: str
|
|
8
|
+
group: str
|
|
9
|
+
description: str
|
|
10
|
+
enum: list[str] | None
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass
|
|
14
|
+
class Secret:
|
|
15
|
+
package_name: str
|
|
16
|
+
env_var: str
|
|
17
|
+
group: str
|
|
18
|
+
description: str
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
_registry: list[Setting] = []
|
|
22
|
+
_secrets_registry: list[Secret] = []
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def register_secret(
|
|
26
|
+
package_name: str,
|
|
27
|
+
env_var: str,
|
|
28
|
+
group: str,
|
|
29
|
+
description: str,
|
|
30
|
+
) -> list[Secret]:
|
|
31
|
+
"""Register a new secret."""
|
|
32
|
+
secret = Secret(package_name=package_name, env_var=env_var, group=group, description=description)
|
|
33
|
+
_secrets_registry.append(secret)
|
|
34
|
+
return list(_secrets_registry)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def register_setting(
|
|
38
|
+
package_name: str,
|
|
39
|
+
env_var: str,
|
|
40
|
+
group: str,
|
|
41
|
+
description: str,
|
|
42
|
+
enum: list[str] | None = None,
|
|
43
|
+
) -> list[Setting]:
|
|
44
|
+
"""Register a new setting.
|
|
45
|
+
|
|
46
|
+
Parameters
|
|
47
|
+
----------
|
|
48
|
+
package_name: str
|
|
49
|
+
Name of the package registering the setting.
|
|
50
|
+
env_var: str
|
|
51
|
+
The environment variable name.
|
|
52
|
+
group: str
|
|
53
|
+
Group the setting belongs to.
|
|
54
|
+
description: str
|
|
55
|
+
Human readable description of the setting.
|
|
56
|
+
enum: List[str] | None
|
|
57
|
+
List of possible values for the setting.
|
|
58
|
+
|
|
59
|
+
Returns
|
|
60
|
+
-------
|
|
61
|
+
List[Setting]
|
|
62
|
+
The list of all registered settings.
|
|
63
|
+
"""
|
|
64
|
+
setting = Setting(
|
|
65
|
+
package_name=package_name,
|
|
66
|
+
env_var=env_var,
|
|
67
|
+
group=group,
|
|
68
|
+
description=description,
|
|
69
|
+
enum=enum,
|
|
70
|
+
)
|
|
71
|
+
_registry.append(setting)
|
|
72
|
+
return list(_registry)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def get_settings_registry() -> list[Setting]:
|
|
76
|
+
"""Return the list of all registered settings."""
|
|
77
|
+
return list(_registry)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def get_secrets_registry() -> list[Secret]:
|
|
81
|
+
"""Return the list of all registered secrets."""
|
|
82
|
+
return list(_secrets_registry)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def _is_running_under_pytest() -> bool:
|
|
7
|
+
"""Detect pytest presence from command-line arguments or environment.
|
|
8
|
+
|
|
9
|
+
This checks both sys.argv (for main pytest process) and PYTEST_CURRENT_TEST
|
|
10
|
+
environment variable (which is set in all pytest workers, including xdist workers).
|
|
11
|
+
"""
|
|
12
|
+
# Check if PYTEST_CURRENT_TEST is set (works for all pytest workers)
|
|
13
|
+
if "PYTEST_CURRENT_TEST" in os.environ:
|
|
14
|
+
return True
|
|
15
|
+
# Fallback to checking sys.argv for main process
|
|
16
|
+
return any(arg and "pytest" in str(arg).lower() for arg in sys.argv)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
RUNNING_PYTEST = _is_running_under_pytest()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def get_system_env_value(key: str, default: Any = None) -> Any:
|
|
23
|
+
"""Return an environment variable value.
|
|
24
|
+
|
|
25
|
+
Tests may monkeypatch os.environ to drive configuration, so we always
|
|
26
|
+
read from the current process environment instead of short-circuiting
|
|
27
|
+
when pytest is detected.
|
|
28
|
+
"""
|
|
29
|
+
return os.environ.get(key, default)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def get_system_env() -> dict[str, str]:
|
|
33
|
+
"""Return the current process environment."""
|
|
34
|
+
return dict(os.environ)
|