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

Introducing Juvet - Building Bots in Elixir

Introducing Juvet - Building Bots in Elixir

There is another massive shift happening with how we interact with companies through software. Users feel comfortable naturally talking with their applications through chat bots. Chat is the next generation of the user interface.

Elixir is the perfect language and ecosystem for building bots and for conversational interfaces. In this session, we will see how we can build scalable, realtime web applications (or “bots”) using a new library Juvet and the Slack API. We will see what a good bot architecture looks like and how we can integrate with existing artificial intelligence services to make our bots smarter.

Finally, we will learn how you can leverage metaprogramming in Elixir to build a router to help route requests from chat services to create a Phoenix-like experience for building chat apps.

Jamie Wright

August 30, 2022
Tweet

More Decks by Jamie Wright

Other Decks in Business

Transcript

  1. USER PLATFORM APP OPS CHANNEL /HELP OPS CHANNEL HERE IS

    THE HELP YOU REQUESTED: { CHANNEL: ‘C1234’, USER: ‘U8324’, TEAM: ‘T4390’, MESSAGE: ‘/HELP’ } CHAT.POST_MESSAGE(‘HERE IS THE HELP YOU REQUESTED:’)
  2. USER PLATFORM APP OPS CHANNEL /HELP HOW SLACK WORKS {

    CHANNEL: ‘C1234’, USER: ‘U8324’, TEAM: ‘T4390’, MESSAGE: ‘/HELP’ }
  3. LEBOWSKI COMMANDS / B E V E R A G

    E - H E R E - M A N
  4. JUVET WALKTHROUGH S U P E R V I S

    I O N T R E E NEW LEBOWSKI APP FOR MY TEAM
  5. MIDDLEWARE D E F I N I N G M

    I D D L E W A R E
  6. ROUTING A NICE BLACK BOX YOUR APP ROUTER CONTROLLERS TEMPLATES

    AUTHORIZATION LOW-LEVEL API PLATFORM LIBRARIES HIDE THE PLUMBING
  7. EVERYTHING HAS A PLACE TEMPLATES CONTROLLERS MODELS ROUTES > BUSINESS

    LOGIC > HANDLES PLATFORM REQUESTS > RUNS MIDDLEWARE > PASSES CONTEXT > CREATES CONTROLLER > RUNS ACTION > HANDLES REQUEST > PREPARES RESPONSE > RENDERS RESPONSE(S) > RETRIEVE DATA > UPDATE DATA > INTEGRATES DATA > PROVIDES RESPONSE
  8. EXTENSION POINTS USER REQUEST PLATFORM APP ROUTER FINDS ROUTE MIDDLEWARE

    IS RUN CONTROLLER IS CREATED ACTION IS CALLED TEMPLATE IS RENDERED RESPONSE IS SENT USER RESPONSE
  9. HARDER TO DEBUG > (PHOENIX.ROUTER.NOROUTEERROR) NO ROUTE FOUND FOR POST

    /SLACK/ACTIONS (TATSUWEB.ROUTER) > (TATSU 0.0.11) LIB/PHOENIX/ROUTER.EX:405: TATSUWEB.ROUTER.CALL/2 > (COWBOY 2.9.0) /TATSU_NEXT/DEPS/COWBOY/SRC/COWBOY_HANDLER.ERL:37: :COWBOY_HANDLER.EXECUTE/2 > (TATSU 0.0.11) LIB/TATSU_WEB/ENDPOINT.EX:1: TATSUWEB.ENDPOINT.PLUG_BUILDER_CALL/2 > … > … > … > … > … > … > … C A L L S T A C K
  10. BETTER ERROR MESSAGES > (PHOENIX.ROUTER.NOROUTEERROR) NO ROUTE FOUND FOR POST

    /SLACK/ACTIONS (TATSUWEB.ROUTER) > … >… > … > … > … > … > … > ??? 💀😅 C A L L S T A C K
  11. RANDOM ACCESS MEMORY USER CAN YOU SCHEDULE A MEETING? APP

    I SURE CAN. WITH WHOM? USER WITH TIM. APP GOT IT. WHEN? USER TOMORROW AT 2. APP DONE. I SCHEDULED A MEETING WITH TIM TOMORROW AT 2.
  12. RANDOM ACCESS MEMORY CAN YOU SCHEDULE A MEETING? USER CAN

    YOU SCHEDULE A MEETING WITH TIM TOMORROW AT 2? APP DONE. I SCHEDULED YOUR MEETING WITH TIM FOR TOMORROW AT 2. CAN YOU SCHEDULE A MEETING? USER ACTUALLY CAN YOU MAKE IT FOR 3? APP DONE. I RE-SCHEDULED IT FOR TOMORROW AT 3.
  13. DISCOVERABILITY T R A I N I N G W

    H E E L S ARE YOU READY FOR THE MEETING? YOU CAN REPLY WITH ‘Y’ES OR ’N’O. APP USER YES. MEETING SCHEDULED! DID YOU KNOW YOU CAN REQUEST A RESCHEDULE BY REPLYING ‘RE-SCHEDULE’? APP
  14. VALIDATION ANDY WANTS TO MEET WITH YOU TODAY AT 2.

    APP ARE YOU AVAILABLE? USER BLERG.
  15. VALIDATION I’M SORRY ‘BLERG’ IS NOT AN ANSWER. APP ACKNOWLEDGE

    THE RESPONSE 1. YOU CAN RESPOND ‘YES’ OR ‘NO’ APP PROVIDE CORRECT OPTIONS 2. ANDY WANTS TO MEET WITH YOU TODAY AT 2. APP ARE YOU AVAILABLE? RE-ASK THE QUESTION 3.
  16. SELECTION WHERE DO YOU WANT TO MEET MACKENZIE TONIGHT? APP

    USER 1. 1. COFFEE SHOP 2. RESTAURANT 3. BAR APP O P T I O N R E D U C T I O N
  17. SELECTION OK. WHICH COFFEE SHOP? APP O P T I

    O N R E D U C T I O N 1. CAFE JOE’S 2. STARBUCKS ON MAIN 3. PERKATORY APP
  18. RESPONSE SAMPLING YES APP OK APP CORRECT APP WRONG APP

    NOPE APP LOOKS GOOD APP 👍 APP ✌ APP THAT’S WHAT SHE SAID APP COOL APP
  19. Q+A