1import { TEST_API } from "https://esm.town/v/stevekrouse/TEST_API";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function runAllTests2({ names }: { names: string[] }) {
5 return names.map((name) =>
6 fetchJSON(`${TEST_API}/eval/@stevekrouse.${name}()`)
7 .then(({ data, error }) => (data ?? error?.message) + ` (${name})`)
8 );
1export function myApi(name) {
2 return "hi " + name;
3}
8 "Rewrite this fact about cats as if it was written for 3 year old:\n\n" +
9 fact;
10 const story = await fetch("https://api.openai.com/v1/chat/completions", {
11 method: "POST",
12 body: JSON.stringify({
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
12 return await axios({
13 method: "POST",
14 url: `https://api.notion.com/v1/databases/${databaseId}/query`,
15 headers: {
16 Authorization: `Bearer ${notionAccessToken}`,
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({
8 limit: "10",
5//
6// Setup: Add a slash command using
7// "https://api.val.town/express/@nate.slackapp" as the request URL.
8//
9// Usage: /yourcommandname {expression}
16
17 if (
18 !("api_app_id" in req.body) ||
19 req.body.api_app_id !== process.env.SLACK_API_APP_ID ||
20 !("text" in req.body) ||
21 !("response_url" in req.body)
1export function myApi(name) {
2 return "hi " + name;
3}
1import { runVal } from "https://esm.town/v/std/runVal";
2
3export let topSecretInfoApi = runVal("bpietroniro.messWithTopSecretInfo");