shinychat
Chat UI component for Shiny
shinychat provides a chat user interface component for building conversational applications in Shiny. It enables developers to create chatbot interfaces in both R and Python Shiny applications.
The package handles the UI complexity of chat interfaces, including message display, user input, and conversation history. It integrates with Shiny’s reactive programming model, allowing developers to connect chat interactions to backend logic like LLM APIs or custom response handlers. This eliminates the need to build chat UI components from scratch when developing conversational applications.
Contributors#
Resources featuring shinychat#
Getting Started with LLM APIs in R
Getting Started with LLM APIs in R - Sara Altman
Abstract: LLMs are transforming how we write code, build tools, and analyze data, but getting started with directly working with LLM APIs can feel daunting. This workshop will introduce participants to programming with LLM APIs in R using ellmer, an open-source package that makes it easy to work with LLMs from R. We’ll cover the basics of calling LLMs from R, as well as system prompt design, tool calling, and building basic chatbots. No AI or machine learning background is required—just basic R familiarity. Participants will leave with example scripts they can adapt to their own projects.
Resources mentioned in the workshop:
- Workshop site: https://skaltman.github.io/r-pharma-llm/
- ellmer documentation: https://ellmer.tidyverse.org/
- shinychat documentation: https://posit-dev.github.io/shinychat/
Positron Assistant for Developing Shiny Apps - Tom Mock
Positron Assistant for Developing Shiny Apps - Tom Mock (Posit)
Abstract: This talk will explore building AI Apps with a focus on Positron Assistant for Shiny developer experience and in-IDE tooling for accelerating app creation. This talk will discuss tools like ellmer / chatlas / querychat / shinychat and compare it to Positron Assistant.
Resources mentioned in the presentation:
- Positron - https://positron.posit.co/
- Positron Assistant - https://positron.posit.co/assistant.html
Harnessing LLMs for Data Analysis | Led by Joe Cheng, CTO at Posit
When we think of LLMs (large language models), usually what comes to mind are general purpose chatbots like ChatGPT or code assistants like GitHub Copilot. But as useful as ChatGPT and Copilot are, LLMs have so much more to offer—if you know how to code. In this demo Joe Cheng will explain LLM APIs from zero, and have you building and deploying custom LLM-empowered data workflows and apps in no time.
Posit PBC hosts these Workflow Demos the last Wednesday of every month. To join us for future events, you can register here: https://posit.co/events/
Slides: https://jcheng5.github.io/workflow-demo/ GitHub repo: https://github.com/jcheng5/workflow-demo
Resources shared during the demo: Ellmer https://ellmer.tidyverse.org/ Chatlas https://posit-dev.github.io/chatlas/
Environment variable management: For R: https://docs.posit.co/ide/user/ide/guide/environments/r/managing-r.html#renviron For Python https://pypi.org/project/python-dotenv/
Shiny chatbot UI: For R, Shinychat https://posit-dev.github.io/shinychat/ For Python, ui.Chat https://shiny.posit.co/py/docs/genai-inspiration.html
Deployment Cloud hosting https://connect.posit.cloud On-premises (Enterprise) https://posit.co/products/enterprise/connect/ On-premises (Open source) https://posit.co/products/open-source/shiny-server/
Querychat Demo: https://jcheng.shinyapps.io/sidebot/ Package: https://github.com/posit-dev/querychat/
If you have specific follow-up questions about our professional products, you can schedule time to chat with our team: pos.it/llm-demo

Joe Cheng - Summer is Coming: AI for R, Shiny, and Pharma
Summer is Coming: AI for R, Shiny, and Pharma - Joe Cheng
Abstract: R users tend to be skeptical of modern AI models, given our weird insistence on answers being accurate, or at least supported by the data. But I believe the time has come—or maybe it’s a little late—for even the most AI-cynical among us to push past their discomfort and get informed about what these tools are truly capable of. And key to that is moving beyond using AI-enabled apps, and towards building our own scripts, packages, and apps that make judicious use of AI.
In this talk, I’ll tell you why I believe AI has more to offer the R community than just wrong answers from chat windows or mediocre code suggestions in our IDEs. I’ll also introduce brand-new tools we’re developing at Posit that put powerful AI tools within reach of every R user. And finally, I’ll show how adding some AI could make your next Shiny app dramatically more useful for your users.
Resources mentioned in the talk:
- Slides: https://jcheng5.github.io/pharma-ai-2024
- {elmer} Call LLM APIs from R: https://elmer.tidyverse.org/
- {shinychat} Chat UI component for Shiny for R https://github.com/jcheng5/shinychat
- R/Pharma GenAI Day Recordings: https://www.youtube.com/playlist?list=PLMtxz1fUYA5AYryl4t2mtqBngqWDrnMXJ
Presented at the 2024 R/Pharma Conference



