dhisana 0.0.1.dev29__tar.gz → 0.0.1.dev30__tar.gz
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-0.0.1.dev29 → dhisana-0.0.1.dev30}/PKG-INFO +2 -1
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/setup.py +3 -2
- dhisana-0.0.1.dev30/src/dhisana/utils/cache_output_tools.py +95 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana.egg-info/PKG-INFO +2 -1
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana.egg-info/SOURCES.txt +1 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana.egg-info/requires.txt +1 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/README.md +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/pyproject.toml +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/setup.cfg +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/__init__.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/cli/__init__.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/cli/cli.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/cli/datasets.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/cli/models.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/cli/predictions.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/schemas/__init__.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/schemas/common.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/schemas/sales.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/ui/__init__.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/ui/components.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/__init__.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/agent_task.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/agent_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/apollo_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/assistant_tool_tag.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/built_with_api_tools.py +0 -0
- /dhisana-0.0.1.dev29/src/dhisana/utils/cache_output_tools.py → /dhisana-0.0.1.dev30/src/dhisana/utils/cache_output_tools_local.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/check_email_validity_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/check_for_intent_signal.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/check_linkedin_url_validity.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/clay_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/company_utils.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/compose_cadence.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/compose_salesnav_query.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/compose_search_query.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/compose_three_step_workflow.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/compose_workflow.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/composite_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/create_list_from_sales_navigator.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/create_smart_list.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/dataframe_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/domain_parser.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/enrich_lead_information.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/extract_email_content_for_llm.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/g2_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_content.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_email.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_email_response.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_flow.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_linkedin_connect_message.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_linkedin_response_message.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_structured_output_internal.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/google_custom_search.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/google_workspace_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/hubspot_clearbit.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/hubspot_crm_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/instantly_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/linkedin_crawler.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/lusha_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/openai_assistant_and_file_utils.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/openai_helpers.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/openapi_spec_to_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/openapi_tool/__init__.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/openapi_tool/api_models.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/openapi_tool/convert_openai_spec_to_tool.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/openapi_tool/openapi_tool.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/proxy_curl_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/python_function_to_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/research_lead.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/sales_navigator_crawler.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/salesforce_crm_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/sendgrid_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/serpapi_search_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/trasform_json.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/web_download_parse_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/workflow_code_model.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/zoominfo_tools.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/workflow/__init__.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/workflow/agent.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/workflow/flow.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/workflow/task.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/workflow/test.py +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana.egg-info/dependency_links.txt +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana.egg-info/entry_points.txt +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana.egg-info/top_level.txt +0 -0
- {dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/tests/test_agent_tools.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: dhisana
|
|
3
|
-
Version: 0.0.1.
|
|
3
|
+
Version: 0.0.1.dev30
|
|
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
|
|
@@ -29,6 +29,7 @@ Requires-Dist: html2text
|
|
|
29
29
|
Requires-Dist: hubspot-api-client
|
|
30
30
|
Requires-Dist: tldextract
|
|
31
31
|
Requires-Dist: pyperclip
|
|
32
|
+
Requires-Dist: azure-storage-blob
|
|
32
33
|
Dynamic: author
|
|
33
34
|
Dynamic: author-email
|
|
34
35
|
Dynamic: classifier
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='dhisana',
|
|
5
|
-
version='0.0.1-
|
|
5
|
+
version='0.0.1-dev30',
|
|
6
6
|
description='A Python SDK for Dhisana AI Platform',
|
|
7
7
|
author='Admin',
|
|
8
8
|
author_email='contact@dhisana.ai',
|
|
@@ -28,7 +28,8 @@ setup(
|
|
|
28
28
|
'html2text',
|
|
29
29
|
'hubspot-api-client',
|
|
30
30
|
'tldextract',
|
|
31
|
-
'pyperclip'
|
|
31
|
+
'pyperclip',
|
|
32
|
+
'azure-storage-blob'
|
|
32
33
|
],
|
|
33
34
|
entry_points={
|
|
34
35
|
'console_scripts': [
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import hashlib
|
|
3
|
+
import json
|
|
4
|
+
import logging
|
|
5
|
+
|
|
6
|
+
from azure.storage.blob import BlobServiceClient
|
|
7
|
+
from azure.core.exceptions import ResourceNotFoundError, AzureError
|
|
8
|
+
|
|
9
|
+
# Retrieve the connection string from the environment variable
|
|
10
|
+
AZURE_BLOB_CONNECTION_STRING = os.environ.get("AZURE_BLOB_CONNECTION_STRING")
|
|
11
|
+
if not AZURE_BLOB_CONNECTION_STRING:
|
|
12
|
+
raise ValueError("AZURE_BLOB_CONNECTION_STRING environment variable is not set")
|
|
13
|
+
|
|
14
|
+
# Define the container name for caching outputs
|
|
15
|
+
CONTAINER_NAME = "cacheoutputs"
|
|
16
|
+
|
|
17
|
+
# Initialize the BlobServiceClient
|
|
18
|
+
blob_service_client = BlobServiceClient.from_connection_string(AZURE_BLOB_CONNECTION_STRING)
|
|
19
|
+
|
|
20
|
+
# Ensure the container exists (if it already exists, an error is caught and ignored)
|
|
21
|
+
try:
|
|
22
|
+
container_client = blob_service_client.get_container_client(CONTAINER_NAME)
|
|
23
|
+
container_client.create_container()
|
|
24
|
+
except AzureError as e:
|
|
25
|
+
# The container might already exist so we ignore the exception
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def cache_output(tool_name: str, key: str, value, ttl: int = None) -> bool:
|
|
30
|
+
"""
|
|
31
|
+
Cache the output of a function using Azure Blob Storage.
|
|
32
|
+
|
|
33
|
+
Parameters:
|
|
34
|
+
tool_name (str): Name of the tool whose output is being cached.
|
|
35
|
+
key (str): The cache key.
|
|
36
|
+
value (Any): The value to be cached.
|
|
37
|
+
ttl (int, optional): The time-to-live (TTL) for the cached value in seconds.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
bool: True if the value was successfully cached, False otherwise.
|
|
41
|
+
"""
|
|
42
|
+
# Create a hash of the key for a consistent blob name
|
|
43
|
+
key_hash = hashlib.sha256(key.encode()).hexdigest()
|
|
44
|
+
|
|
45
|
+
# Construct the blob name using a virtual folder for the tool name.
|
|
46
|
+
# For example: "my_tool/abcdef123456.json"
|
|
47
|
+
blob_name = f"{tool_name}/{key_hash}.json"
|
|
48
|
+
|
|
49
|
+
# Prepare the cache data
|
|
50
|
+
cache_data = {
|
|
51
|
+
"value": value,
|
|
52
|
+
"ttl": ttl
|
|
53
|
+
}
|
|
54
|
+
data = json.dumps(cache_data)
|
|
55
|
+
|
|
56
|
+
try:
|
|
57
|
+
# Get a blob client for the specific blob
|
|
58
|
+
blob_client = blob_service_client.get_blob_client(container=CONTAINER_NAME, blob=blob_name)
|
|
59
|
+
# Upload the blob content (overwrite if the blob already exists)
|
|
60
|
+
blob_client.upload_blob(data, overwrite=True)
|
|
61
|
+
return True
|
|
62
|
+
except Exception as e:
|
|
63
|
+
logging.error(f"Error uploading blob '{blob_name}': {e}")
|
|
64
|
+
return False
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def retrieve_output(tool_name: str, key: str):
|
|
68
|
+
"""
|
|
69
|
+
Retrieve the cached output for a given tool and cache key from Azure Blob Storage.
|
|
70
|
+
|
|
71
|
+
Parameters:
|
|
72
|
+
tool_name (str): Name of the tool whose output is being retrieved.
|
|
73
|
+
key (str): The cache key.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
Any: The cached value if found, None otherwise.
|
|
77
|
+
"""
|
|
78
|
+
# Create a hash of the key to locate the blob
|
|
79
|
+
key_hash = hashlib.sha256(key.encode()).hexdigest()
|
|
80
|
+
|
|
81
|
+
# Construct the blob name using the tool name folder
|
|
82
|
+
blob_name = f"{tool_name}/{key_hash}.json"
|
|
83
|
+
|
|
84
|
+
try:
|
|
85
|
+
blob_client = blob_service_client.get_blob_client(container=CONTAINER_NAME, blob=blob_name)
|
|
86
|
+
download_stream = blob_client.download_blob()
|
|
87
|
+
content = download_stream.readall() # content is in bytes
|
|
88
|
+
cache_data = json.loads(content.decode("utf-8"))
|
|
89
|
+
return cache_data.get("value")
|
|
90
|
+
except ResourceNotFoundError:
|
|
91
|
+
# Blob does not exist
|
|
92
|
+
return None
|
|
93
|
+
except Exception as e:
|
|
94
|
+
logging.error(f"Error retrieving blob '{blob_name}': {e}")
|
|
95
|
+
return None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: dhisana
|
|
3
|
-
Version: 0.0.1.
|
|
3
|
+
Version: 0.0.1.dev30
|
|
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
|
|
@@ -29,6 +29,7 @@ Requires-Dist: html2text
|
|
|
29
29
|
Requires-Dist: hubspot-api-client
|
|
30
30
|
Requires-Dist: tldextract
|
|
31
31
|
Requires-Dist: pyperclip
|
|
32
|
+
Requires-Dist: azure-storage-blob
|
|
32
33
|
Dynamic: author
|
|
33
34
|
Dynamic: author-email
|
|
34
35
|
Dynamic: classifier
|
|
@@ -25,6 +25,7 @@ src/dhisana/utils/apollo_tools.py
|
|
|
25
25
|
src/dhisana/utils/assistant_tool_tag.py
|
|
26
26
|
src/dhisana/utils/built_with_api_tools.py
|
|
27
27
|
src/dhisana/utils/cache_output_tools.py
|
|
28
|
+
src/dhisana/utils/cache_output_tools_local.py
|
|
28
29
|
src/dhisana/utils/check_email_validity_tools.py
|
|
29
30
|
src/dhisana/utils/check_for_intent_signal.py
|
|
30
31
|
src/dhisana/utils/check_linkedin_url_validity.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/check_linkedin_url_validity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/compose_three_step_workflow.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/create_list_from_sales_navigator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/extract_email_content_for_llm.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_linkedin_connect_message.py
RENAMED
|
File without changes
|
{dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_linkedin_response_message.py
RENAMED
|
File without changes
|
{dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/generate_structured_output_internal.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dhisana-0.0.1.dev29 → dhisana-0.0.1.dev30}/src/dhisana/utils/openai_assistant_and_file_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|