Anatomy of a conversation

Programmatically conversing with LLMs

Slides

View slides in full screen

Outline

  • (10m) Think empirically, be pragmatic
    • Getting into the right mindset for working with LLMs
    • How to approach this workshop
    • Extra time to work with participants on setup if needed
  • (20m) Anatomy of a conversation
    • The same conversation from R and Python with ellmer and chatlas
    • Message roles: system, user, assistant
    • Your Turn _exercises/02_conversation: same question with and without a system prompt
    • How does the LLM remember the conversation? _demos/03_clearbot
  • (20m) How do LLMs work?
  • (20m) Shinychat basics
    • live_console() and live_browser() (or chat.console() and chat.app())
    • Your Turn _exercises/05_live: write a roast of Hadley Wickham with live_console()
    • Making your own shinychat app: chat_app() for a quick app, page_chat() + chat_server() in R or Chat(client=) in Python for an app others can use
    • Your Turn _exercises/06_word-games: 20-questions-style game — the model picks a word, you guess