Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swipe right to Cloud : Elevating User Engageme...

Abid Jamil
December 13, 2023

Swipe right to Cloud : Elevating User Engagement with Firebase and Vertex AI

Abid Jamil

December 13, 2023
Tweet

More Decks by Abid Jamil

Other Decks in Programming

Transcript

  1. Cloud Lahore Swipe right to Cloud : Elevating User Engagement

    with Firebase and Vertex AI Abid Jamil Engineering Manager @ Dubicars
  2. • Streamline Engineering, • Designing Architectures, • Team Building Magic,

    • Crafting Awesome Mobile Apps, • Talking and Writing with Style, • Sharing Open Source Love. What I love doing:
  3. Agenda Cloud Lahore 1. User Engagement 2. Firebase Analytics 3.

    Churn & Spend Predictions 4. Integration of Vertex AI 5. Generate AI for Push Notifications
  4. firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_ITEM) { param(FirebaseAnalytics.Param.ITEM_ID, id) param(FirebaseAnalytics.Param.ITEM_NAME, name) param(FirebaseAnalytics.Param.CONTENT_TYPE, "image") } firebaseAnalytics.setUserProperty("favorite_food",

    food) firebaseAnalytics.setUserProperty("city", city) firebaseAnalytics.setUserProperty("phoneNumber", phoneNumber) firebaseAnalytics.setUserProperty("theme", theme) Log Events
  5. import vertexai from vertexai.language_models import ChatModel, InputOutputTextPair vertexai.init(project="optimizeroute-403219", location="us-central1") chat_model

    = ChatModel.from_pretrained("chat-bison") parameters = { "candidate_count": 1, "max_output_tokens": 1024, "temperature": 0.2, "top_p": 0.8, "top_k": 40 } Generate Personalized Push
  6. chat = chat_model.start_chat( context="""My user is going to install application,

    i predicted it using Firebase churn predictions, He is active buyer of catgeory items from our platform, I want to send push notification to engage him with our application, Application is already in user\'s phone, I want to send him link of the relevant items he viewed, item link is \"www.xyz.com/item1, Also add some message for view discounts on specific categories. user name and category will be passed in prompt""", ) response = chat.send_message("""Generate push notificaiton title and message to send to user \"Abid\", Category name \"XYZ\", generate response in json""", **parameters) print(f"Response from Model: {response.text}") Generate Personalized Push
  7. { "notification": { "title": "Abid, Don't miss out on our

    latest XYZ items!", "body": "View our curated selection of XYZ items and enjoy exclusive discounts. Tap to explore now!", "click_action": "www.xyz.com/item1" } } Response : Personalized Push
  8. Can’t think of questions now? Ask me on Linked in

    @abidjamil www.linkedin.com/in/abidjamil