nvidia-nat-test 1.3.0rc1__py3-none-any.whl → 1.4.0a20251008__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/functions.py +9 -1
- {nvidia_nat_test-1.3.0rc1.dist-info → nvidia_nat_test-1.4.0a20251008.dist-info}/METADATA +2 -2
- {nvidia_nat_test-1.3.0rc1.dist-info → nvidia_nat_test-1.4.0a20251008.dist-info}/RECORD +6 -6
- {nvidia_nat_test-1.3.0rc1.dist-info → nvidia_nat_test-1.4.0a20251008.dist-info}/WHEEL +0 -0
- {nvidia_nat_test-1.3.0rc1.dist-info → nvidia_nat_test-1.4.0a20251008.dist-info}/entry_points.txt +0 -0
- {nvidia_nat_test-1.3.0rc1.dist-info → nvidia_nat_test-1.4.0a20251008.dist-info}/top_level.txt +0 -0
nat/test/functions.py
CHANGED
@@ -21,6 +21,7 @@ from nat.cli.register_workflow import register_function
|
|
21
21
|
from nat.data_models.api_server import ChatRequest
|
22
22
|
from nat.data_models.api_server import ChatResponse
|
23
23
|
from nat.data_models.api_server import ChatResponseChunk
|
24
|
+
from nat.data_models.api_server import Usage
|
24
25
|
from nat.data_models.function import FunctionBaseConfig
|
25
26
|
|
26
27
|
|
@@ -35,7 +36,14 @@ async def echo_function(config: EchoFunctionConfig, builder: Builder):
|
|
35
36
|
return message
|
36
37
|
|
37
38
|
async def inner_oai(message: ChatRequest) -> ChatResponse:
|
38
|
-
|
39
|
+
content = message.messages[0].content
|
40
|
+
|
41
|
+
# Create usage statistics for the response
|
42
|
+
prompt_tokens = sum(len(str(msg.content).split()) for msg in message.messages)
|
43
|
+
completion_tokens = len(content.split()) if content else 0
|
44
|
+
total_tokens = prompt_tokens + completion_tokens
|
45
|
+
usage = Usage(prompt_tokens=prompt_tokens, completion_tokens=completion_tokens, total_tokens=total_tokens)
|
46
|
+
return ChatResponse.from_string(content, usage=usage)
|
39
47
|
|
40
48
|
if (config.use_openai_api):
|
41
49
|
yield inner_oai
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: nvidia-nat-test
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.4.0a20251008
|
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.
|
12
|
+
Requires-Dist: nvidia-nat==v1.4.0a20251008
|
13
13
|
Requires-Dist: langchain-community~=0.3
|
14
14
|
Requires-Dist: pytest~=8.3
|
15
15
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
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
|
-
nat/test/functions.py,sha256=
|
4
|
+
nat/test/functions.py,sha256=ZxXVzfaLBGOpR5qtmMrKU7q-M9-vVGGj3Xi5mrw4vHY,3557
|
5
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
|
@@ -9,8 +9,8 @@ nat/test/plugin.py,sha256=P6awHPN-iVmb8VIzLX_pd9rMnR4PD8Of3H_ypPPFr8Q,11246
|
|
9
9
|
nat/test/register.py,sha256=o1BEA5fyxyFyCxXhQ6ArmtuNpgRyTEfvw6HdBgECPLI,897
|
10
10
|
nat/test/tool_test_runner.py,sha256=SxavwXHkvCQDl_PUiiiqgvGfexKJJTeBdI5i1qk6AzI,21712
|
11
11
|
nat/test/utils.py,sha256=y77p5uVpRPSQqVOnetBLvJVsSRgS4_fEgcuRoHwvRKE,3187
|
12
|
-
nvidia_nat_test-1.
|
13
|
-
nvidia_nat_test-1.
|
14
|
-
nvidia_nat_test-1.
|
15
|
-
nvidia_nat_test-1.
|
16
|
-
nvidia_nat_test-1.
|
12
|
+
nvidia_nat_test-1.4.0a20251008.dist-info/METADATA,sha256=5A2Bi7o4xQUV-GvLlvZ-Ben6mAC8P0XgzXOq_ziUWzs,1619
|
13
|
+
nvidia_nat_test-1.4.0a20251008.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
14
|
+
nvidia_nat_test-1.4.0a20251008.dist-info/entry_points.txt,sha256=7dOP9XB6iMDqvav3gYx9VWUwA8RrFzhbAa8nGeC8e4Y,99
|
15
|
+
nvidia_nat_test-1.4.0a20251008.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
|
16
|
+
nvidia_nat_test-1.4.0a20251008.dist-info/RECORD,,
|
File without changes
|
{nvidia_nat_test-1.3.0rc1.dist-info → nvidia_nat_test-1.4.0a20251008.dist-info}/entry_points.txt
RENAMED
File without changes
|
{nvidia_nat_test-1.3.0rc1.dist-info → nvidia_nat_test-1.4.0a20251008.dist-info}/top_level.txt
RENAMED
File without changes
|