nvidia-nat-test 1.2.0rc5__py3-none-any.whl → 1.2.0rc6__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.
Potentially problematic release.
This version of nvidia-nat-test might be problematic. Click here for more details.
- {aiq → nat}/meta/pypi.md +1 -1
- {aiq → nat}/test/embedder.py +6 -6
- {aiq → nat}/test/functions.py +12 -12
- {aiq → nat}/test/memory.py +5 -5
- {aiq → nat}/test/object_store_tests.py +4 -4
- {aiq → nat}/test/plugin.py +6 -6
- {aiq → nat}/test/tool_test_runner.py +10 -10
- {nvidia_nat_test-1.2.0rc5.dist-info → nvidia_nat_test-1.2.0rc6.dist-info}/METADATA +4 -4
- nvidia_nat_test-1.2.0rc6.dist-info/RECORD +14 -0
- nvidia_nat_test-1.2.0rc6.dist-info/entry_points.txt +5 -0
- nvidia_nat_test-1.2.0rc6.dist-info/top_level.txt +1 -0
- nvidia_nat_test-1.2.0rc5.dist-info/RECORD +0 -14
- nvidia_nat_test-1.2.0rc5.dist-info/entry_points.txt +0 -5
- nvidia_nat_test-1.2.0rc5.dist-info/top_level.txt +0 -1
- {aiq → nat}/test/__init__.py +0 -0
- {aiq → nat}/test/register.py +0 -0
- {nvidia_nat_test-1.2.0rc5.dist-info → nvidia_nat_test-1.2.0rc6.dist-info}/WHEEL +0 -0
{aiq → nat}/meta/pypi.md
RENAMED
|
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
-->
|
|
17
17
|
|
|
18
|
-

|
|
19
19
|
|
|
20
20
|
# NVIDIA NeMo Agent Toolkit Subpackage
|
|
21
21
|
This is a subpackage for NeMo Agent toolkit test utilities.
|
{aiq → nat}/test/embedder.py
RENAMED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
|
|
16
16
|
from pydantic import ConfigDict
|
|
17
17
|
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
18
|
+
from nat.builder.builder import Builder
|
|
19
|
+
from nat.builder.embedder import EmbedderProviderInfo
|
|
20
|
+
from nat.builder.framework_enum import LLMFrameworkEnum
|
|
21
|
+
from nat.cli.register_workflow import register_embedder_client
|
|
22
|
+
from nat.cli.register_workflow import register_embedder_provider
|
|
23
|
+
from nat.data_models.embedder import EmbedderBaseConfig
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class EmbedderTestConfig(EmbedderBaseConfig, name="test_embedder"):
|
{aiq → nat}/test/functions.py
RENAMED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
from collections.abc import AsyncGenerator
|
|
17
17
|
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
18
|
+
from nat.builder.builder import Builder
|
|
19
|
+
from nat.builder.function_info import FunctionInfo
|
|
20
|
+
from nat.cli.register_workflow import register_function
|
|
21
|
+
from nat.data_models.api_server import ChatRequest
|
|
22
|
+
from nat.data_models.api_server import ChatResponse
|
|
23
|
+
from nat.data_models.api_server import ChatResponseChunk
|
|
24
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class EchoFunctionConfig(FunctionBaseConfig, name="test_echo"):
|
|
@@ -34,8 +34,8 @@ async def echo_function(config: EchoFunctionConfig, builder: Builder):
|
|
|
34
34
|
async def inner(message: str) -> str:
|
|
35
35
|
return message
|
|
36
36
|
|
|
37
|
-
async def inner_oai(message:
|
|
38
|
-
return
|
|
37
|
+
async def inner_oai(message: ChatRequest) -> ChatResponse:
|
|
38
|
+
return ChatResponse.from_string(message.messages[0].content)
|
|
39
39
|
|
|
40
40
|
if (config.use_openai_api):
|
|
41
41
|
yield inner_oai
|
|
@@ -50,16 +50,16 @@ class StreamingEchoFunctionConfig(FunctionBaseConfig, name="test_streaming_echo"
|
|
|
50
50
|
@register_function(config_type=StreamingEchoFunctionConfig)
|
|
51
51
|
async def streaming_function(config: StreamingEchoFunctionConfig, builder: Builder):
|
|
52
52
|
|
|
53
|
-
def oai_to_list(message:
|
|
53
|
+
def oai_to_list(message: ChatRequest) -> list[str]:
|
|
54
54
|
return [m.content for m in message.messages]
|
|
55
55
|
|
|
56
56
|
async def inner(message: list[str]) -> AsyncGenerator[str]:
|
|
57
57
|
for value in message:
|
|
58
58
|
yield value
|
|
59
59
|
|
|
60
|
-
async def inner_oai(message:
|
|
60
|
+
async def inner_oai(message: ChatRequest) -> AsyncGenerator[ChatResponseChunk]:
|
|
61
61
|
for value in oai_to_list(message):
|
|
62
|
-
yield
|
|
62
|
+
yield ChatResponseChunk.from_string(value)
|
|
63
63
|
|
|
64
64
|
yield FunctionInfo.from_fn(inner_oai if config.use_openai_api else inner, converters=[oai_to_list])
|
|
65
65
|
|
{aiq → nat}/test/memory.py
RENAMED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
16
|
+
from nat.builder.builder import Builder
|
|
17
|
+
from nat.cli.register_workflow import register_memory
|
|
18
|
+
from nat.data_models.memory import MemoryBaseConfig
|
|
19
|
+
from nat.memory.interfaces import MemoryEditor
|
|
20
|
+
from nat.memory.models import MemoryItem
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class DummyMemoryConfig(MemoryBaseConfig, name="test_dummy"):
|
|
@@ -20,10 +20,10 @@ from contextlib import asynccontextmanager
|
|
|
20
20
|
import pytest
|
|
21
21
|
import pytest_asyncio
|
|
22
22
|
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
23
|
+
from nat.data_models.object_store import KeyAlreadyExistsError
|
|
24
|
+
from nat.data_models.object_store import NoSuchKeyError
|
|
25
|
+
from nat.object_store.interfaces import ObjectStore
|
|
26
|
+
from nat.object_store.models import ObjectStoreItem
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
@pytest.mark.asyncio(loop_scope="class")
|
{aiq → nat}/test/plugin.py
RENAMED
|
@@ -59,16 +59,16 @@ def pytest_runtest_setup(item):
|
|
|
59
59
|
|
|
60
60
|
@pytest.fixture(name="register_components", scope="session", autouse=True)
|
|
61
61
|
def register_components_fixture():
|
|
62
|
-
from
|
|
63
|
-
from
|
|
62
|
+
from nat.runtime.loader import PluginTypes
|
|
63
|
+
from nat.runtime.loader import discover_and_register_plugins
|
|
64
64
|
|
|
65
65
|
# Ensure that all components which need to be registered as part of an import are done so. This is necessary
|
|
66
66
|
# because imports will not be reloaded between tests, so we need to ensure that all components are registered
|
|
67
67
|
# before any tests are run.
|
|
68
68
|
discover_and_register_plugins(PluginTypes.ALL)
|
|
69
69
|
|
|
70
|
-
# Also import the
|
|
71
|
-
import
|
|
70
|
+
# Also import the nat.test.register module to register test-only components
|
|
71
|
+
import nat.test.register # pylint: disable=unused-import # noqa: F401
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
@pytest.fixture(name="module_registry", scope="module", autouse=True)
|
|
@@ -78,7 +78,7 @@ def module_registry_fixture():
|
|
|
78
78
|
|
|
79
79
|
This gets automatically used at the module level to ensure no state is leaked between modules
|
|
80
80
|
"""
|
|
81
|
-
from
|
|
81
|
+
from nat.cli.type_registry import GlobalTypeRegistry
|
|
82
82
|
|
|
83
83
|
with GlobalTypeRegistry.push() as registry:
|
|
84
84
|
yield registry
|
|
@@ -91,7 +91,7 @@ def function_registry_fixture():
|
|
|
91
91
|
|
|
92
92
|
This gets automatically used at the function level to ensure no state is leaked between functions
|
|
93
93
|
"""
|
|
94
|
-
from
|
|
94
|
+
from nat.cli.type_registry import GlobalTypeRegistry
|
|
95
95
|
|
|
96
96
|
with GlobalTypeRegistry.push() as registry:
|
|
97
97
|
yield registry
|
|
@@ -20,15 +20,15 @@ from contextlib import asynccontextmanager
|
|
|
20
20
|
from unittest.mock import AsyncMock
|
|
21
21
|
from unittest.mock import MagicMock
|
|
22
22
|
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
27
|
-
from
|
|
28
|
-
from
|
|
29
|
-
from
|
|
30
|
-
from
|
|
31
|
-
from
|
|
23
|
+
from nat.builder.builder import Builder
|
|
24
|
+
from nat.builder.function import Function
|
|
25
|
+
from nat.builder.function_info import FunctionInfo
|
|
26
|
+
from nat.cli.type_registry import GlobalTypeRegistry
|
|
27
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
28
|
+
from nat.data_models.object_store import ObjectStoreBaseConfig
|
|
29
|
+
from nat.object_store.interfaces import ObjectStore
|
|
30
|
+
from nat.runtime.loader import PluginTypes
|
|
31
|
+
from nat.runtime.loader import discover_and_register_plugins
|
|
32
32
|
|
|
33
33
|
logger = logging.getLogger(__name__)
|
|
34
34
|
|
|
@@ -231,7 +231,7 @@ class MockBuilder(Builder):
|
|
|
231
231
|
|
|
232
232
|
class ToolTestRunner:
|
|
233
233
|
"""
|
|
234
|
-
A test runner that enables isolated testing of
|
|
234
|
+
A test runner that enables isolated testing of NAT tools without requiring
|
|
235
235
|
full workflow setup, LLMs, or complex dependencies.
|
|
236
236
|
|
|
237
237
|
Usage:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nvidia-nat-test
|
|
3
|
-
Version: 1.2.
|
|
4
|
-
Summary: Testing utilities for
|
|
3
|
+
Version: 1.2.0rc6
|
|
4
|
+
Summary: Testing utilities for NeMo Agent toolkit
|
|
5
5
|
Keywords: ai,rag,agents
|
|
6
6
|
Classifier: Programming Language :: Python
|
|
7
7
|
Requires-Python: <3.13,>=3.11
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
|
-
Requires-Dist: nvidia-nat
|
|
9
|
+
Requires-Dist: nvidia-nat==v1.2.0-rc6
|
|
10
10
|
Requires-Dist: langchain-community~=0.3
|
|
11
11
|
Requires-Dist: pytest~=8.3
|
|
12
12
|
|
|
@@ -27,7 +27,7 @@ See the License for the specific language governing permissions and
|
|
|
27
27
|
limitations under the License.
|
|
28
28
|
-->
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
32
|
# NVIDIA NeMo Agent Toolkit Subpackage
|
|
33
33
|
This is a subpackage for NeMo Agent toolkit test utilities.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
nat/meta/pypi.md,sha256=LLKJHg5oN1-M9Pqfk3Bmphkk4O2TFsyiixuK5T0Y-gw,1100
|
|
2
|
+
nat/test/__init__.py,sha256=_RnTJnsUucHvla_nYKqD4O4g8Bz0tcuDRzWk1bEhcy0,875
|
|
3
|
+
nat/test/embedder.py,sha256=ClDyK1kna4hCBSlz71gK1B-ZjlwcBHTDQRekoNM81Bs,1809
|
|
4
|
+
nat/test/functions.py,sha256=0ScrdsjcxCsPRLnyb5gfwukmvZxFi_ptCswLSIG0DVY,3095
|
|
5
|
+
nat/test/memory.py,sha256=xki_A2yiMhEZuQk60K7t04QRqf32nQqnfzD5Iv7fkvw,1456
|
|
6
|
+
nat/test/object_store_tests.py,sha256=PyJioOtoSzILPq6LuD-sOZ_89PIcgXWZweoHBQpK2zQ,4281
|
|
7
|
+
nat/test/plugin.py,sha256=fp39ib0W63vfqX6Ssvq4sCuSd8Lm6yQyknL3_qRijgI,3610
|
|
8
|
+
nat/test/register.py,sha256=jU1pW5wf20ZmCOTgkaQshKZfvYh8_-sMJ4P3xXilfTY,891
|
|
9
|
+
nat/test/tool_test_runner.py,sha256=ccErldob2VwBbVL0_pmLrOcKLc18qYjxeAEACYoKKGQ,17469
|
|
10
|
+
nvidia_nat_test-1.2.0rc6.dist-info/METADATA,sha256=C1-6QU-qmIaRCq9qQI9ylmU3U2es_g4U26n1by4ojQw,1455
|
|
11
|
+
nvidia_nat_test-1.2.0rc6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
+
nvidia_nat_test-1.2.0rc6.dist-info/entry_points.txt,sha256=7dOP9XB6iMDqvav3gYx9VWUwA8RrFzhbAa8nGeC8e4Y,99
|
|
13
|
+
nvidia_nat_test-1.2.0rc6.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
|
|
14
|
+
nvidia_nat_test-1.2.0rc6.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nat
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
aiq/meta/pypi.md,sha256=XfzdATwjeiVEfSdXmjS5mhVbrHIwHNyK2CR4KtB9Qaw,1111
|
|
2
|
-
aiq/test/__init__.py,sha256=_RnTJnsUucHvla_nYKqD4O4g8Bz0tcuDRzWk1bEhcy0,875
|
|
3
|
-
aiq/test/embedder.py,sha256=Sszon2lvuET3u3mMcbdWNDh5xkYLSOFxy1WMIhKC2Ig,1809
|
|
4
|
-
aiq/test/functions.py,sha256=qlYAGip6cYh0hG7kySZzlqvdr2caZSMjQGyv9jP7rK4,3125
|
|
5
|
-
aiq/test/memory.py,sha256=UnUJuL0foiOqh6emneIg5gHnK9n1MAnaD2CO7voFfok,1456
|
|
6
|
-
aiq/test/object_store_tests.py,sha256=zPON1yYyhf07CpBbwN_ymIcBFxhogAS7tqcF-7vc9zk,4281
|
|
7
|
-
aiq/test/plugin.py,sha256=Clt81eqpJimOn5ZeUlVBlgOUfogFmPNAkCc5SxS76qo,3610
|
|
8
|
-
aiq/test/register.py,sha256=jU1pW5wf20ZmCOTgkaQshKZfvYh8_-sMJ4P3xXilfTY,891
|
|
9
|
-
aiq/test/tool_test_runner.py,sha256=ime7S4KKQcRYKoh8q6RnYwdwdCWgdftrOV7AgUQ2DnI,17469
|
|
10
|
-
nvidia_nat_test-1.2.0rc5.dist-info/METADATA,sha256=sc0Q-cUTtliaaQ-mUh8gGzFUCePoxMKP4Qr2rNfn7zE,1451
|
|
11
|
-
nvidia_nat_test-1.2.0rc5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
-
nvidia_nat_test-1.2.0rc5.dist-info/entry_points.txt,sha256=whK6YfmQvlrRJtKNiEPuDNqv_O7ZGNA5WZ7ag57CPFU,99
|
|
13
|
-
nvidia_nat_test-1.2.0rc5.dist-info/top_level.txt,sha256=fo7AzYcNhZ_tRWrhGumtxwnxMew4xrT1iwouDy_f0Kc,4
|
|
14
|
-
nvidia_nat_test-1.2.0rc5.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
aiq
|
{aiq → nat}/test/__init__.py
RENAMED
|
File without changes
|
{aiq → nat}/test/register.py
RENAMED
|
File without changes
|
|
File without changes
|