Search

Results include substring matches and semantically similar vals. Learn more
lazeebee avatar
myApi
@lazeebee
An interactive, runnable TypeScript val by lazeebee
Script
export function myApi(name) {
return { "ale": 1 };
kutasartem avatar
createHorror3DGame
@kutasartem
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
'Roguelike'
function AIGameBuilderLanding() {
const [activeSection, setActiveSection] = useState('home');
try {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
if (!gameMechanic) {
- Potential monetization or player engagement strategy`;
const response = await openai.chat.completions.create({
model: "gpt-4o-mini",
try {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const response = await openai.chat.completions.create({
model: "gpt-4o-mini",
</div>
function client() {
const root = document.getElementById("root");
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request) {
return new Response(`
isidentical avatar
falImageHandler
@isidentical
An interactive, runnable TypeScript val by isidentical
HTTP
// Can also be auto-configured using environment variables:
credentials: Deno.env.get("FAL_KEY"),
export default async function(req: Request): Promise<Response> {
const { prompt } = await req.json();
const result: any = await fal.run("fal-ai/fast-lightning-sdxl", { input: { prompt } });
jonataaroeira avatar
webgen
@jonataaroeira
To-dos: Spruce up styles a bit Write this README ~Add a cache!~ ~Try moving style tag to the bottom by prompting so content appears immediately and then becomes styled~ didn't work b/c CSS parsing isn't progressive Need more prompting to get the model not to generate placeholder-y content Better root URL page / index page with links to some good sample generations
HTTP
let pageDescriptionInstructions = "";
let pageResult = "";
// // 2. Do one OpenAI inference to expand that URL to a longer page description
const pageDescriptionStream = await togetherAI.inference("mistralai/Mixtral-8x7B-Instruct-v0.1", {
prompt: `
yawnxyz avatar
buildclubProjectSearch
@yawnxyz
Use embeddings / Lunr search on Airtable. Embeddings need to have been generated / stored on Airtable, or this gets very slow / costly. Simple usage: https://yawnxyz-buildclubprojectsearch.web.val.run/search?query=cars Full GET request: https://yawnxyz-buildclubprojectsearch.web.val.run/search?query=your+search+query&similarity_threshold=0.8&max_results=5&base_id=your_base_id&table_name=your_table_name&content_column=your_content_column&embedding_column=your_embedding_column
HTTP
const defaultContentColumn = "Content";
const defaultEmbeddingColumn = "Embeddings";
async function fetchAirtableData(baseId, tableName, nameColumn, contentColumn, embeddingColumn) {
const base = new Airtable({ apiKey: airtableApiKey }).base(baseId);
const records = await base(tableName).select().all();
embeddingsContent: record.get('EmbeddingsContent'),
return documents;
async function searchDocuments(c, query, similarityThreshold) {
const baseId = c.req.query("base_id") || defaultBaseId;
const tableName = c.req.query("table_name") || defaultTableName;
vawogbemi avatar
characterGuesser
@vawogbemi
@jsxImportSource https://esm.sh/react
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function App() {
const [message, setMessage] = useState("Think of a character, then swipe right to start!");
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
const url = new URL(request.url);
adagradschool avatar
claude_share_html
@adagradschool
An interactive, runnable TypeScript val by adagradschool
Script
export default function handler(req) {
return new Response(
"\n <!DOCTYPE html>\n <html>\n <head>\n <title>Claude Chat Conversation</title>\n <meta charset=\"UTF-8\">
stevekrouse avatar
openAqNowcastAQI
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import { msHour } from "https://esm.town/v/stevekrouse/msHour";
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
export async function openAqNowcastAQI({ location_id }) {
const { results } = await fetchJSON(
"https://api.openaq.org/v2/measurements?" +
maxdrake avatar
chatGPTExample
@maxdrake
An interactive, runnable TypeScript val by maxdrake
Script
let repsonse_obj = await chatGPT(
"hello assistant",
tinue a conversation, you can pass in someting of the form: https://platform.openai.com/docs/guides/chat/introduction
API_KEY
let response_text = repsonse_obj.message;
omar12 avatar
myApi
@omar12
An interactive, runnable TypeScript val by omar12
Script
export function myApi(name) {
return "hi " + name;
websandbox avatar
createAPI
@websandbox
An interactive, runnable TypeScript val by websandbox
HTTP
"access-control-allow-origin": "*",
"access-control-allow-headers": "*",
export default async function(req: Request): Promise<Response> {
try {
if (req.method === "OPTIONS") {
dhvanil avatar
val_0eoDqjj87h
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_0eoDqjj87h(req) {
try {
// Execute the code directly and capture its result
roysarajit143 avatar
ALPHANUMERIC_TEXT_TOO_LONG
@roysarajit143
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import React, { useState } from "https://esm.sh/react@18.2.0";
function App() {
const [messages, setMessages] = useState([
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
if (request.method === "POST" && new URL(request.url).pathname === "/chat") {
try {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const { messages } = await request.json();
const completion = await openai.chat.completions.create({
messages: messages,
ethanniser avatar
myApi
@ethanniser
An interactive, runnable TypeScript val by ethanniser
Script
export function myApi(name) {
return "hi " + name;
stevekrouse avatar
falProxyRequest
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export async function falProxyRequest(req: Request) {
const method = req.method;
const body = method === "GET" || method === "HEAD" ? undefined : await req.text();