30
31 <script>
32 async function main() {
33 let pyodide = await loadPyodide();
34 await pyodide.loadPackage(['numpy', 'pandas', 'scikit-learn', 'matplotlib']);
10import { renderToString } from "npm:react-dom/server";
11
12export default async function(req: Request): Promise<Response> {
13 return new Response(
14 renderToString(
19 {`let hasAnError: string = 10;
20
21function increment(num: number) {
22 return num + 1;
23}
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 const path = url.searchParams.get("path");
6import { Hono } from "npm:hono@3";
7
8function esmTown(url) {
9 return fetch(url, {
10 headers: {
1import { chat } from "https://esm.town/v/stevekrouse/openai?v=19";
2
3export async function getGPT4oEmoji(url) {
4 const response = await chat([
5 {
7};
8
9export default function LandingPage({ title, description }) {
10 const nowPages = [
11 {
3import { runVal } from "https://esm.town/v/std/runVal";
4
5export async function emailGPT3(email) {
6 let response = await runVal("patrickjm.gpt3", { prompt: email.text });
7 return mail({
1import { email } from "https://esm.town/v/std/email?v=11";
2
3export function forwarder(e: {
4 from: string;
5 to: string[];
52
53// The script we run within the worker. Don't reference anything
54// outside of this function as it won't be available within the worker. We could even host this in a separate val and pass
55const workerScript = () => {
56 type Log = {
64 get(target, key) {
65 const real = target[key];
66 if (typeof real === "function" && typeof key === "string") {
67 const fn = function(...args: any[]) {
68 logs.push({
69 level: key,
79 },
80 });
81 async function evaluate(url) {
82 try {
83 const _ = await import(url);
170
171// // evaluate("let ten = 10");
172// // evaluate("function cube(x) { return x ** 3 }");
173// // evaluate("ten + cube(3)");
174// evaluate(`
2import { google } from "npm:googleapis";
3
4export async function getAccessToken(accountId: string, bearer = Deno.env.get("pipedream")) {
5 const response = await fetchJSON(
6 `https://api.pipedream.com/v1/accounts/${accountId}?include_credentials=1`,
10}
11
12export function googleService(service: string, accessToken: string) {
13 return google[service]({
14 version: "v3",
19}
20
21export async function pipeDreamGoogle(service: string, accountId: string, bearer = Deno.env.get("pipedream")) {
22 const accessToken = await getAccessToken(accountId, bearer);
23 return googleService(service, accessToken);
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": "*",