dhisana 0.0.1.dev256__py3-none-any.whl → 0.0.1.dev258__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/utils/enrich_lead_information.py +2 -2
- dhisana/utils/google_workspace_tools.py +26 -3
- dhisana/utils/serpapi_search_tools.py +2 -2
- {dhisana-0.0.1.dev256.dist-info → dhisana-0.0.1.dev258.dist-info}/METADATA +1 -1
- {dhisana-0.0.1.dev256.dist-info → dhisana-0.0.1.dev258.dist-info}/RECORD +8 -8
- {dhisana-0.0.1.dev256.dist-info → dhisana-0.0.1.dev258.dist-info}/WHEEL +0 -0
- {dhisana-0.0.1.dev256.dist-info → dhisana-0.0.1.dev258.dist-info}/entry_points.txt +0 -0
- {dhisana-0.0.1.dev256.dist-info → dhisana-0.0.1.dev258.dist-info}/top_level.txt +0 -0
|
@@ -753,8 +753,8 @@ async def get_organization_linkedin_url(lead: Dict[str, Any], tools: Optional[Li
|
|
|
753
753
|
|
|
754
754
|
linkedin_url = await find_organization_linkedin_url_with_google_search(
|
|
755
755
|
name,
|
|
756
|
-
company_location="
|
|
757
|
-
company_domain=lead.get("primary_domain_of_organization"),
|
|
756
|
+
company_location="USA",
|
|
757
|
+
company_domain=lead.get("primary_domain_of_organization", ""),
|
|
758
758
|
use_strict_check=True,
|
|
759
759
|
tool_config=tools,
|
|
760
760
|
)
|
|
@@ -33,7 +33,7 @@ from dhisana.schemas.common import (SendEmailContext, QueryEmailContext, ReplyEm
|
|
|
33
33
|
# HELPER FUNCTIONS
|
|
34
34
|
################################################################################
|
|
35
35
|
|
|
36
|
-
def get_google_workspace_token(tool_config: Optional[List[Dict]] = None) ->
|
|
36
|
+
def get_google_workspace_token(tool_config: Optional[List[Dict]] = None) -> Any:
|
|
37
37
|
"""
|
|
38
38
|
Retrieves the GOOGLE_SERVICE_KEY (base64-encoded JSON) from the provided tool configuration or environment.
|
|
39
39
|
|
|
@@ -43,7 +43,7 @@ def get_google_workspace_token(tool_config: Optional[List[Dict]] = None) -> str:
|
|
|
43
43
|
where "configuration" is a list of dictionaries containing "name" and "value" keys.
|
|
44
44
|
|
|
45
45
|
Returns:
|
|
46
|
-
|
|
46
|
+
Any: The service account payload (JSON string, base64 string, or dict) for credentials.
|
|
47
47
|
|
|
48
48
|
Raises:
|
|
49
49
|
ValueError: If the Google Workspace integration has not been configured.
|
|
@@ -75,6 +75,29 @@ def get_google_workspace_token(tool_config: Optional[List[Dict]] = None) -> str:
|
|
|
75
75
|
return GOOGLE_SERVICE_KEY
|
|
76
76
|
|
|
77
77
|
|
|
78
|
+
def _normalize_service_account_info(service_account_json: Any) -> Dict[str, Any]:
|
|
79
|
+
"""
|
|
80
|
+
Normalize a service account payload into a dict for Credentials.from_service_account_info.
|
|
81
|
+
Accepts dict, JSON string, or base64-encoded JSON string.
|
|
82
|
+
"""
|
|
83
|
+
if isinstance(service_account_json, dict):
|
|
84
|
+
return service_account_json
|
|
85
|
+
if isinstance(service_account_json, (bytes, bytearray)):
|
|
86
|
+
service_account_json = service_account_json.decode("utf-8")
|
|
87
|
+
if not isinstance(service_account_json, str):
|
|
88
|
+
raise TypeError(
|
|
89
|
+
"Google Workspace service account payload must be a dict, str, bytes, or bytearray."
|
|
90
|
+
)
|
|
91
|
+
try:
|
|
92
|
+
return json.loads(service_account_json)
|
|
93
|
+
except json.JSONDecodeError:
|
|
94
|
+
try:
|
|
95
|
+
decoded = base64.b64decode(service_account_json).decode("utf-8")
|
|
96
|
+
except (ValueError, UnicodeDecodeError) as exc:
|
|
97
|
+
raise ValueError("Invalid Google Workspace service account payload.") from exc
|
|
98
|
+
return json.loads(decoded)
|
|
99
|
+
|
|
100
|
+
|
|
78
101
|
|
|
79
102
|
def get_google_credentials(
|
|
80
103
|
sender_email: str,
|
|
@@ -97,7 +120,7 @@ def get_google_credentials(
|
|
|
97
120
|
raise ValueError("sender_email is required to impersonate via service account.")
|
|
98
121
|
|
|
99
122
|
service_account_json = get_google_workspace_token(tool_config)
|
|
100
|
-
service_account_info =
|
|
123
|
+
service_account_info = _normalize_service_account_info(service_account_json)
|
|
101
124
|
|
|
102
125
|
# Create Credentials object and impersonate the sender_email
|
|
103
126
|
credentials = service_account.Credentials.from_service_account_info(
|
|
@@ -709,8 +709,8 @@ def extract_company_page(url: str) -> str:
|
|
|
709
709
|
@assistant_tool
|
|
710
710
|
async def find_organization_linkedin_url_with_google_search(
|
|
711
711
|
company_name: str,
|
|
712
|
-
company_location:
|
|
713
|
-
company_domain:
|
|
712
|
+
company_location: str = "",
|
|
713
|
+
company_domain: str = "",
|
|
714
714
|
use_strict_check: bool = True,
|
|
715
715
|
tool_config: Optional[List[Dict]] = None,
|
|
716
716
|
) -> str:
|
|
@@ -32,7 +32,7 @@ dhisana/utils/domain_parser.py,sha256=Kw5MPP06wK2azWQzuSiOE-DffOezLqDyF-L9JEBsMS
|
|
|
32
32
|
dhisana/utils/email_body_utils.py,sha256=rlCVjdBlqNnEiUberJGXGcrYY1GQOkW0-aB6AEpS3L4,2302
|
|
33
33
|
dhisana/utils/email_parse_helpers.py,sha256=LIdm1B1IyGSW50y8EkxOk6YRjvxO2SJTgTKPLxYls_o,4613
|
|
34
34
|
dhisana/utils/email_provider.py,sha256=spjbNdnaVfCZEUw62EEHKijuXjI7vTVNqsftxJ15Erw,14352
|
|
35
|
-
dhisana/utils/enrich_lead_information.py,sha256=
|
|
35
|
+
dhisana/utils/enrich_lead_information.py,sha256=FulsC4_nuHBn6YmGIMYSHNDNcDgLcbDkR9Qd5uDkeO4,39407
|
|
36
36
|
dhisana/utils/extract_email_content_for_llm.py,sha256=SQmMZ3YJtm3ZI44XiWEVAItcAwrsSSy1QzDne7LTu_Q,3713
|
|
37
37
|
dhisana/utils/fetch_openai_config.py,sha256=LjWdFuUeTNeAW106pb7DLXZNElos2PlmXRe6bHZJ2hw,5159
|
|
38
38
|
dhisana/utils/field_validators.py,sha256=BZgNCpBG264aRqNUu_J67c6zfr15zlAaIw2XRy8J7DY,11809
|
|
@@ -48,7 +48,7 @@ dhisana/utils/generate_linkedin_response_message.py,sha256=-jg-u5Ipf4-cn9q0yjEHs
|
|
|
48
48
|
dhisana/utils/generate_structured_output_internal.py,sha256=DmZ5QzW-79Jo3JL5nDCZQ-Fjl8Nz7FHK6S0rZxXbKyg,20705
|
|
49
49
|
dhisana/utils/google_custom_search.py,sha256=5rQ4uAF-hjFpd9ooJkd6CjRvSmhZHhqM0jfHItsbpzk,10071
|
|
50
50
|
dhisana/utils/google_oauth_tools.py,sha256=ReG5lCpXL3_e_s0yn6ai4U7B4-feOWHJVtbv_c0g0rE,28525
|
|
51
|
-
dhisana/utils/google_workspace_tools.py,sha256=
|
|
51
|
+
dhisana/utils/google_workspace_tools.py,sha256=fuV0UcvAqF9drLzj7-p6D5zh7d5jMXl1jNJTICk4XOo,50224
|
|
52
52
|
dhisana/utils/hubspot_clearbit.py,sha256=keNX1F_RnDl9AOPxYEOTMdukV_A9g8v9j1fZyT4tuP4,3440
|
|
53
53
|
dhisana/utils/hubspot_crm_tools.py,sha256=lbXFCeq690_TDLjDG8Gm5E-2f1P5EuDqNf5j8PYpMm8,99298
|
|
54
54
|
dhisana/utils/instantly_tools.py,sha256=hhqjDPyLE6o0dzzuvryszbK3ipnoGU2eBm6NlsUGJjY,4771
|
|
@@ -76,7 +76,7 @@ dhisana/utils/serpapi_additional_tools.py,sha256=Xb1tc_oK-IjI9ZrEruYhFg8UJMLHQDa
|
|
|
76
76
|
dhisana/utils/serpapi_google_jobs.py,sha256=HUJFZEW8UvYqsW0sWlEDXgI_IUomh5fTkzRJzEgsDGc,4509
|
|
77
77
|
dhisana/utils/serpapi_google_search.py,sha256=B3sVq2OXdrYmPbH7cjQN4RFoek96qgKzXIayKXn0HLU,7318
|
|
78
78
|
dhisana/utils/serpapi_local_business_search.py,sha256=vinmuXLaQ_0BpEdwnONZ2vLTq5xnRh6ICmPbnpckSN4,5775
|
|
79
|
-
dhisana/utils/serpapi_search_tools.py,sha256=
|
|
79
|
+
dhisana/utils/serpapi_search_tools.py,sha256=Wsvy6JDYWBGhIomWcjZiYcWe7ALTO7CORsNG8whyyQg,31698
|
|
80
80
|
dhisana/utils/serperdev_google_jobs.py,sha256=m5_2f_5y79FOFZz1A_go6m0hIUfbbAoZ0YTjUMO2BSI,4508
|
|
81
81
|
dhisana/utils/serperdev_local_business.py,sha256=JoZfTg58Hojv61cyuwA2lcnPdLT1lawnWaBNrUYWnuQ,6447
|
|
82
82
|
dhisana/utils/serperdev_search.py,sha256=_iBKIfHMq4gFv5StYz58eArriygoi1zW6VnLlux8vto,9363
|
|
@@ -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.
|
|
99
|
-
dhisana-0.0.1.
|
|
100
|
-
dhisana-0.0.1.
|
|
101
|
-
dhisana-0.0.1.
|
|
102
|
-
dhisana-0.0.1.
|
|
98
|
+
dhisana-0.0.1.dev258.dist-info/METADATA,sha256=ufVHL3LUQ_C7zgLk_o2xDFq17AAiX_e3d3-OG_gdbb4,1190
|
|
99
|
+
dhisana-0.0.1.dev258.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
100
|
+
dhisana-0.0.1.dev258.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
|
|
101
|
+
dhisana-0.0.1.dev258.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
|
|
102
|
+
dhisana-0.0.1.dev258.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|