nvidia-nat-semantic-kernel 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.
- {aiq → nat}/meta/pypi.md +1 -1
- {aiq → nat}/plugins/semantic_kernel/llm.py +6 -6
- {aiq → nat}/plugins/semantic_kernel/tool_wrapper.py +16 -16
- {nvidia_nat_semantic_kernel-1.2.0rc5.dist-info → nvidia_nat_semantic_kernel-1.2.0rc6.dist-info}/METADATA +4 -4
- nvidia_nat_semantic_kernel-1.2.0rc6.dist-info/RECORD +10 -0
- nvidia_nat_semantic_kernel-1.2.0rc6.dist-info/entry_points.txt +2 -0
- nvidia_nat_semantic_kernel-1.2.0rc6.dist-info/top_level.txt +1 -0
- nvidia_nat_semantic_kernel-1.2.0rc5.dist-info/RECORD +0 -10
- nvidia_nat_semantic_kernel-1.2.0rc5.dist-info/entry_points.txt +0 -2
- nvidia_nat_semantic_kernel-1.2.0rc5.dist-info/top_level.txt +0 -1
- {aiq → nat}/plugins/semantic_kernel/__init__.py +0 -0
- {aiq → nat}/plugins/semantic_kernel/register.py +0 -0
- {nvidia_nat_semantic_kernel-1.2.0rc5.dist-info → nvidia_nat_semantic_kernel-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 Semantic-Kernel integration in NeMo Agent toolkit.
|
|
@@ -13,12 +13,12 @@
|
|
|
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
|
|
21
|
-
from
|
|
16
|
+
from nat.builder.builder import Builder
|
|
17
|
+
from nat.builder.framework_enum import LLMFrameworkEnum
|
|
18
|
+
from nat.cli.register_workflow import register_llm_client
|
|
19
|
+
from nat.data_models.retry_mixin import RetryMixin
|
|
20
|
+
from nat.llm.openai_llm import OpenAIModelConfig
|
|
21
|
+
from nat.utils.exception_handlers.automatic_retries import patch_with_retry
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
@register_llm_client(config_type=OpenAIModelConfig, wrapper_type=LLMFrameworkEnum.SEMANTIC_KERNEL)
|
|
@@ -24,10 +24,10 @@ from typing import get_origin
|
|
|
24
24
|
|
|
25
25
|
from pydantic import BaseModel
|
|
26
26
|
|
|
27
|
-
from
|
|
28
|
-
from
|
|
29
|
-
from
|
|
30
|
-
from
|
|
27
|
+
from nat.builder.builder import Builder
|
|
28
|
+
from nat.builder.framework_enum import LLMFrameworkEnum
|
|
29
|
+
from nat.builder.function import Function
|
|
30
|
+
from nat.cli.register_workflow import register_tool_wrapper
|
|
31
31
|
|
|
32
32
|
logger = logging.getLogger(__name__)
|
|
33
33
|
|
|
@@ -75,37 +75,37 @@ def semantic_kernel_tool_wrapper(name: str, fn: Function, builder: Builder):
|
|
|
75
75
|
async for item in fn.acall_stream(*args, **kwargs):
|
|
76
76
|
yield item
|
|
77
77
|
|
|
78
|
-
def
|
|
78
|
+
def nat_kernel_function(
|
|
79
79
|
func: Callable[..., object] | None = None,
|
|
80
|
-
|
|
80
|
+
nat_function: Function | None = None,
|
|
81
81
|
name: str | None = None,
|
|
82
82
|
description: str | None = None,
|
|
83
83
|
) -> Callable[..., Any]:
|
|
84
84
|
"""
|
|
85
85
|
Modified version of Semantic Kernel's kernel_function decorator.
|
|
86
86
|
|
|
87
|
-
Uses `
|
|
87
|
+
Uses `nat` Function properties instead of doing type inference on the function's inner
|
|
88
88
|
"""
|
|
89
89
|
|
|
90
90
|
def decorator(func: Callable[..., object]) -> Callable[..., object]:
|
|
91
91
|
"""The actual decorator function."""
|
|
92
92
|
setattr(func, "__kernel_function__", True)
|
|
93
|
-
setattr(func, "__kernel_function_description__", description or
|
|
94
|
-
setattr(func, "__kernel_function_name__", name or
|
|
93
|
+
setattr(func, "__kernel_function_description__", description or nat_function.description)
|
|
94
|
+
setattr(func, "__kernel_function_name__", name or nat_function.config.type)
|
|
95
95
|
|
|
96
96
|
# Always defer to single output schema, if present, for now
|
|
97
97
|
# No need to check streaming output is present given one of the two is always present
|
|
98
|
-
has_single =
|
|
99
|
-
has_streaming =
|
|
100
|
-
output_schema =
|
|
101
|
-
setattr(func, "__kernel_function_streaming__", not
|
|
98
|
+
has_single = nat_function.has_single_output
|
|
99
|
+
has_streaming = nat_function.has_streaming_output
|
|
100
|
+
output_schema = nat_function.single_output_schema if has_single else nat_function.streaming_output_schema
|
|
101
|
+
setattr(func, "__kernel_function_streaming__", not nat_function.has_single_output if has_single else True)
|
|
102
102
|
|
|
103
103
|
if has_single and has_streaming:
|
|
104
104
|
logger.warning("Function has both single and streaming output schemas. "
|
|
105
105
|
"Defaulting to single output schema.")
|
|
106
106
|
|
|
107
107
|
input_annotations = []
|
|
108
|
-
for arg_name, annotation in
|
|
108
|
+
for arg_name, annotation in nat_function.input_schema.model_fields.items():
|
|
109
109
|
type_obj = resolve_type(annotation.annotation)
|
|
110
110
|
include_in_choices = True
|
|
111
111
|
if isinstance(type_obj, type) and (issubclass(type_obj, BaseModel) or is_dataclass(type_obj)):
|
|
@@ -156,8 +156,8 @@ def semantic_kernel_tool_wrapper(name: str, fn: Function, builder: Builder):
|
|
|
156
156
|
return decorator
|
|
157
157
|
|
|
158
158
|
if fn.has_streaming_output and not fn.has_single_output:
|
|
159
|
-
kernel_func =
|
|
159
|
+
kernel_func = nat_kernel_function(func=callable_astream, nat_function=fn, name=name, description=fn.description)
|
|
160
160
|
else:
|
|
161
|
-
kernel_func =
|
|
161
|
+
kernel_func = nat_kernel_function(func=callable_ainvoke, nat_function=fn, name=name, description=fn.description)
|
|
162
162
|
|
|
163
163
|
return {name: kernel_func}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nvidia-nat-semantic-kernel
|
|
3
|
-
Version: 1.2.
|
|
4
|
-
Summary: Subpackage for Semantic-Kernel integration in
|
|
3
|
+
Version: 1.2.0rc6
|
|
4
|
+
Summary: Subpackage for Semantic-Kernel integration in 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: semantic-kernel~=1.24.0
|
|
11
11
|
|
|
12
12
|
<!--
|
|
@@ -26,7 +26,7 @@ See the License for the specific language governing permissions and
|
|
|
26
26
|
limitations under the License.
|
|
27
27
|
-->
|
|
28
28
|
|
|
29
|
-

|
|
30
30
|
|
|
31
31
|
# NVIDIA NeMo Agent Toolkit Subpackage
|
|
32
32
|
This is a subpackage for Semantic-Kernel integration in NeMo Agent toolkit.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
nat/meta/pypi.md,sha256=rFmwVds3akmoz0TE1SOjCjCUbB6SWfaRex_Vi5OfUAk,1116
|
|
2
|
+
nat/plugins/semantic_kernel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
nat/plugins/semantic_kernel/llm.py,sha256=C2ISvuCkz_YN0yOgyf1QJPtbJmX_1kgLpQumwpKfcOI,1744
|
|
4
|
+
nat/plugins/semantic_kernel/register.py,sha256=RKXyuaXy4ftA5IL2RrCofIBjpie_-2lP9YZoHAiyPU0,863
|
|
5
|
+
nat/plugins/semantic_kernel/tool_wrapper.py,sha256=PEtzcYhZ73ftsg80Jz9yWTWQtks1y7PDZdS89seFb3I,7175
|
|
6
|
+
nvidia_nat_semantic_kernel-1.2.0rc6.dist-info/METADATA,sha256=8YGoAQnvVPfkSM-4n_EeiVZqGha_7N4eKdA8weiUv7c,1478
|
|
7
|
+
nvidia_nat_semantic_kernel-1.2.0rc6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
nvidia_nat_semantic_kernel-1.2.0rc6.dist-info/entry_points.txt,sha256=0jCtQBAn5Ohs9XoVCF34WvNCV33OwAsH8bjFzgw_ByM,76
|
|
9
|
+
nvidia_nat_semantic_kernel-1.2.0rc6.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
|
|
10
|
+
nvidia_nat_semantic_kernel-1.2.0rc6.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nat
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
aiq/meta/pypi.md,sha256=Ki8bvrAo3d2iW7q6vTszp2AY2fapDP--el1wKuOtWcQ,1127
|
|
2
|
-
aiq/plugins/semantic_kernel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
aiq/plugins/semantic_kernel/llm.py,sha256=l13R5Wv50iQ8OQ2juAFCoPoll6ZtIbojTnWjyGjepGI,1744
|
|
4
|
-
aiq/plugins/semantic_kernel/register.py,sha256=RKXyuaXy4ftA5IL2RrCofIBjpie_-2lP9YZoHAiyPU0,863
|
|
5
|
-
aiq/plugins/semantic_kernel/tool_wrapper.py,sha256=miogE5cp3o5H-KxaKp1dMqqJZnV-UMsYb1PQ4ox-xKY,7175
|
|
6
|
-
nvidia_nat_semantic_kernel-1.2.0rc5.dist-info/METADATA,sha256=nc7IguzX3ahlmWrPjnadRw_UUP11w8QoJyexsM7Q8sM,1474
|
|
7
|
-
nvidia_nat_semantic_kernel-1.2.0rc5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
nvidia_nat_semantic_kernel-1.2.0rc5.dist-info/entry_points.txt,sha256=qGCOsf9tkWvc5EUonXrUI96cDrTJ3qoueyy3DgClK3M,76
|
|
9
|
-
nvidia_nat_semantic_kernel-1.2.0rc5.dist-info/top_level.txt,sha256=fo7AzYcNhZ_tRWrhGumtxwnxMew4xrT1iwouDy_f0Kc,4
|
|
10
|
-
nvidia_nat_semantic_kernel-1.2.0rc5.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
aiq
|
|
File without changes
|
|
File without changes
|
|
File without changes
|