dhisana 0.0.1.dev271__py3-none-any.whl → 0.0.1.dev272__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.
@@ -826,23 +826,41 @@ def fill_in_missing_properties(input_user_properties: dict, person_data: dict) -
826
826
  # Experiences
827
827
  experiences = person_data.get("experiences", [])
828
828
  if experiences:
829
- # Current role data
830
-
831
- input_user_properties["organization_name"] = experiences[0].get("company", "")
829
+ # Helper to convert starts_at dict to a comparable tuple (year, month, day)
830
+ def get_start_date_tuple(exp):
831
+ starts_at = exp.get("starts_at")
832
+ if not starts_at:
833
+ return (0, 0, 0)
834
+ return (
835
+ starts_at.get("year", 0) or 0,
836
+ starts_at.get("month", 0) or 0,
837
+ starts_at.get("day", 0) or 0
838
+ )
839
+
840
+ # Find current role: no ends_at and latest starts_at
841
+ current_experiences = [exp for exp in experiences if not exp.get("ends_at")]
842
+ if current_experiences:
843
+ # Pick the one with the latest starts_at
844
+ current_role = max(current_experiences, key=get_start_date_tuple)
845
+ else:
846
+ # Fallback: pick the experience with the latest starts_at overall
847
+ current_role = max(experiences, key=get_start_date_tuple)
848
+
849
+ input_user_properties["organization_name"] = current_role.get("company", "")
832
850
 
833
- org_url = experiences[0].get("company_linkedin_profile_url", "")
834
- if org_url and is_empty(input_user_properties.get("organization_linkedin_url")):
851
+ org_url = current_role.get("company_linkedin_profile_url", "")
852
+ if org_url:
835
853
  input_user_properties["organization_linkedin_url"] = org_url
836
854
 
837
- # If there's a second experience, track it as previous
838
- if len(experiences) > 1:
839
- previous_org = experiences[1]
855
+ # Find previous role: the most recent experience that is NOT the current role
856
+ other_experiences = [exp for exp in experiences if exp is not current_role]
857
+ if other_experiences:
858
+ # Sort by starts_at descending and pick the most recent
859
+ previous_org = max(other_experiences, key=get_start_date_tuple)
840
860
  prev_org_url = previous_org.get("company_linkedin_profile_url", "")
841
861
 
842
- if prev_org_url and is_empty(input_user_properties.get("previous_organization_linkedin_url")):
862
+ if prev_org_url:
843
863
  input_user_properties["previous_organization_linkedin_url"] = prev_org_url
844
-
845
- if is_empty(input_user_properties.get("previous_organization_name")):
846
864
  input_user_properties["previous_organization_name"] = previous_org.get("company", "")
847
865
 
848
866
  # Combine city/state if available (and if lead_location is empty); avoid literal "None"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dhisana
3
- Version: 0.0.1.dev271
3
+ Version: 0.0.1.dev272
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
@@ -62,7 +62,7 @@ dhisana/utils/openai_helpers.py,sha256=ZK9S5-jcLCpiiD6XBLkCqYcNz-AGYmO9xh4e2H-FD
62
62
  dhisana/utils/openapi_spec_to_tools.py,sha256=oBLVq3WeDWvW9O02NCvY8bxQURQdKwHJHGcX8bC_b2I,1926
63
63
  dhisana/utils/parse_linkedin_messages_txt.py,sha256=g3N_ac70mAEuDDQ7Ott6mkOaBwI3ZvcsJD3R9RlYwPQ,3320
64
64
  dhisana/utils/profile.py,sha256=12IhefaLp3j74zzBzVRe50_KWqtWZ_cdzUKlYNy9T2Y,1192
65
- dhisana/utils/proxy_curl_tools.py,sha256=3i7Qpk0POME5OU5-lHQ6BlnOi88tIZl-Z0oMrphnCFQ,52975
65
+ dhisana/utils/proxy_curl_tools.py,sha256=MVPYuabKozmTiq75do84gonSad_C2KdOBy1lUIEjUe0,53789
66
66
  dhisana/utils/proxycurl_search_leads.py,sha256=6PlraPNYQ4fIDzTYnY-T2g_ip5fPkqHigbGoPD8ZosQ,16131
67
67
  dhisana/utils/python_function_to_tools.py,sha256=jypddM6WTlIQmRWnqAugYJXvaPYaXaMgWAZRYeeGlj4,2682
68
68
  dhisana/utils/research_lead.py,sha256=Qm9nTiqNzQpDeGFaFY_EVuHVpZnh-vkaIviGjWsWGPE,7005
@@ -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.dev271.dist-info/METADATA,sha256=t746AJjraGpmdydXXdzST-85-XvYPv2WueN1RfXINm8,1190
99
- dhisana-0.0.1.dev271.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
- dhisana-0.0.1.dev271.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
101
- dhisana-0.0.1.dev271.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
102
- dhisana-0.0.1.dev271.dist-info/RECORD,,
98
+ dhisana-0.0.1.dev272.dist-info/METADATA,sha256=gcVzqziXrrxkS44GPUwFkkf1igjYwMWE3PmWwxo_mT0,1190
99
+ dhisana-0.0.1.dev272.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
+ dhisana-0.0.1.dev272.dist-info/entry_points.txt,sha256=jujxteZmNI9EkEaK-pOCoWuBujU8TCevdkfl9ZcKHek,49
101
+ dhisana-0.0.1.dev272.dist-info/top_level.txt,sha256=NETTHt6YifG_P7XtRHbQiXZlgSFk9Qh9aR-ng1XTf4s,8
102
+ dhisana-0.0.1.dev272.dist-info/RECORD,,