Search

Results include substring matches and semantically similar vals. Learn more
sar avatar
myApi
@sar
An interactive, runnable TypeScript val by sar
Script
export function myApi(name) {
return "hi " + name;
rolling_coaster avatar
myApi
@rolling_coaster
An interactive, runnable TypeScript val by rolling_coaster
Script
export function myApi(name) {
return "hi " + name;
dhvanil avatar
val_8kG24m9t0L
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_8kG24m9t0L(req) {
try {
// Execute the code directly and capture its result
nerdymomocat avatar
add_to_notion_w_ai_webpage
@nerdymomocat
Example usage of the add_to_notion_w_ai val Try with the money database . Read and watch the demo run here
HTTP
import OpenAI from "npm:openai";
const oai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY ?? undefined,
function createPrompt(title, description, properties) {
function processProperties(jsonObject) {
async function get_and_save_notion_db_processed_properties(databaseId)
async function get_notion_db_info(databaseId) {
async function get_and_save_notion_db_info(databaseId) {
function createZodSchema(filteredProps) {
function convertToNotionProperties(responseValues, filteredProps) {
tr3ntg avatar
myApi
@tr3ntg
An interactive, runnable TypeScript val by tr3ntg
Script
export function myApi(name) {
return "hi " + name;
anthonyec avatar
spotify
@anthonyec
// Uncomment this line for one run of the Val to create the DB lol
HTTP
} catch (e) {
return c.json({ error: "Failed callback" + e });
async function getToken(c) {
const state = c.req.query("state") as string;
const authData = await db.select().from(table).where(eq(table.id, state)).limit(1);
yawnxyz avatar
pageshot
@yawnxyz
// Inlined content from ./middleware.js
HTTP
"settings": {
"model": "gpt-4o-mini",
"provider": "openai",
"system": "please summarize the following article in a 2-4 sentences, describing it from a 3rd person point of vi
"prompt": "{jina.content}"
dhvanil avatar
val_oXSqoQ1L7X
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_oXSqoQ1L7X(req) {
try {
const result = await (async () => {
function generateArrayProblems() {
const problems = [
"Implement a function to find the missing number in an array of 1 to N",
"Write a function to rotate an array by k positions",
"Create a function to merge two sorted arrays",
"Implement a function to find the longest increasing subsequence",
"Write a function to find pairs in array with sum equal to target"
return problems;
stevekrouse avatar
testMutateSemantics
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import process from "node:process";
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
export async function testMutateSemantics({
stateName,
api,
dhvanil avatar
val_tBJyCZliwe
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_tBJyCZliwe(req) {
try {
// Execute the code directly and capture its result
shivaanneu avatar
moccasinTahr
@shivaanneu
// Fetches a random joke.
Cron
// ... imports ...
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
mrfabbri avatar
myApi
@mrfabbri
An interactive, runnable TypeScript val by mrfabbri
HTTP
export function myApi(name) {
return "hi " + name;
andycoupe avatar
myApi
@andycoupe
An interactive, runnable TypeScript val by andycoupe
Script
export function myApi(name) {
return "hi " + name;
henni avatar
myApi
@henni
An interactive, runnable TypeScript val by henni
Script
export function myApi(name) {
return "hi " + name;
neverstew avatar
alias
@neverstew
An interactive, runnable TypeScript val by neverstew
Script
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export function alias<P extends Params>(params: P): Promise<Result<P>> {
const username = params.username;
let url = `https://api.val.town/v1/alias/${username}`;