Search

Results include substring matches and semantically similar vals. Learn more
tgrv avatar
VALLE
@tgrv
VALL-E LLM code generation for vals! Make apps with a frontend, backend, and database. It's a bit of work to get this running, but it's worth it. Fork this val to your own profile. Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in tempValsParentFolderId . If you want to use OpenAI models you need to set the OPENAI_API_KEY env var . If you want to use Anthropic models you need to set the ANTHROPIC_API_KEY env var . Create a Val Town API token , open the browser preview of this val, and use the API token as the password to log in.
HTTP
* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-v
* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environ
CoachCompanion avatar
curiousTurquoiseDormouse
@CoachCompanion
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
console.warn("YouTube API key (YOUTUBE_API_KEY2) is not set. Falling back to search URL method.");
const { OpenAI } = await import("https://esm.town/v/std/openai");
const regenerateKey = request.headers.get("Regenerate-Key") || "0";
const openai = new OpenAI();
const { sport, skillLevel, ageGroup, groupSize, selectedTopics, sessionDuration } = await request.json();
Ensure that the conclusion ties together all the main concepts covered in the training, reinforces the learning objective
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: prompt + `\n\nRegenerate key: ${regenerateKey}` }],
seflless avatar
weatherGPT
@seflless
If you fork this, you'll need to set OPENAI_API_KEY in your Val Town Secrets .
HTTP
If you fork this, you'll need to set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
return !data ? <p>Loading...</p> : <p>{data}</p>;
export default async function weatherGPT(req: Request) {
const { OpenAI } = await import("npm:openai");
if (new URL(req.url).pathname === "/data") {
return Response.json({
thesephist avatar
webgen
@thesephist
Made on Val Town livestream. This project is a kind of a mini tribute to Websim . 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
import { blob } from "https://esm.town/v/std/blob?v=12";
import OpenAI from "npm:openai";
const openai = new OpenAI();
const getCacheKey = (url: string): string => {
let pageResult = "";
// // 2. Do one OpenAI inference to expand that URL to a longer page description
const pageDescriptionStream = await openai.chat.completions.create({
model: "gpt-4o",
// 3. Generate the page
const stream = await openai.chat.completions.create({
model: "gpt-4o",
ejfox avatar
umap
@ejfox
UMAP Dimensionality Reduction API This is a high-performance dimensionality reduction microservice using UMAP (Uniform Manifold Approximation and Projection). It provides an efficient way to reduce high-dimensional data to 2D or 3D representations, making it easier to visualize and analyze complex datasets. When to Use This Service Visualizing high-dimensional data in 2D or 3D space Reducing dimensionality of large datasets for machine learning tasks Exploring relationships and clusters in complex data Preprocessing step for other machine learning algorithms Common Use Cases Visualizing word embeddings in a scatterplotcs Exploring customer segmentation in marketing analytics Visualizing image embeddings in computer vision tasks
HTTP
<div class="example">
<h3>Example with OpenAI Embeddings:</h3>
<p>This example shows how to use the UMAP service with OpenAI embeddings:</p>
<pre>
// First, generate embeddings using OpenAI API
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
async function getEmbeddings(texts) {
const response = await openai.embeddings.create({
model: "text-embedding-ada-002",
// Then, use these embeddings with the UMAP service
const texts = ["Hello world", "OpenAI is amazing", "UMAP reduces dimensions"];
const embeddings = await getEmbeddings(texts);
stevekrouse avatar
chatGPTPlugin
@stevekrouse
ChatGPT Plugin for Val Town Run code on Val Town from ChatGPT. Usage I haven't been able to get it to do very useful things yet. It certainly can evaluate simple JS code: It would be awesome if it knew how to use other APIs and make fetch calls to them, but it has been failing at that . Limitations This plugin currently only has unauthenticated access to POST /v1/eval, which basically means that all it can do is evaluate JavaScript or TypeScript. In theory it could refer to any existing vals in Val Town, but it wouldn't know about those unless you told it. Future directions Once we have more robust APIs to search for existing vals, this plugin could be WAY more valuable! In theory GPT4 could first search for vals to do a certain task and then if it finds one it could then write code based on that val. In practice however, that might require too many steps for poor GPT. We might need to use some sort of agent or langchain thing if we wanted that sort of behavior. Adding authentication could also enable it to make requests using your secrets and private vals and create new vals for you. However I am dubious that this would actually be practically useful. Installation Select GPT-4 (requires ChatGPT Plus) Click No plugins enabled Click "Install an unverified plugin" or "Develop your own plugin" (I'm not sure the difference) Paste in this val's express endpoint https://stevekrouse-chatGPTPlugin.express.val.run Click through the prompts until it's installed
Express (deprecated)
![](https://i.imgur.com/lLUAcVc.png)
d make `fetch` calls to them, but it has been [failing at that](https://chat.openai.com/share/428183eb-8e6d-4008-b295-f3b0ef2
## Limitations
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
import { openaiOpenAPI } from "https://esm.town/v/stevekrouse/openaiOpenAPI";
// https://stevekrouse-chatgptplugin.express.val.run/.well-known/ai-plugin.json
// only POST /v1/eval for now
res.send(openaiOpenAPI);
else if (req.path === "/v1/eval") {
roysarajit143 avatar
photoEditingAIApp
@roysarajit143
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
const { blob } = await import("https://esm.town/v/std/blob");
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
if (request.method === 'POST') {
const { prompt } = await request.json();
const response = await openai.images.generate({
model: "dall-e-3",
abar04 avatar
weatherGPT
@abar04
Cron
import { email } from "https://esm.town/v/std/email?v=11";
import { OpenAI } from "npm:openai";
let location = "Perth WA";
).then(r => r.json());
const openai = new OpenAI();
let chatCompletion = await openai.chat.completions.create({
messages: [{
peterzakin avatar
VALLE
@peterzakin
Fork it and authenticate with your Val Town API token as the password. Needs an OPENAI_API_KEY env var to be set, and change the variables under "Set these to your own". https://x.com/JanPaul123/status/1812957150559211918
HTTP
it and authenticate with your Val Town API token as the password. Needs an `OPENAI_API_KEY` env var to be set, and change th
https://x.com/JanPaul123/status/1812957150559211918
Handlethis avatar
helpfulFuchsiaAmphibian
@Handlethis
@jsxImportSource https://esm.sh/react
HTTP
// Generate AI audio description
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const audioDescCompletion = await openai.chat.completions.create({
messages: [{
websrai avatar
aigeneratorblog
@websrai
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
const AI_PROVIDERS = [
"OpenAI",
"Anthropic",
const [adContent, setAdContent] = useState("");
const [selectedProvider, setSelectedProvider] = useState("OpenAI");
const [apiKey, setApiKey] = useState("");
setUser(userData);
setSelectedProvider(userData.aiProvider || "OpenAI");
setApiKey(userData.apiKey || "");
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const SCHEMA_VERSION = 2;
VALUES (?, ?, ?, ?, ?)
`, ["Demo User", "FREE", 0, "OpenAI", ""]);
user = (await sqlite.execute(`SELECT * FROM ${KEY}_users_${SCHEMA_VERSION} LIMIT 1`)).rows[0];
headers: { "Content-Type": "application/json" }
// Generate content using OpenAI
const completion = await openai.chat.completions.create({
messages: [
websrai avatar
seoKeywordResearchTool
@websrai
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
const AI_PROVIDERS = [
"OpenAI",
"Anthropic",
const [adContent, setAdContent] = useState("");
const [selectedProvider, setSelectedProvider] = useState("OpenAI");
const [apiKey, setApiKey] = useState("");
setUser(userData);
setSelectedProvider(userData.aiProvider || "OpenAI");
setApiKey(userData.apiKey || "");
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const SCHEMA_VERSION = 2;
VALUES (?, ?, ?, ?, ?)
`, ["Demo User", "FREE", 0, "OpenAI", ""]);
user = (await sqlite.execute(`SELECT * FROM ${KEY}_users_${SCHEMA_VERSION} LIMIT 1`)).rows[0];
headers: { "Content-Type": "application/json" }
// Generate content using OpenAI
const completion = await openai.chat.completions.create({
messages: [
stevekrouse avatar
VALLE
@stevekrouse
Fork it and authenticate with your Val Town API token as the password. Needs an OPENAI_API_KEY env var to be set, and change the variables under "Set these to your own". https://x.com/JanPaul123/status/1812957150559211918
HTTP
it and authenticate with your Val Town API token as the password. Needs an `OPENAI_API_KEY` env var to be set, and change th
https://x.com/JanPaul123/status/1812957150559211918
dnishiyama avatar
dailySlackStandup
@dnishiyama
// Depending on the day do one of these:
Cron
import { fetch } from "https://esm.town/v/std/fetch";
import { OpenAI } from "https://esm.town/v/std/openai";
import process from "node:process";
const openai = new OpenAI();
// Depending on the day do one of these:
console.log(prompt);
const completion = await openai.chat.completions.create({
messages: [
carts avatar
motionlessPurpleBat
@carts
An interactive, runnable TypeScript val by carts
HTTP
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
const prompt = "Tell me a dad joke. Format the response as JSON with 'setup' and 'punchline' keys.";
export default async function dailyDadJoke(req: Request): Response {
const openai = new OpenAI();
const resp = await openai.chat.completions.create({
messages: [
ā€¦
18
ā€¦
Next