linkedin for OMI Web Personas #1752#1780
Conversation
|
1/ how do you handle the profile creation / navigation when the user simply types |
Hi @beastoin , Kindly refer to the "Flow Diagram for Profile Selection" and check the screenshot in the description above. Thanks. |
|
1/ could you simplify the diagram? the complexity level of this simple task should not be that high. man, if you are using an AI to generate the diagram for your code, you have to make sure your code is super good and backed by the diagram from your brain. forgive me if you drew it yourself 🤯 |
Hi @beastoin , The diagram was created manually—yes, the old-fashioned way! ✍️ It was the initial design to ensure all scenarios were covered before diving into the actual code. The final code is now sleek, simple, and handles all the scenarios from the previous flow diagram. Kindly refer to the final code flow diagram. It’s as simple as it gets! 😃 Thanks! |
…d for handling OLD database
|
@harshithsunku can you host it anywhere and give a link? i want to test scraping of posts |
Hi @kodjima33 , I've shared the link over a mail please check. Thanks. |
|
1/ ✅ ok |
Hi @beastoin , @kodjima33 . Good suggestion! I had considered this during the initial design/implementation but didn’t add it since it wasn’t part of the original request. I’ll include this support now. I’m currently on a business travell and will be back on Saturday, February 22nd. I’ll get this done by February 23rd. Thanks for your understanding! Regards, |
Hi @beastoin, @kodjima33, I have added support for the link as well. Kindly verify using the link shared via email. Regards, |
|
2/ could you improve the code quality ? these code block looks messy https://github.com/BasedHardware/omi/pull/1780/files#diff-237e4bc2a7e642164212ab39111544957f2cc77d56606e6ddc91a8f52a2d381fR150-R204 ; imaging we have instagram, threads, ..., and more. 3/ resolve conflicts pls sir. |
|
@harshithsunku need this merged today or will have to reassign or do ourselves, what's the status? |
…ub.com/harshithsunku/omi into feature/Omi-1752-linkedin-web-personas
Hi @kodjima33 , Everything is done from my side. I've addressed the comments, resolved conflicts, and the PR is ready for merge. Regards, |
|
hey @harshithsunku , could you check with the https://x.com/bilawalsidhu , the personas.omi.me told me that "No profile found for the given handle" |
Hi @beastoin , I have just verified the deployment on my PR commit. (This deployment is based on the PR commit before merging to the main branch: https://omi-two.vercel.app/). It is working fine, and I am able to add a new Twitter handle to personas. I guess some other commit might have caused this issue after my PR merge. Currently, I am out of station and will be able to look into this after 8 PM IST today. Regards, |
Hi @beastoin , I've just checked, and it seems to be working. Regards, |
Fixes BasedHardware#1752 # Added LinkedIn Integration to OMI Personas ## Overview Added LinkedIn profile integration alongside existing Twitter support, enabling users to create AI personas from either platform. ## Key Changes - Added LinkedIn API integration - ️ Created new components for better code organization: - `ChatbotList` - `Header` - `Footer` - `InputArea` - `Profiles ' - Updated UI to support both Twitter and LinkedIn profiles - Added LinkedIn-specific data handling: - Profile information - Connection & follower counts - Professional history - Skills and posts ## Technical Implementation ```typescript // New LinkedIn profile fetching const fetchLinkedinProfile = async (handle: string) => { const profileResponse = await fetch(`https://${process.env.NEXT_PUBLIC_LINKEDIN_API_HOST}/profile-data-connection-count-posts?username=${encodedHandle}`, { // Process LinkedIn profile data } ``` ## Testing Coverage ✅ - Twitter-only profiles - LinkedIn-only profiles - Dual-platform profiles ## Environment Variables Added ```env NEXT_PUBLIC_LINKEDIN_API_HOST= NEXT_PUBLIC_LINKEDIN_API_KEY= ```   Snip from firebase:  ## Pop Up if profile exists in both platforms  ## Flow Diagram for Profile selection and creation ```mermaid graph TD A[User Enters Handle] --> B{Is Profile exist?} B -->|Not Found| C{Check Platform Availability?} B -->|Found| D{Where Does it Exist?} C -->|Twitter Only| E[Create Twitter Profile] C -->|LinkedIn Only| F[Create LinkedIn Profile] C -->|Both Available| G[fetch and create both] C -->|Not Available| H[Show Error: Profile Not Found] D -->|Twitter Only| I{Is Linkedin Available?} I -->|No, Route to twitter chat|R I -->|Yes|S D -->|Both| K{Select platform twitter/linkedin?} D -->|LinkedIn Only| J{Is Twitter Available?} S -->K J -->|Yes|T J -->|No, Route to Linkedin Chat|R T -->K K -->|Based on user selection linnked or twitter| R E --> L[Route to New Chat] F --> L G --> M{Selected Platform twitter/linkedin?} M -->|LinkedIn/Twitter based on selection| L R[Route to chat] S[Fetch and create Linkedin] T[Fetch and create Twitter] ``` ## Flow Diagram of Code for Profile selection ```mermaid graph TD A[User enters Handle] -->B[Scrape handle ONLY if Not exists in DB,For both twitter and linkedin scrape and save in DB] B --> C{Check Platform Avalibality?} C -->|if hanle not found| E[toast error profile not exists] C -->|Only Twitter| D[Route to Chat] C -->|Only Linkedin| D C -->|Both platform for same handle| F{Popup to select twitter or linkedin} F -->|twitter or linkedin based on selection| D ``` Test Case: Twitter URL Only Input Example: https://x.com/harshithsunku Expected Outcome: Extracts clean handle as harshithsunku. Only fetchTwitterProfile is called. Retrieves the Twitter docId and redirects to chat without displaying a platform modal. Status: PASS Comment: Verified that when a Twitter URL is provided, only the Twitter profile is fetched, even if the same handle exists for LinkedIn. Test Case: LinkedIn URL Only Input Example: https://linkedin.com/in/harshithsunku Expected Outcome: Extracts clean handle as harshithsunku. Only fetchLinkedinProfile is called. Retrieves the LinkedIn docId and redirects to chat without displaying a platform modal. Status: PASS Comment: Verified that when a LinkedIn URL is provided, only the LinkedIn profile is fetched, ignoring the Twitter branch even if it exists. Test Case: Plain Handle (Ambiguous, Multi-platform) Input Example: harshithsunku or @harshithsunku Expected Outcome: Extracts the clean handle as harshithsunku. Both fetchTwitterProfile and fetchLinkedinProfile are triggered. If both API calls succeed, a modal is shown for platform selection. Status: PASS Comment: Verified that plain handle input triggers both API calls, and a modal prompts the user when the profile exists on multiple platforms. Test Case: Handle with Only Twitter Profile Exists Input Example: x Expected Outcome: Extracts clean handle as x. fetchTwitterProfile succeeds while fetchLinkedinProfile fails. Retrieves Twitter docId and redirects to chat without showing a modal. Status: PASS Comment: Verified that if only the Twitter profile is available, the process continues with Twitter exclusively and bypasses modal selection. Test Case: Handle with Only LinkedIn Profile Exists Input Example: nik-shevchenko-08565b18b Expected Outcome: Extracts clean handle as nik-shevchenko-08565b18b. fetchLinkedinProfile succeeds while fetchTwitterProfile fails. Retrieves LinkedIn docId and redirects to chat without showing a modal. Status: PASS Comment: Verified that if only the LinkedIn profile is available, the process continues with LinkedIn exclusively and bypasses modal selection. Test Case: Profile Already Exists in Database Input Example: Valid handle/URL (any format) Expected Outcome: A success toast is displayed, showing a modal or redirecting to chat. Status: PASS Comment: Verified that when a profile already exists in the database, a success message is shown, and the user is either redirected to chat or shown a modal.
Fixes #1752
Added LinkedIn Integration to OMI Personas
Overview
Added LinkedIn profile integration alongside existing Twitter support, enabling users to create AI personas from either platform.
Key Changes
ChatbotListHeaderFooterInputAreaTechnical Implementation
Testing Coverage ✅
Environment Variables Added
Snip from firebase:

Pop Up if profile exists in both platforms
Flow Diagram for Profile selection and creation
graph TD A[User Enters Handle] --> B{Is Profile exist?} B -->|Not Found| C{Check Platform Availability?} B -->|Found| D{Where Does it Exist?} C -->|Twitter Only| E[Create Twitter Profile] C -->|LinkedIn Only| F[Create LinkedIn Profile] C -->|Both Available| G[fetch and create both] C -->|Not Available| H[Show Error: Profile Not Found] D -->|Twitter Only| I{Is Linkedin Available?} I -->|No, Route to twitter chat|R I -->|Yes|S D -->|Both| K{Select platform twitter/linkedin?} D -->|LinkedIn Only| J{Is Twitter Available?} S -->K J -->|Yes|T J -->|No, Route to Linkedin Chat|R T -->K K -->|Based on user selection linnked or twitter| R E --> L[Route to New Chat] F --> L G --> M{Selected Platform twitter/linkedin?} M -->|LinkedIn/Twitter based on selection| L R[Route to chat] S[Fetch and create Linkedin] T[Fetch and create Twitter]Flow Diagram of Code for Profile selection
graph TD A[User enters Handle] -->B[Scrape handle ONLY if Not exists in DB,For both twitter and linkedin scrape and save in DB] B --> C{Check Platform Avalibality?} C -->|if hanle not found| E[toast error profile not exists] C -->|Only Twitter| D[Route to Chat] C -->|Only Linkedin| D C -->|Both platform for same handle| F{Popup to select twitter or linkedin} F -->|twitter or linkedin based on selection| DTest Case: Twitter URL Only
Input Example: https://x.com/harshithsunku
Expected Outcome: Extracts clean handle as harshithsunku. Only fetchTwitterProfile is called. Retrieves the Twitter docId and redirects to chat without displaying a platform modal.
Status: PASS
Comment: Verified that when a Twitter URL is provided, only the Twitter profile is fetched, even if the same handle exists for LinkedIn.
Test Case: LinkedIn URL Only
Input Example: https://linkedin.com/in/harshithsunku
Expected Outcome: Extracts clean handle as harshithsunku. Only fetchLinkedinProfile is called. Retrieves the LinkedIn docId and redirects to chat without displaying a platform modal.
Status: PASS
Comment: Verified that when a LinkedIn URL is provided, only the LinkedIn profile is fetched, ignoring the Twitter branch even if it exists.
Test Case: Plain Handle (Ambiguous, Multi-platform)
Input Example: harshithsunku or @harshithsunku
Expected Outcome: Extracts the clean handle as harshithsunku. Both fetchTwitterProfile and fetchLinkedinProfile are triggered. If both API calls succeed, a modal is shown for platform selection.
Status: PASS
Comment: Verified that plain handle input triggers both API calls, and a modal prompts the user when the profile exists on multiple platforms.
Test Case: Handle with Only Twitter Profile Exists
Input Example: x
Expected Outcome: Extracts clean handle as x. fetchTwitterProfile succeeds while fetchLinkedinProfile fails. Retrieves Twitter docId and redirects to chat without showing a modal.
Status: PASS
Comment: Verified that if only the Twitter profile is available, the process continues with Twitter exclusively and bypasses modal selection.
Test Case: Handle with Only LinkedIn Profile Exists
Input Example: nik-shevchenko-08565b18b
Expected Outcome: Extracts clean handle as nik-shevchenko-08565b18b. fetchLinkedinProfile succeeds while fetchTwitterProfile fails. Retrieves LinkedIn docId and redirects to chat without showing a modal.
Status: PASS
Comment: Verified that if only the LinkedIn profile is available, the process continues with LinkedIn exclusively and bypasses modal selection.
Test Case: Profile Already Exists in Database
Input Example: Valid handle/URL (any format)
Expected Outcome: A success toast is displayed, showing a modal or redirecting to chat.
Status: PASS
Comment: Verified that when a profile already exists in the database, a success message is shown, and the user is either redirected to chat or shown a modal.