dhisana 0.0.1.dev275__py3-none-any.whl → 0.0.1.dev277__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.
@@ -22,7 +22,7 @@ from dhisana.utils.field_validators import (
22
22
  validation_organization_domain,
23
23
  validate_website_url
24
24
  )
25
- from dhisana.utils.apollo_tools import enrich_user_info_with_apollo
25
+ from dhisana.utils.apollo_tools import enrich_user_info_with_apollo, enrich_person_info_from_apollo
26
26
  from dhisana.utils.assistant_tool_tag import assistant_tool
27
27
  from dhisana.utils.domain_parser import get_domain_from_website, is_excluded_domain
28
28
  from dhisana.utils.generate_structured_output_internal import get_structured_output_internal
@@ -520,6 +520,36 @@ async def enrich_user_info(
520
520
 
521
521
  # 1) If we do not have a user_linkedin_url, try getting it from GitHub
522
522
  if not user_linkedin_url:
523
+ email = (input_properties.get("email") or "").strip()
524
+
525
+ # 1a) If email is present, first try Apollo lookup by email for more robust matching
526
+ if email:
527
+ logger.debug("Attempting Apollo lookup by email: %s", email)
528
+ apollo_result = await enrich_person_info_from_apollo(
529
+ email=email,
530
+ tool_config=tool_config,
531
+ )
532
+ if apollo_result and not apollo_result.get("error"):
533
+ person_data = apollo_result.get("person", {})
534
+ if person_data:
535
+ apollo_linkedin_url = person_data.get("linkedin_url", "")
536
+ if apollo_linkedin_url:
537
+ user_linkedin_url = apollo_linkedin_url
538
+ input_properties["user_linkedin_url"] = user_linkedin_url
539
+ input_properties["linkedin_url_match"] = True
540
+ logger.debug("Found LinkedIn URL via Apollo email lookup: %s", user_linkedin_url)
541
+ # Also populate other fields from Apollo if not already present
542
+ if not input_properties.get("first_name"):
543
+ input_properties["first_name"] = person_data.get("first_name", "")
544
+ if not input_properties.get("last_name"):
545
+ input_properties["last_name"] = person_data.get("last_name", "")
546
+ if not input_properties.get("job_title"):
547
+ input_properties["job_title"] = person_data.get("title", "")
548
+ if not input_properties.get("lead_location"):
549
+ input_properties["lead_location"] = person_data.get("city", "")
550
+ return input_properties
551
+
552
+ # 1b) If still no LinkedIn URL, try getting it from GitHub
523
553
  if github_profile_id:
524
554
  response = await get_user_linkedin_url_from_github_profile(
525
555
  github_profile_id=github_profile_id,
@@ -551,7 +581,6 @@ async def enrich_user_info(
551
581
  location = input_properties.get("lead_location", "") or ""
552
582
  org_name = (input_properties.get("organization_name", "") or "").strip()
553
583
  org_domain = (input_properties.get("primary_domain_of_organization", "") or "").strip()
554
- email = (input_properties.get("email") or "").strip()
555
584
 
556
585
  if full_name and (org_name or org_domain or title):
557
586
  # This function does a google-based search for the user's LinkedIn
@@ -568,7 +597,7 @@ async def enrich_user_info(
568
597
  user_linkedin_url = found_linkedin_url
569
598
  input_properties["user_linkedin_url"] = user_linkedin_url
570
599
  if not user_linkedin_url and email:
571
- # If we have an email but no name, try searching by email
600
+ # If we have an email but no LinkedIn URL yet, try searching by email via Google
572
601
  email_lookup_result = await find_user_linkedin_url_by_email_google(
573
602
  email=email,
574
603
  user_name=full_name,
@@ -231,6 +231,10 @@ async def generate_email_from_instructions(
231
231
  - If there is a link provided, use it as is without wrapping in any HTML tags.
232
232
  """
233
233
 
234
+ html_template_note = ""
235
+ if allow_html and getattr(message_instructions, "html_template", None):
236
+ html_template_note = f"\nHTML Template to follow: {message_instructions.html_template}"
237
+
234
238
  email_prompt = f"""
235
239
  Generate a personalized business email based on these specifications:
236
240
 
@@ -258,6 +262,8 @@ CALL TO ACTION:
258
262
  FORMATTING REQUIREMENTS:
259
263
  {instructions.formatting_requirements}
260
264
 
265
+ {html_template_note}
266
+
261
267
  {output_requirements}
262
268
 
263
269
  ADDITIONAL REQUIREMENTS:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dhisana
3
- Version: 0.0.1.dev275
3
+ Version: 0.0.1.dev277
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
@@ -32,14 +32,14 @@ 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=rl72ggS-yoB-w3ZHW2sevKJulQ-_8iLdpVTH6QnKPcs,6789
34
34
  dhisana/utils/email_provider.py,sha256=ukW_0nHcjTQmpnE9pdJci78LrZcsK1_0v6kcgc2ChPY,14573
35
- dhisana/utils/enrich_lead_information.py,sha256=O0fV-8MlXFT_z5aXvmvXVT76AISN94GpvAOlq3q_Phw,39411
35
+ dhisana/utils/enrich_lead_information.py,sha256=OBzUXdfaquRvjB9Z_bFq542tXJVwWnprGYB7QSjfjHQ,41246
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
39
39
  dhisana/utils/g2_tools.py,sha256=a4vmBYCBvLae5CdpOhMN1oNlvO8v9J1B5Sd8T5PzuU8,3346
40
40
  dhisana/utils/generate_content.py,sha256=kkf-aPuA32BNgwk_j5N6unYHOZpO7zIfO6zP95XM9fA,2298
41
41
  dhisana/utils/generate_custom_message.py,sha256=tQsryytoYKP5uF3bRENeZks1LvOMFCP6L1487P_r_hk,12072
42
- dhisana/utils/generate_email.py,sha256=cEIr9HbGduk-l_0dNY2lCBABFBmmcOHaMyI7oy8ChWQ,16470
42
+ dhisana/utils/generate_email.py,sha256=46vQKq_7DnuOBMhVLqgWegmpmhotjpzJx1fQcMelRDU,16693
43
43
  dhisana/utils/generate_email_response.py,sha256=LPsi2Orhb0W9SG8HDN2aA0w2pgW_c_HTDFAlw9R1cns,21391
44
44
  dhisana/utils/generate_flow.py,sha256=QMn6bWo0nH0fBvy2Ebub1XfH5udnVAqsPsbIqCtQPXU,4728
45
45
  dhisana/utils/generate_leads_salesnav.py,sha256=FG7q6GSm9IywZ9TgQnn5_N3QNfiI-Qk2gaO_3GS99nY,12236
@@ -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.dev275.dist-info/METADATA,sha256=jyDGbVBp2uLFmcP2q44nlsI-AWZclGbuQQLi1ktuhmQ,1190
99
- dhisana-0.0.1.dev275.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
100
- dhisana-0.0.1.dev275.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
101
- dhisana-0.0.1.dev275.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
102
- dhisana-0.0.1.dev275.dist-info/RECORD,,
98
+ dhisana-0.0.1.dev277.dist-info/METADATA,sha256=aXZ6EqTc5mZCHkS4fJiDuleY4FStxUNOC1AbYQ2sUnE,1190
99
+ dhisana-0.0.1.dev277.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
100
+ dhisana-0.0.1.dev277.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
101
+ dhisana-0.0.1.dev277.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
102
+ dhisana-0.0.1.dev277.dist-info/RECORD,,