Skip to content

Live data

Three packages reach outside the process. They differ from the rest of the engine in one important way: the first result is a pending value, and the real answer arrives later.

Built in and enabled by default, because the underlying service needs no key.

ExpressionResult
weather in Parisa description and temperature
temperature in Tokyothe current temperature
high in Berlinthe daily maximum

Opt-in. You supply the fetching function, so the engine never holds a key.

import { createStocksPackage } from "solve-engine/packages";
const stocks = createStocksPackage({
fetchQuote: async (ticker, signal) => {
const res = await fetch(`https://example.com/quote/${ticker}`, { signal });
return res.json();
},
});

Without that function, stock(AAPL) returns a clearly named configuration error rather than a fabricated price.

Also opt-in, and also supplied as a function.

ExpressionResult
search: distance to the moonwhatever your provider answers
distance to the moon = ?the same, in a different phrasing