Demo of Vercel AI SDK to control UI via side effects. Set light/dark/system mode by typing the mode you want, e.g. dark mode
, in the chat. Type clear
to delete messages from the chat.
ai-toggle-mode.mp4
Prompting an llm to set dark or light theme and clear messages
Run the following command to clone the repo:
https://github.com/DraganAleksic99/ai-toggle-mode.git
cd ai-toggle-mode
npm i
cp .env.local.example .env.local
npm run dev
You can now visit http://localhost:3000.