Search

Results include substring matches and semantically similar vals. Learn more
janpaul123 avatar
valle_tmp_9571549127942918010434925760972602
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
import _ from "npm:lodash@4";
import OpenAI from "npm:openai";
import { renderToString } from "npm:react-dom/server";
const contextWindow: any = await valleGetValsContextWindow(model);
const openai = new OpenAI();
const stream = await openai.chat.completions.create({
model,
janpaul123 avatar
valle_tmp_1369396001916440808441248753827946
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
import _ from "npm:lodash@4";
import OpenAI from "npm:openai";
import { renderToString } from "npm:react-dom/server";
const contextWindow: any = await valleGetValsContextWindow(model);
const openai = new OpenAI();
const stream = await openai.chat.completions.create({
model,
janpaul123 avatar
valle_tmp_202239440460780356420276977660784
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
import _ from "npm:lodash@4";
import OpenAI from "npm:openai";
import { renderToString } from "npm:react-dom/server";
const contextWindow: any = await valleGetValsContextWindow(model);
const openai = new OpenAI();
const stream = await openai.chat.completions.create({
model,
nbbaier avatar
VALLE
@nbbaier
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 (deprecated)
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
import _ from "npm:lodash@4";
import OpenAI from "npm:openai";
import { renderToString } from "npm:react-dom/server";
const contextWindow: any = await valleGetValsContextWindow(model);
const openai = new OpenAI();
const stream = await openai.chat.completions.create({
model,
seflless avatar
twitterAlert
@seflless
Daily Twitter "Important Updates" Digest You like getting important updates from Twitter—new projects or writing or companies to learn about. But you don't like being addicted to the feed constantly. This val lets you get daily updates from specific people you want to follow closely. It uses AI to filter out random shitposts and only get the important updates. 1. Authentication You'll need a Twitter Bearer Token. Follow these instructions to get one. Unfortunately it costs $100 / month to have a Basic Twitter Developer account. If you subscribe to Val Town Pro, you can ask Steve Krouse to borrow his token. Also rate limits seem really severe which limits how useful this is :( Need to figure out workarounds... 2. Query Update the list of usernames to people you care about; change the AI prompt if you want different filtering. 3. Notification Sends a daily email. Todos: this should filter the twitter API call to only tweets since the last run. some kind of caching to avoid rate limiting would be nice to use the user's feed instead of a username list... but not sure how easy that is
Cron
import { email } from "https://esm.town/v/std/email?v=12";
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
// "sliminality",
const openai = new OpenAI();
export async function twitterAlert({ lastRunAt }: Interval) {
async function filterTweets(tweets) {
const completion = await openai.chat.completions.create({
messages: [
yawnxyz avatar
valwriter
@yawnxyz
Doesn't seem to work on val.town, should work in principle
HTTP (deprecated)
/** @jsxImportSource npm:hono@3/jsx */
import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
import { chat } from "https://esm.town/v/stevekrouse/openai";
import cronstrue from "npm:cronstrue";
import { Hono } from "npm:hono@3";
janpaul123 avatar
valle_tmp_1232975987134350426195802232196885
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
import _ from "npm:lodash@4";
import OpenAI from "npm:openai";
import { renderToString } from "npm:react-dom/server";
const contextWindow: any = await valleGetValsContextWindow(model);
const openai = new OpenAI();
const stream = await openai.chat.completions.create({
model,
janpaul123 avatar
VALLErun
@janpaul123
The actual code for VALL-E: https://www.val.town/v/janpaul123/VALLE
HTTP (deprecated)
import { sleep } from "https://esm.town/v/stevekrouse/sleep?v=1";
import { anthropic } from "npm:@ai-sdk/anthropic";
import { openai } from "npm:@ai-sdk/openai";
import ValTown from "npm:@valtown/sdk";
import { StreamingTextResponse, streamText } from "npm:ai";
let vercelModel;
if (model.includes("gpt")) {
vercelModel = openai(model);
} else {
vercelModel = anthropic(model);
zzz avatar
ListenTo
@zzz
// https://api.val.town/v1/express/zzz.ListenTo?val=stevekrouse.whatIsValTown
Script
// https://api.val.town/v1/express/zzz.ListenTo?val=stevekrouse.whatIsValTown
export async function ListenTo(req, res) {
const { val = "zzz.demoOpenAIGPT4Summary" } = req.query;
const url = `https://api.val.town/v1/run/${val.replace("@", "")}`
const resp = await fetch(url);
willthereader avatar
InventionDetailstoJSONConverter
@willthereader
@jsxImportSource https://esm.sh/react
HTTP
try {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const { blob } = await import("https://esm.town/v/std/blob");
const openai = new OpenAI();
const body = await request.json();
try {
const completion = await openai.chat.completions.create({
messages: [
stevekrouse avatar
blueOwl
@stevekrouse
The actual code for VALL-E: https://www.val.town/v/janpaul123/VALLE
HTTP (deprecated)
import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
import { anthropic } from "npm:@ai-sdk/anthropic";
import { openai } from "npm:@ai-sdk/openai";
import ValTown from "npm:@valtown/sdk";
import { StreamingTextResponse, streamText } from "npm:ai";
let vercelModel;
if (model.startsWith("gpt")) {
vercelModel = openai(model);
} else {
vercelModel = anthropic(model);
all avatar
townGen
@all
townGen [[https://www.val.town/v/all/promptGen]] [[https://www.val.town/v/stevekrouse/valwriter]] Note : It looks like openai enhancement was dropped at some point when adding all the gizmos;
HTTP
- [[https://www.val.town/v/stevekrouse/valwriter]]
- _Note_: It looks like openai enhancement was dropped at some point when adding all the gizmos;
iamseeley avatar
templateModalTest
@iamseeley
An interactive, runnable TypeScript val by iamseeley
HTTP (deprecated)
<path stroke-linecap="round" stroke-linejoin="round" d="M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.1
</svg>
<div class="font-semibold group-hover:text-black">OpenAI chat completion</div>
</button>
<button class="group bg-gray-50 border-gray-300 flex items-center gap-2 overflow-hidden rounded border p-3 text-l
ejfox avatar
extremePlumCaribou
@ejfox
@jsxImportSource https://esm.sh/react
HTTP
headers: { 'Content-Type': 'application/json' }
// Generate new emoji using OpenAI
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: `Generate a single emoji that best represents "${name}". Respond with only the em
janpaul123 avatar
valle_tmp_54185991019187464068579562776686
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
import _ from "npm:lodash@4";
import OpenAI from "npm:openai";
import { renderToString } from "npm:react-dom/server";
const contextWindow: any = await valleGetValsContextWindow(model);
const openai = new OpenAI();
const stream = await openai.chat.completions.create({
model,