nvidia-nat 1.3.0a20250904__py3-none-any.whl → 1.3.0a20250909__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/builder/component_utils.py +1 -1
- nat/cli/commands/info/list_mcp.py +29 -7
- nat/cli/commands/workflow/templates/pyproject.toml.j2 +1 -1
- nat/data_models/common.py +1 -1
- nat/data_models/thinking_mixin.py +2 -3
- nat/eval/utils/weave_eval.py +6 -4
- nat/front_ends/fastapi/fastapi_front_end_config.py +18 -2
- nat/observability/exporter/processing_exporter.py +294 -39
- nat/observability/mixin/redaction_config_mixin.py +41 -0
- nat/observability/mixin/tagging_config_mixin.py +50 -0
- nat/observability/processor/header_redaction_processor.py +123 -0
- nat/observability/processor/redaction_processor.py +77 -0
- nat/observability/processor/span_tagging_processor.py +61 -0
- nat/tool/register.py +0 -2
- {nvidia_nat-1.3.0a20250904.dist-info → nvidia_nat-1.3.0a20250909.dist-info}/METADATA +7 -2
- {nvidia_nat-1.3.0a20250904.dist-info → nvidia_nat-1.3.0a20250909.dist-info}/RECORD +21 -22
- nat/tool/mcp/__init__.py +0 -14
- nat/tool/mcp/exceptions.py +0 -142
- nat/tool/mcp/mcp_client_base.py +0 -406
- nat/tool/mcp/mcp_client_impl.py +0 -229
- nat/tool/mcp/mcp_tool.py +0 -133
- nat/utils/exception_handlers/mcp.py +0 -211
- {nvidia_nat-1.3.0a20250904.dist-info → nvidia_nat-1.3.0a20250909.dist-info}/WHEEL +0 -0
- {nvidia_nat-1.3.0a20250904.dist-info → nvidia_nat-1.3.0a20250909.dist-info}/entry_points.txt +0 -0
- {nvidia_nat-1.3.0a20250904.dist-info → nvidia_nat-1.3.0a20250909.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {nvidia_nat-1.3.0a20250904.dist-info → nvidia_nat-1.3.0a20250909.dist-info}/licenses/LICENSE.md +0 -0
- {nvidia_nat-1.3.0a20250904.dist-info → nvidia_nat-1.3.0a20250909.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
from enum import Enum
|
|
17
|
+
from typing import Generic
|
|
18
|
+
from typing import TypeVar
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel
|
|
21
|
+
from pydantic import Field
|
|
22
|
+
|
|
23
|
+
TagValueT = TypeVar("TagValueT")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class PrivacyLevel(str, Enum):
|
|
27
|
+
"""Privacy level for the traces."""
|
|
28
|
+
NONE = "none"
|
|
29
|
+
LOW = "low"
|
|
30
|
+
MEDIUM = "medium"
|
|
31
|
+
HIGH = "high"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TaggingConfigMixin(BaseModel, Generic[TagValueT]):
|
|
35
|
+
"""Generic mixin for tagging spans with typed values.
|
|
36
|
+
|
|
37
|
+
This mixin provides a flexible tagging system where both the tag key
|
|
38
|
+
and value type can be customized for different use cases.
|
|
39
|
+
"""
|
|
40
|
+
tag_key: str | None = Field(default=None, description="Key to use when tagging traces.")
|
|
41
|
+
tag_value: TagValueT | None = Field(default=None, description="Value to tag the traces with.")
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class PrivacyTaggingConfigMixin(TaggingConfigMixin[PrivacyLevel]):
|
|
45
|
+
"""Mixin for privacy level tagging on spans.
|
|
46
|
+
|
|
47
|
+
Specializes TaggingConfigMixin to work with PrivacyLevel enum values,
|
|
48
|
+
providing a typed interface for privacy-related span tagging.
|
|
49
|
+
"""
|
|
50
|
+
pass
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
import logging
|
|
17
|
+
from collections.abc import Callable
|
|
18
|
+
from functools import lru_cache
|
|
19
|
+
|
|
20
|
+
from starlette.datastructures import Headers
|
|
21
|
+
|
|
22
|
+
from nat.builder.context import Context
|
|
23
|
+
from nat.data_models.span import Span
|
|
24
|
+
from nat.observability.processor.redaction_processor import SpanRedactionProcessor
|
|
25
|
+
from nat.utils.type_utils import override
|
|
26
|
+
|
|
27
|
+
logger = logging.getLogger(__name__)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def default_callback(_auth_key: str) -> bool:
|
|
31
|
+
"""Default callback that always returns False."""
|
|
32
|
+
return False
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class HeaderRedactionProcessor(SpanRedactionProcessor):
|
|
36
|
+
"""Processor that redacts the span based on auth key, span attributes, and callback.
|
|
37
|
+
|
|
38
|
+
Uses an LRU cache to avoid redundant callback executions for the same auth keys,
|
|
39
|
+
providing bounded memory usage and automatic eviction of least recently used entries.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
attributes: List of span attribute keys to redact.
|
|
43
|
+
header: The header key to check for authentication.
|
|
44
|
+
callback: Function to determine if the auth key should trigger redaction.
|
|
45
|
+
enabled: Whether the processor is enabled (default: True).
|
|
46
|
+
force_redact: If True, always redact regardless of header checks (default: False).
|
|
47
|
+
redaction_value: The value to replace redacted attributes with (default: "[REDACTED]").
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
def __init__(self,
|
|
51
|
+
attributes: list[str] | None = None,
|
|
52
|
+
header: str | None = None,
|
|
53
|
+
callback: Callable[[str], bool] | None = None,
|
|
54
|
+
enabled: bool = True,
|
|
55
|
+
force_redact: bool = False,
|
|
56
|
+
redaction_value: str = "[REDACTED]"):
|
|
57
|
+
self.attributes = attributes or []
|
|
58
|
+
self.header = header
|
|
59
|
+
self.callback = callback or default_callback
|
|
60
|
+
self.enabled = enabled
|
|
61
|
+
self.force_redact = force_redact
|
|
62
|
+
self.redaction_value = redaction_value
|
|
63
|
+
|
|
64
|
+
@override
|
|
65
|
+
def should_redact(self, item: Span, context: Context) -> bool:
|
|
66
|
+
"""Determine if this span should be redacted based on header auth.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
item (Span): The span to check.
|
|
70
|
+
context (Context): The current context.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
bool: True if the span should be redacted, False otherwise.
|
|
74
|
+
"""
|
|
75
|
+
# If force_redact is enabled, always redact regardless of other conditions
|
|
76
|
+
if self.force_redact:
|
|
77
|
+
return True
|
|
78
|
+
|
|
79
|
+
if not self.enabled:
|
|
80
|
+
return False
|
|
81
|
+
|
|
82
|
+
headers: Headers | None = context.metadata.headers
|
|
83
|
+
|
|
84
|
+
if headers is None or self.header is None:
|
|
85
|
+
return False
|
|
86
|
+
|
|
87
|
+
auth_key = headers.get(self.header, None)
|
|
88
|
+
|
|
89
|
+
if not auth_key:
|
|
90
|
+
return False
|
|
91
|
+
|
|
92
|
+
# Use LRU cached method to determine if redaction is needed
|
|
93
|
+
return self._should_redact_impl(auth_key)
|
|
94
|
+
|
|
95
|
+
@lru_cache(maxsize=128)
|
|
96
|
+
def _should_redact_impl(self, auth_key: str) -> bool:
|
|
97
|
+
"""Implementation method for checking if redaction should occur.
|
|
98
|
+
|
|
99
|
+
This method uses lru_cache to avoid redundant callback executions.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
auth_key (str): The authentication key to check.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
bool: True if the span should be redacted, False otherwise.
|
|
106
|
+
"""
|
|
107
|
+
return self.callback(auth_key)
|
|
108
|
+
|
|
109
|
+
@override
|
|
110
|
+
def redact_item(self, item: Span) -> Span:
|
|
111
|
+
"""Redact the span.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
item (Span): The span to redact.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
Span: The redacted span.
|
|
118
|
+
"""
|
|
119
|
+
for key in self.attributes:
|
|
120
|
+
if key in item.attributes:
|
|
121
|
+
item.attributes[key] = self.redaction_value
|
|
122
|
+
|
|
123
|
+
return item
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
import logging
|
|
17
|
+
from abc import ABC
|
|
18
|
+
from abc import abstractmethod
|
|
19
|
+
from typing import TypeVar
|
|
20
|
+
|
|
21
|
+
from nat.builder.context import Context
|
|
22
|
+
from nat.data_models.span import Span
|
|
23
|
+
from nat.observability.processor.processor import Processor
|
|
24
|
+
from nat.utils.type_utils import override
|
|
25
|
+
|
|
26
|
+
RedactionItemT = TypeVar('RedactionItemT')
|
|
27
|
+
|
|
28
|
+
logger = logging.getLogger(__name__)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class RedactionProcessor(Processor[RedactionItemT, RedactionItemT], ABC):
|
|
32
|
+
"""Abstract base class for redaction processors."""
|
|
33
|
+
|
|
34
|
+
@abstractmethod
|
|
35
|
+
def should_redact(self, item: RedactionItemT, context: Context) -> bool:
|
|
36
|
+
"""Determine if this item should be redacted.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
item (RedactionItemT): The item to check.
|
|
40
|
+
context (Context): The current context.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
bool: True if the item should be redacted, False otherwise.
|
|
44
|
+
"""
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
@abstractmethod
|
|
48
|
+
def redact_item(self, item: RedactionItemT) -> RedactionItemT:
|
|
49
|
+
"""Redact the item.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
item (RedactionItemT): The item to redact.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
RedactionItemT: The redacted item.
|
|
56
|
+
"""
|
|
57
|
+
pass
|
|
58
|
+
|
|
59
|
+
@override
|
|
60
|
+
async def process(self, item: RedactionItemT) -> RedactionItemT:
|
|
61
|
+
"""Perform redaction on the item if it should be redacted.
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
item (RedactionItemT): The item to process.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
RedactionItemT: The processed item.
|
|
68
|
+
"""
|
|
69
|
+
context = Context.get()
|
|
70
|
+
if self.should_redact(item, context):
|
|
71
|
+
return self.redact_item(item)
|
|
72
|
+
return item
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class SpanRedactionProcessor(RedactionProcessor[Span]):
|
|
76
|
+
"""Abstract base class for span redaction processors."""
|
|
77
|
+
pass
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
import logging
|
|
17
|
+
import os
|
|
18
|
+
|
|
19
|
+
from nat.data_models.span import Span
|
|
20
|
+
from nat.observability.processor.processor import Processor
|
|
21
|
+
from nat.utils.type_utils import override
|
|
22
|
+
|
|
23
|
+
logger = logging.getLogger(__name__)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class SpanTaggingProcessor(Processor[Span, Span]):
|
|
27
|
+
"""Processor that tags spans with key-value metadata attributes.
|
|
28
|
+
|
|
29
|
+
This processor adds custom tags to spans by setting attributes with a configurable prefix.
|
|
30
|
+
Tags are only applied when both tag_key and tag_value are provided. The processor uses
|
|
31
|
+
a span prefix (configurable via NAT_SPAN_PREFIX environment variable) to namespace
|
|
32
|
+
the tag attributes.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
tag_key: The key name for the tag to add to spans.
|
|
36
|
+
tag_value: The value for the tag to add to spans.
|
|
37
|
+
span_prefix: The prefix to use for tag attributes (default: from NAT_SPAN_PREFIX env var or "nat").
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
def __init__(self, tag_key: str | None = None, tag_value: str | None = None, span_prefix: str | None = None):
|
|
41
|
+
self.tag_key = tag_key
|
|
42
|
+
self.tag_value = tag_value
|
|
43
|
+
|
|
44
|
+
if span_prefix is None:
|
|
45
|
+
span_prefix = os.getenv("NAT_SPAN_PREFIX", "nat").strip() or "nat"
|
|
46
|
+
|
|
47
|
+
self._span_prefix = span_prefix
|
|
48
|
+
|
|
49
|
+
@override
|
|
50
|
+
async def process(self, item: Span) -> Span:
|
|
51
|
+
"""Tag the span with a tag if both tag_key and tag_value are provided.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
item (Span): The span to tag.
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
Span: The tagged span.
|
|
58
|
+
"""
|
|
59
|
+
if self.tag_key and self.tag_value:
|
|
60
|
+
item.set_attribute(f"{self._span_prefix}.{self.tag_key}", self.tag_value)
|
|
61
|
+
return item
|
nat/tool/register.py
CHANGED
|
@@ -31,8 +31,6 @@ from .github_tools import get_github_file
|
|
|
31
31
|
from .github_tools import get_github_issue
|
|
32
32
|
from .github_tools import get_github_pr
|
|
33
33
|
from .github_tools import update_github_issue
|
|
34
|
-
from .mcp import mcp_client_impl
|
|
35
|
-
from .mcp import mcp_tool
|
|
36
34
|
from .memory_tools import add_memory_tool
|
|
37
35
|
from .memory_tools import delete_memory_tool
|
|
38
36
|
from .memory_tools import get_memory_tool
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nvidia-nat
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.0a20250909
|
|
4
4
|
Summary: NVIDIA NeMo Agent toolkit
|
|
5
5
|
Author: NVIDIA Corporation
|
|
6
6
|
Maintainer: NVIDIA Corporation
|
|
@@ -207,7 +207,10 @@ License: Apache License
|
|
|
207
207
|
limitations under the License.
|
|
208
208
|
Keywords: ai,rag,agents
|
|
209
209
|
Classifier: Programming Language :: Python
|
|
210
|
-
|
|
210
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
211
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
212
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
213
|
+
Requires-Python: <3.14,>=3.11
|
|
211
214
|
Description-Content-Type: text/markdown
|
|
212
215
|
License-File: LICENSE-3rd-party.txt
|
|
213
216
|
License-File: LICENSE.md
|
|
@@ -252,6 +255,8 @@ Provides-Extra: langchain
|
|
|
252
255
|
Requires-Dist: nvidia-nat-langchain; extra == "langchain"
|
|
253
256
|
Provides-Extra: llama-index
|
|
254
257
|
Requires-Dist: nvidia-nat-llama-index; extra == "llama-index"
|
|
258
|
+
Provides-Extra: mcp
|
|
259
|
+
Requires-Dist: nvidia-nat-mcp; extra == "mcp"
|
|
255
260
|
Provides-Extra: mem0ai
|
|
256
261
|
Requires-Dist: nvidia-nat-mem0ai; extra == "mem0ai"
|
|
257
262
|
Provides-Extra: opentelemetry
|
|
@@ -35,7 +35,7 @@ nat/authentication/oauth2/oauth2_auth_code_flow_provider_config.py,sha256=e165ys
|
|
|
35
35
|
nat/authentication/oauth2/register.py,sha256=7rXhf-ilgSS_bUJsd9pOOCotL1FM8dKUt3ke1TllKkQ,1228
|
|
36
36
|
nat/builder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
37
|
nat/builder/builder.py,sha256=kLqfg69IOtKb4-_iK8Vht0USbmf9dZry5YQgbfDJOzI,10016
|
|
38
|
-
nat/builder/component_utils.py,sha256=
|
|
38
|
+
nat/builder/component_utils.py,sha256=aVVLW468v0nbX1RxS5jBPaCvlnTRiHqwbmHuRyVh-2E,13581
|
|
39
39
|
nat/builder/context.py,sha256=LLyMNwgF5h5Sx1qGdNz3rp4CaJfDn_ytd7T_qv6itb0,11618
|
|
40
40
|
nat/builder/embedder.py,sha256=NPkOEcxt_-wc53QRijCQQDLretRUYHRYaKoYmarmrBk,965
|
|
41
41
|
nat/builder/eval_builder.py,sha256=6Raia6VgQwfFTQGbjnwAL8p4MXQhl_n5UIVuQ-l9_GQ,6575
|
|
@@ -75,7 +75,7 @@ nat/cli/commands/info/__init__.py,sha256=GUJrgGtpvyMUCjUBvR3faAdv-tZzbU9W-izgx9a
|
|
|
75
75
|
nat/cli/commands/info/info.py,sha256=5_s2_MMYn6ZLQpADdZ3aVRg4uvyXvF-4xVJclXxN15U,1317
|
|
76
76
|
nat/cli/commands/info/list_channels.py,sha256=K97TE6wtikgImY-wAbFNi0HHUGtkvIFd2woaG06VkT0,1277
|
|
77
77
|
nat/cli/commands/info/list_components.py,sha256=QlAJVONBA77xW8Lx6Autw5NTAZNy_VrJGr1GL9MfnHM,4532
|
|
78
|
-
nat/cli/commands/info/list_mcp.py,sha256
|
|
78
|
+
nat/cli/commands/info/list_mcp.py,sha256=lPp_6h_QPLblsJIeWROYr6Nx30BD-3JOtIbpxr8n39E,18985
|
|
79
79
|
nat/cli/commands/object_store/__init__.py,sha256=GUJrgGtpvyMUCjUBvR3faAdv-tZzbU9W-izgx9aMEQg,680
|
|
80
80
|
nat/cli/commands/object_store/object_store.py,sha256=_ivB-R30a-66fNy-fUzi58HQ0Ay0gYsGz7T1xXoRa3Y,8576
|
|
81
81
|
nat/cli/commands/registry/__init__.py,sha256=GUJrgGtpvyMUCjUBvR3faAdv-tZzbU9W-izgx9aMEQg,680
|
|
@@ -92,13 +92,13 @@ nat/cli/commands/workflow/workflow.py,sha256=40nIOehOX-4xI-qJqJraBX3XVz3l2VtFsZk
|
|
|
92
92
|
nat/cli/commands/workflow/workflow_commands.py,sha256=jk0Nm27hhyb0Nj7WzVdQa_w2HP9yEZTzb6U_O7llg0c,13032
|
|
93
93
|
nat/cli/commands/workflow/templates/__init__.py.j2,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
94
94
|
nat/cli/commands/workflow/templates/config.yml.j2,sha256=KkZl1fOMVQVFBW-BD_d0Lu8kQgNBtjNpfojhSCPu4uA,222
|
|
95
|
-
nat/cli/commands/workflow/templates/pyproject.toml.j2,sha256
|
|
95
|
+
nat/cli/commands/workflow/templates/pyproject.toml.j2,sha256=lDBC4exHYutXa_skuJj176yMEuZr-DsdzrqQHPZoKpk,1035
|
|
96
96
|
nat/cli/commands/workflow/templates/register.py.j2,sha256=txA-qBpWhxRc0GUcVRCIqVI6gGSh-TJijemrUqnb38s,138
|
|
97
97
|
nat/cli/commands/workflow/templates/workflow.py.j2,sha256=Z4uZPG9rtf1nxF74dF4DqDtrF3uYmYUmWowDFbQBjao,1241
|
|
98
98
|
nat/data_models/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
|
|
99
99
|
nat/data_models/api_server.py,sha256=J9G4aYV2TmIsMNEQtwHZYriyyjynghyHHIa7uwileFM,25689
|
|
100
100
|
nat/data_models/authentication.py,sha256=kF-eTOiKuEsvHFAPy-WQxumeSIhtjny59Wci1uh84qo,7349
|
|
101
|
-
nat/data_models/common.py,sha256=
|
|
101
|
+
nat/data_models/common.py,sha256=nXXfGrjpxebzBUa55mLdmzePLt7VFHvTAc6Znj3yEv0,5875
|
|
102
102
|
nat/data_models/component.py,sha256=YURCaCPnaa6ZPVzSMHHm3iFkqnxGhUHvxUWY8bRKlnI,1816
|
|
103
103
|
nat/data_models/component_ref.py,sha256=mVkaVv55xfTYXUxl28gGWHlKFT73IqUGwFkKaBLVVuw,4518
|
|
104
104
|
nat/data_models/config.py,sha256=VBin3qeWxX8DUkw5lJ6RD7dStR7qPp52XIsy0cJkUP4,17156
|
|
@@ -128,7 +128,7 @@ nat/data_models/streaming.py,sha256=sSqJqLqb70qyw69_4R9QC2RMbRw7UjTLPdo3FYBUGxE,
|
|
|
128
128
|
nat/data_models/swe_bench_model.py,sha256=uZs-hLFuT1B5CiPFwFg1PHinDW8PHne8TBzu7tHFv_k,1718
|
|
129
129
|
nat/data_models/telemetry_exporter.py,sha256=P7kqxIQnFVuvo_UFpH9QSB8fACy_0U2Uzkw_IfWXagE,998
|
|
130
130
|
nat/data_models/temperature_mixin.py,sha256=nUvA_tvjMfILGpBx52RLmJrApJzuswQqlNpS6netkxM,1485
|
|
131
|
-
nat/data_models/thinking_mixin.py,sha256=
|
|
131
|
+
nat/data_models/thinking_mixin.py,sha256=lzAnUk5vyv1nTYG9ho4BD3U2NTVZ50gBysN62iGj2KM,3303
|
|
132
132
|
nat/data_models/top_p_mixin.py,sha256=33cRWjgT0lctucSl8rzioMVeabw3977aGRRWupD9ZaY,1456
|
|
133
133
|
nat/data_models/ttc_strategy.py,sha256=tAkKWcyEBmBOOYtHMtQTgeCbHxFTk5SEkmFunNVnfyE,1114
|
|
134
134
|
nat/embedder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -170,7 +170,7 @@ nat/eval/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
170
170
|
nat/eval/utils/eval_trace_ctx.py,sha256=hN0YZ0wMOPzh9I-iSav-cGdxY3RWQWoE_tk5BxUf1mc,3264
|
|
171
171
|
nat/eval/utils/output_uploader.py,sha256=27-aKIejV-6DGNErR6iTioNE5rN_lEeiNoBTS1qIVVM,5579
|
|
172
172
|
nat/eval/utils/tqdm_position_registry.py,sha256=9CtpCk1wtYCSyieHPaSp8nlZu6EcNUOaUz2RTqfekrA,1286
|
|
173
|
-
nat/eval/utils/weave_eval.py,sha256=
|
|
173
|
+
nat/eval/utils/weave_eval.py,sha256=fma5x9JbWpWrfQbfMHcjMovlRVR0v35yfNt1Avt6Vro,7719
|
|
174
174
|
nat/experimental/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
175
175
|
nat/experimental/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
176
176
|
nat/experimental/decorators/experimental_warning_decorator.py,sha256=ji9fITsDF5N5ps5Y9jwb1sqc1e_3TvkUUUBBiJC76CE,5020
|
|
@@ -217,7 +217,7 @@ nat/front_ends/console/console_front_end_plugin.py,sha256=BJ1o2IflZeFKC2gGfL_gI2
|
|
|
217
217
|
nat/front_ends/console/register.py,sha256=2Kf6Mthx6jzWzU8YdhYIR1iABmZDvs1UXM_20npXWXs,1153
|
|
218
218
|
nat/front_ends/cron/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
|
|
219
219
|
nat/front_ends/fastapi/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
|
|
220
|
-
nat/front_ends/fastapi/fastapi_front_end_config.py,sha256
|
|
220
|
+
nat/front_ends/fastapi/fastapi_front_end_config.py,sha256=AV0yY86MjCGrB9VIcvykWvfu5WcnMcrti6rXxUdk9co,11292
|
|
221
221
|
nat/front_ends/fastapi/fastapi_front_end_controller.py,sha256=ei-34KCMpyaeAgeAN4gVvSGFjewjjRhHZPN0FqAfhDY,2548
|
|
222
222
|
nat/front_ends/fastapi/fastapi_front_end_plugin.py,sha256=t_kpMG6S9SIdBKz4Igy0rzrZ9xFz9DUbCBc0eowaixk,4432
|
|
223
223
|
nat/front_ends/fastapi/fastapi_front_end_plugin_worker.py,sha256=1FS1GC_lsQEMP64cPuXrF5MW4B8dMEyBxudJWz9XqPw,51852
|
|
@@ -268,7 +268,7 @@ nat/observability/exporter/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48j
|
|
|
268
268
|
nat/observability/exporter/base_exporter.py,sha256=tP7c5O-gQnHB_1TwIJJUib1xmtUhX4f4Mf_bmpejtkI,16612
|
|
269
269
|
nat/observability/exporter/exporter.py,sha256=fqF0GYuhZRQEq0skq_FK2nlnsaUAzLpQi-OciaOkRno,2391
|
|
270
270
|
nat/observability/exporter/file_exporter.py,sha256=XYsFjF8ob4Ag-SyGtKEh6wRU9lBx3lbdu7Uo85NvVyo,1465
|
|
271
|
-
nat/observability/exporter/processing_exporter.py,sha256=
|
|
271
|
+
nat/observability/exporter/processing_exporter.py,sha256=lfSURNc03kkAYFFnzcStSgC2EEYoFY0JgnvOvh05n3E,26212
|
|
272
272
|
nat/observability/exporter/raw_exporter.py,sha256=0ROEd-DlLP6pIxl4u2zJ6PMVrDrQa0DMHFDRsdGQMIk,1859
|
|
273
273
|
nat/observability/exporter/span_exporter.py,sha256=p2rugOIyubBk_Frg1c-x-THzvFZt8q8HhYssKUp8Hdg,13250
|
|
274
274
|
nat/observability/mixin/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
|
|
@@ -276,16 +276,21 @@ nat/observability/mixin/batch_config_mixin.py,sha256=DixQq-jRhBFJvpOX-gq7GvPmZCP
|
|
|
276
276
|
nat/observability/mixin/collector_config_mixin.py,sha256=3iptkRH9N6JgcsPq7GyjjJVAoxjd-l42UKE7iSF4Hq8,1087
|
|
277
277
|
nat/observability/mixin/file_mixin.py,sha256=J5kC70O3hoU86IDOoQtdk7caRD28nlIZL3igXcRSNBE,12306
|
|
278
278
|
nat/observability/mixin/file_mode.py,sha256=Rq7l8UegECub5QCyCAYwhyL_Jul386gW-ANmtMmv2G4,837
|
|
279
|
+
nat/observability/mixin/redaction_config_mixin.py,sha256=aizfK6nI8_bAJF2lrxSzcxjz8Er9o7itGNa-hDyRhr0,2028
|
|
279
280
|
nat/observability/mixin/resource_conflict_mixin.py,sha256=mcUp3Qinmhiepq3DyRvp9IaKGYtJfDgQVB-MuyVkWvk,5243
|
|
280
281
|
nat/observability/mixin/serialize_mixin.py,sha256=DgRHJpXCz9qHFYzhlTTx8Dkj297EylCKK3ydGrH5zOw,2478
|
|
282
|
+
nat/observability/mixin/tagging_config_mixin.py,sha256=_LLC2fZYM3CzMr2E1Kcy_-UXbjRb8fP1Yd8kcgTNozk,1731
|
|
281
283
|
nat/observability/mixin/type_introspection_mixin.py,sha256=VCb68SY_hitWrWLaK2UHQLkjn2jsgxSn9593T2N3zC0,6637
|
|
282
284
|
nat/observability/processor/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
|
|
283
285
|
nat/observability/processor/batching_processor.py,sha256=R0Qy3bHmf-QBM6FJmjmccdsf60JuvYLU-tV4kvy2hBA,13762
|
|
284
286
|
nat/observability/processor/callback_processor.py,sha256=T5DsEm4HCUOi1VL29XCpaK04sYQvJ75KZLH-mlJGQgk,1547
|
|
285
287
|
nat/observability/processor/falsy_batch_filter_processor.py,sha256=CInyZ1eIjtD1W6imPbuqwUeoWOMQ_0J0M9nPL6XwhTo,1778
|
|
288
|
+
nat/observability/processor/header_redaction_processor.py,sha256=cUmsVjHepddFHZu80zvdugG2eOUaGQr6cqxKyVS8fi4,4284
|
|
286
289
|
nat/observability/processor/intermediate_step_serializer.py,sha256=aHeCmixyop7uxNnKmrUZ8SIFeBNS05gYohKLepqbrcQ,1249
|
|
287
290
|
nat/observability/processor/processor.py,sha256=kTqOsus5Ycu5aFnxCTH1EkCP23uRBZ4xNhXmj3DP5OE,2593
|
|
288
291
|
nat/observability/processor/processor_factory.py,sha256=1Ak4OWwmbimc5PKWwqPYq4fJqJifFm6MiI8vcafeErY,2408
|
|
292
|
+
nat/observability/processor/redaction_processor.py,sha256=Mg4zIShjQwX3GCKgXgrx7VaHhoGG3JrFY_QkoDUNtEk,2401
|
|
293
|
+
nat/observability/processor/span_tagging_processor.py,sha256=w5DqWrNU0US1afjVifMAq1_wCjNobwzxo9wAovDMKos,2298
|
|
289
294
|
nat/observability/utils/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
|
|
290
295
|
nat/observability/utils/dict_utils.py,sha256=DcNhZ0mgcJ-QQfsCl9QSGL-m_jTuHhr1N-v43ZCAMik,7371
|
|
291
296
|
nat/observability/utils/time_utils.py,sha256=V8m-e3ldUgwv031B17y29yLXIowdlTH4QW8xDw9WKvk,1071
|
|
@@ -376,7 +381,7 @@ nat/tool/chat_completion.py,sha256=zB8sqEBEHW0QDcnv0NdqO43ybxe5Q-WKZr9s349UBvA,3
|
|
|
376
381
|
nat/tool/datetime_tools.py,sha256=yZV5lE3FsQuIZE3B36gg38hxfavxgaG04eVFbL0UBTI,3239
|
|
377
382
|
nat/tool/document_search.py,sha256=M6OjKdqUm_HdNn5-rgm5SDOeFGTNuwjYiuMQL43myGc,6741
|
|
378
383
|
nat/tool/nvidia_rag.py,sha256=cEHSc3CZwpd71YcOQngya-Ca_B6ZOb87Dmsoza0VhFY,4163
|
|
379
|
-
nat/tool/register.py,sha256=
|
|
384
|
+
nat/tool/register.py,sha256=7w_yQp4Z1ELX7RqcGME36fL5DlYaCqeD2ZW1bLwSooE,1433
|
|
380
385
|
nat/tool/retriever.py,sha256=FP5JL1vCQNrqaKz4F1up-osjxEPhxPFOyaScrgByc34,3877
|
|
381
386
|
nat/tool/server_tools.py,sha256=rQLipwRv8lAyU-gohky2JoVDxWQTUTSttNWjhu7lcHU,3194
|
|
382
387
|
nat/tool/code_execution/README.md,sha256=sl3YX4As95HX61XqTXOGnUcHBV1lla-OeuTnLI4qgng,4019
|
|
@@ -399,11 +404,6 @@ nat/tool/github_tools/get_github_file.py,sha256=tGMzrE-v16rjDoG-IbOkaS5hXe4SCb-o
|
|
|
399
404
|
nat/tool/github_tools/get_github_issue.py,sha256=fFJFYt3mWR6CK46r6k3-3eVbAKLNh1yHRMmZU0c-4jA,6532
|
|
400
405
|
nat/tool/github_tools/get_github_pr.py,sha256=p4Xu-YA6L1dQ8O0e5LDzphrn5DknjttDhLeudgk7Iys,9716
|
|
401
406
|
nat/tool/github_tools/update_github_issue.py,sha256=fj_OAp5bSmSyj-wPAUvzfCGRBuwPyoK1kJ95Fn8XDg8,4103
|
|
402
|
-
nat/tool/mcp/__init__.py,sha256=GUJrgGtpvyMUCjUBvR3faAdv-tZzbU9W-izgx9aMEQg,680
|
|
403
|
-
nat/tool/mcp/exceptions.py,sha256=EGVOnYlui8xufm8dhJyPL1SUqBLnCGOTvRoeyNcmcWE,5980
|
|
404
|
-
nat/tool/mcp/mcp_client_base.py,sha256=uZ9WCJYhPiYYCaZfC3oa2EwXYJUMDSnm2b5Z6_VSfZE,13412
|
|
405
|
-
nat/tool/mcp/mcp_client_impl.py,sha256=Q2qJAUFWq__opXXUzO6XhhRf9gjwJcEkdHXSiQz4S4I,9668
|
|
406
|
-
nat/tool/mcp/mcp_tool.py,sha256=OIvoLnl2d9PWqE9625jj0CiVEPBVS9LajxFD1VOJlVY,6382
|
|
407
407
|
nat/tool/memory_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
408
408
|
nat/tool/memory_tools/add_memory_tool.py,sha256=DYaYkVlH2myRshJpzmULfzdF0wFoPCAkTBokFVmhfzU,3349
|
|
409
409
|
nat/tool/memory_tools/delete_memory_tool.py,sha256=EWJVgzIzLDqktY5domXph-N2U9FmybdWl4J7KM7uK4g,2532
|
|
@@ -423,7 +423,6 @@ nat/utils/data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
|
423
423
|
nat/utils/data_models/schema_validator.py,sha256=pmGr5KuRX5tbVsymG1NxaSnGrKIfzxXEJNd58wIQ9SM,1532
|
|
424
424
|
nat/utils/exception_handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
425
425
|
nat/utils/exception_handlers/automatic_retries.py,sha256=uje36i6tcZ7gX5tMF2mmAB6c2uhkgYjUErs6VL2rCeA,11913
|
|
426
|
-
nat/utils/exception_handlers/mcp.py,sha256=BPfcmSEeW8XVA46vm1kQEOEKTNkZarKW-PMEK-n0QvM,7625
|
|
427
426
|
nat/utils/exception_handlers/schemas.py,sha256=EcNukc4-oASIX2mHAP-hH1up1roWnm99iY18P_v13D0,3800
|
|
428
427
|
nat/utils/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
429
428
|
nat/utils/io/model_processing.py,sha256=bEbH_tIgZQvPlEJKVV4kye_Y9UU96W4k2mKuckGErHA,936
|
|
@@ -439,10 +438,10 @@ nat/utils/reactive/base/observer_base.py,sha256=6BiQfx26EMumotJ3KoVcdmFBYR_fnAss
|
|
|
439
438
|
nat/utils/reactive/base/subject_base.py,sha256=UQOxlkZTIeeyYmG5qLtDpNf_63Y7p-doEeUA08_R8ME,2521
|
|
440
439
|
nat/utils/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
441
440
|
nat/utils/settings/global_settings.py,sha256=9JaO6pxKT_Pjw6rxJRsRlFCXdVKCl_xUKU2QHZQWWNM,7294
|
|
442
|
-
nvidia_nat-1.3.
|
|
443
|
-
nvidia_nat-1.3.
|
|
444
|
-
nvidia_nat-1.3.
|
|
445
|
-
nvidia_nat-1.3.
|
|
446
|
-
nvidia_nat-1.3.
|
|
447
|
-
nvidia_nat-1.3.
|
|
448
|
-
nvidia_nat-1.3.
|
|
441
|
+
nvidia_nat-1.3.0a20250909.dist-info/licenses/LICENSE-3rd-party.txt,sha256=fOk5jMmCX9YoKWyYzTtfgl-SUy477audFC5hNY4oP7Q,284609
|
|
442
|
+
nvidia_nat-1.3.0a20250909.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
443
|
+
nvidia_nat-1.3.0a20250909.dist-info/METADATA,sha256=Usx9uaZgocnncgN6GEsXRUFY5xAU73Y4fkRsMy7e57I,22152
|
|
444
|
+
nvidia_nat-1.3.0a20250909.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
445
|
+
nvidia_nat-1.3.0a20250909.dist-info/entry_points.txt,sha256=FNh4pZVSe_61s29zdks66lmXBPtsnko8KSZ4ffv7WVE,653
|
|
446
|
+
nvidia_nat-1.3.0a20250909.dist-info/top_level.txt,sha256=lgJWLkigiVZuZ_O1nxVnD_ziYBwgpE2OStdaCduMEGc,8
|
|
447
|
+
nvidia_nat-1.3.0a20250909.dist-info/RECORD,,
|
nat/tool/mcp/__init__.py
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
nat/tool/mcp/exceptions.py
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
|
|
16
|
-
from enum import Enum
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class MCPErrorCategory(str, Enum):
|
|
20
|
-
"""Categories of MCP errors for structured handling."""
|
|
21
|
-
CONNECTION = "connection"
|
|
22
|
-
TIMEOUT = "timeout"
|
|
23
|
-
SSL = "ssl"
|
|
24
|
-
AUTHENTICATION = "authentication"
|
|
25
|
-
TOOL_NOT_FOUND = "tool_not_found"
|
|
26
|
-
PROTOCOL = "protocol"
|
|
27
|
-
UNKNOWN = "unknown"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class MCPError(Exception):
|
|
31
|
-
"""Base exception for MCP-related errors."""
|
|
32
|
-
|
|
33
|
-
def __init__(self,
|
|
34
|
-
message: str,
|
|
35
|
-
url: str,
|
|
36
|
-
category: MCPErrorCategory = MCPErrorCategory.UNKNOWN,
|
|
37
|
-
suggestions: list[str] | None = None,
|
|
38
|
-
original_exception: Exception | None = None):
|
|
39
|
-
super().__init__(message)
|
|
40
|
-
self.url = url
|
|
41
|
-
self.category = category
|
|
42
|
-
self.suggestions = suggestions or []
|
|
43
|
-
self.original_exception = original_exception
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class MCPConnectionError(MCPError):
|
|
47
|
-
"""Exception for MCP connection failures."""
|
|
48
|
-
|
|
49
|
-
def __init__(self, url: str, original_exception: Exception | None = None):
|
|
50
|
-
super().__init__(f"Unable to connect to MCP server at {url}",
|
|
51
|
-
url=url,
|
|
52
|
-
category=MCPErrorCategory.CONNECTION,
|
|
53
|
-
suggestions=[
|
|
54
|
-
"Please ensure the MCP server is running and accessible",
|
|
55
|
-
"Check if the URL and port are correct"
|
|
56
|
-
],
|
|
57
|
-
original_exception=original_exception)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class MCPTimeoutError(MCPError):
|
|
61
|
-
"""Exception for MCP timeout errors."""
|
|
62
|
-
|
|
63
|
-
def __init__(self, url: str, original_exception: Exception | None = None):
|
|
64
|
-
super().__init__(f"Connection timed out to MCP server at {url}",
|
|
65
|
-
url=url,
|
|
66
|
-
category=MCPErrorCategory.TIMEOUT,
|
|
67
|
-
suggestions=[
|
|
68
|
-
"The server may be overloaded or network is slow",
|
|
69
|
-
"Try again in a moment or check network connectivity"
|
|
70
|
-
],
|
|
71
|
-
original_exception=original_exception)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
class MCPSSLError(MCPError):
|
|
75
|
-
"""Exception for MCP SSL/TLS errors."""
|
|
76
|
-
|
|
77
|
-
def __init__(self, url: str, original_exception: Exception | None = None):
|
|
78
|
-
super().__init__(f"SSL/TLS error connecting to {url}",
|
|
79
|
-
url=url,
|
|
80
|
-
category=MCPErrorCategory.SSL,
|
|
81
|
-
suggestions=[
|
|
82
|
-
"Check if the server requires HTTPS or has valid certificates",
|
|
83
|
-
"Try using HTTP instead of HTTPS if appropriate"
|
|
84
|
-
],
|
|
85
|
-
original_exception=original_exception)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class MCPRequestError(MCPError):
|
|
89
|
-
"""Exception for MCP request errors."""
|
|
90
|
-
|
|
91
|
-
def __init__(self, url: str, original_exception: Exception | None = None):
|
|
92
|
-
message = f"Request failed to MCP server at {url}"
|
|
93
|
-
if original_exception:
|
|
94
|
-
message += f": {original_exception}"
|
|
95
|
-
|
|
96
|
-
super().__init__(message,
|
|
97
|
-
url=url,
|
|
98
|
-
category=MCPErrorCategory.PROTOCOL,
|
|
99
|
-
suggestions=["Check the server URL format and network settings"],
|
|
100
|
-
original_exception=original_exception)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
class MCPToolNotFoundError(MCPError):
|
|
104
|
-
"""Exception for when a specific MCP tool is not found."""
|
|
105
|
-
|
|
106
|
-
def __init__(self, tool_name: str, url: str, original_exception: Exception | None = None):
|
|
107
|
-
super().__init__(f"Tool '{tool_name}' not available at {url}",
|
|
108
|
-
url=url,
|
|
109
|
-
category=MCPErrorCategory.TOOL_NOT_FOUND,
|
|
110
|
-
suggestions=[
|
|
111
|
-
"Use 'nat info mcp --detail' to see available tools",
|
|
112
|
-
"Check that the tool name is spelled correctly"
|
|
113
|
-
],
|
|
114
|
-
original_exception=original_exception)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
class MCPAuthenticationError(MCPError):
|
|
118
|
-
"""Exception for MCP authentication failures."""
|
|
119
|
-
|
|
120
|
-
def __init__(self, url: str, original_exception: Exception | None = None):
|
|
121
|
-
super().__init__(f"Authentication failed when connecting to MCP server at {url}",
|
|
122
|
-
url=url,
|
|
123
|
-
category=MCPErrorCategory.AUTHENTICATION,
|
|
124
|
-
suggestions=[
|
|
125
|
-
"Check if the server requires authentication credentials",
|
|
126
|
-
"Verify that your credentials are correct and not expired"
|
|
127
|
-
],
|
|
128
|
-
original_exception=original_exception)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
class MCPProtocolError(MCPError):
|
|
132
|
-
"""Exception for MCP protocol-related errors."""
|
|
133
|
-
|
|
134
|
-
def __init__(self, url: str, message: str = "Protocol error", original_exception: Exception | None = None):
|
|
135
|
-
super().__init__(f"{message} (MCP server at {url})",
|
|
136
|
-
url=url,
|
|
137
|
-
category=MCPErrorCategory.PROTOCOL,
|
|
138
|
-
suggestions=[
|
|
139
|
-
"Check that the MCP server is running and accessible at this URL",
|
|
140
|
-
"Verify the server supports the expected MCP protocol version"
|
|
141
|
-
],
|
|
142
|
-
original_exception=original_exception)
|