nvidia-nat 1.2.0rc8__py3-none-any.whl → 1.3a20250818__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.
- nat/cli/commands/workflow/templates/pyproject.toml.j2 +1 -1
- nat/cli/commands/workflow/workflow_commands.py +56 -10
- {nvidia_nat-1.2.0rc8.dist-info → nvidia_nat-1.3a20250818.dist-info}/METADATA +1 -1
- {nvidia_nat-1.2.0rc8.dist-info → nvidia_nat-1.3a20250818.dist-info}/RECORD +9 -10
- {nvidia_nat-1.2.0rc8.dist-info → nvidia_nat-1.3a20250818.dist-info}/top_level.txt +0 -1
- aiq/__init__.py +0 -66
- {nvidia_nat-1.2.0rc8.dist-info → nvidia_nat-1.3a20250818.dist-info}/WHEEL +0 -0
- {nvidia_nat-1.2.0rc8.dist-info → nvidia_nat-1.3a20250818.dist-info}/entry_points.txt +0 -0
- {nvidia_nat-1.2.0rc8.dist-info → nvidia_nat-1.3a20250818.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {nvidia_nat-1.2.0rc8.dist-info → nvidia_nat-1.3a20250818.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -9,7 +9,7 @@ root = "{{ rel_path_to_repo_root}}"{% else %}requires = ["setuptools >= 64"]{% e
|
|
|
9
9
|
name = "{{ package_name }}"
|
|
10
10
|
{% if editable %}dynamic = ["version"]{% else %}version = "0.1.0"{% endif %}
|
|
11
11
|
dependencies = [
|
|
12
|
-
"
|
|
12
|
+
"{{ nat_dependency }}",
|
|
13
13
|
]
|
|
14
14
|
requires-python = ">=3.11,<3.13"
|
|
15
15
|
description = "Custom NeMo Agent Toolkit Workflow"
|
|
@@ -27,6 +27,37 @@ from jinja2 import FileSystemLoader
|
|
|
27
27
|
logger = logging.getLogger(__name__)
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
def _get_nat_dependency(versioned: bool = True) -> str:
|
|
31
|
+
"""
|
|
32
|
+
Get the NAT dependency string with version.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
versioned: Whether to include the version in the dependency string
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
str: The dependency string to use in pyproject.toml
|
|
39
|
+
"""
|
|
40
|
+
# Assume the default dependency is langchain
|
|
41
|
+
dependency = "nvidia-nat[langchain]"
|
|
42
|
+
|
|
43
|
+
if not versioned:
|
|
44
|
+
logger.debug("Using unversioned NAT dependency: %s", dependency)
|
|
45
|
+
return dependency
|
|
46
|
+
|
|
47
|
+
# Get the current NAT version
|
|
48
|
+
from nat.cli.entrypoint import get_version
|
|
49
|
+
current_version = get_version()
|
|
50
|
+
if current_version == "unknown":
|
|
51
|
+
logger.warning("Could not detect NAT version, using unversioned dependency")
|
|
52
|
+
return dependency
|
|
53
|
+
|
|
54
|
+
# Extract major.minor (e.g., "1.2.3" -> "1.2")
|
|
55
|
+
major_minor = ".".join(current_version.split(".")[:2])
|
|
56
|
+
dependency += f"~={major_minor}"
|
|
57
|
+
logger.debug("Using NAT dependency: %s", dependency)
|
|
58
|
+
return dependency
|
|
59
|
+
|
|
60
|
+
|
|
30
61
|
class PackageError(Exception):
|
|
31
62
|
pass
|
|
32
63
|
|
|
@@ -166,12 +197,17 @@ def create_command(workflow_name: str, install: bool, workflow_dir: str, descrip
|
|
|
166
197
|
click.echo(f"Workflow '{workflow_name}' already exists.")
|
|
167
198
|
return
|
|
168
199
|
|
|
200
|
+
base_dir = new_workflow_dir / 'src' / package_name
|
|
201
|
+
|
|
202
|
+
configs_dir = base_dir / 'configs'
|
|
203
|
+
data_dir = base_dir / 'data'
|
|
204
|
+
|
|
169
205
|
# Create directory structure
|
|
170
|
-
|
|
206
|
+
base_dir.mkdir(parents=True)
|
|
171
207
|
# Create config directory
|
|
172
|
-
|
|
173
|
-
# Create
|
|
174
|
-
|
|
208
|
+
configs_dir.mkdir(parents=True)
|
|
209
|
+
# Create data directory
|
|
210
|
+
data_dir.mkdir(parents=True)
|
|
175
211
|
|
|
176
212
|
# Initialize Jinja2 environment
|
|
177
213
|
env = Environment(loader=FileSystemLoader(str(template_dir)))
|
|
@@ -182,13 +218,15 @@ def create_command(workflow_name: str, install: bool, workflow_dir: str, descrip
|
|
|
182
218
|
else:
|
|
183
219
|
install_cmd = ['pip', 'install', '-e', str(new_workflow_dir)]
|
|
184
220
|
|
|
221
|
+
config_source = configs_dir / 'config.yml'
|
|
222
|
+
|
|
185
223
|
# List of templates and their destinations
|
|
186
224
|
files_to_render = {
|
|
187
225
|
'pyproject.toml.j2': new_workflow_dir / 'pyproject.toml',
|
|
188
|
-
'register.py.j2':
|
|
189
|
-
'workflow.py.j2':
|
|
190
|
-
'__init__.py.j2':
|
|
191
|
-
'config.yml.j2':
|
|
226
|
+
'register.py.j2': base_dir / 'register.py',
|
|
227
|
+
'workflow.py.j2': base_dir / f'{workflow_name}_function.py',
|
|
228
|
+
'__init__.py.j2': base_dir / '__init__.py',
|
|
229
|
+
'config.yml.j2': config_source,
|
|
192
230
|
}
|
|
193
231
|
|
|
194
232
|
# Render templates
|
|
@@ -199,7 +237,8 @@ def create_command(workflow_name: str, install: bool, workflow_dir: str, descrip
|
|
|
199
237
|
'package_name': package_name,
|
|
200
238
|
'rel_path_to_repo_root': rel_path_to_repo_root,
|
|
201
239
|
'workflow_class_name': f"{_generate_valid_classname(workflow_name)}FunctionConfig",
|
|
202
|
-
'workflow_description': description
|
|
240
|
+
'workflow_description': description,
|
|
241
|
+
'nat_dependency': _get_nat_dependency()
|
|
203
242
|
}
|
|
204
243
|
|
|
205
244
|
for template_name, output_path in files_to_render.items():
|
|
@@ -209,10 +248,17 @@ def create_command(workflow_name: str, install: bool, workflow_dir: str, descrip
|
|
|
209
248
|
f.write(content)
|
|
210
249
|
|
|
211
250
|
# Create symlink for config.yml
|
|
212
|
-
config_source = new_workflow_dir / 'src' / package_name / 'configs' / 'config.yml'
|
|
213
251
|
config_link = new_workflow_dir / 'configs' / 'config.yml'
|
|
214
252
|
os.symlink(config_source, config_link)
|
|
215
253
|
|
|
254
|
+
# Create symlinks for config and data directories
|
|
255
|
+
config_dir_source = configs_dir
|
|
256
|
+
config_dir_link = new_workflow_dir / 'configs'
|
|
257
|
+
data_dir_source = data_dir
|
|
258
|
+
data_dir_link = new_workflow_dir / 'data'
|
|
259
|
+
os.symlink(config_dir_source, config_dir_link)
|
|
260
|
+
os.symlink(data_dir_source, data_dir_link)
|
|
261
|
+
|
|
216
262
|
if install:
|
|
217
263
|
# Install the new package without changing directories
|
|
218
264
|
click.echo(f"Installing workflow '{workflow_name}'...")
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
aiq/__init__.py,sha256=E9vuQX0dCZIALhOg360sRLO53f6NXPgMTv3X1sh8WAM,2376
|
|
2
1
|
nat/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
2
|
nat/agent/base.py,sha256=vKD3q6RiRdXYlmsZOsB9DB0cVfSMNByhjn7uwp8TxGw,9094
|
|
4
3
|
nat/agent/dual_node.py,sha256=EOYpYzhaY-m1t2W3eiQrBjSfNjYMDttAwtzEEEcYP4s,2353
|
|
@@ -87,10 +86,10 @@ nat/cli/commands/sizing/calc.py,sha256=3cJHKCbzvV7EwYfLcpfk3_Ki7soAjOaiBcLK-Q6hP
|
|
|
87
86
|
nat/cli/commands/sizing/sizing.py,sha256=-Hr9mz_ScEMtBbn6ijvmmWVk0WybLeX0Ryi4qhDiYQU,902
|
|
88
87
|
nat/cli/commands/workflow/__init__.py,sha256=GUJrgGtpvyMUCjUBvR3faAdv-tZzbU9W-izgx9aMEQg,680
|
|
89
88
|
nat/cli/commands/workflow/workflow.py,sha256=40nIOehOX-4xI-qJqJraBX3XVz3l2VtFsZkMQYd897w,1342
|
|
90
|
-
nat/cli/commands/workflow/workflow_commands.py,sha256=
|
|
89
|
+
nat/cli/commands/workflow/workflow_commands.py,sha256=NodOkGNicA7TLTwyNFRT5w8wu7NzlkkwCDiDM7JcIKc,13109
|
|
91
90
|
nat/cli/commands/workflow/templates/__init__.py.j2,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
91
|
nat/cli/commands/workflow/templates/config.yml.j2,sha256=KkZl1fOMVQVFBW-BD_d0Lu8kQgNBtjNpfojhSCPu4uA,222
|
|
93
|
-
nat/cli/commands/workflow/templates/pyproject.toml.j2,sha256
|
|
92
|
+
nat/cli/commands/workflow/templates/pyproject.toml.j2,sha256=P6-8FNx4YpNulBxhGqkIFjhGcfMeXNE456JIYZrIBMk,739
|
|
94
93
|
nat/cli/commands/workflow/templates/register.py.j2,sha256=SlOFmIZakPDu_E6DbIhUZ3yP8KhTrAQCFGBuhy9Fyg4,170
|
|
95
94
|
nat/cli/commands/workflow/templates/workflow.py.j2,sha256=Z4uZPG9rtf1nxF74dF4DqDtrF3uYmYUmWowDFbQBjao,1241
|
|
96
95
|
nat/data_models/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
|
|
@@ -426,10 +425,10 @@ nat/utils/reactive/base/observer_base.py,sha256=UAlyAY_ky4q2t0P81RVFo2Bs_R7z5Nde
|
|
|
426
425
|
nat/utils/reactive/base/subject_base.py,sha256=UQOxlkZTIeeyYmG5qLtDpNf_63Y7p-doEeUA08_R8ME,2521
|
|
427
426
|
nat/utils/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
428
427
|
nat/utils/settings/global_settings.py,sha256=CYHQX7F6MDR18vsVFTrEySpS9cBufuVGTUqZm9lREFs,7446
|
|
429
|
-
nvidia_nat-1.
|
|
430
|
-
nvidia_nat-1.
|
|
431
|
-
nvidia_nat-1.
|
|
432
|
-
nvidia_nat-1.
|
|
433
|
-
nvidia_nat-1.
|
|
434
|
-
nvidia_nat-1.
|
|
435
|
-
nvidia_nat-1.
|
|
428
|
+
nvidia_nat-1.3a20250818.dist-info/licenses/LICENSE-3rd-party.txt,sha256=8o7aySJa9CBvFshPcsRdJbczzdNyDGJ8b0J67WRUQ2k,183936
|
|
429
|
+
nvidia_nat-1.3a20250818.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
430
|
+
nvidia_nat-1.3a20250818.dist-info/METADATA,sha256=HqmqsilD4P1XBwL7JqBcxh9jHhILOa6oDrDBnSs5VsE,21692
|
|
431
|
+
nvidia_nat-1.3a20250818.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
432
|
+
nvidia_nat-1.3a20250818.dist-info/entry_points.txt,sha256=FNh4pZVSe_61s29zdks66lmXBPtsnko8KSZ4ffv7WVE,653
|
|
433
|
+
nvidia_nat-1.3a20250818.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
|
|
434
|
+
nvidia_nat-1.3a20250818.dist-info/RECORD,,
|
aiq/__init__.py
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
|
|
16
|
-
import sys
|
|
17
|
-
import importlib
|
|
18
|
-
import importlib.abc
|
|
19
|
-
import importlib.util
|
|
20
|
-
import warnings
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class CompatFinder(importlib.abc.MetaPathFinder):
|
|
24
|
-
|
|
25
|
-
def __init__(self, alias_prefix, target_prefix):
|
|
26
|
-
self.alias_prefix = alias_prefix
|
|
27
|
-
self.target_prefix = target_prefix
|
|
28
|
-
|
|
29
|
-
def find_spec(self, fullname, path, target=None): # pylint: disable=unused-argument
|
|
30
|
-
if fullname == self.alias_prefix or fullname.startswith(self.alias_prefix + "."):
|
|
31
|
-
# Map aiq.something -> nat.something
|
|
32
|
-
target_name = self.target_prefix + fullname[len(self.alias_prefix):]
|
|
33
|
-
spec = importlib.util.find_spec(target_name)
|
|
34
|
-
if spec is None:
|
|
35
|
-
return None
|
|
36
|
-
# Wrap the loader so it loads under the alias name
|
|
37
|
-
return importlib.util.spec_from_loader(fullname, CompatLoader(fullname, target_name))
|
|
38
|
-
return None
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class CompatLoader(importlib.abc.Loader):
|
|
42
|
-
|
|
43
|
-
def __init__(self, alias_name, target_name):
|
|
44
|
-
self.alias_name = alias_name
|
|
45
|
-
self.target_name = target_name
|
|
46
|
-
|
|
47
|
-
def create_module(self, spec):
|
|
48
|
-
# Reuse the actual module so there's only one instance
|
|
49
|
-
target_module = importlib.import_module(self.target_name)
|
|
50
|
-
sys.modules[self.alias_name] = target_module
|
|
51
|
-
return target_module
|
|
52
|
-
|
|
53
|
-
def exec_module(self, module):
|
|
54
|
-
# Nothing to execute since the target is already loaded
|
|
55
|
-
pass
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
# Register the compatibility finder
|
|
59
|
-
sys.meta_path.insert(0, CompatFinder("aiq", "nat"))
|
|
60
|
-
|
|
61
|
-
warnings.warn(
|
|
62
|
-
"!!! The 'aiq' namespace is deprecated and will be removed in a future release. "
|
|
63
|
-
"Please use the 'nat' namespace instead.",
|
|
64
|
-
DeprecationWarning,
|
|
65
|
-
stacklevel=2,
|
|
66
|
-
)
|
|
File without changes
|
|
File without changes
|
{nvidia_nat-1.2.0rc8.dist-info → nvidia_nat-1.3a20250818.dist-info}/licenses/LICENSE-3rd-party.txt
RENAMED
|
File without changes
|
|
File without changes
|