dhisana 0.0.1.dev220__py3-none-any.whl → 0.0.1.dev221__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.
@@ -573,7 +573,7 @@ async def search_leads_with_apollo(
573
573
  # Important: handle personNotTitles as well
574
574
  "personNotTitles": "person_not_titles",
575
575
 
576
- "qOrganizationJobTitles": "q_keywords",
576
+ "qOrganizationJobTitles": "q_organization_job_titles",
577
577
  "sortAscending": "sort_ascending",
578
578
  "sortByField": "sort_by_field",
579
579
  "contactEmailStatusV2": "contact_email_status",
@@ -646,6 +646,8 @@ async def search_leads_with_apollo(
646
646
  "organization_ids",
647
647
  "organization_num_employees_ranges",
648
648
  "person_not_titles", # <--- added so single item is forced into list
649
+ "q_organization_job_titles",
650
+ "organization_latest_funding_stage_cd",
649
651
  ):
650
652
  if isinstance(final_value, str):
651
653
  final_value = [final_value]
@@ -675,6 +677,10 @@ async def search_leads_with_apollo(
675
677
  "page": 1,
676
678
  "per_page": min(max_items, 100),
677
679
  }
680
+ if query.job_openings_with_titles:
681
+ dynamic_payload["q_organization_job_titles"] = query.job_openings_with_titles
682
+ if query.latest_funding_stages:
683
+ dynamic_payload["organization_latest_funding_stage_cd"] = query.latest_funding_stages
678
684
  if query.sort_by_field is not None:
679
685
  dynamic_payload["sort_by_field"] = query.sort_by_field
680
686
  if query.sort_ascending is not None:
@@ -785,7 +791,7 @@ async def search_leads_with_apollo_page(
785
791
  "organizationNumEmployeesRanges": "organization_num_employees_ranges",
786
792
  "personTitles": "person_titles",
787
793
  "personNotTitles": "person_not_titles",
788
- "qOrganizationJobTitles": "q_keywords",
794
+ "qOrganizationJobTitles": "q_organization_job_titles",
789
795
  "sortAscending": "sort_ascending",
790
796
  "sortByField": "sort_by_field",
791
797
  "contactEmailStatusV2": "contact_email_status",
@@ -843,6 +849,8 @@ async def search_leads_with_apollo_page(
843
849
  "organization_ids",
844
850
  "organization_num_employees_ranges",
845
851
  "person_not_titles",
852
+ "q_organization_job_titles",
853
+ "organization_latest_funding_stage_cd",
846
854
  ):
847
855
  if isinstance(final_value, str):
848
856
  final_value = [final_value]
@@ -866,6 +874,10 @@ async def search_leads_with_apollo_page(
866
874
  or [f"{query.min_employees_in_organization or 1},{query.max_employees_in_organization or 1000}"]
867
875
  ),
868
876
  }
877
+ if query.job_openings_with_titles:
878
+ dynamic_payload["q_organization_job_titles"] = query.job_openings_with_titles
879
+ if query.latest_funding_stages:
880
+ dynamic_payload["organization_latest_funding_stage_cd"] = query.latest_funding_stages
869
881
  if query.sort_by_field is not None:
870
882
  dynamic_payload["sort_by_field"] = query.sort_by_field
871
883
  if query.sort_ascending is not None:
@@ -296,6 +296,68 @@ async def test_proxycurl(api_key: str) -> Dict[str, Any]:
296
296
  return {"success": False, "status_code": 0, "error_message": str(e)}
297
297
 
298
298
 
299
+ async def test_exa(api_key: str) -> Dict[str, Any]:
300
+ """Verify Exa connectivity by issuing a minimal search request."""
301
+
302
+ url = "https://api.exa.ai/search"
303
+ headers = {
304
+ "x-api-key": api_key,
305
+ "Content-Type": "application/json",
306
+ "Accept": "application/json",
307
+ }
308
+ payload = {
309
+ "query": "Dhisana connectivity check",
310
+ "numResults": 1,
311
+ }
312
+
313
+ try:
314
+ timeout = aiohttp.ClientTimeout(total=10)
315
+ async with aiohttp.ClientSession(timeout=timeout) as session:
316
+ async with session.post(url, headers=headers, json=payload) as response:
317
+ status = response.status
318
+ data = await safe_json(response)
319
+
320
+ if status != 200:
321
+ err_message = None
322
+ if isinstance(data, dict):
323
+ err_message = (
324
+ data.get("message")
325
+ or data.get("error")
326
+ or data.get("detail")
327
+ )
328
+ if isinstance(err_message, dict):
329
+ err_message = err_message.get("message") or str(err_message)
330
+ return {
331
+ "success": False,
332
+ "status_code": status,
333
+ "error_message": err_message or f"Non-200 from Exa: {status}",
334
+ }
335
+
336
+ if isinstance(data, dict):
337
+ if "error" in data:
338
+ error_value = data["error"]
339
+ if isinstance(error_value, dict):
340
+ error_value = error_value.get("message") or str(error_value)
341
+ return {
342
+ "success": False,
343
+ "status_code": status,
344
+ "error_message": str(error_value),
345
+ }
346
+
347
+ results = data.get("results")
348
+ if isinstance(results, list):
349
+ return {"success": True, "status_code": status, "error_message": None}
350
+
351
+ return {
352
+ "success": False,
353
+ "status_code": status,
354
+ "error_message": "Unexpected response from Exa API.",
355
+ }
356
+ except Exception as exc:
357
+ logger.error(f"Exa test failed: {exc}")
358
+ return {"success": False, "status_code": 0, "error_message": str(exc)}
359
+
360
+
299
361
  async def test_apollo(api_key: str) -> Dict[str, Any]:
300
362
  organization_domain = 'microsoft.com'
301
363
  url = f'https://api.apollo.io/api/v1/organizations/enrich?domain={organization_domain}'
@@ -1179,6 +1241,7 @@ async def test_connectivity(tool_config: List[Dict[str, Any]]) -> Dict[str, Dict
1179
1241
  "serpapi": test_serpapi,
1180
1242
  "serperdev": test_serperdev,
1181
1243
  "proxycurl": test_proxycurl,
1244
+ "exa": test_exa,
1182
1245
  "apollo": test_apollo,
1183
1246
  "hubspot": test_hubspot,
1184
1247
  "github": test_github,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dhisana
3
- Version: 0.0.1.dev220
3
+ Version: 0.0.1.dev221
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
@@ -12,7 +12,7 @@ dhisana/ui/components.py,sha256=4NXrAyl9tx2wWwoVYyABO-EOGnreGMvql1AkXWajIIo,1431
12
12
  dhisana/utils/__init__.py,sha256=jv2YF__bseklT3OWEzlqJ5qE24c4aWd5F4r0TTjOrWQ,65
13
13
  dhisana/utils/add_mapping.py,sha256=oq_QNqag86DhgdwINBRRXNx7SOb8Q9M-V0QLP6pTzr8,13837
14
14
  dhisana/utils/agent_tools.py,sha256=pzBFvfhU4wfSB4zv1eiRzjmnteJnfhC5V32r_v1m38Y,2321
15
- dhisana/utils/apollo_tools.py,sha256=WSt5SV3ElfYlNjFw6-8FyZ0_6wete5vahoSYPhACcD8,65716
15
+ dhisana/utils/apollo_tools.py,sha256=aOJYxFlSWaFa_uCt0ZTDEvX6qZTrnAO5NrZgDBYWPN4,66506
16
16
  dhisana/utils/assistant_tool_tag.py,sha256=rYRl8ubLI7fUUIjg30XTefHBkFgRqNEVC12lF6U6Z-8,119
17
17
  dhisana/utils/built_with_api_tools.py,sha256=TFNGhnPb2vFdveVCpjiCvE1WKe_eK95UPpR0Ha5NgMQ,10260
18
18
  dhisana/utils/cache_output_tools.py,sha256=sSAruvUZn-WAJQ0lB9T1QjSmkm-_14AuxC9xKmcCQ0k,3428
@@ -78,7 +78,7 @@ dhisana/utils/serperdev_google_jobs.py,sha256=m5_2f_5y79FOFZz1A_go6m0hIUfbbAoZ0Y
78
78
  dhisana/utils/serperdev_local_business.py,sha256=JoZfTg58Hojv61cyuwA2lcnPdLT1lawnWaBNrUYWnuQ,6447
79
79
  dhisana/utils/serperdev_search.py,sha256=_iBKIfHMq4gFv5StYz58eArriygoi1zW6VnLlux8vto,9363
80
80
  dhisana/utils/smtp_email_tools.py,sha256=kx0VSa0JQyVLD020oARCHhOBZJxDwMIri1Z7jPN0nP4,15843
81
- dhisana/utils/test_connect.py,sha256=1rupW6dIfRzBKUH1AcWqfhYWhW-wETD475AJlCbgvFw,58254
81
+ dhisana/utils/test_connect.py,sha256=-5Wxc1D4KyCuNJjf9UvIXqK-eXmcr_1MpUg4u_B06SQ,60749
82
82
  dhisana/utils/trasform_json.py,sha256=s48DoyzVVCI4dTvSUwF5X-exX6VH6nPWrjbUENkYuNE,6979
83
83
  dhisana/utils/web_download_parse_tools.py,sha256=ouXwH7CmjcRjoBfP5BWat86MvcGO-8rLCmWQe_eZKjc,7810
84
84
  dhisana/utils/workflow_code_model.py,sha256=YPWse5vBb3O6Km2PvKh1Q3AB8qBkzLt1CrR5xOL9Mro,99
@@ -92,8 +92,8 @@ dhisana/workflow/agent.py,sha256=esv7_i_XuMkV2j1nz_UlsHov_m6X5WZZiZm_tG4OBHU,565
92
92
  dhisana/workflow/flow.py,sha256=xWE3qQbM7j2B3FH8XnY3zOL_QXX4LbTW4ArndnEYJE0,1638
93
93
  dhisana/workflow/task.py,sha256=HlWz9mtrwLYByoSnePOemBUBrMEcj7KbgNjEE1oF5wo,1830
94
94
  dhisana/workflow/test.py,sha256=kwW8jWqSBNcRmoyaxlTuZCMOpGJpTbJQgHI7gSjwdzM,3399
95
- dhisana-0.0.1.dev220.dist-info/METADATA,sha256=HsH4PGLIF-9i_HFv9ODch9lhyl7tdQ48epFKP7TcUXM,1190
96
- dhisana-0.0.1.dev220.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
97
- dhisana-0.0.1.dev220.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
98
- dhisana-0.0.1.dev220.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
99
- dhisana-0.0.1.dev220.dist-info/RECORD,,
95
+ dhisana-0.0.1.dev221.dist-info/METADATA,sha256=b-NJrLnqGwpHzBkbkln7ZoEUSbUG9-48gIwjJiicSxE,1190
96
+ dhisana-0.0.1.dev221.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
97
+ dhisana-0.0.1.dev221.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
98
+ dhisana-0.0.1.dev221.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
99
+ dhisana-0.0.1.dev221.dist-info/RECORD,,