nvidia-nat 1.3a0__py3-none-any.whl → 1.3.dev0__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.3a0.dist-info → nvidia_nat-1.3.dev0.dist-info}/METADATA +1 -1
- {nvidia_nat-1.3a0.dist-info → nvidia_nat-1.3.dev0.dist-info}/RECORD +9 -9
- {nvidia_nat-1.3a0.dist-info → nvidia_nat-1.3.dev0.dist-info}/WHEEL +0 -0
- {nvidia_nat-1.3a0.dist-info → nvidia_nat-1.3.dev0.dist-info}/entry_points.txt +0 -0
- {nvidia_nat-1.3a0.dist-info → nvidia_nat-1.3.dev0.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {nvidia_nat-1.3a0.dist-info → nvidia_nat-1.3.dev0.dist-info}/licenses/LICENSE.md +0 -0
- {nvidia_nat-1.3a0.dist-info → nvidia_nat-1.3.dev0.dist-info}/top_level.txt +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}'...")
|
|
@@ -86,10 +86,10 @@ nat/cli/commands/sizing/calc.py,sha256=3cJHKCbzvV7EwYfLcpfk3_Ki7soAjOaiBcLK-Q6hP
|
|
|
86
86
|
nat/cli/commands/sizing/sizing.py,sha256=-Hr9mz_ScEMtBbn6ijvmmWVk0WybLeX0Ryi4qhDiYQU,902
|
|
87
87
|
nat/cli/commands/workflow/__init__.py,sha256=GUJrgGtpvyMUCjUBvR3faAdv-tZzbU9W-izgx9aMEQg,680
|
|
88
88
|
nat/cli/commands/workflow/workflow.py,sha256=40nIOehOX-4xI-qJqJraBX3XVz3l2VtFsZkMQYd897w,1342
|
|
89
|
-
nat/cli/commands/workflow/workflow_commands.py,sha256=
|
|
89
|
+
nat/cli/commands/workflow/workflow_commands.py,sha256=NodOkGNicA7TLTwyNFRT5w8wu7NzlkkwCDiDM7JcIKc,13109
|
|
90
90
|
nat/cli/commands/workflow/templates/__init__.py.j2,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
91
91
|
nat/cli/commands/workflow/templates/config.yml.j2,sha256=KkZl1fOMVQVFBW-BD_d0Lu8kQgNBtjNpfojhSCPu4uA,222
|
|
92
|
-
nat/cli/commands/workflow/templates/pyproject.toml.j2,sha256
|
|
92
|
+
nat/cli/commands/workflow/templates/pyproject.toml.j2,sha256=P6-8FNx4YpNulBxhGqkIFjhGcfMeXNE456JIYZrIBMk,739
|
|
93
93
|
nat/cli/commands/workflow/templates/register.py.j2,sha256=SlOFmIZakPDu_E6DbIhUZ3yP8KhTrAQCFGBuhy9Fyg4,170
|
|
94
94
|
nat/cli/commands/workflow/templates/workflow.py.j2,sha256=Z4uZPG9rtf1nxF74dF4DqDtrF3uYmYUmWowDFbQBjao,1241
|
|
95
95
|
nat/data_models/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
|
|
@@ -425,10 +425,10 @@ nat/utils/reactive/base/observer_base.py,sha256=UAlyAY_ky4q2t0P81RVFo2Bs_R7z5Nde
|
|
|
425
425
|
nat/utils/reactive/base/subject_base.py,sha256=UQOxlkZTIeeyYmG5qLtDpNf_63Y7p-doEeUA08_R8ME,2521
|
|
426
426
|
nat/utils/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
427
427
|
nat/utils/settings/global_settings.py,sha256=CYHQX7F6MDR18vsVFTrEySpS9cBufuVGTUqZm9lREFs,7446
|
|
428
|
-
nvidia_nat-1.
|
|
429
|
-
nvidia_nat-1.
|
|
430
|
-
nvidia_nat-1.
|
|
431
|
-
nvidia_nat-1.
|
|
432
|
-
nvidia_nat-1.
|
|
433
|
-
nvidia_nat-1.
|
|
434
|
-
nvidia_nat-1.
|
|
428
|
+
nvidia_nat-1.3.dev0.dist-info/licenses/LICENSE-3rd-party.txt,sha256=8o7aySJa9CBvFshPcsRdJbczzdNyDGJ8b0J67WRUQ2k,183936
|
|
429
|
+
nvidia_nat-1.3.dev0.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
430
|
+
nvidia_nat-1.3.dev0.dist-info/METADATA,sha256=As5tc0Yy6MvPkciHw6lmpIE1qy3lxk_YF-etQrzSUJE,21688
|
|
431
|
+
nvidia_nat-1.3.dev0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
432
|
+
nvidia_nat-1.3.dev0.dist-info/entry_points.txt,sha256=FNh4pZVSe_61s29zdks66lmXBPtsnko8KSZ4ffv7WVE,653
|
|
433
|
+
nvidia_nat-1.3.dev0.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
|
|
434
|
+
nvidia_nat-1.3.dev0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|