dhisana 0.0.1.dev252__py3-none-any.whl → 0.0.1.dev254__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.
dhisana/schemas/sales.py CHANGED
@@ -728,7 +728,10 @@ class LeadsQueryFilters(BaseModel):
728
728
  # CHANGED: Renamed to be more descriptive
729
729
  industries: Optional[List[str]] = Field(
730
730
  default=None,
731
- description="List of organization industries. Maps to organization_industries in Apollo."
731
+ description=(
732
+ "List of organization industries (case sensitive). "
733
+ "Maps to organization_industries in Apollo."
734
+ )
732
735
  )
733
736
 
734
737
  # Potential existing fields
@@ -800,7 +803,10 @@ class LeadsQueryFilters(BaseModel):
800
803
  # CHANGED: Renamed for consistency
801
804
  company_industry_tag_ids: Optional[List[str]] = Field(
802
805
  default=None,
803
- description="List of industry tag IDs, e.g. ['5567cd4773696439b10b0000']. Maps to organization_industry_tag_ids."
806
+ description=(
807
+ "List of industry tag IDs, e.g. ['5567cd4773696439b10b0000']. "
808
+ "Maps to organization_industry_tag_ids."
809
+ )
804
810
  )
805
811
 
806
812
  q_organization_keyword_tags: Optional[List[str]] = Field(
@@ -547,6 +547,7 @@ async def search_leads_with_apollo(
547
547
  "revenueRange[max]": "revenue_range_max",
548
548
  "revenueRange[min]": "revenue_range_min",
549
549
  "currentlyUsingAnyOfTechnologyUids": "currently_using_any_of_technology_uids",
550
+ "organizationIndustries": "organization_industries",
550
551
  "organizationIndustryTagIds": "organization_industry_tag_ids",
551
552
  "notOrganizationIds": "not_organization_ids",
552
553
  "qOrganizationDomainsList": "q_organization_domains_list",
@@ -614,6 +615,8 @@ async def search_leads_with_apollo(
614
615
  "person_not_titles", # <--- added so single item is forced into list
615
616
  "q_organization_job_titles",
616
617
  "organization_latest_funding_stage_cd",
618
+ "organization_industries",
619
+ "organization_industry_tag_ids",
617
620
  ):
618
621
  if isinstance(final_value, str):
619
622
  final_value = [final_value]
@@ -664,6 +667,10 @@ async def search_leads_with_apollo(
664
667
  dynamic_payload["sort_ascending"] = query.sort_ascending
665
668
  if query.person_seniorities:
666
669
  dynamic_payload["person_seniorities"] = query.person_seniorities
670
+ if query.industries:
671
+ dynamic_payload["organization_industries"] = query.industries
672
+ if query.company_industry_tag_ids:
673
+ dynamic_payload["organization_industry_tag_ids"] = query.company_industry_tag_ids
667
674
  # Add company domains to include in search
668
675
  if query.company_domains:
669
676
  dynamic_payload["q_organization_domains_list"] = query.company_domains
@@ -782,6 +789,7 @@ async def search_leads_with_apollo_page(
782
789
  "revenueRange[max]": "revenue_range_max",
783
790
  "revenueRange[min]": "revenue_range_min",
784
791
  "currentlyUsingAnyOfTechnologyUids": "currently_using_any_of_technology_uids",
792
+ "organizationIndustries": "organization_industries",
785
793
  "organizationIndustryTagIds": "organization_industry_tag_ids",
786
794
  "notOrganizationIds": "not_organization_ids",
787
795
  "qOrganizationDomainsList": "q_organization_domains_list",
@@ -834,6 +842,8 @@ async def search_leads_with_apollo_page(
834
842
  "person_not_titles",
835
843
  "q_organization_job_titles",
836
844
  "organization_latest_funding_stage_cd",
845
+ "organization_industries",
846
+ "organization_industry_tag_ids",
837
847
  ):
838
848
  if isinstance(final_value, str):
839
849
  final_value = [final_value]
@@ -880,6 +890,10 @@ async def search_leads_with_apollo_page(
880
890
 
881
891
  if query.q_not_organization_keyword_tags:
882
892
  dynamic_payload["q_not_organization_keyword_tags"] = query.q_not_organization_keyword_tags
893
+ if query.industries:
894
+ dynamic_payload["organization_industries"] = query.industries
895
+ if query.company_industry_tag_ids:
896
+ dynamic_payload["organization_industry_tag_ids"] = query.company_industry_tag_ids
883
897
 
884
898
  # Add company domains to include in search (Apollo API: q_organization_domains_list[])
885
899
  if query.company_domains:
@@ -1714,6 +1714,82 @@ async def test_theorg(api_key: str) -> Dict[str, Any]:
1714
1714
  return {"success": False, "status_code": 0, "error_message": str(exc)}
1715
1715
 
1716
1716
 
1717
+ ###############################################################################
1718
+ # CORESIGNAL CONNECTIVITY
1719
+ ###############################################################################
1720
+
1721
+ async def test_coresignal(api_key: str) -> Dict[str, Any]:
1722
+ """
1723
+ Connectivity test for Coresignal using the Multi-source Jobs API search preview.
1724
+
1725
+ Uses a lightweight search query to verify API key validity.
1726
+ Reference: https://docs.coresignal.com/jobs-api/multi-source-jobs-api/search-preview
1727
+ """
1728
+ url = "https://api.coresignal.com/cdapi/v2/job_multi_source/search/es_dsl/preview"
1729
+ headers = {
1730
+ "apikey": api_key,
1731
+ "Accept": "application/json",
1732
+ "Content-Type": "application/json",
1733
+ }
1734
+ # Minimal query to check connectivity
1735
+ payload = {
1736
+ "query": {
1737
+ "bool": {
1738
+ "must": [
1739
+ {
1740
+ "match": {
1741
+ "title": "software engineer"
1742
+ }
1743
+ }
1744
+ ]
1745
+ }
1746
+ }
1747
+ }
1748
+
1749
+ try:
1750
+ timeout = aiohttp.ClientTimeout(total=15)
1751
+ async with aiohttp.ClientSession(timeout=timeout) as session:
1752
+ async with session.post(url, headers=headers, json=payload) as resp:
1753
+ status = resp.status
1754
+ data = await safe_json(resp)
1755
+
1756
+ if status == 200:
1757
+ # Check if we got a valid response (list of job results or empty list)
1758
+ if isinstance(data, list):
1759
+ return {"success": True, "status_code": status, "error_message": None}
1760
+ # Some endpoints may return a dict with results
1761
+ if isinstance(data, dict):
1762
+ if "error" in data or "errors" in data:
1763
+ err = data.get("error") or data.get("errors")
1764
+ if isinstance(err, dict):
1765
+ err = err.get("message") or str(err)
1766
+ return {"success": False, "status_code": status, "error_message": str(err)}
1767
+ return {"success": True, "status_code": status, "error_message": None}
1768
+ return {"success": True, "status_code": status, "error_message": None}
1769
+
1770
+ if status in (401, 403):
1771
+ msg = None
1772
+ if isinstance(data, dict):
1773
+ msg = data.get("message") or data.get("error") or data.get("detail")
1774
+ return {
1775
+ "success": False,
1776
+ "status_code": status,
1777
+ "error_message": msg or "Unauthorized – check Coresignal API key",
1778
+ }
1779
+
1780
+ msg = None
1781
+ if isinstance(data, dict):
1782
+ msg = data.get("message") or data.get("error") or data.get("detail")
1783
+ return {
1784
+ "success": False,
1785
+ "status_code": status,
1786
+ "error_message": msg or f"Coresignal responded with {status}",
1787
+ }
1788
+ except Exception as e:
1789
+ logger.error(f"Coresignal connectivity test failed: {e}")
1790
+ return {"success": False, "status_code": 0, "error_message": str(e)}
1791
+
1792
+
1717
1793
  ###############################################################################
1718
1794
  # DATAGMA CONNECTIVITY
1719
1795
  ###############################################################################
@@ -1808,6 +1884,7 @@ async def test_connectivity(tool_config: List[Dict[str, Any]]) -> Dict[str, Dict
1808
1884
  "commonRoom": test_commonroom,
1809
1885
  "scarf": test_scarf,
1810
1886
  "theorg": test_theorg,
1887
+ "coresignal": test_coresignal,
1811
1888
  "salesforce": test_salesforce,
1812
1889
  "clay": test_clay,
1813
1890
  "posthog": test_posthog,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dhisana
3
- Version: 0.0.1.dev252
3
+ Version: 0.0.1.dev254
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
@@ -6,13 +6,13 @@ dhisana/cli/models.py,sha256=IzUFZW_X32mL3fpM1_j4q8AF7v5nrxJcxBoqvG-TTgA,706
6
6
  dhisana/cli/predictions.py,sha256=VYgoLK1Ksv6MFImoYZqjQJkds7e5Hso65dHwbxTNNzE,646
7
7
  dhisana/schemas/__init__.py,sha256=jv2YF__bseklT3OWEzlqJ5qE24c4aWd5F4r0TTjOrWQ,65
8
8
  dhisana/schemas/common.py,sha256=dO3JJvu6uZQPGGwvwtstjogEVJZjvwY4nPF2B7w0tIY,9465
9
- dhisana/schemas/sales.py,sha256=PyJWs6qxk2Kj_1N87eGsehXzlE7OLSOkaCcMinwlfAA,34351
9
+ dhisana/schemas/sales.py,sha256=mR5ekyeFeSiD_nGEf1KmtXnZcqg4UAPjeMRZOpfwgr4,34446
10
10
  dhisana/ui/__init__.py,sha256=jv2YF__bseklT3OWEzlqJ5qE24c4aWd5F4r0TTjOrWQ,65
11
11
  dhisana/ui/components.py,sha256=4NXrAyl9tx2wWwoVYyABO-EOGnreGMvql1AkXWajIIo,14316
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=1b9FaL_3spQKUsOP1k8-kD1kcFxCkG4KJHoN71SjOkU,69796
15
+ dhisana/utils/apollo_tools.py,sha256=Yjs594qP5Q86ZaIJzSGJ7sgWdvitc3LXLocg9FPnZ8Y,70606
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=q-d-WR_pkIUQyCJk8T-u9sfTy1TvvWoD2kJlZfqY-vA,4392
@@ -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=pYR1Ki6WKx-vAhLJxQ6At627xfOnlQeVRjnW7FBdGKM,86702
84
+ dhisana/utils/test_connect.py,sha256=UbVNVPS8OXRCrntwRCZVieX2m3OJ3mRYZG-gj2oajHA,90040
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.dev252.dist-info/METADATA,sha256=-JTN_wbJlVSnuz7HWr4sETgjQZuhaXFhZrFIJkKhQ28,1190
99
- dhisana-0.0.1.dev252.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
- dhisana-0.0.1.dev252.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
101
- dhisana-0.0.1.dev252.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
102
- dhisana-0.0.1.dev252.dist-info/RECORD,,
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,,