airbyte-agent-zendesk-support 0.18.29__py3-none-any.whl → 0.18.31__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.
- airbyte_agent_zendesk_support/_vendored/connector_sdk/__init__.py +0 -3
- airbyte_agent_zendesk_support/_vendored/connector_sdk/connector_model_loader.py +10 -2
- airbyte_agent_zendesk_support/_vendored/connector_sdk/extensions.py +39 -0
- airbyte_agent_zendesk_support/_vendored/connector_sdk/introspection.py +1 -1
- airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/components.py +2 -1
- airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/security.py +10 -0
- airbyte_agent_zendesk_support/_vendored/connector_sdk/types.py +4 -0
- airbyte_agent_zendesk_support/connector.py +45 -7
- {airbyte_agent_zendesk_support-0.18.29.dist-info → airbyte_agent_zendesk_support-0.18.31.dist-info}/METADATA +3 -3
- {airbyte_agent_zendesk_support-0.18.29.dist-info → airbyte_agent_zendesk_support-0.18.31.dist-info}/RECORD +11 -12
- airbyte_agent_zendesk_support/_vendored/connector_sdk/decorators.py +0 -128
- {airbyte_agent_zendesk_support-0.18.29.dist-info → airbyte_agent_zendesk_support-0.18.31.dist-info}/WHEEL +0 -0
|
@@ -13,7 +13,6 @@ from __future__ import annotations
|
|
|
13
13
|
from .auth_strategies import AuthStrategy
|
|
14
14
|
from .connector_model_loader import load_connector_model
|
|
15
15
|
from .constants import SDK_VERSION
|
|
16
|
-
from .decorators import airbyte_description
|
|
17
16
|
from .exceptions import (
|
|
18
17
|
AuthenticationError,
|
|
19
18
|
HTTPClientError,
|
|
@@ -80,6 +79,4 @@ __all__ = [
|
|
|
80
79
|
"instrument",
|
|
81
80
|
# Utilities
|
|
82
81
|
"save_download",
|
|
83
|
-
# Decorators for AI integration
|
|
84
|
-
"airbyte_description",
|
|
85
82
|
]
|
|
@@ -393,16 +393,24 @@ def convert_openapi_to_connector_model(spec: OpenAPIConnector) -> ConnectorModel
|
|
|
393
393
|
for entity_name, endpoints_dict in entities_map.items():
|
|
394
394
|
actions = list(endpoints_dict.keys())
|
|
395
395
|
|
|
396
|
-
# Get schema from components if available
|
|
396
|
+
# Get schema and stream_name from components if available
|
|
397
397
|
schema = None
|
|
398
|
+
entity_stream_name = None
|
|
398
399
|
if spec.components:
|
|
399
400
|
# Look for a schema matching the entity name
|
|
400
401
|
for schema_name, schema_def in spec.components.schemas.items():
|
|
401
402
|
if schema_def.x_airbyte_entity_name == entity_name or schema_name.lower() == entity_name.lower():
|
|
402
403
|
schema = schema_def.model_dump(by_alias=True)
|
|
404
|
+
entity_stream_name = schema_def.x_airbyte_stream_name
|
|
403
405
|
break
|
|
404
406
|
|
|
405
|
-
entity = EntityDefinition(
|
|
407
|
+
entity = EntityDefinition(
|
|
408
|
+
name=entity_name,
|
|
409
|
+
stream_name=entity_stream_name,
|
|
410
|
+
actions=actions,
|
|
411
|
+
endpoints=endpoints_dict,
|
|
412
|
+
schema=schema,
|
|
413
|
+
)
|
|
406
414
|
entities.append(entity)
|
|
407
415
|
|
|
408
416
|
# Extract retry config from x-airbyte-retry-config extension
|
|
@@ -159,6 +159,38 @@ Example:
|
|
|
159
159
|
```
|
|
160
160
|
"""
|
|
161
161
|
|
|
162
|
+
AIRBYTE_STREAM_NAME = "x-airbyte-stream-name"
|
|
163
|
+
"""
|
|
164
|
+
Extension: x-airbyte-stream-name
|
|
165
|
+
Location: Schema object (in components.schemas)
|
|
166
|
+
Type: string
|
|
167
|
+
Required: No
|
|
168
|
+
|
|
169
|
+
Description:
|
|
170
|
+
Specifies the Airbyte stream name for cache lookup purposes. This maps the entity
|
|
171
|
+
to the corresponding Airbyte stream, enabling cache-based data retrieval. When
|
|
172
|
+
specified, the EntityDefinition.stream_name field will be populated with this value.
|
|
173
|
+
|
|
174
|
+
This extension is placed on Schema objects alongside x-airbyte-entity-name, following
|
|
175
|
+
the same pattern. The stream name is an entity-level property (not operation-level)
|
|
176
|
+
since an entity maps to exactly one Airbyte stream.
|
|
177
|
+
|
|
178
|
+
Example:
|
|
179
|
+
```yaml
|
|
180
|
+
components:
|
|
181
|
+
schemas:
|
|
182
|
+
Customer:
|
|
183
|
+
type: object
|
|
184
|
+
x-airbyte-entity-name: customers
|
|
185
|
+
x-airbyte-stream-name: customers
|
|
186
|
+
properties:
|
|
187
|
+
id:
|
|
188
|
+
type: string
|
|
189
|
+
name:
|
|
190
|
+
type: string
|
|
191
|
+
```
|
|
192
|
+
"""
|
|
193
|
+
|
|
162
194
|
AIRBYTE_TOKEN_PATH = "x-airbyte-token-path"
|
|
163
195
|
"""
|
|
164
196
|
Extension: x-airbyte-token-path
|
|
@@ -548,6 +580,7 @@ def get_all_extension_names() -> list[str]:
|
|
|
548
580
|
AIRBYTE_ENTITY,
|
|
549
581
|
AIRBYTE_ACTION,
|
|
550
582
|
AIRBYTE_ENTITY_NAME,
|
|
583
|
+
AIRBYTE_STREAM_NAME,
|
|
551
584
|
AIRBYTE_TOKEN_PATH,
|
|
552
585
|
AIRBYTE_BODY_TYPE,
|
|
553
586
|
AIRBYTE_PATH_OVERRIDE,
|
|
@@ -594,6 +627,12 @@ EXTENSION_REGISTRY = {
|
|
|
594
627
|
"required": False,
|
|
595
628
|
"description": "Links schema to an entity/stream",
|
|
596
629
|
},
|
|
630
|
+
AIRBYTE_STREAM_NAME: {
|
|
631
|
+
"location": "schema",
|
|
632
|
+
"type": "string",
|
|
633
|
+
"required": False,
|
|
634
|
+
"description": "Maps entity to Airbyte stream for cache lookup",
|
|
635
|
+
},
|
|
597
636
|
AIRBYTE_TOKEN_PATH: {
|
|
598
637
|
"location": "securityScheme",
|
|
599
638
|
"type": "string",
|
|
@@ -203,7 +203,7 @@ def generate_tool_description(model: ConnectorModelProtocol) -> str:
|
|
|
203
203
|
- Response structure documentation with pagination hints
|
|
204
204
|
- Example questions if available in the OpenAPI spec
|
|
205
205
|
|
|
206
|
-
This is used by the
|
|
206
|
+
This is used by the Connector.describe class method decorator to populate
|
|
207
207
|
function docstrings for AI framework integration.
|
|
208
208
|
|
|
209
209
|
Args:
|
|
@@ -65,8 +65,9 @@ class Schema(BaseModel):
|
|
|
65
65
|
write_only: Optional[bool] = Field(None, alias="writeOnly")
|
|
66
66
|
deprecated: Optional[bool] = None
|
|
67
67
|
|
|
68
|
-
# Airbyte
|
|
68
|
+
# Airbyte extensions
|
|
69
69
|
x_airbyte_entity_name: Optional[str] = Field(None, alias="x-airbyte-entity-name")
|
|
70
|
+
x_airbyte_stream_name: Optional[str] = Field(None, alias="x-airbyte-stream-name")
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
class Parameter(BaseModel):
|
|
@@ -77,6 +77,10 @@ class AuthConfigOption(BaseModel):
|
|
|
77
77
|
default_factory=dict,
|
|
78
78
|
description="Mapping from auth parameters (e.g., 'username', 'password', 'token') to template strings using ${field} syntax",
|
|
79
79
|
)
|
|
80
|
+
replication_auth_key_mapping: Optional[Dict[str, str]] = Field(
|
|
81
|
+
None,
|
|
82
|
+
description="Mapping from source config paths (e.g., 'credentials.api_key') to auth config keys for direct connectors",
|
|
83
|
+
)
|
|
80
84
|
|
|
81
85
|
|
|
82
86
|
class AirbyteAuthConfig(BaseModel):
|
|
@@ -99,6 +103,12 @@ class AirbyteAuthConfig(BaseModel):
|
|
|
99
103
|
properties: Optional[Dict[str, AuthConfigFieldSpec]] = None
|
|
100
104
|
auth_mapping: Optional[Dict[str, str]] = None
|
|
101
105
|
|
|
106
|
+
# Replication connector auth mapping
|
|
107
|
+
replication_auth_key_mapping: Optional[Dict[str, str]] = Field(
|
|
108
|
+
None,
|
|
109
|
+
description="Mapping from source config paths (e.g., 'credentials.api_key') to auth config keys for direct connectors",
|
|
110
|
+
)
|
|
111
|
+
|
|
102
112
|
# Multiple options (oneOf)
|
|
103
113
|
one_of: Optional[List[AuthConfigOption]] = Field(None, alias="oneOf")
|
|
104
114
|
|
|
@@ -221,6 +221,10 @@ class EntityDefinition(BaseModel):
|
|
|
221
221
|
model_config = {"populate_by_name": True}
|
|
222
222
|
|
|
223
223
|
name: str
|
|
224
|
+
stream_name: str | None = Field(
|
|
225
|
+
default=None,
|
|
226
|
+
description="Airbyte stream name for cache lookup (from x-airbyte-stream-name schema extension)",
|
|
227
|
+
)
|
|
224
228
|
actions: list[Action]
|
|
225
229
|
endpoints: dict[Action, EndpointDefinition]
|
|
226
230
|
entity_schema: dict[str, Any] | None = Field(default=None, alias="schema")
|
|
@@ -5,15 +5,14 @@ zendesk-support connector.
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
7
7
|
import logging
|
|
8
|
-
from typing import TYPE_CHECKING, Any, AsyncIterator, overload
|
|
8
|
+
from typing import TYPE_CHECKING, Any, Callable, TypeVar, AsyncIterator, overload
|
|
9
9
|
try:
|
|
10
10
|
from typing import Literal
|
|
11
11
|
except ImportError:
|
|
12
12
|
from typing_extensions import Literal
|
|
13
13
|
|
|
14
14
|
from .connector_model import ZendeskSupportConnectorModel
|
|
15
|
-
from ._vendored.connector_sdk.introspection import describe_entities
|
|
16
|
-
|
|
15
|
+
from ._vendored.connector_sdk.introspection import describe_entities, generate_tool_description
|
|
17
16
|
from .types import (
|
|
18
17
|
ArticleAttachmentsDownloadParams,
|
|
19
18
|
ArticleAttachmentsGetParams,
|
|
@@ -55,7 +54,6 @@ from .types import (
|
|
|
55
54
|
ViewsGetParams,
|
|
56
55
|
ViewsListParams,
|
|
57
56
|
)
|
|
58
|
-
|
|
59
57
|
if TYPE_CHECKING:
|
|
60
58
|
from .models import ZendeskSupportAuthConfig
|
|
61
59
|
# Import specific auth config classes for multi-auth isinstance checks
|
|
@@ -104,6 +102,9 @@ from .models import (
|
|
|
104
102
|
ArticleAttachmentsGetResult,
|
|
105
103
|
)
|
|
106
104
|
|
|
105
|
+
# TypeVar for decorator type preservation
|
|
106
|
+
_F = TypeVar("_F", bound=Callable[..., Any])
|
|
107
|
+
|
|
107
108
|
|
|
108
109
|
class ZendeskSupportConnector:
|
|
109
110
|
"""
|
|
@@ -716,9 +717,46 @@ class ZendeskSupportConnector:
|
|
|
716
717
|
|
|
717
718
|
# ===== INTROSPECTION METHODS =====
|
|
718
719
|
|
|
719
|
-
|
|
720
|
+
@classmethod
|
|
721
|
+
def describe(cls, func: _F) -> _F:
|
|
722
|
+
"""
|
|
723
|
+
Decorator that populates a function's docstring with connector capabilities.
|
|
724
|
+
|
|
725
|
+
This class method can be used as a decorator to automatically generate
|
|
726
|
+
comprehensive documentation for AI tool functions.
|
|
727
|
+
|
|
728
|
+
Usage:
|
|
729
|
+
@mcp.tool()
|
|
730
|
+
@ZendeskSupportConnector.describe
|
|
731
|
+
async def execute(entity: str, action: str, params: dict):
|
|
732
|
+
'''Execute operations.'''
|
|
733
|
+
...
|
|
734
|
+
|
|
735
|
+
The decorated function's __doc__ will be updated with:
|
|
736
|
+
- Available entities and their actions
|
|
737
|
+
- Parameter signatures with required (*) and optional (?) markers
|
|
738
|
+
- Response structure documentation
|
|
739
|
+
- Example questions (if available in OpenAPI spec)
|
|
740
|
+
|
|
741
|
+
Args:
|
|
742
|
+
func: The function to decorate
|
|
743
|
+
|
|
744
|
+
Returns:
|
|
745
|
+
The same function with updated __doc__
|
|
746
|
+
"""
|
|
747
|
+
description = generate_tool_description(ZendeskSupportConnectorModel)
|
|
748
|
+
|
|
749
|
+
original_doc = func.__doc__ or ""
|
|
750
|
+
if original_doc.strip():
|
|
751
|
+
func.__doc__ = f"{original_doc.strip()}\n\n{description}"
|
|
752
|
+
else:
|
|
753
|
+
func.__doc__ = description
|
|
754
|
+
|
|
755
|
+
return func
|
|
756
|
+
|
|
757
|
+
def list_entities(self) -> list[dict[str, Any]]:
|
|
720
758
|
"""
|
|
721
|
-
|
|
759
|
+
Get structured data about available entities, actions, and parameters.
|
|
722
760
|
|
|
723
761
|
Returns a list of entity descriptions with:
|
|
724
762
|
- entity_name: Name of the entity (e.g., "contacts", "deals")
|
|
@@ -727,7 +765,7 @@ class ZendeskSupportConnector:
|
|
|
727
765
|
- parameters: Dict mapping action -> list of parameter dicts
|
|
728
766
|
|
|
729
767
|
Example:
|
|
730
|
-
entities = connector.
|
|
768
|
+
entities = connector.list_entities()
|
|
731
769
|
for entity in entities:
|
|
732
770
|
print(f"{entity['entity_name']}: {entity['available_actions']}")
|
|
733
771
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: airbyte-agent-zendesk-support
|
|
3
|
-
Version: 0.18.
|
|
3
|
+
Version: 0.18.31
|
|
4
4
|
Summary: Airbyte Zendesk-Support Connector for AI platforms
|
|
5
5
|
Project-URL: Homepage, https://github.com/airbytehq/airbyte-embedded
|
|
6
6
|
Project-URL: Documentation, https://github.com/airbytehq/airbyte-embedded/tree/main/integrations
|
|
@@ -141,6 +141,6 @@ For the service's official API docs, see the [Zendesk-Support API reference](htt
|
|
|
141
141
|
|
|
142
142
|
## Version information
|
|
143
143
|
|
|
144
|
-
- **Package version:** 0.18.
|
|
144
|
+
- **Package version:** 0.18.31
|
|
145
145
|
- **Connector version:** 0.1.4
|
|
146
|
-
- **Generated with Connector SDK commit SHA:**
|
|
146
|
+
- **Generated with Connector SDK commit SHA:** 3bcb33e8122bbe7f7e52f786cc94c8d2f3ba9e12
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
airbyte_agent_zendesk_support/__init__.py,sha256=MPz4HU055DRA3-1qgbGXh2E0YHmhcexQCFl-Tz21gm4,6227
|
|
2
|
-
airbyte_agent_zendesk_support/connector.py,sha256
|
|
2
|
+
airbyte_agent_zendesk_support/connector.py,sha256=VYOTY7bEtXsvjyZSggoeS4lbSbGUsnVmtq3B2awkW5o,67058
|
|
3
3
|
airbyte_agent_zendesk_support/connector_model.py,sha256=SAEWsLhW517Gc5eajkkYV1fQEGpsLlMALs2pTJ9BcPk,241131
|
|
4
4
|
airbyte_agent_zendesk_support/models.py,sha256=31bsOmf4nBdf8EXN3JpYzXW8mx6gv1xaZjeuEBgSzws,36399
|
|
5
5
|
airbyte_agent_zendesk_support/types.py,sha256=3CxJ8HosRMyzNEbVmRbybNCTVj9Ycxr7io25TP3YcCQ,6337
|
|
6
6
|
airbyte_agent_zendesk_support/_vendored/__init__.py,sha256=ILl7AHXMui__swyrjxrh9yRa4dLiwBvV6axPWFWty80,38
|
|
7
|
-
airbyte_agent_zendesk_support/_vendored/connector_sdk/__init__.py,sha256=
|
|
7
|
+
airbyte_agent_zendesk_support/_vendored/connector_sdk/__init__.py,sha256=T5o7roU6NSpH-lCAGZ338sE5dlh4ZU6i6IkeG1zpems,1949
|
|
8
8
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/auth_strategies.py,sha256=0BfIISVzuvZTAYZjQFOOhKTpw0QuKDlLQBQ1PQo-V2M,39967
|
|
9
9
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/auth_template.py,sha256=vKnyA21Jp33EuDjkIUAf1PGicwk4t9kZAPJuAgAZKzU,4458
|
|
10
|
-
airbyte_agent_zendesk_support/_vendored/connector_sdk/connector_model_loader.py,sha256=
|
|
10
|
+
airbyte_agent_zendesk_support/_vendored/connector_sdk/connector_model_loader.py,sha256=nKrXfe-FAyvNMkW7AqGzxrp5wXdaHiqC0yIFJoIVwlY,34890
|
|
11
11
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/constants.py,sha256=uH4rjBX6WsBP8M0jt7AUJI9w5Adn4wvJwib7Gdfkr1M,2736
|
|
12
|
-
airbyte_agent_zendesk_support/_vendored/connector_sdk/decorators.py,sha256=849qEYLCbEI7bPbpnKaB_hYyb5SrFoWe4XMwg_vzc7Q,4376
|
|
13
12
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/exceptions.py,sha256=ss5MGv9eVPmsbLcLWetuu3sDmvturwfo6Pw3M37Oq5k,481
|
|
14
|
-
airbyte_agent_zendesk_support/_vendored/connector_sdk/extensions.py,sha256=
|
|
13
|
+
airbyte_agent_zendesk_support/_vendored/connector_sdk/extensions.py,sha256=fWy9uwGUCjPO1KDYuGZo9nkrNU35P-dLcqi4K6UF4uA,21371
|
|
15
14
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/http_client.py,sha256=NdccrrBHI5rW56XnXcP54arCwywIVKnMeSQPas6KlOM,27466
|
|
16
|
-
airbyte_agent_zendesk_support/_vendored/connector_sdk/introspection.py,sha256=
|
|
15
|
+
airbyte_agent_zendesk_support/_vendored/connector_sdk/introspection.py,sha256=6v3YNdca8qe8qIz3m97GZ_ll_Ih3oUKMrqrdipPcpRk,10331
|
|
17
16
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/secrets.py,sha256=UWcO9fP-vZwcfkAuvlZahlOCTOwdNN860BIwe8X4jxw,6868
|
|
18
|
-
airbyte_agent_zendesk_support/_vendored/connector_sdk/types.py,sha256=
|
|
17
|
+
airbyte_agent_zendesk_support/_vendored/connector_sdk/types.py,sha256=TI-O7EyWAoppGc9G7kXHwceYWekt_sxXmXKxD1xC_7U,8285
|
|
19
18
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/utils.py,sha256=G4LUXOC2HzPoND2v4tQW68R9uuPX9NQyCjaGxb7Kpl0,1958
|
|
20
19
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/validation.py,sha256=CDjCux1eg35a0Y4BegSivzIwZjiTqOxYWotWNLqTSVU,31792
|
|
21
20
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/cloud_utils/__init__.py,sha256=4799Hv9f2zxDVj1aLyQ8JpTEuFTp_oOZMRz-NZCdBJg,134
|
|
@@ -43,15 +42,15 @@ airbyte_agent_zendesk_support/_vendored/connector_sdk/performance/instrumentatio
|
|
|
43
42
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/performance/metrics.py,sha256=3-wPwlJyfVLUIG3y7ESxk0avhkILk3z8K7zSrnlZf5U,2833
|
|
44
43
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/__init__.py,sha256=Uymu-QuzGJuMxexBagIvUxpVAigIuIhz3KeBl_Vu4Ko,1638
|
|
45
44
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/base.py,sha256=eN6YfHwsYNz_0CE-S715Me8x3gQWTtaRk1vhFjEZF8I,4799
|
|
46
|
-
airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/components.py,sha256=
|
|
45
|
+
airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/components.py,sha256=4clYbIJNqfmFj7Te31ZqC3Rr5E2v33BeXyQx1wp3oj0,8076
|
|
47
46
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/connector.py,sha256=VFBOzIkLgYBR1XUTmyrPGqBkX8PP-zsG8avQcdJUqXs,3864
|
|
48
47
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/extensions.py,sha256=LdoCuMLNdCj68O47qAL4v8xmqGz5tJgRiNZL5JnL9uw,3311
|
|
49
48
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/operations.py,sha256=zInMjx9iOEVZo-CCWw06Uk2SFg7HtUAXXpO5kFGUwNk,5825
|
|
50
|
-
airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/security.py,sha256=
|
|
49
|
+
airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/security.py,sha256=Xo6Z0-NCryMY4EDZgvg8ABSPglskpXANvm_iI34meV8,8588
|
|
51
50
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/__init__.py,sha256=RaLgkBU4dfxn1LC5Y0Q9rr2PJbrwjxvPgBLmq8_WafE,211
|
|
52
51
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/config.py,sha256=tLmQwAFD0kP1WyBGWBS3ysaudN9H3e-3EopKZi6cGKg,885
|
|
53
52
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/events.py,sha256=NvqjlUbkm6cbGh4ffKxYxtjdwwgzfPF4MKJ2GfgWeFg,1285
|
|
54
53
|
airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/tracker.py,sha256=KacNdbHatvPPhnNrycp5YUuD5xpkp56AFcHd-zguBgk,5247
|
|
55
|
-
airbyte_agent_zendesk_support-0.18.
|
|
56
|
-
airbyte_agent_zendesk_support-0.18.
|
|
57
|
-
airbyte_agent_zendesk_support-0.18.
|
|
54
|
+
airbyte_agent_zendesk_support-0.18.31.dist-info/METADATA,sha256=E1EP_SjDCza1bGz6jJhjkEizLuAZEvNwcfBl8cuFswY,6267
|
|
55
|
+
airbyte_agent_zendesk_support-0.18.31.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
56
|
+
airbyte_agent_zendesk_support-0.18.31.dist-info/RECORD,,
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Decorators for AI agent tool integration.
|
|
3
|
-
|
|
4
|
-
Provides utilities to auto-generate comprehensive tool descriptions
|
|
5
|
-
from connector metadata, enabling easy integration with AI frameworks.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from __future__ import annotations
|
|
9
|
-
|
|
10
|
-
import importlib
|
|
11
|
-
from typing import Any, Callable, TypeVar
|
|
12
|
-
|
|
13
|
-
from .introspection import (
|
|
14
|
-
MAX_EXAMPLE_QUESTIONS,
|
|
15
|
-
ConnectorModelProtocol,
|
|
16
|
-
EndpointProtocol,
|
|
17
|
-
generate_tool_description,
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
F = TypeVar("F", bound=Callable[..., Any])
|
|
21
|
-
|
|
22
|
-
__all__ = [
|
|
23
|
-
"airbyte_description",
|
|
24
|
-
"EndpointProtocol",
|
|
25
|
-
"ConnectorModelProtocol",
|
|
26
|
-
"MAX_EXAMPLE_QUESTIONS",
|
|
27
|
-
# Private function exposed for testing
|
|
28
|
-
"_load_connector_model",
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def airbyte_description(connector_name: str) -> Callable[[F], F]:
|
|
33
|
-
"""
|
|
34
|
-
Decorator that generates comprehensive tool descriptions from connector metadata.
|
|
35
|
-
|
|
36
|
-
Automatically populates the function's docstring with:
|
|
37
|
-
- Connector description
|
|
38
|
-
- Available entities and their actions
|
|
39
|
-
- Example questions the connector can answer
|
|
40
|
-
|
|
41
|
-
Args:
|
|
42
|
-
connector_name: Name of the connector (e.g., "hubspot", "stripe")
|
|
43
|
-
Must match the generated package name pattern:
|
|
44
|
-
airbyte_agent_{connector_name}
|
|
45
|
-
|
|
46
|
-
Returns:
|
|
47
|
-
Decorator that updates the function's __doc__ attribute
|
|
48
|
-
|
|
49
|
-
Example:
|
|
50
|
-
from airbyte_agent_hubspot import HubspotConnector
|
|
51
|
-
|
|
52
|
-
connector = HubspotConnector(
|
|
53
|
-
external_user_id=external_user_id,
|
|
54
|
-
airbyte_client_id=airbyte_client_id,
|
|
55
|
-
airbyte_client_secret=airbyte_client_secret
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
# IMPORTANT: @airbyte_description must be the INNER decorator (closest to function)
|
|
59
|
-
# This ensures __doc__ is expanded BEFORE frameworks like FastMCP capture it
|
|
60
|
-
@agent.tool_plain # or @mcp.tool() for FastMCP
|
|
61
|
-
@airbyte_description("hubspot")
|
|
62
|
-
async def hubspot_exec(entity: str, action: str, params: dict | None = None):
|
|
63
|
-
'''Execute HubSpot operations.'''
|
|
64
|
-
return await connector.execute(entity, action, params or {})
|
|
65
|
-
|
|
66
|
-
The decorator will update hubspot_exec.__doc__ with a comprehensive
|
|
67
|
-
description including all available entities, actions, and example questions.
|
|
68
|
-
"""
|
|
69
|
-
|
|
70
|
-
def decorator(func: F) -> F:
|
|
71
|
-
# Load connector model from generated package
|
|
72
|
-
model = _load_connector_model(connector_name)
|
|
73
|
-
|
|
74
|
-
# Generate description using shared introspection module
|
|
75
|
-
description = generate_tool_description(model)
|
|
76
|
-
|
|
77
|
-
# Preserve original docstring if present, append to it
|
|
78
|
-
original_doc = func.__doc__ or ""
|
|
79
|
-
if original_doc.strip():
|
|
80
|
-
func.__doc__ = f"{original_doc.strip()}\n\n{description}"
|
|
81
|
-
else:
|
|
82
|
-
func.__doc__ = description
|
|
83
|
-
|
|
84
|
-
return func
|
|
85
|
-
|
|
86
|
-
return decorator
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def _load_connector_model(connector_name: str) -> Any:
|
|
90
|
-
"""
|
|
91
|
-
Load connector model from generated package.
|
|
92
|
-
|
|
93
|
-
Args:
|
|
94
|
-
connector_name: Connector name (e.g., "hubspot")
|
|
95
|
-
|
|
96
|
-
Returns:
|
|
97
|
-
ConnectorModel instance from the generated package
|
|
98
|
-
|
|
99
|
-
Raises:
|
|
100
|
-
ImportError: If connector package is not installed
|
|
101
|
-
AttributeError: If connector model constant not found
|
|
102
|
-
"""
|
|
103
|
-
# Normalize connector name to package name
|
|
104
|
-
package_name = f"airbyte_agent_{connector_name.replace('-', '_')}"
|
|
105
|
-
|
|
106
|
-
try:
|
|
107
|
-
# Import the connector_model module from the generated package
|
|
108
|
-
module = importlib.import_module(f"{package_name}.connector_model")
|
|
109
|
-
except ImportError as e:
|
|
110
|
-
raise ImportError(f"Could not import connector package '{package_name}'. " f"Ensure the package is installed. Error: {e}") from e
|
|
111
|
-
|
|
112
|
-
# Find the ConnectorModel constant (named like HubspotConnectorModel)
|
|
113
|
-
# Convention: {PascalCase connector name}ConnectorModel
|
|
114
|
-
pascal_name = "".join(word.capitalize() for word in connector_name.replace("-", "_").split("_"))
|
|
115
|
-
model_name = f"{pascal_name}ConnectorModel"
|
|
116
|
-
|
|
117
|
-
model = getattr(module, model_name, None)
|
|
118
|
-
if model is None:
|
|
119
|
-
# Fallback: look for any ConnectorModel attribute
|
|
120
|
-
for attr_name in dir(module):
|
|
121
|
-
if attr_name.endswith("ConnectorModel"):
|
|
122
|
-
model = getattr(module, attr_name)
|
|
123
|
-
break
|
|
124
|
-
|
|
125
|
-
if model is None:
|
|
126
|
-
raise AttributeError(f"Could not find ConnectorModel in {package_name}.connector_model. " f"Expected constant named '{model_name}'")
|
|
127
|
-
|
|
128
|
-
return model
|
|
File without changes
|