zyloxAIChatAppmain.tsx3 matches
4import OpenAI from "https://esm.sh/openai@4.28.4";
56function App() {
7const [messages, setMessages] = useState([]);
8const [inputMessage, setInputMessage] = useState("");
177}
178179function client() {
180createRoot(document.getElementById("root")).render(<App />);
181}
182if (typeof document !== "undefined") { client(); }
183184export default async function server(request: Request): Promise<Response> {
185if (request.method === "POST" && new URL(request.url).pathname === "/chat") {
186const { OpenAI } = await import("https://esm.town/v/std/openai");
compassionateBlackCatfishmain.tsx7 matches
1import OpenAI from "https://esm.sh/openai@4.28.4";
23export default async function(req: Request): Promise<Response> {
4const LEPTON_API_TOKEN = Deno.env.get('LEPTON_API_TOKEN') || '';
583const audioInput = document.getElementById('audio-input');
8485function createMatrixBackground() {
86const canvas = document.createElement('canvas');
87const ctx = canvas.getContext('2d');
106}
107108function draw() {
109ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
110ctx.fillRect(0, 0, canvas.width, canvas.height);
129createMatrixBackground();
130131function addMessage(role, content, isTyping = false, contentType = 'text') {
132const msgParent = document.createElement("div");
133msgParent.className = "mb-4 " + (role === 'user' ? 'text-right' : 'text-left');
158if (file) {
159const reader = new FileReader();
160reader.onload = async function(e) {
161const base64Audio = e.target.result.split(',')[1];
162addMessage('user', file.name, false, 'audio');
218});
219220document.getElementById("input").addEventListener("submit", async function(event) {
221event.preventDefault();
222const userMessage = event.target.message.value;
302303// Add a separate API route handler for chat
304export async function handler(req: Request) {
305if (req.method !== 'POST') {
306return new Response('Method Not Allowed', { status: 405 });
stellarCrimsonPandamain.tsx11 matches
24);
2526function Hero({
27prompt,
28setPrompt,
4546<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47Turn your ideas into fully functional apps in{" "}
48<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49less than a second
116}
117118function App() {
119const previewRef = React.useRef<HTMLDivElement>(null);
120const [prompt, setPrompt] = useState("");
170});
171172function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173setLoading(true);
174setTimeout(() => handleSubmit(promptItem.prompt), 0);
175}
176177async function handleSubmit(e: React.FormEvent | string) {
178if (typeof e !== "string") {
179e.preventDefault();
226}
227228function handleVersionChange(direction: "back" | "forward") {
229const { currentVersionIndex, versions } = versionHistory;
230if (direction === "back" && currentVersionIndex > 0) {
974);
975976function client() {
977const path = window.location.pathname;
978const root = createRoot(document.getElementById("root")!);
1010}
10111012function extractCodeFromFence(text: string): string {
1013const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014return htmlMatch ? htmlMatch[1].trim() : text;
1015}
10161017async function generateCode(prompt: string, currentCode: string) {
1018const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019if (starterPrompt) {
1060}
10611062export default async function cerebras_coder(req: Request): Promise<Response> {
1063// Dynamic import for SQLite to avoid client-side import
1064const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163<meta property="og:site_name" content="Cerebras Coder">
1164<meta property="og:url" content="https://cerebrascoder.com"/>
1165<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166<meta property="og:type" content="website">
1167<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
cerebras_codermain.tsx11 matches
24);
2526function Hero({
27prompt,
28setPrompt,
4546<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47Turn your ideas into fully functional apps in{" "}
48<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49less than a second
116}
117118function App() {
119const previewRef = React.useRef<HTMLDivElement>(null);
120const [prompt, setPrompt] = useState("");
170});
171172function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173setLoading(true);
174setTimeout(() => handleSubmit(promptItem.prompt), 0);
175}
176177async function handleSubmit(e: React.FormEvent | string) {
178if (typeof e !== "string") {
179e.preventDefault();
226}
227228function handleVersionChange(direction: "back" | "forward") {
229const { currentVersionIndex, versions } = versionHistory;
230if (direction === "back" && currentVersionIndex > 0) {
974);
975976function client() {
977const path = window.location.pathname;
978const root = createRoot(document.getElementById("root")!);
1010}
10111012function extractCodeFromFence(text: string): string {
1013const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014return htmlMatch ? htmlMatch[1].trim() : text;
1015}
10161017async function generateCode(prompt: string, currentCode: string) {
1018const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019if (starterPrompt) {
1060}
10611062export default async function cerebras_coder(req: Request): Promise<Response> {
1063// Dynamic import for SQLite to avoid client-side import
1064const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163<meta property="og:site_name" content="Cerebras Coder">
1164<meta property="og:url" content="https://cerebrascoder.com"/>
1165<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166<meta property="og:type" content="website">
1167<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
calculateRequiredQuantityAppmain.tsx4 matches
3import React, { useRef, useState } from "https://esm.sh/react@18.2.0";
45function PriceQuantityCalculator() {
6const [calculation, setCalculation] = useState({
7item: "",
204}
205206function App() {
207return <PriceQuantityCalculator />;
208}
209210function client() {
211createRoot(document.getElementById("root")).render(<App />);
212}
213if (typeof document !== "undefined") { client(); }
214215export default async function server(request: Request): Promise<Response> {
216return new Response(
217`
gistFetchermain.tsx1 match
38});
3940function transformData(data) {
41// Implement your data transformation logic here
42return getFileContents("accounts.json")(data); // Modify as needed
cerebras_codermain.tsx11 matches
24);
2526function Hero({
27prompt,
28setPrompt,
4546<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47Turn your ideas into fully functional apps in{" "}
48<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49less than a second
116}
117118function App() {
119const previewRef = React.useRef<HTMLDivElement>(null);
120const [prompt, setPrompt] = useState("");
170});
171172function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173setLoading(true);
174setTimeout(() => handleSubmit(promptItem.prompt), 0);
175}
176177async function handleSubmit(e: React.FormEvent | string) {
178if (typeof e !== "string") {
179e.preventDefault();
226}
227228function handleVersionChange(direction: "back" | "forward") {
229const { currentVersionIndex, versions } = versionHistory;
230if (direction === "back" && currentVersionIndex > 0) {
974);
975976function client() {
977const path = window.location.pathname;
978const root = createRoot(document.getElementById("root")!);
1010}
10111012function extractCodeFromFence(text: string): string {
1013const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014return htmlMatch ? htmlMatch[1].trim() : text;
1015}
10161017async function generateCode(prompt: string, currentCode: string) {
1018const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019if (starterPrompt) {
1060}
10611062export default async function cerebras_coder(req: Request): Promise<Response> {
1063// Dynamic import for SQLite to avoid client-side import
1064const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163<meta property="og:site_name" content="Cerebras Coder">
1164<meta property="og:url" content="https://cerebrascoder.com"/>
1165<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166<meta property="og:type" content="website">
1167<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
293].map(pair => ({ origin: `${pair.orig}`, destination: `${pair.arpt}` }));
294295// Function to parse duration string into seconds
296function parseDurationToSeconds(duration: string): number {
297const parts = duration.split(" ");
298let seconds = 0;
322}
323324// Function to get travel time between two airports
325async function getTravelTime(
326origin: string,
327destination: string,
355}
356357// Main function to calculate travel times for all airport pairs
358export async function calculateAirportTravelTimes(): Promise<string> {
359const results: Array<
360{ origin: string; destination: string; duration: string | null; durationSeconds: number | null; error?: string }
compassionateFuchsiaXerinaemain.tsx3 matches
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
45function App() {
6const [todos, setTodos] = useState([]);
7const [newTodo, setNewTodo] = useState("");
91}
9293function client() {
94createRoot(document.getElementById("root")).render(<App />);
95}
96if (typeof document !== "undefined") { client(); }
9798export default async function server(request: Request): Promise<Response> {
99const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
100const KEY = "compassionateFuchsiaXerinae";
9};
1011function ModelBuilder() {
12const [modelName, setModelName] = useState('');
13const [fields, setFields] = useState<ModelField[]>([]);
178}
179180function client() {
181createRoot(document.getElementById("root")).render(<ModelBuilder />);
182}
183if (typeof document !== "undefined") { client(); }
184185export default async function server(request: Request): Promise<Response> {
186const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
187const KEY = "settingWebAppWithUserModelInterface";