dhisana 0.0.1.dev240__py3-none-any.whl → 0.0.1.dev242__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 +1 -0
- dhisana/schemas/sales.py +1 -0
- dhisana/utils/generate_content.py +3 -1
- dhisana/utils/generate_custom_message.py +271 -0
- dhisana/utils/google_oauth_tools.py +6 -0
- dhisana/utils/google_workspace_tools.py +7 -0
- dhisana/utils/mailgun_tools.py +6 -0
- dhisana/utils/microsoft365_tools.py +8 -0
- dhisana/utils/sendgrid_tools.py +10 -0
- dhisana/utils/smtp_email_tools.py +6 -0
- {dhisana-0.0.1.dev240.dist-info → dhisana-0.0.1.dev242.dist-info}/METADATA +1 -1
- {dhisana-0.0.1.dev240.dist-info → dhisana-0.0.1.dev242.dist-info}/RECORD +15 -14
- {dhisana-0.0.1.dev240.dist-info → dhisana-0.0.1.dev242.dist-info}/WHEEL +0 -0
- {dhisana-0.0.1.dev240.dist-info → dhisana-0.0.1.dev242.dist-info}/entry_points.txt +0 -0
- {dhisana-0.0.1.dev240.dist-info → dhisana-0.0.1.dev242.dist-info}/top_level.txt +0 -0
dhisana/schemas/common.py
CHANGED
dhisana/schemas/sales.py
CHANGED
|
@@ -270,6 +270,7 @@ class ChannelType(str, Enum):
|
|
|
270
270
|
LINKEDIN_CONNECT_MESSAGE = "linkedin_connect_message"
|
|
271
271
|
REPLY_EMAIL = "reply_email"
|
|
272
272
|
LINKEDIN_USER_MESSAGE = "linkedin_user_message"
|
|
273
|
+
CUSTOM_MESSAGE = "custom_message"
|
|
273
274
|
|
|
274
275
|
class SenderInfo(BaseModel):
|
|
275
276
|
"""
|
|
@@ -5,6 +5,7 @@ from dhisana.utils.generate_linkedin_connect_message import generate_personalize
|
|
|
5
5
|
from dhisana.utils.assistant_tool_tag import assistant_tool
|
|
6
6
|
from dhisana.utils.generate_email import generate_personalized_email
|
|
7
7
|
from dhisana.utils.generate_linkedin_response_message import get_linkedin_response_message_variations
|
|
8
|
+
from dhisana.utils.generate_custom_message import generate_custom_message
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
@assistant_tool
|
|
@@ -36,4 +37,5 @@ async def generate_content(
|
|
|
36
37
|
elif generation_context.target_channel_type == ChannelType.LINKEDIN_USER_MESSAGE.value:
|
|
37
38
|
return await get_linkedin_response_message_variations(generation_context, number_of_variations, tool_config)
|
|
38
39
|
else:
|
|
39
|
-
|
|
40
|
+
# Default to CUSTOM_MESSAGE for any unrecognized channel type
|
|
41
|
+
return await generate_custom_message(generation_context, number_of_variations, tool_config)
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Import necessary modules
|
|
2
|
+
import html as html_lib
|
|
3
|
+
import re
|
|
4
|
+
from typing import Dict, List, Optional
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
from dhisana.schemas.sales import CampaignContext, ContentGenerationContext, ConversationContext, Lead, MessageGenerationInstructions, MessageItem, SenderInfo
|
|
8
|
+
from dhisana.utils.generate_structured_output_internal import (
|
|
9
|
+
get_structured_output_internal,
|
|
10
|
+
get_structured_output_with_assistant_and_vector_store
|
|
11
|
+
)
|
|
12
|
+
from datetime import datetime
|
|
13
|
+
from pydantic import BaseModel, ConfigDict
|
|
14
|
+
|
|
15
|
+
# -----------------------------------------------------------------------------
|
|
16
|
+
# Custom Message schema
|
|
17
|
+
# -----------------------------------------------------------------------------
|
|
18
|
+
class CustomMessageCopy(BaseModel):
|
|
19
|
+
subject: str
|
|
20
|
+
body: str
|
|
21
|
+
body_html: Optional[str] = None
|
|
22
|
+
|
|
23
|
+
model_config = ConfigDict(extra="forbid")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _html_to_plain_text(html_content: str) -> str:
|
|
27
|
+
"""Simple HTML to text conversion to backfill plain body."""
|
|
28
|
+
if not html_content:
|
|
29
|
+
return ""
|
|
30
|
+
# Remove tags and normalize whitespace
|
|
31
|
+
text = re.sub(r"<[^>]+>", " ", html_content)
|
|
32
|
+
text = html_lib.unescape(text)
|
|
33
|
+
# Collapse repeated whitespace/newlines
|
|
34
|
+
lines = [line.strip() for line in text.splitlines()]
|
|
35
|
+
return "\n".join([line for line in lines if line])
|
|
36
|
+
|
|
37
|
+
# -----------------------------------------------------------------------------
|
|
38
|
+
# Utility to Clean Up Context (if needed)
|
|
39
|
+
# -----------------------------------------------------------------------------
|
|
40
|
+
def cleanup_message_context(message_context: ContentGenerationContext) -> ContentGenerationContext:
|
|
41
|
+
"""
|
|
42
|
+
Return a copy of ContentGenerationContext without sensitive or irrelevant fields.
|
|
43
|
+
Modify or remove fields as necessary for your project.
|
|
44
|
+
"""
|
|
45
|
+
clone_context = message_context.copy(deep=True)
|
|
46
|
+
# For demonstration, no sensitive fields in new classes by default.
|
|
47
|
+
# Adjust if you want to remove certain fields (like 'sender_bio', etc.).
|
|
48
|
+
if clone_context.external_known_data:
|
|
49
|
+
clone_context.external_known_data.external_openai_vector_store_id = None
|
|
50
|
+
return clone_context
|
|
51
|
+
|
|
52
|
+
# -----------------------------------------------------------------------------
|
|
53
|
+
# Known Framework Variations (fallback if user instructions are not provided)
|
|
54
|
+
# -----------------------------------------------------------------------------
|
|
55
|
+
FRAMEWORK_VARIATIONS = [
|
|
56
|
+
"Write a summary of the input having key highlights.",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
# -----------------------------------------------------------------------------
|
|
60
|
+
# Core function to generate a custom message copy
|
|
61
|
+
# -----------------------------------------------------------------------------
|
|
62
|
+
async def generate_custom_message_copy(
|
|
63
|
+
message_context: ContentGenerationContext,
|
|
64
|
+
message_instructions: MessageGenerationInstructions,
|
|
65
|
+
variation_text: str,
|
|
66
|
+
tool_config: Optional[List[Dict]] = None,
|
|
67
|
+
) -> dict:
|
|
68
|
+
"""
|
|
69
|
+
Generate a personalized custom message using the provided context and instructions.
|
|
70
|
+
|
|
71
|
+
Steps:
|
|
72
|
+
1. Build a prompt referencing 6 main info:
|
|
73
|
+
(a) Lead Info
|
|
74
|
+
(b) Sender Info
|
|
75
|
+
(c) Campaign Info
|
|
76
|
+
(d) Messaging Instructions
|
|
77
|
+
(e) Additional Data (vector store) if any
|
|
78
|
+
(f) Current Conversation Context
|
|
79
|
+
2. Generate an initial draft with or without vector store usage.
|
|
80
|
+
3. Optionally refine if a vector store was used and user instructions were not provided.
|
|
81
|
+
4. Return the final subject & body.
|
|
82
|
+
"""
|
|
83
|
+
cleaned_context = cleanup_message_context(message_context)
|
|
84
|
+
|
|
85
|
+
# Check if user provided custom instructions
|
|
86
|
+
user_custom_instructions = (message_instructions.instructions_to_generate_message or "").strip()
|
|
87
|
+
use_custom_instructions = bool(user_custom_instructions)
|
|
88
|
+
|
|
89
|
+
# Decide final instructions: user-provided or fallback variation
|
|
90
|
+
if use_custom_instructions:
|
|
91
|
+
selected_instructions = user_custom_instructions
|
|
92
|
+
else:
|
|
93
|
+
selected_instructions = variation_text
|
|
94
|
+
|
|
95
|
+
# Pull out fields or fallback to empty if None
|
|
96
|
+
lead_data = cleaned_context.lead_info or Lead()
|
|
97
|
+
sender_data = cleaned_context.sender_info or SenderInfo()
|
|
98
|
+
campaign_data = cleaned_context.campaign_context or CampaignContext()
|
|
99
|
+
conversation_data = cleaned_context.current_conversation_context or ConversationContext()
|
|
100
|
+
|
|
101
|
+
html_note = (
|
|
102
|
+
f"\n Provide the HTML body using this guidance/template when possible:\n {message_instructions.html_template}"
|
|
103
|
+
if getattr(message_instructions, "html_template", None)
|
|
104
|
+
else ""
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
important_requirements = """
|
|
108
|
+
IMPORTANT REQUIREMENTS:
|
|
109
|
+
- Output must be JSON with "subject", "body", and "body_html" fields.
|
|
110
|
+
- "body_html" should be clean HTML suitable for the message (no external assets), inline styles welcome.
|
|
111
|
+
- "body" must be the plain-text equivalent of "body_html".
|
|
112
|
+
- Keep it concise and relevant. No placeholders or extra instructions.
|
|
113
|
+
- Do not include PII or internal references, guids or content identifiers in the message.
|
|
114
|
+
- Use conversational names for company/person placeholders when provided.
|
|
115
|
+
- Do Not Make up information. Use the information provided in the context and instructions only.
|
|
116
|
+
- Do Not use em dash in the generated output.
|
|
117
|
+
- Follow the user instructions carefully regarding format, tone, and structure.
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
if not getattr(message_instructions, "allow_html", False):
|
|
121
|
+
important_requirements = """
|
|
122
|
+
IMPORTANT REQUIREMENTS:
|
|
123
|
+
- Output must be JSON with "subject" and "body" fields only.
|
|
124
|
+
- In the subject or body DO NOT include any HTML tags like <a>, <b>, <i>, etc.
|
|
125
|
+
- The body and subject should be in plain text.
|
|
126
|
+
- If there is a link provided use it as is. Don't wrap it in any HTML tags.
|
|
127
|
+
- Keep it concise and relevant. No placeholders or extra instructions.
|
|
128
|
+
- Do not include PII or internal references, guids or content identifiers in the message.
|
|
129
|
+
- Use conversational name for company name if used.
|
|
130
|
+
- Do Not Make up information. Use the information provided in the context and instructions only.
|
|
131
|
+
- Make sure the body text is well-formatted and that newline and carriage-return characters are correctly present and preserved in the message body.
|
|
132
|
+
- Do Not use em dash in the generated output.
|
|
133
|
+
- Follow the user instructions carefully regarding format, tone, and structure.
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
# Construct the consolidated prompt
|
|
137
|
+
initial_prompt = f"""
|
|
138
|
+
Hi AI Assistant,
|
|
139
|
+
|
|
140
|
+
Below is the context in 6 main sections. Use it to craft a concise, professional message:
|
|
141
|
+
|
|
142
|
+
1) Lead Information:
|
|
143
|
+
{lead_data.dict()}
|
|
144
|
+
|
|
145
|
+
2) Sender Information:
|
|
146
|
+
Full Name: {sender_data.sender_full_name or ''}
|
|
147
|
+
First Name: {sender_data.sender_first_name or ''}
|
|
148
|
+
Last Name: {sender_data.sender_last_name or ''}
|
|
149
|
+
Bio: {sender_data.sender_bio or ''}
|
|
150
|
+
|
|
151
|
+
3) Campaign Information:
|
|
152
|
+
Product Name: {campaign_data.product_name or ''}
|
|
153
|
+
Value Proposition: {campaign_data.value_prop or ''}
|
|
154
|
+
Call To Action: {campaign_data.call_to_action or ''}
|
|
155
|
+
Pain Points: {campaign_data.pain_points or []}
|
|
156
|
+
Proof Points: {campaign_data.proof_points or []}
|
|
157
|
+
Triage Guidelines (Email): {campaign_data.email_triage_guidelines or ''}
|
|
158
|
+
Triage Guidelines (LinkedIn): {campaign_data.linkedin_triage_guidelines or ''}
|
|
159
|
+
|
|
160
|
+
4) Messaging Instructions (template/framework):
|
|
161
|
+
{selected_instructions}{html_note}
|
|
162
|
+
|
|
163
|
+
5) External Data / Vector Store:
|
|
164
|
+
(I will be provided with file_search tool if present.)
|
|
165
|
+
|
|
166
|
+
6) Current Conversation Context:
|
|
167
|
+
Email Thread: {conversation_data.current_email_thread or ''}
|
|
168
|
+
LinkedIn Thread: {conversation_data.current_linkedin_thread or ''}
|
|
169
|
+
|
|
170
|
+
{important_requirements}
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
# Check if a vector store is available
|
|
174
|
+
vector_store_id = (message_context.external_known_data.external_openai_vector_store_id
|
|
175
|
+
if message_context.external_known_data else None)
|
|
176
|
+
|
|
177
|
+
initial_response = None
|
|
178
|
+
initial_status = ""
|
|
179
|
+
|
|
180
|
+
# Generate initial draft
|
|
181
|
+
if vector_store_id:
|
|
182
|
+
initial_response, initial_status = await get_structured_output_with_assistant_and_vector_store(
|
|
183
|
+
prompt=initial_prompt,
|
|
184
|
+
response_format=CustomMessageCopy,
|
|
185
|
+
vector_store_id=vector_store_id,
|
|
186
|
+
model="gpt-5.1-chat",
|
|
187
|
+
tool_config=tool_config,
|
|
188
|
+
use_cache=message_context.message_instructions.use_cache if message_context.message_instructions else True
|
|
189
|
+
)
|
|
190
|
+
else:
|
|
191
|
+
# Otherwise, generate the initial draft internally
|
|
192
|
+
initial_response, initial_status = await get_structured_output_internal(
|
|
193
|
+
prompt=initial_prompt,
|
|
194
|
+
response_format=CustomMessageCopy,
|
|
195
|
+
model="gpt-5.1-chat",
|
|
196
|
+
tool_config=tool_config,
|
|
197
|
+
use_cache=message_context.message_instructions.use_cache if message_context.message_instructions else True
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
if initial_status != "SUCCESS":
|
|
201
|
+
raise Exception("Error: Could not generate initial draft for the custom message.")
|
|
202
|
+
|
|
203
|
+
plain_body = initial_response.body
|
|
204
|
+
html_body = getattr(initial_response, "body_html", None)
|
|
205
|
+
if not plain_body and html_body:
|
|
206
|
+
plain_body = _html_to_plain_text(html_body)
|
|
207
|
+
|
|
208
|
+
response_item = MessageItem(
|
|
209
|
+
message_id="", # or some real ID if you have it
|
|
210
|
+
thread_id="",
|
|
211
|
+
sender_name=message_context.sender_info.sender_full_name or "",
|
|
212
|
+
sender_email=message_context.sender_info.sender_email or "",
|
|
213
|
+
receiver_name=message_context.lead_info.full_name or "",
|
|
214
|
+
receiver_email=message_context.lead_info.email or "",
|
|
215
|
+
iso_datetime=datetime.utcnow().isoformat(),
|
|
216
|
+
subject="",
|
|
217
|
+
body=plain_body,
|
|
218
|
+
html_body=html_body if getattr(message_instructions, "allow_html", False) else None,
|
|
219
|
+
)
|
|
220
|
+
return response_item.model_dump()
|
|
221
|
+
|
|
222
|
+
# -----------------------------------------------------------------------------
|
|
223
|
+
# Primary function to generate multiple variations
|
|
224
|
+
# -----------------------------------------------------------------------------
|
|
225
|
+
async def generate_custom_message(
|
|
226
|
+
generation_context: ContentGenerationContext,
|
|
227
|
+
number_of_variations: int = 3,
|
|
228
|
+
tool_config: Optional[List[Dict]] = None
|
|
229
|
+
) -> List[dict]:
|
|
230
|
+
"""
|
|
231
|
+
Generates multiple custom message variations based on the given context and instructions.
|
|
232
|
+
|
|
233
|
+
Parameters:
|
|
234
|
+
- generation_context: The consolidated context for message generation.
|
|
235
|
+
- number_of_variations: How many message variations to produce.
|
|
236
|
+
- tool_config: Optional tool configuration for the LLM calls.
|
|
237
|
+
|
|
238
|
+
Returns:
|
|
239
|
+
A list of dictionaries, each containing:
|
|
240
|
+
{
|
|
241
|
+
"subject": "string",
|
|
242
|
+
"body": "string"
|
|
243
|
+
}
|
|
244
|
+
"""
|
|
245
|
+
message_variations = []
|
|
246
|
+
message_instructions = generation_context.message_instructions
|
|
247
|
+
user_instructions_exist = bool(
|
|
248
|
+
(message_instructions.instructions_to_generate_message or "").strip()
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
for i in range(number_of_variations):
|
|
252
|
+
try:
|
|
253
|
+
# If user provided instructions, use them for each variation
|
|
254
|
+
# (skip the internal frameworks).
|
|
255
|
+
if user_instructions_exist:
|
|
256
|
+
variation_text = message_instructions.instructions_to_generate_message or ""
|
|
257
|
+
else:
|
|
258
|
+
# Otherwise, pick from known frameworks (circular indexing)
|
|
259
|
+
variation_text = FRAMEWORK_VARIATIONS[i % len(FRAMEWORK_VARIATIONS)]
|
|
260
|
+
|
|
261
|
+
message_copy = await generate_custom_message_copy(
|
|
262
|
+
message_context=generation_context,
|
|
263
|
+
message_instructions=message_instructions,
|
|
264
|
+
variation_text=variation_text,
|
|
265
|
+
tool_config=tool_config
|
|
266
|
+
)
|
|
267
|
+
message_variations.append(message_copy)
|
|
268
|
+
|
|
269
|
+
except Exception as e:
|
|
270
|
+
raise e
|
|
271
|
+
return message_variations
|
|
@@ -145,6 +145,12 @@ async def send_email_using_google_oauth_async(
|
|
|
145
145
|
message["from"] = f"{send_email_context.sender_name} <{send_email_context.sender_email}>"
|
|
146
146
|
message["subject"] = send_email_context.subject
|
|
147
147
|
|
|
148
|
+
extra_headers = getattr(send_email_context, "headers", None) or {}
|
|
149
|
+
for header, value in extra_headers.items():
|
|
150
|
+
if not header or value is None:
|
|
151
|
+
continue
|
|
152
|
+
message[header] = str(value)
|
|
153
|
+
|
|
148
154
|
raw_message = base64.urlsafe_b64encode(message.as_bytes()).decode()
|
|
149
155
|
|
|
150
156
|
payload: Dict[str, Any] = {"raw": raw_message}
|
|
@@ -179,6 +179,12 @@ async def send_email_using_service_account_async(
|
|
|
179
179
|
message['from'] = f"{send_email_context.sender_name} <{send_email_context.sender_email}>"
|
|
180
180
|
message['subject'] = send_email_context.subject
|
|
181
181
|
|
|
182
|
+
extra_headers = getattr(send_email_context, "headers", None) or {}
|
|
183
|
+
for header, value in extra_headers.items():
|
|
184
|
+
if not header or value is None:
|
|
185
|
+
continue
|
|
186
|
+
message[header] = str(value)
|
|
187
|
+
|
|
182
188
|
# Base64-encode the message
|
|
183
189
|
raw_message = base64.urlsafe_b64encode(message.as_bytes()).decode()
|
|
184
190
|
|
|
@@ -531,6 +537,7 @@ class SendEmailContext(BaseModel):
|
|
|
531
537
|
sender_email: str
|
|
532
538
|
labels: Optional[List[str]]
|
|
533
539
|
body_format: BodyFormat = BodyFormat.AUTO
|
|
540
|
+
headers: Optional[Dict[str, str]] = None
|
|
534
541
|
|
|
535
542
|
@assistant_tool
|
|
536
543
|
async def send_email_using_service_account_async(
|
dhisana/utils/mailgun_tools.py
CHANGED
|
@@ -126,6 +126,12 @@ async def send_email_using_mailgun_async(
|
|
|
126
126
|
"html": html_body,
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
extra_headers = getattr(send_email_context, "headers", None) or {}
|
|
130
|
+
for header, value in extra_headers.items():
|
|
131
|
+
if not header or value is None:
|
|
132
|
+
continue
|
|
133
|
+
data[f"h:{header}"] = str(value)
|
|
134
|
+
|
|
129
135
|
async with aiohttp.ClientSession() as session:
|
|
130
136
|
async with session.post(
|
|
131
137
|
f"https://api.mailgun.net/v3/{domain}/messages",
|
|
@@ -168,6 +168,14 @@ async def send_email_using_microsoft_graph_async(
|
|
|
168
168
|
],
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
extra_headers = getattr(send_email_context, "headers", None) or {}
|
|
172
|
+
if extra_headers:
|
|
173
|
+
message_payload["internetMessageHeaders"] = [
|
|
174
|
+
{"name": header, "value": str(value)}
|
|
175
|
+
for header, value in extra_headers.items()
|
|
176
|
+
if header and value is not None
|
|
177
|
+
]
|
|
178
|
+
|
|
171
179
|
headers = {
|
|
172
180
|
"Authorization": f"Bearer {token}",
|
|
173
181
|
"Content-Type": "application/json",
|
dhisana/utils/sendgrid_tools.py
CHANGED
|
@@ -59,6 +59,7 @@ async def send_email_with_sendgrid(
|
|
|
59
59
|
message: str,
|
|
60
60
|
tool_config: Optional[List[Dict]] = None,
|
|
61
61
|
body_format: Optional[str] = None,
|
|
62
|
+
custom_headers: Optional[Dict[str, str]] = None,
|
|
62
63
|
):
|
|
63
64
|
"""
|
|
64
65
|
Send an email using SendGrid's v3 Mail Send API.
|
|
@@ -69,6 +70,7 @@ async def send_email_with_sendgrid(
|
|
|
69
70
|
- subject: Subject string.
|
|
70
71
|
- message: HTML body content.
|
|
71
72
|
- tool_config: Optional integration configuration list.
|
|
73
|
+
- custom_headers: Optional mapping of header names to values.
|
|
72
74
|
"""
|
|
73
75
|
api_key = get_sendgrid_api_key(tool_config)
|
|
74
76
|
|
|
@@ -98,6 +100,13 @@ async def send_email_with_sendgrid(
|
|
|
98
100
|
"content": content,
|
|
99
101
|
}
|
|
100
102
|
|
|
103
|
+
if custom_headers:
|
|
104
|
+
payload["headers"] = {
|
|
105
|
+
header: str(value)
|
|
106
|
+
for header, value in custom_headers.items()
|
|
107
|
+
if header and value is not None
|
|
108
|
+
}
|
|
109
|
+
|
|
101
110
|
headers = {
|
|
102
111
|
"Authorization": f"Bearer {api_key}",
|
|
103
112
|
"Content-Type": "application/json",
|
|
@@ -143,6 +152,7 @@ async def send_email_using_sendgrid_async(
|
|
|
143
152
|
message=ctx.body or "",
|
|
144
153
|
body_format=getattr(ctx, "body_format", None),
|
|
145
154
|
tool_config=tool_config,
|
|
155
|
+
custom_headers=getattr(ctx, "headers", None),
|
|
146
156
|
)
|
|
147
157
|
# Normalise output to a string id-like value
|
|
148
158
|
if isinstance(result, dict) and result.get("status") == 202:
|
|
@@ -174,6 +174,12 @@ async def send_email_via_smtp_async(
|
|
|
174
174
|
generated_id = f"<{uuid.uuid4()}@{domain_part}>"
|
|
175
175
|
msg["Message-ID"] = generated_id
|
|
176
176
|
|
|
177
|
+
extra_headers = getattr(ctx, "headers", None) or {}
|
|
178
|
+
for header, value in extra_headers.items():
|
|
179
|
+
if not header or value is None:
|
|
180
|
+
continue
|
|
181
|
+
msg[header] = str(value)
|
|
182
|
+
|
|
177
183
|
smtp_kwargs = dict(
|
|
178
184
|
hostname=smtp_server,
|
|
179
185
|
port=smtp_port,
|
|
@@ -5,8 +5,8 @@ dhisana/cli/datasets.py,sha256=OwzoCrVQqmh0pKpUAKAg_w9uGYncbWU7ZrAL_QukxAk,839
|
|
|
5
5
|
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
|
-
dhisana/schemas/common.py,sha256=
|
|
9
|
-
dhisana/schemas/sales.py,sha256=
|
|
8
|
+
dhisana/schemas/common.py,sha256=WZJDobtNRJaqY51UhRL2axhft8AHHiD1kw794IaR-W8,9377
|
|
9
|
+
dhisana/schemas/sales.py,sha256=ZmrLblwyXymtnbIMmKxwY5_8vCg5tu0yzzxGvHvywtg,34257
|
|
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
|
|
@@ -37,7 +37,8 @@ dhisana/utils/extract_email_content_for_llm.py,sha256=SQmMZ3YJtm3ZI44XiWEVAItcAw
|
|
|
37
37
|
dhisana/utils/fetch_openai_config.py,sha256=LjWdFuUeTNeAW106pb7DLXZNElos2PlmXRe6bHZJ2hw,5159
|
|
38
38
|
dhisana/utils/field_validators.py,sha256=BZgNCpBG264aRqNUu_J67c6zfr15zlAaIw2XRy8J7DY,11809
|
|
39
39
|
dhisana/utils/g2_tools.py,sha256=a4vmBYCBvLae5CdpOhMN1oNlvO8v9J1B5Sd8T5PzuU8,3346
|
|
40
|
-
dhisana/utils/generate_content.py,sha256=
|
|
40
|
+
dhisana/utils/generate_content.py,sha256=kkf-aPuA32BNgwk_j5N6unYHOZpO7zIfO6zP95XM9fA,2298
|
|
41
|
+
dhisana/utils/generate_custom_message.py,sha256=_m_8akk5eHyD6nNvzbhnFVmOp_v14rB-jDTVKk1PHOQ,11988
|
|
41
42
|
dhisana/utils/generate_email.py,sha256=YUhrku9meo3ee5Ft2ybtLTUTAfUf4quPmJp9hmSkdzM,12895
|
|
42
43
|
dhisana/utils/generate_email_response.py,sha256=3pggNoJKwZ0bAZ3aKaelw7Qip7AsySh16Qw_36Q0Mh4,21212
|
|
43
44
|
dhisana/utils/generate_flow.py,sha256=QMn6bWo0nH0fBvy2Ebub1XfH5udnVAqsPsbIqCtQPXU,4728
|
|
@@ -46,16 +47,16 @@ dhisana/utils/generate_linkedin_connect_message.py,sha256=WZThEun-DMuAOqlzMI--hG
|
|
|
46
47
|
dhisana/utils/generate_linkedin_response_message.py,sha256=-jg-u5Ipf4-cn9q0yjEHsEBe1eJhYLCLrjZDtOXnCyQ,14464
|
|
47
48
|
dhisana/utils/generate_structured_output_internal.py,sha256=DmZ5QzW-79Jo3JL5nDCZQ-Fjl8Nz7FHK6S0rZxXbKyg,20705
|
|
48
49
|
dhisana/utils/google_custom_search.py,sha256=5rQ4uAF-hjFpd9ooJkd6CjRvSmhZHhqM0jfHItsbpzk,10071
|
|
49
|
-
dhisana/utils/google_oauth_tools.py,sha256=
|
|
50
|
-
dhisana/utils/google_workspace_tools.py,sha256=
|
|
50
|
+
dhisana/utils/google_oauth_tools.py,sha256=ReG5lCpXL3_e_s0yn6ai4U7B4-feOWHJVtbv_c0g0rE,28525
|
|
51
|
+
dhisana/utils/google_workspace_tools.py,sha256=axHOrbSs5Yod0kREdu11T53GMjZn4pyuVjQCA51UntY,49132
|
|
51
52
|
dhisana/utils/hubspot_clearbit.py,sha256=keNX1F_RnDl9AOPxYEOTMdukV_A9g8v9j1fZyT4tuP4,3440
|
|
52
53
|
dhisana/utils/hubspot_crm_tools.py,sha256=lbXFCeq690_TDLjDG8Gm5E-2f1P5EuDqNf5j8PYpMm8,99298
|
|
53
54
|
dhisana/utils/instantly_tools.py,sha256=hhqjDPyLE6o0dzzuvryszbK3ipnoGU2eBm6NlsUGJjY,4771
|
|
54
55
|
dhisana/utils/linkedin_crawler.py,sha256=6fMQTY5lTw2kc65SFHgOAM6YfezAS0Yhg-jkiX8LGHo,6533
|
|
55
56
|
dhisana/utils/lusha_tools.py,sha256=MdiWlxBBjSNpSKz8rhNOyLPtbeh-YWHgGiUq54vN_gM,12734
|
|
56
|
-
dhisana/utils/mailgun_tools.py,sha256=
|
|
57
|
+
dhisana/utils/mailgun_tools.py,sha256=OTesN8spYrvoH4Q5BheC8TPUvUlfbZhliYOhzCrD7Mg,5506
|
|
57
58
|
dhisana/utils/mailreach_tools.py,sha256=uJ_gIcg8qrj5-k3jnYYhpwLVnQncoA1swzr5Jfkc1JU,3864
|
|
58
|
-
dhisana/utils/microsoft365_tools.py,sha256=
|
|
59
|
+
dhisana/utils/microsoft365_tools.py,sha256=ClqBzTrJ2SZM5K9nsOFyyHRfV-d-6jlxXNpNONtgLlY,18596
|
|
59
60
|
dhisana/utils/openai_assistant_and_file_utils.py,sha256=-eyPcxFvtS-DDtYQGle1SU6C6CuxjulVIojFy27HeWc,8957
|
|
60
61
|
dhisana/utils/openai_helpers.py,sha256=ZK9S5-jcLCpiiD6XBLkCqYcNz-AGYmO9xh4e2H-FDLo,40155
|
|
61
62
|
dhisana/utils/openapi_spec_to_tools.py,sha256=oBLVq3WeDWvW9O02NCvY8bxQURQdKwHJHGcX8bC_b2I,1926
|
|
@@ -69,7 +70,7 @@ dhisana/utils/sales_navigator_crawler.py,sha256=z8yurwUTLXdM71xWPDSAFNuDyA_SlanT
|
|
|
69
70
|
dhisana/utils/salesforce_crm_tools.py,sha256=r6tROej4PtfcRN2AViPD7tV24oxBNm6QCE7uwhDH5Hc,17169
|
|
70
71
|
dhisana/utils/search_router.py,sha256=p_1MPHbjalBM8gZuU4LADbmqSLNtZ4zll6CbPOc0POU,4610
|
|
71
72
|
dhisana/utils/search_router_jobs.py,sha256=LgCHNGLMSv-ovgzF32muprfaDTdTpIKgrP5F7swAqhk,1721
|
|
72
|
-
dhisana/utils/sendgrid_tools.py,sha256=
|
|
73
|
+
dhisana/utils/sendgrid_tools.py,sha256=VyiLbQfa0xYY-onWqhHRcNKL7z-Wev-t4lim1d-vDVw,5526
|
|
73
74
|
dhisana/utils/serarch_router_local_business.py,sha256=n9yZjeXKOSgBnr0lCSQomP1nN3ucbC9ZTTSmSHQLeVo,2920
|
|
74
75
|
dhisana/utils/serpapi_additional_tools.py,sha256=Xb1tc_oK-IjI9ZrEruYhFg8UJMLHQDaO9B51YiNbeBs,10569
|
|
75
76
|
dhisana/utils/serpapi_google_jobs.py,sha256=HUJFZEW8UvYqsW0sWlEDXgI_IUomh5fTkzRJzEgsDGc,4509
|
|
@@ -79,7 +80,7 @@ dhisana/utils/serpapi_search_tools.py,sha256=xiiYi6Rd6Mqn94mjSKEs5nNZk1l2-PW_hTL
|
|
|
79
80
|
dhisana/utils/serperdev_google_jobs.py,sha256=m5_2f_5y79FOFZz1A_go6m0hIUfbbAoZ0YTjUMO2BSI,4508
|
|
80
81
|
dhisana/utils/serperdev_local_business.py,sha256=JoZfTg58Hojv61cyuwA2lcnPdLT1lawnWaBNrUYWnuQ,6447
|
|
81
82
|
dhisana/utils/serperdev_search.py,sha256=_iBKIfHMq4gFv5StYz58eArriygoi1zW6VnLlux8vto,9363
|
|
82
|
-
dhisana/utils/smtp_email_tools.py,sha256=
|
|
83
|
+
dhisana/utils/smtp_email_tools.py,sha256=J9uDHCEu2BTyFzDBru0e1lC8bsAMt9c_mYXTzJgk9Kc,22054
|
|
83
84
|
dhisana/utils/test_connect.py,sha256=pYR1Ki6WKx-vAhLJxQ6At627xfOnlQeVRjnW7FBdGKM,86702
|
|
84
85
|
dhisana/utils/trasform_json.py,sha256=7V72XNDpuxUX0GHN5D83z4anj_gIf5zabaHeQm7b1_E,6979
|
|
85
86
|
dhisana/utils/web_download_parse_tools.py,sha256=ouXwH7CmjcRjoBfP5BWat86MvcGO-8rLCmWQe_eZKjc,7810
|
|
@@ -94,8 +95,8 @@ dhisana/workflow/agent.py,sha256=esv7_i_XuMkV2j1nz_UlsHov_m6X5WZZiZm_tG4OBHU,565
|
|
|
94
95
|
dhisana/workflow/flow.py,sha256=xWE3qQbM7j2B3FH8XnY3zOL_QXX4LbTW4ArndnEYJE0,1638
|
|
95
96
|
dhisana/workflow/task.py,sha256=HlWz9mtrwLYByoSnePOemBUBrMEcj7KbgNjEE1oF5wo,1830
|
|
96
97
|
dhisana/workflow/test.py,sha256=E7lRnXK0PguTNzyasHytLzTJdkqIPxG5_4qk4hMEeKc,3399
|
|
97
|
-
dhisana-0.0.1.
|
|
98
|
-
dhisana-0.0.1.
|
|
99
|
-
dhisana-0.0.1.
|
|
100
|
-
dhisana-0.0.1.
|
|
101
|
-
dhisana-0.0.1.
|
|
98
|
+
dhisana-0.0.1.dev242.dist-info/METADATA,sha256=_1Ygo4n90g6vRR9Dd5BObCwTL7tQ4S-0idHeHdMv4Fk,1190
|
|
99
|
+
dhisana-0.0.1.dev242.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
100
|
+
dhisana-0.0.1.dev242.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
|
|
101
|
+
dhisana-0.0.1.dev242.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
|
|
102
|
+
dhisana-0.0.1.dev242.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|