18})();
19
20export default async function(req: Request): Promise<Response> {
21 await init;
22 await pg.query(`
11import { email } from "https://esm.town/v/std/email?v=13";
12
13export default async function (interval: Interval) {
14 const bookingInfo = await resyBot( {
15 slug: 'amaro-bar',
3import { twitterUser } from "https://esm.town/v/stevekrouse/twitterUser";
4
5export async function twitterSearch({
6 query,
7 start_time,
4import type { Context, MiddlewareHandler } from "npm:hono";
5
6export function unkeyRatelimitMiddleware(config: RatelimitConfig): MiddlewareHandler {
7 const ratelimiter = new Ratelimit(config);
8
4const cacheBlobKey = "getValsContextWindowCache3";
5
6export default async function getValsContextWindow(model: any) {
7 const fullCacheBlobKey = `${cacheBlobKey}-${model}`;
8 const cached = await blob.getJSON(fullCacheBlobKey);
194 import { render } from "npm:preact-render-to-string";
195
196 export default async function(req: Request) {
197 return new Response(
198 render(
223 const FLAT_TEMPLATES = sections.flatMap((section) => section.templates);
224
225 function tsResponse(code) {
226 return "```ts\n" + code + "\n```";
227 }
394 ### Utilities
395
396 Our Blob SDK also includes some utility functions to make working with blobs easier.
397
398 ##### Copy
432 role: "assistant",
433 content:
434 "\n```ts\nexport default async function (req: Request): Promise<Response> {\n return Response.json(\"Hello world\")\n}\n```",
435 },
436 {
441 role: "assistant",
442 content:
443 "\n```ts\nexport default async function(req: Request): Promise<Response> {\n const query = new URL(req.url).searchParams;\n\n // Read name from the querystring or body. Defaults to \"you\" if not present.\n const name = query.get(\"name\") || (await req.json().catch(() => ({}))).name || \"you\";\n\n // Returns the HTML response\n return new Response(`<h1>Hi ${name}!</h1>`, {\n headers: { \"Content-Type\": \"text/html\" },\n });\n}\n```",
444 },
445 {
458 role: "assistant",
459 content:
460 "```ts\nexport default async function(req: Request): Promise<Response> {\n const apiKey = Deno.env.get(\"METEO_KEY\");\n const apiUrl = `https://api.open-meteo.com/v1/forecast?latitude=40.6782&longitude=-73.9442&hourly=temperature_2m¤t_weather=true&apikey=${apiKey}`;\n\n const response = await fetch(apiUrl);\n const weatherData = await response.json();\n\n return new Response(JSON.stringify(weatherData), { headers: { \"Content-Type\": \"application/json\" } });\n}\n```",
461 },
462 {
1import { parse } from "npm:parse-github-event";
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5 const userName = url.searchParams.get("userName");
18const ValTownOfficeDeviceId = "CD6F3A810848";
19
20async function switchbotRequest(path, args) {
21 const token = Deno.env.get("SWITCHBOT_TOKEN");
22 const secret = Deno.env.get("SWITCHBOT_KEY");
42}
43
44function botPress(device) {
45 return switchbotRequest(`v1.1/devices/${device}/commands`, {
46 method: "POST",
18const ValTownOfficeDeviceId = "CD6F3A810848";
19
20async function switchbotRequest(path, args) {
21 const token = Deno.env.get("SWITCHBOT_TOKEN");
22 const secret = Deno.env.get("SWITCHBOT_KEY");
42}
43
44function botPress(device) {
45 return switchbotRequest(`v1.1/devices/${device}/commands`, {
46 method: "POST",
2
3/**
4 * You can supply these options as a second argument to the `proxy` function.
5 * These options are used to configure the frontend.
6 */
135
136export const proxy = (url: string, options?: FrontendOptions) => {
137 return async function(req: Request): Promise<Response> {
138 if (req.method === "GET") {
139 return renderFrontend(url, options);
1export default async function (e: Email) {
2
3}
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.