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);
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export async function exchangeRate() {
5 const cheerio = await import("npm:cheerio");
6 const page = await fetch(
2import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
3
4export async function generateOnce<S>(fn: () => S | PromiseLike<S>, key): Promise<S> {
5 let value: any = await blob.getJSON(key);
6 if (value) return value;
12 * The email address(es) to send the email to.
13 * Can be a single string, IAddress object, or an array of strings/IAddress objects.
14 * @default the email of the logged user calling this function.
15 */
16 to?: (IAddress | string)[] | IAddress | string;
56};
57
58export default async function(req: Request): Promise<Response> {
59 const JSDOM = jsdom.JSDOM;
60 const url = new URL(req.url);
77
78 <script>
79 document.getElementById('nameForm').onsubmit = function(event) {
80 event.preventDefault();
81 const targetURL = document.getElementById("name").value
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.