3import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems?v=6";
4
5export async function tootLatestPosts({ lastRunAt }: Interval) {
6 return Promise.all(
7 (await newRSSItems({
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function wttrGetForecast({
4 location,
5 languageCode = "en",
6import { unusedQuotes } from "https://esm.town/v/canpolat/unusedQuotes";
7
8export async function createQuotePost({ instance, communityId, auth }: {
9 instance: string;
10 communityId: number;
14 const { LemmyHttp } = await import("npm:lemmy-js-client@0.18.1");
15 let client = new LemmyHttp(`https://${instance}`, {
16 fetchFunction: fetch,
17 });
18 const quote = unusedQuotes.pop();
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function dohRequestIpAddr(domain) {
4 let req = await fetch(`https://1.1.1.1/dns-query?name=${domain}`, {
5 headers: { "Accept": "application/dns-json" },
1export function myApi(name) {
2 return "hi " + name;
3}
12 const tb = await getLangSmithBuilder();
13 const tracer = await tb();
14 const functionSchema = [
15 {
16 name: "joke",
33 ];
34 const chain = prompt.pipe(model.bind({
35 functions: functionSchema,
36 function_call: { name: "joke" },
37 }));
38 return await chain.invoke({ subject: "bears" }, { callbacks: [tracer] });
1export function Food(x, y) {
2 return { x, y };
3}
1export function hueRotate() {
2 // Generate a random number between 0 and 180
3 let randomNumber = Math.floor(Math.random() * 181);
1export async function handler(req, res) {
2 console.email(JSON.stringify(req.body, null, 4), "Hello from Val.town!");
3}
1// NOT FUNCTIONAL
2// THE PDF LIBRARY PROBABLY WON'T WORK WITH THE CODE AS IT IS
3export const parsePdfData = (req: express.Request, res: express.Response) => {
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": "*",