Search

Results include substring matches and semantically similar vals. Learn more
xsec avatar
ChatGPTTextDefinitionUserscript
@xsec
// @name Improved ChatGPT Text Definition
Script
// Configuration
const API_CONFIG = {
url: "https://willthereader-openaidefiner.web.val.run",
method: "POST",
mode: "cors",
cosmo avatar
get_weather_message
@cosmo
An interactive, runnable TypeScript val by cosmo
Script
import { chat } from "https://esm.town/v/cosmo/chat_openai";
import { getCurrentWeather } from "https://esm.town/v/cosmo/get_current_weather";
export async function getWeatherMessage(apiKey, latitude, longitude) {
janpaul123 avatar
getValsContextWindow
@janpaul123
An interactive, runnable TypeScript val by janpaul123
Script
el.attributes.filter(a => a.name === "href").map(a => a.value)
prompt: "Write a val that uses OpenAI",
code: `import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
"messages": [
elsif_maj avatar
topHNThreadByHour
@elsif_maj
// set at Thu Nov 30 2023 14:22:53 GMT+0000 (Coordinated Universal Time)
Email
// set at Thu Nov 30 2023 14:22:53 GMT+0000 (Coordinated Universal Time)
for 18:00 is: The Midwit Smart Home","Top thread on Hackernews for 19:00 is: OpenAI is too cheap to beat","Top thread on Hack
jxnblk avatar
VALLErun
@jxnblk
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);
roadlabs avatar
valleGetValsContextWindow
@roadlabs
An interactive, runnable TypeScript val by roadlabs
Script
el.attributes.filter(a => a.name === "href").map(a => a.value)
prompt: "Write a val that uses OpenAI",
code: `import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
"messages": [
stevekrouse avatar
cron
@stevekrouse
CronGPT This is a minisite to help you create cron expressions, particularly for crons on Val Town. It was inspired by Cron Prompt , but also does the timezone conversion from wherever you are to UTC (typically the server timezone). Tech Hono for routing ( GET / and POST /compile .) Hono JSX HTMX (probably overcomplicates things; should remove) @stevekrouse/openai, which is a light wrapper around @std/openai I'm finding HTMX a bit overpowered for this, so I have two experimental forks without it: Vanilla client-side JavaScript: @stevekrouse/cron_client_side_script_fork Client-side ReactJS (no SSR): @stevekrouse/cron_client_react_fork I think (2) Client-side React without any SSR is the simplest architecture. Maybe will move to that.
HTTP
* HTMX (probably overcomplicates things; should remove)
* @stevekrouse/openai, which is a light wrapper around @std/openai
I'm finding HTMX a bit overpowered for this, so I have two experimental forks without it:
/** @jsxImportSource npm:hono@3/jsx */
import { chat } from "https://esm.town/v/stevekrouse/openai";
import cronstrue from "npm:cronstrue";
import { Hono } from "npm:hono@3";
cofsana avatar
VALLErun
@cofsana
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);
arash2060 avatar
VALLErun
@arash2060
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);
jesi_rgb avatar
email_weather
@jesi_rgb
* This val will create a daily weather email service. * It uses the OpenWeatherMap API to fetch weather data and the Val Town email API to send emails. * The val will be triggered daily using a cron job.
Cron
import { email } from "https://esm.town/v/std/email";
import { OpenAI } from "https://esm.town/v/std/openai";
const OPENWEATHERMAP_API_KEY = Deno.env.get("WEATHER_API_KEY");
async function generateEmailContent(weatherData) {
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
ubyk avatar
VALLErun
@ubyk
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);
ejfox avatar
VALLErun
@ejfox
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);
stevekrouse avatar
cron_client_react_fork
@stevekrouse
CronGPT This is a minisite to help you create cron expressions, particularly for crons on Val Town. It was inspired by Cron Prompt , but also does the timezone conversion from wherever you are to UTC (typically the server timezone). Tech Hono for routing ( GET / and POST /compile .) Hono JSX HTML (probably overcomplicates things; should remove) @stevekrouse/openai, which is a light wrapper around @std/openai TODO [ ] simplify by removing HTMX (try doing the form as a GET request, manual JS script, or client side react) [ ] make the timezone picker better (fewer options, searchable) [ ] add a copy button?
HTTP (deprecated)
* HTML (probably overcomplicates things; should remove)
* @stevekrouse/openai, which is a light wrapper around @std/openai
## TODO
import cronstrue from "https://esm.sh/cronstrue";
import React, { useState } from "https://esm.sh/react@18.2.0";
import { chat } from "https://esm.town/v/stevekrouse/openai?v=19";
import react_http from "https://esm.town/v/stevekrouse/react_http?v=6";
export default function(req: Request) {
stevekrouse avatar
valleGetValsContextWindow
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP
el.attributes.filter(a => a.name === "href").map(a => a.value)
prompt: "Write a val that uses OpenAI",
code: `import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
"messages": [
stevekrouse avatar
cron2
@stevekrouse
@jsxImportSource npm:hono@3/jsx
HTTP (deprecated)
/** @jsxImportSource npm:hono@3/jsx */
import { chat } from "https://esm.town/v/stevekrouse/openai";
import cronstrue from "npm:cronstrue";
import { Hono } from "npm:hono@3";