2
3export let postWebhookTest = fetchJSON(
4 "https://api.val.town/express/@ggarnhart.citiBikeSpotChecker",
5 {
6 method: "POST",
4export const chatSampleFunctionSingle = (async () => {
5 // Example dummy function hard coded to return the same weather
6 // In production, this could be your backend API or an external API
7 const getCurrentWeather = (location, unit = "fahrenheit") => ({
8 unit,
6 options = {},
7) => {
8 // Initialize OpenAI API stub
9 const { Configuration, OpenAIApi } = await import("https://esm.sh/openai");
10 const configuration = new Configuration({
11 apiKey: process.env.openAIAPI,
12 });
13 const openai = new OpenAIApi(configuration);
14 // Request chat completion
15 const messages = typeof prompt === "string"
21 };
22 capturePostHogEvent(
23 process.env.phProjectAPIKey,
24 user,
25 eventName,
1export function myApi(name) {
2 return "hi " + name;
3}
1export const bigLeagueMe = async (req: Request) => {
2 const params = Object.fromEntries(new URL(req.url).searchParams.entries());
3 var {default: atproto} = await import("npm:@atproto/api");
4
5 const BskyAgent = atproto.
3/**
4 * Create a new Qdrant collection in an existing cluster with the given name
5 * Uses recommended values for OpenAPI embeddings
6 */
7export async function createQdrantCollection(args: {
16 method: "PUT",
17 headers: {
18 "api-key": qdrantKey,
19 "Content-Type": "application/json",
20 },
3
4export async function sendRandomChihuahuaToSlack() {
5 const dogAPIURL = new URL(
6 "https://dog.ceo/api/breed/chihuahua/images/random",
7 );
8 const dogApiResp = await fetch(dogAPIURL.href);
9 const { message } = await dogApiResp.json();
10 const res = await fetch(process.env.BROOKLAND_SLACK_WEBHOOK_URL, {
11 method: "POST",
6 }
7 const [author, name] = val.split(".");
8 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`);
9 if (resp.status !== 200) {
10 throw new Error(resp.statusText);
8 for (let i = 0; i < count; i++) {
9 let start = Date.now();
10 await fetch("https://api.val.town/eval/(()=%3E1+1)()");
11 evalTimes.push(Date.now() - start);
12 }
23 for (let i = 0; i < count; i++) {
24 let start = Date.now();
25 await fetch("https://api.val.town/eval/@healeycodes.addOnes()");
26 userFuncTimes.push(Date.now() - start);
27 }