Open History to see the last commit
Effect Chat#
You want a streaming chat where the server is written with Effect. Ask for the weather in a city. The model calls a tool that is an Effect, and a Layer gives that tool its service.
Run it#
- Copy
.env.exampleto.env.localand put your OpenAI key in it. - From the repo root, run
pnpm install. - Run
pnpm --filter effect-chat dev. - Open http://localhost:3100.
- Type "What is the weather in Oslo?" and click Send.
The tool and its service are in src/lib/weather.ts. The server route is src/routes/api.chat.ts. The chat UI is src/routes/index.tsx.