Recap

Tools, structured data, & chatbots

πŸ”§ Tool calling

  • Agent = LLM + tools + loop
  • A tool can be a typed, documented function β€” the model decides when to call it.
  • register_tool() turns a Python function into something the model can call.
  • Letting an LLM execute arbitrary code is powerful but risky β€” sandbox it, run it remotely, or restrict its scope.
  • Tools can be extended beyond your own process using MCP (over HTTP or STDIO).

πŸ“¦ Structured data extraction

  • Extract structured data from text/images/PDFs
  • Transform LLM responses into data your code can branch on, not just prose.
    • Useful for a lot of stuff beyond chat apps!
  • .chat_structured() + a Pydantic model extracts typed data from text, images, or PDFs.
  • str | None fields handle data that’s sometimes missing.

πŸ’¬ shinychat

  • Turn any chatlas instance into a web app in just a few lines of code.
  • client= gives you history, tool display, streaming, cancel, attachments, and error handling for free.
  • Return a ToolResultDisplay to show the user a polished view while the model sees raw data.
  • Customize with tool displays, slash commands, and more

Quick check πŸ™‹πŸ»β€β™€οΈ

  • What two things does a Python function need to become a tool?
  • Name one way to keep LLM-driven code execution safe.
  • What does client= give you for free in shinychat?

Up next

πŸ“Š querychat β€” the capstone: self-service analytics

βœ”οΈ Measuring correctness β€” evals

πŸ§ͺ Production tooling β€” observability