Search
Code47
Find similar pages on HN and return a streaming markdown summary.Powered by [Exa](https://exa.ai/) and [Substrate](https://substrate.run).🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits. Find comments on HN (powered by [Algolia](https://hn.algolia.com/api)), extract content and return a streaming markdown summary (powered by [Substrate](https://substrate.run)).The RAG portion of this is 34 lines of Substrate code. Twitter thread walkthrough: https://x.com/vprtwn/status/1812844236401762513🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits. import { hnSearch } from "https://esm.town/v/stevekrouse/hnSearch";import inputHeader from "https://esm.town/v/substrate/inputHeader";import { ComputeJSON, ComputeText, sb, Substrate } from "npm:substrate";import { z } from "npm:zod";import { zodToJsonSchema } from "npm:zod-to-json-schema";const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });// search for HN comments using https://hn.algolia.com/api model: "Llama3Instruct70B",});const stream = await substrate.stream(markdown);// Render streaming markdownimport { hnSearch } from "https://esm.town/v/stevekrouse/hnSearch";import inputHeader from "https://esm.town/v/substrate/inputHeader";import { ComputeJSON, ComputeText, sb, Substrate } from "npm:substrate";import { z } from "npm:zod";import { zodToJsonSchema } from "npm:zod-to-json-schema";const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });// search for HN comments using https://hn.algolia.com/api model: "Llama3Instruct70B",});const stream = await substrate.stream(markdown);// Render streaming markdownFind comments on HN (powered by [Algolia](https://hn.algolia.com/api)), extract content and return a streaming markdown summary (powered by [Substrate](https://substrate.run)).The RAG portion of this is 34 lines of Substrate code. Twitter thread walkthrough: https://x.com/vprtwn/status/1812844236401762513🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits. [WebSim](https://x.com/websim_ai) on Val with Substrate🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits import urlHeader from "https://esm.town/v/substrate/urlHeader";import { ComputeText, GenerateImage, sb, Substrate, UpscaleImage } from "npm:substrate";const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });export default async function render(req: Request): Promise<Response> { }); image.cache_age = 60 * 60 * 24; const res = await substrate.run(image); const imageUri = res.get(image).image_uri; const base64Data = imageUri.split(",")[1]; model: "Llama3Instruct70B", }); const stream = await substrate.stream(html); let { readable, writable } = new TransformStream();import promptHeader from "https://esm.town/v/substrate/promptHeader";import wrapper from "https://esm.town/v/substrate/substrateBadgeMiddleware";import { ComputeJSON, ComputeText, GenerateImage, sb, Substrate } from "npm:substrate";async function handler(req: Request): Promise<Response> { const { prompt = "modernism" } = Object.fromEntries(searchParams); // Substrate graph const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") }); const startup_name = new ComputeText({ }); const stream = await substrate.stream(haiku); async function* content() {// substrate + valtown badgeconst left = 80;const width = 160;<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}"> <rect width="${width}" height="${height}" fill="#111" rx="${radius}" ry="${radius}" /> <a href="https://substrate.run"> <text x="8" y="17" textAnchor="start" fill="#fff" style="font-family:system-ui,sans-serif;font-size:12px;font-weight:500;letter-spacing:-0.05em;"> Substrate </text> <text x="64" y="17" textAnchor="start" fill="#fff" style="font-family:system-ui,sans-serif;font-size:10px;letter-spacing:-0.05em;">Docs
No docs found