1export default async function(req: Request): Promise<Response> {
2 // Define your .ts file URLs
3 const urls = [
32 };
33
34 // Call the function to concatenate files
35 const concatenatedData = await concatenateFiles();
36
3const HOSTED_PHOENIX_BASE_URL = "https://llamatrace.com";
4// const HOSTED_PHOENIX_BASE_URL = "https://app.phoenix.arize.com";
5export default async function(req: Request) {
6 if (req.method === "OPTIONS") {
7 return new Response(null, {
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
21
22 useEffect(() => {
23 function handleKeyDown(e: KeyboardEvent) {
24 if (e.key === "ArrowLeft" && currentIndex > 0) {
25 setCurrentIndex(i => i - 1);
39 }, [currentIndex, history]);
40
41 async function handleSubmit(e: React.FormEvent) {
42 e.preventDefault();
43 setLoading(true);
131}
132
133function client() {
134 createRoot(document.getElementById("root")!).render(<App />);
135}
139}
140
141function extractCodeFromFence(text: string): string {
142 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
143 return htmlMatch ? htmlMatch[1].trim() : text;
144}
145
146export default async function server(req: Request): Promise<Response> {
147 if (req.method === "POST") {
148 const client = new Cerebras();
24];
25
26function App() {
27 const [personality1, setPersonality1] = useState(PRESET_PODCASTS[0].personality1);
28 const [personality2, setPersonality2] = useState(PRESET_PODCASTS[0].personality2);
305}
306
307function client() {
308 createRoot(document.getElementById("root")).render(<App />);
309}
313}
314
315export default async function server(req: Request): Promise<Response> {
316 const url = new URL(req.url);
317
12}
13
14function App() {
15 const [prompt, setPrompt] = useState("hello llamapalooza");
16 const [code, setCode] = useState("");
31 }, []);
32
33 async function fetchSavedSnippets() {
34 const response = await fetch("/snippets");
35 const snippets = await response.json();
37 }
38
39 async function handleSave() {
40 if (!code) return;
41 const response = await fetch("/snippets", {
49 }
50
51 async function handleDelete(id: number) {
52 const response = await fetch(`/snippets/${id}`, { method: "DELETE" });
53 if (response.ok) {
56 }
57
58 async function handleSubmit(e: React.FormEvent) {
59 e.preventDefault();
60 setLoading(true);
80 }
81
82 function handleBack() {
83 if (currentIndex > 0) {
84 setCurrentIndex(currentIndex - 1);
87 }
88
89 function handleForward() {
90 if (currentIndex < history.length - 1) {
91 setCurrentIndex(currentIndex + 1);
189}
190
191function client() {
192 createRoot(document.getElementById("root")!).render(<App />);
193}
197}
198
199function extractCodeFromFence(text: string): string {
200 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
201 return htmlMatch ? htmlMatch[1].trim() : text;
202}
203
204export default async function server(req: Request): Response {
205 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
206 const KEY = "savvyPurpleSpoonbill";
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
123}
124
125function client() {
126 createRoot(document.getElementById("root")!).render(<App />);
127}
131}
132
133function extractCodeFromFence(text: string): string {
134 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
135 return htmlMatch ? htmlMatch[1].trim() : text;
136}
137
138export default async function server(req: Request): Promise<Response> {
139 if (req.method === "POST") {
140 const client = new Cerebras();
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
123}
124
125function client() {
126 createRoot(document.getElementById("root")!).render(<App />);
127}
131}
132
133function extractCodeFromFence(text: string): string {
134 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
135 return htmlMatch ? htmlMatch[1].trim() : text;
136}
137
138export default async function server(req: Request): Promise<Response> {
139 if (req.method === "POST") {
140 const client = new Cerebras();
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
18 >(null);
19
20 async function handleSubmit(e: React.FormEvent) {
21 e.preventDefault();
22 setLoading(true);
92}
93
94function client() {
95 createRoot(document.getElementById("root")!).render(<App />);
96}
100}
101
102function extractCodeFromFence(text: string): string {
103 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
104 return htmlMatch ? htmlMatch[1].trim() : text;
105}
106
107export default async function server(req: Request): Promise<Response> {
108 if (req.method === "POST") {
109 const client = new Cerebras();
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
135}
136
137function client() {
138 createRoot(document.getElementById("root")!).render(<App />);
139}
143}
144
145function extractCodeFromFence(text: string): string {
146 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
147 return htmlMatch ? htmlMatch[1].trim() : text;
148}
149
150export default async function server(req: Request): Promise<Response> {
151 if (req.method === "POST") {
152 const client = new Cerebras();
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
45 }
46
47 function handleBack() {
48 if (currentIndex > 0) {
49 setCurrentIndex(currentIndex - 1);
52 }
53
54 function handleForward() {
55 if (currentIndex < history.length - 1) {
56 setCurrentIndex(currentIndex + 1);
132}
133
134function client() {
135 createRoot(document.getElementById("root")!).render(<App />);
136}
140}
141
142function extractCodeFromFence(text: string): string {
143 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
144 return htmlMatch ? htmlMatch[1].trim() : text;
145}
146
147export default async function server(req: Request): Promise<Response> {
148 if (req.method === "POST") {
149 const client = new Cerebras();
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": "*",