36});
37
38export async function fetchNewestVals({ page = 0 } = {}) {
39 const url = new URL("https://www.val.town/newest");
40 url.searchParams.set("_data", "routes/_app.newest");
24});
25
26export async function fetchVal(author: string, name: string) {
27 const prefixUrl = new URL("/v1/alias", API_URL);
28 const resp = await ky.get(`${author}/${name}`, { prefixUrl }).json();
17`;
18
19export default function() {
20 return new Response(body, {
21 headers: {
2import { BrowserContext } from "https://esm.town/v/pomdtr/browser";
3
4export default async function(ctx: BrowserContext) {
5 const { author, name } = ctx.params;
6
7 await askAI(`Add jsdoc comments for each exported function of the val @${author}/${name}`);
8}
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=44";
3
4export default async function() {
5 const { vals } = await fetchJSON("https://www.val.town/newest?page=0&_data=routes/_app.newest");
6
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
37
6import { askAI } from "https://esm.town/v/pomdtr/ask_ai";
7
8await askAI(`Add jsdoc comments for each exported function of the val @pomdtr/askAi`);
9```
12 * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
13 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
14 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
12const openai = new OpenAI();
13
14const functionExpression = await openai.chat.completions.create({
15 "messages": [
16 { "role": "user", "content": "Say hello in a creative way" },
20});
21
22console.log(functionExpression.choices[0].message.content);
23```
4 );
5 const html = htm.bind(h);
6 function Component() {
7 const [count, setCount] = useState(0);
8 const inc = () => setCount(count => count + 1);
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.