Live demo
A real weather bot running on OpenRouter and open-meteo.
apps/demo runs a real weather bot. It shows the whole stack working together:
- the open-meteo forecast toolchain is generated from open-meteo's own
OpenAPI spec (
src/openapi/forecast.yml); - the model is
deepseek/deepseek-v4-flash-0731via OpenRouter; - the agent answers weather questions for any city using an agent-owned tool loop.
Running the demo
cp .env.example .env # add OPENROUTER_API_KEY
bun run apps/demo/tests/weather.test.ts # Mumbai, Tokyo, Los Angeles in one threadThe test is a live integration test — it needs a real OPENROUTER_API_KEY
and skips nothing. It drives the weather bot for three cities in one thread.
How it's built
const forecast = await toolchainFromOpenAPISpecPath("./openapi/forecast.yml");
const runtime = Runtime({
inference: inferenceStack({
providers: [openrouterProvider({ apiKey: process.env.OPENROUTER_API_KEY })],
models: [
{
id: "deepseek/deepseek-v4-flash-0731",
provider: "openrouter",
model: "deepseek/deepseek-v4-flash-0731",
},
],
}),
})
.toolchain({ name: "forecast", tools: forecast })
.agent(
Agent({
name: "weather-bot",
model: "deepseek/deepseek-v4-flash-0731",
instructions:
"You are a helpful weather assistant. Use the forecast toolchain to answer questions about the weather for any city.",
tools: [forecast],
maxSteps: 5,
}),
)
.actor({
name: "weather-inbox",
topics: ["messages.incoming"],
act: async (env, ctx) => {
await ctx.agents["weather-bot"]("default").sendMessage(env.payload);
},
});
const server = await runtime.serve({ port: 3000 });Open apps/demo/src and apps/demo/tests in the repository to read the full
source.