4import { zodToJsonSchema } from "npm:zod-to-json-schema";
5
6const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
7
8// search for HN comments using https://hn.algolia.com/api
9const query = "langchain";
10const searchResults = await hnSearch({
27 new ComputeJSON({
28 prompt: `Summarize this comment and how it relates to the topic: ${query}
29 Use "negative" sentiment for posts about API, abstraction, documentation, tutorial, general quality, slowness, or performance issues.
30 COMMENT: ${JSON.stringify(hit)}`,
31 json_schema: zodToJsonSchema(commentInfo),
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO
67 "----- 2023-06-27T16:13:00 -----\n",
68 "Hafði tekið QR-kóðadæmið til baka Ăľar sem vatn hafði komist inn Ă plastumslagið og lĂmbandið sem hĂ©lt Ăľvà á skiltisstakun hafði gefið sig.\n",
69 "Ăžað var um sĂðustu helgi. Ăžurfti hvort sem er að skipta ĂľvĂ Ăşt ĂľvĂ að e-r nĂ˝tti sĂ©r SameOriginPolicy veikleikann Ă api.val.town.\n",
70 "Leit á kartöflugrösin à dag og reitt frá sumum þeirra arfa sem var orðin of ágengur.\n",
71 "Þessi grös virðast dafna bara fjandi vel verð ég bara að segja.\n",
1import Exa from "npm:exa-js";
2
3const exaSecret = Deno.env.get("EXA_API_KEY");
4const exa = new Exa(exaSecret);
5
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />
1Fork it and authenticate with your Val Town API token as the password. Needs an `OPENAI_API_KEY` env var to be set, and change the variables under "Set these to your own".
2
3https://x.com/JanPaul123/status/1812957150559211918