Programming with LLM APIs
A Beginner’s Guide in R and Python
posit::conf(2025)
2025-09-16
15_coding-assistantUse Claude 3.5 Sonnet to write a function that gets the weather.
The first time, use Claude on its own.
Do some basic research for Claude about
how to use a specific package to get the weather.
How does Claude do with the same task now?
06:00
Augmented Generation
Answer: word vector embeddings → turn words into vectors
Every prompt you send gets passed through
a RAG system and is augmented
The LLM can decide when to call the RAG system


16_ragFollow the steps in the 16_rag exercise, which are roughly:
First, you’ll create a vector database from a set of documents:
Test out the vector database with a simple query.
Attach a retrieval tool to a chat client and try it in a Shiny app.
15:00