nvidia-nat-test 1.3.0a20250909__py3-none-any.whl → 1.3.0a20250917__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/test/llm.py +1 -1
- nat/test/tool_test_runner.py +31 -0
- {nvidia_nat_test-1.3.0a20250909.dist-info → nvidia_nat_test-1.3.0a20250917.dist-info}/METADATA +2 -2
- {nvidia_nat_test-1.3.0a20250909.dist-info → nvidia_nat_test-1.3.0a20250917.dist-info}/RECORD +7 -7
- {nvidia_nat_test-1.3.0a20250909.dist-info → nvidia_nat_test-1.3.0a20250917.dist-info}/WHEEL +0 -0
- {nvidia_nat_test-1.3.0a20250909.dist-info → nvidia_nat_test-1.3.0a20250917.dist-info}/entry_points.txt +0 -0
- {nvidia_nat_test-1.3.0a20250909.dist-info → nvidia_nat_test-1.3.0a20250917.dist-info}/top_level.txt +0 -0
nat/test/llm.py
CHANGED
@@ -74,7 +74,7 @@ async def test_llm_provider(config: TestLLMConfig, builder: Builder):
|
|
74
74
|
|
75
75
|
@register_llm_client(config_type=TestLLMConfig, wrapper_type=LLMFrameworkEnum.LANGCHAIN)
|
76
76
|
async def test_llm_langchain(config: TestLLMConfig, builder: Builder):
|
77
|
-
"""LLM client for LangChain."""
|
77
|
+
"""LLM client for LangChain/LangGraph."""
|
78
78
|
|
79
79
|
chooser = _ResponseChooser(response_seq=config.response_seq, delay_ms=config.delay_ms)
|
80
80
|
|
nat/test/tool_test_runner.py
CHANGED
@@ -17,6 +17,7 @@ import asyncio
|
|
17
17
|
import inspect
|
18
18
|
import logging
|
19
19
|
import typing
|
20
|
+
from collections.abc import Sequence
|
20
21
|
from contextlib import asynccontextmanager
|
21
22
|
from unittest.mock import AsyncMock
|
22
23
|
from unittest.mock import MagicMock
|
@@ -24,11 +25,13 @@ from unittest.mock import MagicMock
|
|
24
25
|
from nat.authentication.interfaces import AuthProviderBase
|
25
26
|
from nat.builder.builder import Builder
|
26
27
|
from nat.builder.function import Function
|
28
|
+
from nat.builder.function import FunctionGroup
|
27
29
|
from nat.builder.function_info import FunctionInfo
|
28
30
|
from nat.cli.type_registry import GlobalTypeRegistry
|
29
31
|
from nat.data_models.authentication import AuthProviderBaseConfig
|
30
32
|
from nat.data_models.embedder import EmbedderBaseConfig
|
31
33
|
from nat.data_models.function import FunctionBaseConfig
|
34
|
+
from nat.data_models.function import FunctionGroupBaseConfig
|
32
35
|
from nat.data_models.function_dependencies import FunctionDependencies
|
33
36
|
from nat.data_models.llm import LLMBaseConfig
|
34
37
|
from nat.data_models.memory import MemoryBaseConfig
|
@@ -57,6 +60,10 @@ class MockBuilder(Builder):
|
|
57
60
|
"""Add a mock function that returns a fixed response."""
|
58
61
|
self._mocks[name] = mock_response
|
59
62
|
|
63
|
+
def mock_function_group(self, name: str, mock_response: typing.Any):
|
64
|
+
"""Add a mock function group that returns a fixed response."""
|
65
|
+
self._mocks[name] = mock_response
|
66
|
+
|
60
67
|
def mock_llm(self, name: str, mock_response: typing.Any):
|
61
68
|
"""Add a mock LLM that returns a fixed response."""
|
62
69
|
self._mocks[f"llm_{name}"] = mock_response
|
@@ -137,6 +144,22 @@ class MockBuilder(Builder):
|
|
137
144
|
"""Mock implementation."""
|
138
145
|
return FunctionBaseConfig()
|
139
146
|
|
147
|
+
async def add_function_group(self, name: str, config: FunctionGroupBaseConfig) -> FunctionGroup:
|
148
|
+
"""Mock implementation - not used in tool testing."""
|
149
|
+
raise NotImplementedError("Mock implementation does not support add_function_group")
|
150
|
+
|
151
|
+
def get_function_group(self, name: str) -> FunctionGroup:
|
152
|
+
"""Return a mock function group if one is configured."""
|
153
|
+
if name in self._mocks:
|
154
|
+
mock_fn_group = MagicMock(spec=FunctionGroup)
|
155
|
+
mock_fn_group.ainvoke = AsyncMock(return_value=self._mocks[name])
|
156
|
+
return mock_fn_group
|
157
|
+
raise ValueError(f"Function group '{name}' not mocked. Use mock_function_group() to add it.")
|
158
|
+
|
159
|
+
def get_function_group_config(self, name: str) -> FunctionGroupBaseConfig:
|
160
|
+
"""Mock implementation."""
|
161
|
+
return FunctionGroupBaseConfig()
|
162
|
+
|
140
163
|
async def set_workflow(self, config: FunctionBaseConfig) -> Function:
|
141
164
|
"""Mock implementation."""
|
142
165
|
mock_fn = AsyncMock()
|
@@ -153,6 +176,10 @@ class MockBuilder(Builder):
|
|
153
176
|
"""Mock implementation."""
|
154
177
|
return FunctionBaseConfig()
|
155
178
|
|
179
|
+
def get_tools(self, tool_names: Sequence[str], wrapper_type):
|
180
|
+
"""Mock implementation."""
|
181
|
+
return []
|
182
|
+
|
156
183
|
def get_tool(self, fn_name: str, wrapper_type):
|
157
184
|
"""Mock implementation."""
|
158
185
|
pass
|
@@ -258,6 +285,10 @@ class MockBuilder(Builder):
|
|
258
285
|
"""Mock implementation."""
|
259
286
|
return FunctionDependencies()
|
260
287
|
|
288
|
+
def get_function_group_dependencies(self, fn_name: str) -> FunctionDependencies:
|
289
|
+
"""Mock implementation."""
|
290
|
+
return FunctionDependencies()
|
291
|
+
|
261
292
|
|
262
293
|
class ToolTestRunner:
|
263
294
|
"""
|
{nvidia_nat_test-1.3.0a20250909.dist-info → nvidia_nat_test-1.3.0a20250917.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: nvidia-nat-test
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.0a20250917
|
4
4
|
Summary: Testing utilities for NeMo Agent toolkit
|
5
5
|
Keywords: ai,rag,agents
|
6
6
|
Classifier: Programming Language :: Python
|
@@ -9,7 +9,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.13
|
10
10
|
Requires-Python: <3.14,>=3.11
|
11
11
|
Description-Content-Type: text/markdown
|
12
|
-
Requires-Dist: nvidia-nat==v1.3.
|
12
|
+
Requires-Dist: nvidia-nat==v1.3.0a20250917
|
13
13
|
Requires-Dist: langchain-community~=0.3
|
14
14
|
Requires-Dist: pytest~=8.3
|
15
15
|
|
{nvidia_nat_test-1.3.0a20250909.dist-info → nvidia_nat_test-1.3.0a20250917.dist-info}/RECORD
RENAMED
@@ -2,14 +2,14 @@ nat/meta/pypi.md,sha256=LLKJHg5oN1-M9Pqfk3Bmphkk4O2TFsyiixuK5T0Y-gw,1100
|
|
2
2
|
nat/test/__init__.py,sha256=_RnTJnsUucHvla_nYKqD4O4g8Bz0tcuDRzWk1bEhcy0,875
|
3
3
|
nat/test/embedder.py,sha256=ClDyK1kna4hCBSlz71gK1B-ZjlwcBHTDQRekoNM81Bs,1809
|
4
4
|
nat/test/functions.py,sha256=0ScrdsjcxCsPRLnyb5gfwukmvZxFi_ptCswLSIG0DVY,3095
|
5
|
-
nat/test/llm.py,sha256=
|
5
|
+
nat/test/llm.py,sha256=osJWGsJN7x-JGOaitueKeSwuJPVmnIFqJUCz28ngSRg,8215
|
6
6
|
nat/test/memory.py,sha256=xki_A2yiMhEZuQk60K7t04QRqf32nQqnfzD5Iv7fkvw,1456
|
7
7
|
nat/test/object_store_tests.py,sha256=PyJioOtoSzILPq6LuD-sOZ_89PIcgXWZweoHBQpK2zQ,4281
|
8
8
|
nat/test/plugin.py,sha256=sMZ7xupCgEpQCuwUksUDYMjbBj0VNlhR6SK5UcOrBzg,6953
|
9
9
|
nat/test/register.py,sha256=FZLjc3-G1lniSUJ3qVOr0aQ-aoH1F493JMFtKbZG56w,877
|
10
|
-
nat/test/tool_test_runner.py,sha256=
|
11
|
-
nvidia_nat_test-1.3.
|
12
|
-
nvidia_nat_test-1.3.
|
13
|
-
nvidia_nat_test-1.3.
|
14
|
-
nvidia_nat_test-1.3.
|
15
|
-
nvidia_nat_test-1.3.
|
10
|
+
nat/test/tool_test_runner.py,sha256=Yww9846TwtYqSBB_4CP2q3a7QD6AzLoxP0fHTuwSX_o,21544
|
11
|
+
nvidia_nat_test-1.3.0a20250917.dist-info/METADATA,sha256=5pbDbsXwl5ATFoNsmlBJQ-nQWm0RvlxVZKAIVQNcEoA,1619
|
12
|
+
nvidia_nat_test-1.3.0a20250917.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
13
|
+
nvidia_nat_test-1.3.0a20250917.dist-info/entry_points.txt,sha256=7dOP9XB6iMDqvav3gYx9VWUwA8RrFzhbAa8nGeC8e4Y,99
|
14
|
+
nvidia_nat_test-1.3.0a20250917.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
|
15
|
+
nvidia_nat_test-1.3.0a20250917.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{nvidia_nat_test-1.3.0a20250909.dist-info → nvidia_nat_test-1.3.0a20250917.dist-info}/top_level.txt
RENAMED
File without changes
|