Slide 1

Slide 1 text

Joe Cheng / CTO at Posit / posit::conf(2024) Shiny × AI I, for one, welcome our new robot overlords

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

What is your AI strategy?

Slide 4

Slide 4 text

Joe’s 5 stages of AI grief Denial: Arti fi cial “Intelligence”? All I see are stochastic parrots. Anger: Enough with the AI hype! Can we talk about literally anything else!? Bargaining: Fine, there’s something here, but let’s wait for the dust to settle. Depression: AI is going to eat everything I’ve ever loved. Acceptance: pip install openai

Slide 5

Slide 5 text

Two-pronged approach • What does Shiny have to o ff er AI researchers? • “I have an idea for an AI-driven app. Is Shiny a good framework to use?” • What does AI have to o ff er Shiny app authors? • “I have a Shiny app. Are there interesting, useful, and responsible ways to leverage LLMs to enhance my app?”

Slide 6

Slide 6 text

What can Shiny do for AI? • Honestly, I don’t know yet • But let me share one recent experience...

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Hi Curtis, I want to build a video chat assistant using GPT-4o, can Shiny do that? Tina Great, can Winston join my livestream
 in 9 days and live code one? Ahoy! You betcha Curtis @ Posit Fo sho

Slide 9

Slide 9 text

A few small problems 😬 • GPT-4o doesn’t o ff er a video chat API • Shiny doesn’t have a video input component • Winston had just left for PyCon ✈

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

One week later... input_video_clip()

Slide 12

Slide 12 text

One week later... input_video_clip() audio_spinner()

Slide 13

Slide 13 text

Morning of the livestream...

Slide 14

Slide 14 text

Demo https://jcheng.shinyapps.io/multimodal/

Slide 15

Slide 15 text

Morning of the livestream... Awesome! What if it could
 query three di ff erent LLMs
 and let you compare which
 one did the best? And plot
 which model is in the lead? 😳😬😰🤔🧐👍

Slide 16

Slide 16 text

Three hours later

Slide 17

Slide 17 text

What did we learn? • Interactivity “in the small” is hard and requires JavaScript expertise • Creating polished controls for input_video_clip and audio_spinner took time and skill • Interactivity “in the large” is easy (with Shiny) • Building apps around these components was blazingly fast to build and iterate

Slide 18

Slide 18 text

What did we learn? • Sometimes you need a Tina

Slide 19

Slide 19 text

What can AI do for Shiny? • Honestly, I don’t know yet • But we’re o ff to an amazing start!

Slide 20

Slide 20 text

Have you thought at all about how you might combine shiny + LLMs to create dashboards that give the viewer some ability to do independent analysis? Hadley How did you get this number Joe

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Put a chatbot on it!

Slide 23

Slide 23 text

Demo https://jcheng.shinyapps.io/sidebot/

Slide 24

Slide 24 text

What did we learn? The power of Domain Speci fi c Languages • SQL is a stunningly good language for connecting LLMs to data apps • Easy for LLMs to write • Easy for humans to read and reason about • Powerful and fl exible • Safe (relative to executing straight Python or R from an LLM) • Other DSLs might hold similar promise • Vega-lite for grammar of graphics • CSS Grid for dashboard layout

Slide 25

Slide 25 text

What did we learn? • Being a mere consumer of Copilot and ChatGPT is not enough to have a well- informed opinion of the potential of LLMs (you will miss out on structured output and tool calls). Start coding! • Revise your mental model of LLMs • The “stochastic parrot” mental model is true, reassuring, and unhelpful • The “machines that reason” mental model is false, terrifying, and helpful • Stay skeptical, but also, let yourself be curious

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

What is your AI strategy?

Slide 28

Slide 28 text

Thank you • Links to all packages and demos:
 https://tinyurl.com/jcheng-conf2024 or QR code 👉 • For a less con fl icted take on Shiny and AI, stick around for the next talk! • Come talk to us at the Lounge from 12-1PM today, or catch us on Discord