nvidia-nat-adk 1.4.0a20251015__py3-none-any.whl → 1.4.0a20251022__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/plugins/adk/adk_callback_handler.py +10 -6
- nat/plugins/adk/llm.py +16 -4
- {nvidia_nat_adk-1.4.0a20251015.dist-info → nvidia_nat_adk-1.4.0a20251022.dist-info}/METADATA +2 -2
- nvidia_nat_adk-1.4.0a20251022.dist-info/RECORD +13 -0
- nvidia_nat_adk-1.4.0a20251015.dist-info/RECORD +0 -13
- {nvidia_nat_adk-1.4.0a20251015.dist-info → nvidia_nat_adk-1.4.0a20251022.dist-info}/WHEEL +0 -0
- {nvidia_nat_adk-1.4.0a20251015.dist-info → nvidia_nat_adk-1.4.0a20251022.dist-info}/entry_points.txt +0 -0
- {nvidia_nat_adk-1.4.0a20251015.dist-info → nvidia_nat_adk-1.4.0a20251022.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {nvidia_nat_adk-1.4.0a20251015.dist-info → nvidia_nat_adk-1.4.0a20251022.dist-info}/licenses/LICENSE.md +0 -0
- {nvidia_nat_adk-1.4.0a20251015.dist-info → nvidia_nat_adk-1.4.0a20251022.dist-info}/top_level.txt +0 -0
|
@@ -214,21 +214,23 @@ class ADKProfilerHandler(BaseProfilerCallback):
|
|
|
214
214
|
model_name = first
|
|
215
215
|
model_name = model_name or ""
|
|
216
216
|
|
|
217
|
-
model_input =
|
|
217
|
+
model_input = []
|
|
218
218
|
try:
|
|
219
219
|
for message in kwargs.get("messages", []):
|
|
220
220
|
content = message.get("content", "")
|
|
221
221
|
if isinstance(content, list):
|
|
222
222
|
for part in content:
|
|
223
223
|
if isinstance(part, dict):
|
|
224
|
-
model_input
|
|
224
|
+
model_input.append(str(part.get("text", ""))) # text parts
|
|
225
225
|
else:
|
|
226
|
-
model_input
|
|
226
|
+
model_input.append(str(part))
|
|
227
227
|
else:
|
|
228
|
-
model_input
|
|
228
|
+
model_input.append("" if content is None else str(content))
|
|
229
229
|
except Exception as _e:
|
|
230
230
|
logger.exception("Error getting model input")
|
|
231
231
|
|
|
232
|
+
model_input = "".join(model_input)
|
|
233
|
+
|
|
232
234
|
# Record the start event
|
|
233
235
|
input_stats = IntermediateStepPayload(
|
|
234
236
|
event_type=IntermediateStepType.LLM_START,
|
|
@@ -252,14 +254,16 @@ class ADKProfilerHandler(BaseProfilerCallback):
|
|
|
252
254
|
raise RuntimeError("Original LLM function is None - instrumentation may not have been set up correctly")
|
|
253
255
|
output = await original_func(*args, **kwargs)
|
|
254
256
|
|
|
255
|
-
model_output =
|
|
257
|
+
model_output = []
|
|
256
258
|
try:
|
|
257
259
|
for choice in output.choices:
|
|
258
260
|
msg = choice.message
|
|
259
|
-
model_output
|
|
261
|
+
model_output.append(msg.content or "")
|
|
260
262
|
except Exception as _e:
|
|
261
263
|
logger.exception("Error getting model output")
|
|
262
264
|
|
|
265
|
+
model_output = "".join(model_output)
|
|
266
|
+
|
|
263
267
|
now = time.time()
|
|
264
268
|
# Record the end event
|
|
265
269
|
# Prepare safe metadata and usage
|
nat/plugins/adk/llm.py
CHANGED
|
@@ -23,6 +23,7 @@ from nat.llm.azure_openai_llm import AzureOpenAIModelConfig
|
|
|
23
23
|
from nat.llm.litellm_llm import LiteLlmModelConfig
|
|
24
24
|
from nat.llm.nim_llm import NIMModelConfig
|
|
25
25
|
from nat.llm.openai_llm import OpenAIModelConfig
|
|
26
|
+
from nat.utils.responses_api import validate_no_responses_api
|
|
26
27
|
|
|
27
28
|
logger = logging.getLogger(__name__)
|
|
28
29
|
|
|
@@ -37,8 +38,12 @@ async def azure_openai_adk(config: AzureOpenAIModelConfig, _builder: Builder):
|
|
|
37
38
|
"""
|
|
38
39
|
from google.adk.models.lite_llm import LiteLlm
|
|
39
40
|
|
|
41
|
+
validate_no_responses_api(config, LLMFrameworkEnum.ADK)
|
|
42
|
+
|
|
40
43
|
config_dict = config.model_dump(
|
|
41
|
-
exclude={
|
|
44
|
+
exclude={
|
|
45
|
+
"type", "max_retries", "thinking", "azure_endpoint", "azure_deployment", "model_name", "model", "api_type"
|
|
46
|
+
},
|
|
42
47
|
by_alias=True,
|
|
43
48
|
exclude_none=True,
|
|
44
49
|
)
|
|
@@ -51,8 +56,11 @@ async def azure_openai_adk(config: AzureOpenAIModelConfig, _builder: Builder):
|
|
|
51
56
|
@register_llm_client(config_type=LiteLlmModelConfig, wrapper_type=LLMFrameworkEnum.ADK)
|
|
52
57
|
async def litellm_adk(litellm_config: LiteLlmModelConfig, _builder: Builder):
|
|
53
58
|
from google.adk.models.lite_llm import LiteLlm
|
|
59
|
+
|
|
60
|
+
validate_no_responses_api(litellm_config, LLMFrameworkEnum.ADK)
|
|
61
|
+
|
|
54
62
|
yield LiteLlm(**litellm_config.model_dump(
|
|
55
|
-
exclude={"type", "max_retries", "thinking"},
|
|
63
|
+
exclude={"type", "max_retries", "thinking", "api_type"},
|
|
56
64
|
by_alias=True,
|
|
57
65
|
exclude_none=True,
|
|
58
66
|
))
|
|
@@ -69,6 +77,8 @@ async def nim_adk(config: NIMModelConfig, _builder: Builder):
|
|
|
69
77
|
import litellm
|
|
70
78
|
from google.adk.models.lite_llm import LiteLlm
|
|
71
79
|
|
|
80
|
+
validate_no_responses_api(config, LLMFrameworkEnum.ADK)
|
|
81
|
+
|
|
72
82
|
logger.warning("NIMs do not currently support tools with ADK. Tools will be ignored.")
|
|
73
83
|
litellm.add_function_to_prompt = True
|
|
74
84
|
litellm.drop_params = True
|
|
@@ -77,7 +87,7 @@ async def nim_adk(config: NIMModelConfig, _builder: Builder):
|
|
|
77
87
|
os.environ["NVIDIA_NIM_API_KEY"] = api_key
|
|
78
88
|
|
|
79
89
|
config_dict = config.model_dump(
|
|
80
|
-
exclude={"type", "max_retries", "thinking", "model_name", "model", "base_url"},
|
|
90
|
+
exclude={"type", "max_retries", "thinking", "model_name", "model", "base_url", "api_type"},
|
|
81
91
|
by_alias=True,
|
|
82
92
|
exclude_none=True,
|
|
83
93
|
)
|
|
@@ -97,8 +107,10 @@ async def openai_adk(config: OpenAIModelConfig, _builder: Builder):
|
|
|
97
107
|
"""
|
|
98
108
|
from google.adk.models.lite_llm import LiteLlm
|
|
99
109
|
|
|
110
|
+
validate_no_responses_api(config, LLMFrameworkEnum.ADK)
|
|
111
|
+
|
|
100
112
|
config_dict = config.model_dump(
|
|
101
|
-
exclude={"type", "max_retries", "thinking", "model_name", "model", "base_url"},
|
|
113
|
+
exclude={"type", "max_retries", "thinking", "model_name", "model", "base_url", "api_type"},
|
|
102
114
|
by_alias=True,
|
|
103
115
|
exclude_none=True,
|
|
104
116
|
)
|
{nvidia_nat_adk-1.4.0a20251015.dist-info → nvidia_nat_adk-1.4.0a20251022.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nvidia-nat-adk
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.0a20251022
|
|
4
4
|
Summary: Subpackage for Google ADK integration in NeMo Agent Toolkit
|
|
5
5
|
Author: NVIDIA Corporation
|
|
6
6
|
Maintainer: NVIDIA Corporation
|
|
@@ -16,7 +16,7 @@ Requires-Python: <3.14,>=3.11
|
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE-3rd-party.txt
|
|
18
18
|
License-File: LICENSE.md
|
|
19
|
-
Requires-Dist: nvidia-nat[litellm]==v1.4.
|
|
19
|
+
Requires-Dist: nvidia-nat[litellm]==v1.4.0a20251022
|
|
20
20
|
Requires-Dist: google-adk~=1.14.1
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
nat/meta/pypi.md,sha256=AOSYTEk4JQQeaQQ1fA7v__j9-5rchBPvvSAICORgttE,953
|
|
2
|
+
nat/plugins/adk/__init__.py,sha256=GUJrgGtpvyMUCjUBvR3faAdv-tZzbU9W-izgx9aMEQg,680
|
|
3
|
+
nat/plugins/adk/adk_callback_handler.py,sha256=JtyqakzOVGhnGQOZY7RRrWIO6rFNgsrC2j5Dv42HlkQ,12706
|
|
4
|
+
nat/plugins/adk/llm.py,sha256=43UaoTcEnNmpLGX3VdYIL89jrpcudC2lUnpbcUTn5l4,4505
|
|
5
|
+
nat/plugins/adk/register.py,sha256=q6ZOmldtbr_7Gr8iUS8xrhR8_FhSubwGqr7VJNrZg1A,809
|
|
6
|
+
nat/plugins/adk/tool_wrapper.py,sha256=TroOo7tM6I3gOqMxOL7fQmPsyVKlntPPRNbYQMk6JHs,5779
|
|
7
|
+
nvidia_nat_adk-1.4.0a20251022.dist-info/licenses/LICENSE-3rd-party.txt,sha256=fOk5jMmCX9YoKWyYzTtfgl-SUy477audFC5hNY4oP7Q,284609
|
|
8
|
+
nvidia_nat_adk-1.4.0a20251022.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
9
|
+
nvidia_nat_adk-1.4.0a20251022.dist-info/METADATA,sha256=rz6lcUYOqcuiWoKfNnuQ1BaGE-Uj0shkstBfU0pUu_w,1772
|
|
10
|
+
nvidia_nat_adk-1.4.0a20251022.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
nvidia_nat_adk-1.4.0a20251022.dist-info/entry_points.txt,sha256=K1K0clA1uqXk1Q0dh8ZaWNQyveaFx_XvgBWzCyGMYts,52
|
|
12
|
+
nvidia_nat_adk-1.4.0a20251022.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
|
|
13
|
+
nvidia_nat_adk-1.4.0a20251022.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
nat/meta/pypi.md,sha256=AOSYTEk4JQQeaQQ1fA7v__j9-5rchBPvvSAICORgttE,953
|
|
2
|
-
nat/plugins/adk/__init__.py,sha256=GUJrgGtpvyMUCjUBvR3faAdv-tZzbU9W-izgx9aMEQg,680
|
|
3
|
-
nat/plugins/adk/adk_callback_handler.py,sha256=MMjMp6WN1zCVOFqoJWC90H0GGCHs49qMgoHfMHFitsU,12562
|
|
4
|
-
nat/plugins/adk/llm.py,sha256=glwlO9UQhfGagVDNbtw-bNQ7FVdJfs31v6rqd-MBJLY,4120
|
|
5
|
-
nat/plugins/adk/register.py,sha256=q6ZOmldtbr_7Gr8iUS8xrhR8_FhSubwGqr7VJNrZg1A,809
|
|
6
|
-
nat/plugins/adk/tool_wrapper.py,sha256=TroOo7tM6I3gOqMxOL7fQmPsyVKlntPPRNbYQMk6JHs,5779
|
|
7
|
-
nvidia_nat_adk-1.4.0a20251015.dist-info/licenses/LICENSE-3rd-party.txt,sha256=fOk5jMmCX9YoKWyYzTtfgl-SUy477audFC5hNY4oP7Q,284609
|
|
8
|
-
nvidia_nat_adk-1.4.0a20251015.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
9
|
-
nvidia_nat_adk-1.4.0a20251015.dist-info/METADATA,sha256=JgOFnBO62pM8Tp6NT9l5akxOmyw5Igjp32T5QpyqBk8,1772
|
|
10
|
-
nvidia_nat_adk-1.4.0a20251015.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
-
nvidia_nat_adk-1.4.0a20251015.dist-info/entry_points.txt,sha256=K1K0clA1uqXk1Q0dh8ZaWNQyveaFx_XvgBWzCyGMYts,52
|
|
12
|
-
nvidia_nat_adk-1.4.0a20251015.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
|
|
13
|
-
nvidia_nat_adk-1.4.0a20251015.dist-info/RECORD,,
|
|
File without changes
|
{nvidia_nat_adk-1.4.0a20251015.dist-info → nvidia_nat_adk-1.4.0a20251022.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nvidia_nat_adk-1.4.0a20251015.dist-info → nvidia_nat_adk-1.4.0a20251022.dist-info}/top_level.txt
RENAMED
|
File without changes
|