dhisana 0.0.1.dev85__py3-none-any.whl → 0.0.1.dev236__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/common.py +33 -0
- dhisana/schemas/sales.py +224 -23
- dhisana/utils/add_mapping.py +72 -63
- dhisana/utils/apollo_tools.py +739 -109
- dhisana/utils/built_with_api_tools.py +4 -2
- dhisana/utils/cache_output_tools.py +23 -23
- dhisana/utils/check_email_validity_tools.py +456 -458
- dhisana/utils/check_for_intent_signal.py +1 -2
- dhisana/utils/check_linkedin_url_validity.py +34 -8
- dhisana/utils/clay_tools.py +3 -2
- dhisana/utils/clean_properties.py +3 -1
- dhisana/utils/compose_salesnav_query.py +0 -1
- dhisana/utils/compose_search_query.py +7 -3
- dhisana/utils/composite_tools.py +0 -1
- dhisana/utils/dataframe_tools.py +2 -2
- dhisana/utils/email_body_utils.py +72 -0
- dhisana/utils/email_provider.py +375 -0
- dhisana/utils/enrich_lead_information.py +585 -85
- dhisana/utils/fetch_openai_config.py +129 -0
- dhisana/utils/field_validators.py +1 -1
- dhisana/utils/g2_tools.py +0 -1
- dhisana/utils/generate_content.py +0 -1
- dhisana/utils/generate_email.py +69 -16
- dhisana/utils/generate_email_response.py +298 -41
- dhisana/utils/generate_flow.py +0 -1
- dhisana/utils/generate_linkedin_connect_message.py +19 -6
- dhisana/utils/generate_linkedin_response_message.py +156 -65
- dhisana/utils/generate_structured_output_internal.py +351 -131
- dhisana/utils/google_custom_search.py +150 -44
- dhisana/utils/google_oauth_tools.py +721 -0
- dhisana/utils/google_workspace_tools.py +391 -25
- dhisana/utils/hubspot_clearbit.py +3 -1
- dhisana/utils/hubspot_crm_tools.py +771 -167
- dhisana/utils/instantly_tools.py +3 -1
- dhisana/utils/lusha_tools.py +10 -7
- dhisana/utils/mailgun_tools.py +150 -0
- dhisana/utils/microsoft365_tools.py +447 -0
- dhisana/utils/openai_assistant_and_file_utils.py +121 -177
- dhisana/utils/openai_helpers.py +19 -16
- dhisana/utils/parse_linkedin_messages_txt.py +2 -3
- dhisana/utils/profile.py +37 -0
- dhisana/utils/proxy_curl_tools.py +507 -206
- dhisana/utils/proxycurl_search_leads.py +426 -0
- dhisana/utils/research_lead.py +121 -68
- dhisana/utils/sales_navigator_crawler.py +1 -6
- dhisana/utils/salesforce_crm_tools.py +323 -50
- dhisana/utils/search_router.py +131 -0
- dhisana/utils/search_router_jobs.py +51 -0
- dhisana/utils/sendgrid_tools.py +126 -91
- dhisana/utils/serarch_router_local_business.py +75 -0
- dhisana/utils/serpapi_additional_tools.py +290 -0
- dhisana/utils/serpapi_google_jobs.py +117 -0
- dhisana/utils/serpapi_google_search.py +188 -0
- dhisana/utils/serpapi_local_business_search.py +129 -0
- dhisana/utils/serpapi_search_tools.py +363 -432
- dhisana/utils/serperdev_google_jobs.py +125 -0
- dhisana/utils/serperdev_local_business.py +154 -0
- dhisana/utils/serperdev_search.py +233 -0
- dhisana/utils/smtp_email_tools.py +576 -0
- dhisana/utils/test_connect.py +1765 -92
- dhisana/utils/trasform_json.py +95 -16
- dhisana/utils/web_download_parse_tools.py +0 -1
- dhisana/utils/zoominfo_tools.py +2 -3
- dhisana/workflow/test.py +1 -1
- {dhisana-0.0.1.dev85.dist-info → dhisana-0.0.1.dev236.dist-info}/METADATA +5 -2
- dhisana-0.0.1.dev236.dist-info/RECORD +100 -0
- {dhisana-0.0.1.dev85.dist-info → dhisana-0.0.1.dev236.dist-info}/WHEEL +1 -1
- dhisana-0.0.1.dev85.dist-info/RECORD +0 -81
- {dhisana-0.0.1.dev85.dist-info → dhisana-0.0.1.dev236.dist-info}/entry_points.txt +0 -0
- {dhisana-0.0.1.dev85.dist-info → dhisana-0.0.1.dev236.dist-info}/top_level.txt +0 -0
|
@@ -23,7 +23,7 @@ def get_builtwith_api_key(tool_config: Optional[List[Dict]] = None) -> str:
|
|
|
23
23
|
str: The BUILTWITH_API_KEY access token.
|
|
24
24
|
|
|
25
25
|
Raises:
|
|
26
|
-
ValueError: If the
|
|
26
|
+
ValueError: If the BuiltWith integration has not been configured.
|
|
27
27
|
"""
|
|
28
28
|
if tool_config:
|
|
29
29
|
builtwith_config = next(
|
|
@@ -43,7 +43,9 @@ def get_builtwith_api_key(tool_config: Optional[List[Dict]] = None) -> str:
|
|
|
43
43
|
|
|
44
44
|
BUILTWITH_API_KEY = BUILTWITH_API_KEY or os.getenv("BUILTWITH_API_KEY")
|
|
45
45
|
if not BUILTWITH_API_KEY:
|
|
46
|
-
raise ValueError(
|
|
46
|
+
raise ValueError(
|
|
47
|
+
"BuiltWith integration is not configured. Please configure the connection to BuiltWith in Integrations."
|
|
48
|
+
)
|
|
47
49
|
return BUILTWITH_API_KEY
|
|
48
50
|
|
|
49
51
|
# Use BuiltWith API to find tech stack and financials of a company
|
|
@@ -5,28 +5,31 @@ import logging
|
|
|
5
5
|
|
|
6
6
|
from azure.storage.blob import BlobServiceClient
|
|
7
7
|
from azure.core.exceptions import ResourceNotFoundError, AzureError
|
|
8
|
-
logger = logging.getLogger(__name__)
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if not AZURE_BLOB_CONNECTION_STRING:
|
|
13
|
-
raise ValueError("AZURE_BLOB_CONNECTION_STRING environment variable is not set")
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
logging.getLogger("azure").setLevel(logging.CRITICAL)
|
|
14
11
|
|
|
15
|
-
# Define the container name for caching outputs
|
|
16
12
|
CONTAINER_NAME = "cacheoutputs"
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
def _get_container_client():
|
|
15
|
+
"""
|
|
16
|
+
Returns the container client for the cache container.
|
|
17
|
+
Ensures that the container is created if it doesn't exist.
|
|
18
|
+
"""
|
|
19
|
+
connection_string = os.environ.get("AZURE_BLOB_CONNECTION_STRING")
|
|
20
|
+
if not connection_string:
|
|
21
|
+
raise ValueError("AZURE_BLOB_CONNECTION_STRING environment variable is not set")
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
try:
|
|
23
|
+
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
|
|
24
24
|
container_client = blob_service_client.get_container_client(CONTAINER_NAME)
|
|
25
|
-
container_client.create_container()
|
|
26
|
-
except AzureError as e:
|
|
27
|
-
# The container might already exist so we ignore the exception
|
|
28
|
-
pass
|
|
29
25
|
|
|
26
|
+
# Ensure the container exists; if already created, the AzureError is ignored.
|
|
27
|
+
try:
|
|
28
|
+
container_client.create_container()
|
|
29
|
+
except AzureError:
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
return container_client
|
|
30
33
|
|
|
31
34
|
def cache_output(tool_name: str, key: str, value, ttl: int = None) -> bool:
|
|
32
35
|
"""
|
|
@@ -43,9 +46,7 @@ def cache_output(tool_name: str, key: str, value, ttl: int = None) -> bool:
|
|
|
43
46
|
"""
|
|
44
47
|
# Create a hash of the key for a consistent blob name
|
|
45
48
|
key_hash = hashlib.sha256(key.encode()).hexdigest()
|
|
46
|
-
|
|
47
|
-
# Construct the blob name using a virtual folder for the tool name.
|
|
48
|
-
# For example: "my_tool/abcdef123456.json"
|
|
49
|
+
# Construct the blob name using a virtual folder for the tool name
|
|
49
50
|
blob_name = f"{tool_name}/{key_hash}.json"
|
|
50
51
|
|
|
51
52
|
# Prepare the cache data
|
|
@@ -56,8 +57,8 @@ def cache_output(tool_name: str, key: str, value, ttl: int = None) -> bool:
|
|
|
56
57
|
data = json.dumps(cache_data)
|
|
57
58
|
|
|
58
59
|
try:
|
|
59
|
-
|
|
60
|
-
blob_client =
|
|
60
|
+
container_client = _get_container_client()
|
|
61
|
+
blob_client = container_client.get_blob_client(blob=blob_name)
|
|
61
62
|
# Upload the blob content (overwrite if the blob already exists)
|
|
62
63
|
blob_client.upload_blob(data, overwrite=True)
|
|
63
64
|
return True
|
|
@@ -65,7 +66,6 @@ def cache_output(tool_name: str, key: str, value, ttl: int = None) -> bool:
|
|
|
65
66
|
logger.error(f"Error uploading blob '{blob_name}': {e}")
|
|
66
67
|
return False
|
|
67
68
|
|
|
68
|
-
|
|
69
69
|
def retrieve_output(tool_name: str, key: str):
|
|
70
70
|
"""
|
|
71
71
|
Retrieve the cached output for a given tool and cache key from Azure Blob Storage.
|
|
@@ -79,12 +79,12 @@ def retrieve_output(tool_name: str, key: str):
|
|
|
79
79
|
"""
|
|
80
80
|
# Create a hash of the key to locate the blob
|
|
81
81
|
key_hash = hashlib.sha256(key.encode()).hexdigest()
|
|
82
|
-
|
|
83
82
|
# Construct the blob name using the tool name folder
|
|
84
83
|
blob_name = f"{tool_name}/{key_hash}.json"
|
|
85
84
|
|
|
86
85
|
try:
|
|
87
|
-
|
|
86
|
+
container_client = _get_container_client()
|
|
87
|
+
blob_client = container_client.get_blob_client(blob=blob_name)
|
|
88
88
|
download_stream = blob_client.download_blob()
|
|
89
89
|
content = download_stream.readall() # content is in bytes
|
|
90
90
|
cache_data = json.loads(content.decode("utf-8"))
|