1Migrated from folder: openai_function_calling/latLngOfCity
1Migrated from folder: openai_function_calling/weatherBot
1import { TreeItem } from "https://esm.town/v/pomdtr/tree_types";
2
3export function valItem({ author, name }: { author: string; name: string }): TreeItem {
4 return {
5 title: name,
4const query = "\"val.town\" OR \"val town\" -_ValTown_";
5
6export async function twitterAlert({ lastRunAt }: Interval) {
7 const results = await twitterSearch({
8 query,
1import { valForm } from "https://esm.town/v/rodrigotello/valForm";
2import { multiplicationFunctionTest } from "https://esm.town/v/rodrigotello/multiplicationFunctionTest";
3
4export async function FunctionToHTMLForm(
5 req: express.Request,
6 res: express.Response,
7) {
8 let myFunctionValAsHTML = multiplicationFunctionTest; // Insert your function here and it should generate an HTML form
9 return res.send(`${valForm(myFunctionValAsHTML)}`);
10}
6const dateChangedKey = "work-permit-change-date";
7
8export default async function(interval: Interval) {
9 const page = await fetch(site).then(res => res.text());
10 const date = page.match(/Last updated: <time datetime="([^"]+)">/)?.[1].toString();
14});
15
16app.post("/", async function(c) {
17 let res = await sqlite.execute({
18 sql: `insert into kv(key, value) values (:key, :value)`,
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export default async function() {
4 discordWebhook({
5 url: Deno.env.get("engDiscord"),
1import isMyWebsiteDown from "https://esm.town/v/weaverwhale/isMyWebsiteDown";
2
3export default async function(interval: Interval) {
4 const data = await isMyWebsiteDown("https://app.triplewhale.com");
5 console.log(data);
63
64// convert a timezone string like America/New_York to "EST"
65function shortenTimezoneString(timeZone: string) {
66 const string = new Date().toLocaleString("en-US", { timeZone, timeZoneName: "short" });
67 return string.split(" ").at(-1);
76};
77
78export async function compile(description: string, timezone: string) {
79 const { content } = await chat([
80 {
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",