24 const model = await builder();
25 const input = await prompt.format({
26 question: "What is the capital of France?",
27 });
28 const response = await model.call(input);
1export function myApi(name) {
2 return "hi " + name;
3}
2
3export const quotes = await fetchJSON(
4 "https://zenquotes.io/api/random",
5);
1export function myApi(name) {
2 console.email("name sent" + name);
3}
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/mkmik",
6);
19 // like the sender and the message text
20 const result = await fetchJSON(
21 "https://slack.com/api/chat.postMessage",
22 {
23 headers: {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleVal = (async () => {
4 const response = await fetch(
5 `https://api.val.town/v1/alias/tmcw/valTownApiExampleVal`,
6 );
7 return await response.json();
2
3export let evaluationFromValExample = (async () => {
4 const response = await fetch(`https://api.val.town/v1/eval`, {
5 method: "post",
6 body: JSON.stringify({ code: "1 + 1" }),
16 },
17 headers: {
18 "X-GitHub-Api-Version": "2022-11-28",
19 },
20 }));
4export let uid =
5 (await fetchJSON(
6 `https://api.val.town/v1/alias/${handle}`,
7 )).id;