airbyte-agent-zendesk-support 0.18.29__py3-none-any.whl → 0.18.30__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.
@@ -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
  ]
@@ -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 @airbyte_description decorator to populate
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:
@@ -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
- def describe(self) -> list[dict[str, Any]]:
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
- Describe available entities, actions, and parameters.
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.describe()
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.29
3
+ Version: 0.18.30
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.29
144
+ - **Package version:** 0.18.30
145
145
  - **Connector version:** 0.1.4
146
- - **Generated with Connector SDK commit SHA:** d023e05f2b7a1ddabf81fab7640c64de1e0aa6a1
146
+ - **Generated with Connector SDK commit SHA:** da9b741b7b9d8091113af16ba8ec5d5e5d13b749
@@ -1,19 +1,18 @@
1
1
  airbyte_agent_zendesk_support/__init__.py,sha256=MPz4HU055DRA3-1qgbGXh2E0YHmhcexQCFl-Tz21gm4,6227
2
- airbyte_agent_zendesk_support/connector.py,sha256=-myr_jxv7k37t-j3Gk0FaTL9ZuLOG1uxr0fcavTNuww,65663
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=wcf0bwjYCV6fZtMtkugUjsuUbMUl_8LjM7ojgh32eNI,2056
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
10
  airbyte_agent_zendesk_support/_vendored/connector_sdk/connector_model_loader.py,sha256=BeX4QykMUQZk5qY--WuwxXClI7FBDxxbGguqcztAd8A,34663
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
13
  airbyte_agent_zendesk_support/_vendored/connector_sdk/extensions.py,sha256=iWA2i0kiiGZY84H8P25A6QmfbuZwu7euMcj4-Vx2DOQ,20185
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=_fdhYJIX-BsH3c55wDD7Nos2Fa6CEVmGHr-i5hEAInU,10320
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
17
  airbyte_agent_zendesk_support/_vendored/connector_sdk/types.py,sha256=sS9olOyT-kVemHmcFll2ePFRhTdGMbWcz7bSgV-MuSw,8114
19
18
  airbyte_agent_zendesk_support/_vendored/connector_sdk/utils.py,sha256=G4LUXOC2HzPoND2v4tQW68R9uuPX9NQyCjaGxb7Kpl0,1958
@@ -52,6 +51,6 @@ airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/__init__.py,sha2
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.29.dist-info/METADATA,sha256=_xUrBuX_Yo44RTyD4LjQ4x_QhRbf-cjlLjg7zRM2L-c,6267
56
- airbyte_agent_zendesk_support-0.18.29.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
57
- airbyte_agent_zendesk_support-0.18.29.dist-info/RECORD,,
54
+ airbyte_agent_zendesk_support-0.18.30.dist-info/METADATA,sha256=ERDPqj299pT-gjecz3Q0eI14nvZPb41ngI0XKvcM3ME,6267
55
+ airbyte_agent_zendesk_support-0.18.30.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
56
+ airbyte_agent_zendesk_support-0.18.30.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