dhisana 0.0.1.dev254__py3-none-any.whl → 0.0.1.dev255__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.
@@ -1561,6 +1561,36 @@ async def test_dialpad(client_id: str, client_secret: str) -> Dict[str, Any]:
1561
1561
  return {"success": False, "status_code": 0, "error_message": str(exc)}
1562
1562
 
1563
1563
 
1564
+ async def test_twilio(account_sid: str, auth_token: str) -> Dict[str, Any]:
1565
+ """
1566
+ Validate Twilio credentials via a lightweight authenticated call.
1567
+ Uses HTTP Basic Auth (account_sid:auth_token) to fetch account info.
1568
+ """
1569
+ url = f"https://api.twilio.com/2010-04-01/Accounts/{account_sid}.json"
1570
+
1571
+ try:
1572
+ auth = aiohttp.BasicAuth(account_sid, auth_token)
1573
+ async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=10), auth=auth) as session:
1574
+ async with session.get(url) as response:
1575
+ status = response.status
1576
+ data = await safe_json(response)
1577
+
1578
+ if status == 200 and isinstance(data, dict) and "sid" in data:
1579
+ return {"success": True, "status_code": status, "error_message": None}
1580
+
1581
+ message = None
1582
+ if isinstance(data, dict):
1583
+ message = data.get("message") or data.get("error")
1584
+ return {
1585
+ "success": False,
1586
+ "status_code": status,
1587
+ "error_message": message or f"Twilio responded with {status}",
1588
+ }
1589
+ except Exception as exc:
1590
+ logger.error(f"Twilio connectivity test failed: {exc}")
1591
+ return {"success": False, "status_code": 0, "error_message": str(exc)}
1592
+
1593
+
1564
1594
  async def test_nooks(api_key: str) -> Dict[str, Any]:
1565
1595
  """
1566
1596
  Validate Nooks.ai API key via a simple authenticated call.
@@ -1880,6 +1910,7 @@ async def test_connectivity(tool_config: List[Dict[str, Any]]) -> Dict[str, Dict
1880
1910
  "aircall": test_aircall, # handled specially to pass appId + apiToken
1881
1911
  "ringover": test_ringover,
1882
1912
  "dialpad": test_dialpad, # handled specially to pass client credentials
1913
+ "twilio": test_twilio, # handled specially to pass account_sid + auth_token
1883
1914
  "nooks": test_nooks,
1884
1915
  "commonRoom": test_commonroom,
1885
1916
  "scarf": test_scarf,
@@ -2097,6 +2128,23 @@ async def test_connectivity(tool_config: List[Dict[str, Any]]) -> Dict[str, Dict
2097
2128
  results[tool_name] = await test_dialpad(client_id, client_secret)
2098
2129
  continue
2099
2130
 
2131
+ # ------------------------------------------------------------------ #
2132
+ # Special-case: Twilio (account_sid + auth_token)
2133
+ # ------------------------------------------------------------------ #
2134
+ if tool_name == "twilio":
2135
+ account_sid = next((c["value"] for c in config_entries if c["name"] in ("accountSid", "account_sid")), None)
2136
+ auth_token = next((c["value"] for c in config_entries if c["name"] in ("authToken", "auth_token")), None)
2137
+ if not account_sid or not auth_token:
2138
+ results[tool_name] = {
2139
+ "success": False,
2140
+ "status_code": 0,
2141
+ "error_message": "Missing accountSid or authToken for Twilio.",
2142
+ }
2143
+ else:
2144
+ logger.info("Testing connectivity for Twilio…")
2145
+ results[tool_name] = await test_twilio(account_sid, auth_token)
2146
+ continue
2147
+
2100
2148
  # ------------------------------------------------------------------ #
2101
2149
  # All other tools – expect an apiKey by default
2102
2150
  # ------------------------------------------------------------------ #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dhisana
3
- Version: 0.0.1.dev254
3
+ Version: 0.0.1.dev255
4
4
  Summary: A Python SDK for Dhisana AI Platform
5
5
  Home-page: https://github.com/dhisana-ai/dhisana-python-sdk
6
6
  Author: Admin
@@ -81,7 +81,7 @@ dhisana/utils/serperdev_google_jobs.py,sha256=m5_2f_5y79FOFZz1A_go6m0hIUfbbAoZ0Y
81
81
  dhisana/utils/serperdev_local_business.py,sha256=JoZfTg58Hojv61cyuwA2lcnPdLT1lawnWaBNrUYWnuQ,6447
82
82
  dhisana/utils/serperdev_search.py,sha256=_iBKIfHMq4gFv5StYz58eArriygoi1zW6VnLlux8vto,9363
83
83
  dhisana/utils/smtp_email_tools.py,sha256=J9uDHCEu2BTyFzDBru0e1lC8bsAMt9c_mYXTzJgk9Kc,22054
84
- dhisana/utils/test_connect.py,sha256=UbVNVPS8OXRCrntwRCZVieX2m3OJ3mRYZG-gj2oajHA,90040
84
+ dhisana/utils/test_connect.py,sha256=YCweFyTRWSP3iwR3uLE0VWLIOK1qHY2OI4oNe6pCV_Y,92403
85
85
  dhisana/utils/trasform_json.py,sha256=7V72XNDpuxUX0GHN5D83z4anj_gIf5zabaHeQm7b1_E,6979
86
86
  dhisana/utils/web_download_parse_tools.py,sha256=ouXwH7CmjcRjoBfP5BWat86MvcGO-8rLCmWQe_eZKjc,7810
87
87
  dhisana/utils/workflow_code_model.py,sha256=YPWse5vBb3O6Km2PvKh1Q3AB8qBkzLt1CrR5xOL9Mro,99
@@ -95,8 +95,8 @@ dhisana/workflow/agent.py,sha256=esv7_i_XuMkV2j1nz_UlsHov_m6X5WZZiZm_tG4OBHU,565
95
95
  dhisana/workflow/flow.py,sha256=xWE3qQbM7j2B3FH8XnY3zOL_QXX4LbTW4ArndnEYJE0,1638
96
96
  dhisana/workflow/task.py,sha256=HlWz9mtrwLYByoSnePOemBUBrMEcj7KbgNjEE1oF5wo,1830
97
97
  dhisana/workflow/test.py,sha256=E7lRnXK0PguTNzyasHytLzTJdkqIPxG5_4qk4hMEeKc,3399
98
- dhisana-0.0.1.dev254.dist-info/METADATA,sha256=Y4lCiPFjHmSRLN2QfJsTlKVxdu_m3XRXHl9c8DmIm6k,1190
99
- dhisana-0.0.1.dev254.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
- dhisana-0.0.1.dev254.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
101
- dhisana-0.0.1.dev254.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
102
- dhisana-0.0.1.dev254.dist-info/RECORD,,
98
+ dhisana-0.0.1.dev255.dist-info/METADATA,sha256=lwJJzuSsIrzXyK7pli9XTZzeEy8aTJAkYLKAeWDgT9c,1190
99
+ dhisana-0.0.1.dev255.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
+ dhisana-0.0.1.dev255.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
101
+ dhisana-0.0.1.dev255.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
102
+ dhisana-0.0.1.dev255.dist-info/RECORD,,