CoolFace
Apppublic

Akshayram1/Linked_in_profile_enhancer_streamlit

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
orchestrator.cpython-311.pyc32 linesDownload Raw Back to __pycache__
1�

2��[h"��X�ddlZddlmZddlmZddlmZddlmZGd�d��Z	dS)	�N�)�ScraperAgent)�
AnalyzerAgent)�ContentAgent)�
MemoryManagerc�&�eZdZdZd�Zdd�Zd�ZdS)	�ProfileOrchestratorz<Main coordinator for all LinkedIn profile enhancement agentsc��t��|_t��|_t	��|_t
��|_dS)N)r�scraperr�analyzerr�content_generatorr�memory)�selfs �ZE:\QED42\linkedin_enhancer\Linked_in_profile_enhancer_streamlit\src\agents\orchestrator.py�__init__zProfileOrchestrator.__init__s3��#�~�~���%����
�!-�����#�o�o������Tc���	td|����|r\td��|j�|��|j�|��|j���td��td|����|j�|��}|�d��|krGtd��td|����td|�dd	������td3��|j�||��}td��|j	�4||��}||||tjd��d
�}|j�
||��td��|�||��S#t$r}dt!|����cYd}~Sd}~wwxYw)a�5        Main workflow for enhancing a LinkedIn profile6        7        Args:8            linkedin_url (str): LinkedIn profile URL9            job_description (str): Optional job description for tailored suggestions10            force_refresh (bool): Force fresh scraping instead of using cache11            12        Returns:13            str: Enhancement suggestions and analysis14        u'🎯 Starting profile enhancement for: u#🗑️ Clearing all cached data...u%📡 Step 1: Scraping profile data...u🔗 Target URL: �urlu⚠️ URL mismatch detected!z
   Expected: z   Got: �Unknownu!🔍 Step 2: Analyzing profile...u&💡 Step 3: Generating suggestions...z%Y-%m-%d %H:%M:%S)�profile_data�analysis�suggestions�job_description�	timestampu"✅ Profile enhancement completed!zError in orchestration: N)�printr�force_refresh_session�clear_session_cacher�extract_profile_data�getr�analyze_profiler
�generate_suggestions�time�strftime�
store_session�_format_output�	Exception�str)	r�linkedin_urlr�
force_refreshrrr�session_data�es	         r�enhance_profilez#ProfileOrchestrator.enhance_profiles��-	7��J�L�J�J�K�K�K��
2��;�<�<�<���1�1�,�?�?�?���/�/��=�=�=���/�/�1�1�1�
�9�:�:�:��4�l�4�4�5�5�5��<�<�<�\�J�J�L�����&�&�,�6�6��6�7�7�7��4�l�4�4�5�5�5��E��!1�!1�%��!C�!C�E�E�F�F�F�
�5�6�6�6��}�4�4�\�?�S�S�H�
�:�;�;�;��0�E�E�h�P_�`�`�K�!-�$�*�#2�!�]�+>�?�?���L�
�K�%�%�l�L�A�A�A��6�7�7�7��&�&�x��=�=�=���	7�	7�	7�6�c�!�f�f�6�6�6�6�6�6�6�6�����	7���s�F8F;�;15G!�G�G!�G!c16��
�g}|�d��|�d��|�d|�dd��d�d���|�d|�d	d17������|�d|�dd��d�d���|�d��|�d
g��}|rG|�d��|D]}|�d|�����|�d��|�dg��}|rG|�d��|D]}|�d|�����|�d��|�di��}|r�|�dg��}	|�dg��}18|�d��|�dt|	���dd�|	dd�������|19r3|�dd�|20dd�������|�d��|�d��|�d��|���D�]�\}}|dk�r!|�d ��t|t��r|ni}
d!|
vr�|
d!r�|�d��|�d"��t|
d!d#��D]y\}}|�d$���	d%d$��}|�21d&��r|d'd����}|�|�d(|�����z|�d��d)|
vr�|
d)r�|�d*��|�d+��|
d)}|�d,��}|D]=}|���r'|�|������>|�d+��|�d��d-|
vrU|
d-rM|�d.��|
d-D]}|�d/|�����|�d����.|�	d0d1�����}|�d2|����t|t��r|D]}|�d/|�����n|�d/|����|�d�����|�d3��|�d��|�d4g��}|rb|�d5��t|dd�d#��D]\}}|�|�d(|����� |�d��|�d6��|�d7��|�d8��|�d9��|�d:��|�d;��|�d��|�d<��|�d=��d,�|��S)>z#Format the final output for displayu## 📊 Profile Analysisru**📈 Completeness Score:** �completeness_scorerz.1f�%u**⭐ Overall Rating:** �overall_ratingru**🎯 Job Match Score:** �job_match_score�	strengthsu### 🌟 Profile Strengthsu✅ �22weaknessesu### 🔧 Areas for Improvementu🔸 �keyword_analysis�found_keywords�missing_keywordsu### � Keyword Analysisz**Keywords Found (z):** z, N�23z**Missing Keywords:** �u## 🎯 Enhancement Suggestions�ai_generated_contentu)### 🤖 AI-Generated Content Suggestions�ai_headlinesu#### ✨ Professional Headlinesr�"z\")z1.z2.z3.z4.z5.�z. �ai_about_sectionu #### 📝 Enhanced About Sectionz```�24�ai_experience_descriptionsu&#### 💼 Experience Description Ideasu• �_� z### u## 📈 Implementation Roadmap�recommendationsu### 🎯 Priority Actionsu### 📊 General Best Practicesu8🔸 Update your profile regularly with new achievementsu8🔸 Use professional keywords relevant to your industryu9🔸 Engage with your network by sharing valuable contentu8🔸 Ask for recommendations from colleagues and clientsu2🔸 Monitor profile views and connection requestsz---uH*Analysis powered by AI • Data scraped with respect to LinkedIn's ToS*)�appendr �len�join�items�25isinstance�dict�	enumerate�strip�replace�26startswith�split�title�list)rrr�outputr3�strengthr4�weaknessr5r6r7�categoryrG�27ai_content�i�headline�cleaned_headline�
about_content�about_lines�line�desc�
category_name�itemrC�recs                         rr&z"ProfileOrchestrator._format_outputLs<����	�
�
�0�1�1�1��
�
�b�����
�
�b�h�l�l�CW�YZ�6[�6[�b�b�b�b�c�c�c��
�
�\����>N�PY�1Z�1Z�\�\�]�]�]��
�
�\�8�<�<�@Q�ST�3U�3U�\�\�\�\�]�]�]��
�
�b�����L�L��b�1�1�	��	��M�M�6�7�7�7�%�
1�
1���
�
�/�X�/�/�0�0�0�0��M�M�"�����\�\�,��3�3�28��	��M�M�:�;�;�;�&�
2�
2���
�
�0�h�0�0�1�1�1�1��M�M�"����$�<�<�(:�B�?�?���	�-�1�1�2B�B�G�G�N�/�3�3�4F��K�K���M�M�4�5�5�5��M�M�i�s�>�/B�/B�i�i����Sa�be�ce�be�Sf�Ig�Ig�i�i�j�j�j��
Z��
�
�X�t�y�y�AQ�RT�ST�RT�AU�7V�7V�X�X�Y�Y�Y��M�M�"����	�
�
�7�8�8�8��
�
�b����*�0�0�2�2�+	"�+	"�O�H�e��1�1�1��
�
�I�J�J�J�&0���&=�&=�E�U�U�2�29�!�Z�/�/�J�~�4N�/��M�M�"�%�%�%��M�M�"C�D�D�D�'0��N�1K�Q�'O�'O�B�B���8�+3�>�>�#�+>�+>�+F�+F�u�c�+R�+R�(�+�6�6�7U�V�V�L�/?����/C�/I�/I�/K�/K�,��
�
��&@�&@�.>�&@�&@�A�A�A�A��M�M�"�%�%�%�%��3�3�30�CU�8V�3��M�M�"D�E�E�E��M�M�%�(�(�(�$.�/A�$B�M�"/�"5�"5�d�";�";�K� +�8�8���:�:�<�<�8�"�M�M�$�*�*�,�,�7�7�7���M�M�%�(�(�(��M�M�"�%�%�%�/�:�=�=�*�Mi�Bj�=��M�M�"J�K�K�K� *�+G� H�5�5���
�
�m�T�m�m�4�4�4�4��M�M�"�%�%�%��!)� 0� 0��c� :� :� @� @� B� B�
��
�
�4�]�4�4�5�5�5��e�T�*�*�2� %�5�5���
�
�m�T�m�m�4�4�4�4�5��M�M�.��.�.�1�1�1��
�
�b�!�!�!�!�	�
�
�6�7�7�7��
�
�b����"�,�,�'8�"�=�=���	��M�M�5�6�6�6�#�O�B�Q�B�$7��;�;�
-�
-���3��
�
��m�m�c�m�m�,�,�,�,��M�M�"�����
�
�7�8�8�8��
�
�P�Q�Q�Q��
�
�P�Q�Q�Q��
�
�Q�R�R�R��
�
�P�Q�Q�Q��
�
�J�K�K�K��
�
�b�����
�
�e�����
�
�`�a�a�a��y�y�� � � rN)rT)�__name__�31__module__�__qualname__�__doc__rr-r&�rrr	r	sR������F�F�&�&�&�97�97�97�97�vn!�n!�n!�n!�n!rr	)32r#�
scraper_agentr�analyzer_agentr�
content_agentr�memory.memory_managerrr	rdrr�<module>ris�������'�'�'�'�'�'�)�)�)�)�)�)�'�'�'�'�'�'�/�/�/�/�/�/�r!�r!�r!�r!�r!�r!�r!�r!�r!�r!r