Search

Results include substring matches and semantically similar vals. Learn more
stevekrouse avatar
unserializeableLogEx
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export let unserializeableLogEx = (async () => {
const { Configuration, OpenAIApi } = await import("npm:openai");
const configuration = new Configuration({
apiKey: process.env.openai,
const openai = new OpenAIApi(configuration);
console.log(openai);
odicho avatar
entireGoldLark
@odicho
An interactive, runnable TypeScript val by odicho
HTTP
$error: "Run completed without signaling end or error.",
export const service = (boardUrl: string, options?: ServiceOptions) => {
return async function(req: Request): Promise<Response> {
const url = new URL(req.url);
const path = url.pathname;
thomasatflexos avatar
createRelevantComment
@thomasatflexos
An interactive, runnable TypeScript val by thomasatflexos
Script
import { getOpenAiResponse } from "https://esm.town/v/thomasatflexos/getOpenAiResponse";
import { getRelevantContent } from "https://esm.town/v/thomasatflexos/getRelevantContent";
import process from "node:process";
\n IF you think that the Linkedin post is about new job opportunities, just respond with the text "N/A" and stop immedi
\n ELSE IF you think the Linkdedin post is not about new job opportunities, please proceed to a meaningful comment to t
let finalResponse = await getOpenAiResponse(PROMPT);
const { data1, error1 } = await supabase
.from("linkedin_seedings")
bingo16 avatar
newChatGPT35
@bingo16
An interactive, runnable TypeScript val by bingo16
Script
content: "请介绍一下你自己",
const getCompletion = async () => {
const response = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.openaiKey}`,
body: JSON.stringify(postData),
const data = await response.json();
prabhanshu avatar
claudeForwarder
@prabhanshu
// This val implements a function to call the Claude API using fetch.
HTTP
// This val implements a function to call the Claude API using fetch.
// It handles the API request and response processing.
// CORS is enabled for all origins.
export default async function server(req: Request): Promise<Response> {
// Handle preflight requests
"Access-Control-Allow-Origin": "*",
async function callClaudeApi(systemPrompt: string, userPrompt: string, apiKey: string): Promise<string> {
const url = "https://api.anthropic.com/v1/messages";
} catch (error) {
console.error("Error calling Claude API:", error);
throw error;
dhvanil avatar
val_RcFf3oHVQl
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_RcFf3oHVQl(req) {
try {
// Execute the code directly and capture its result
// Exploit proof-of-concept for matrix precision glitch
const exploitPrecisionGlitch = () => {
// Create a function that forces values into specific rational states
const forceValueSnap = (value, target) => {
// Use extremely high precision to force rational interpretation
nbbaier avatar
create_val
@nbbaier
An interactive, runnable TypeScript val by nbbaier
Script
import { api } from "https://esm.town/v/pomdtr/api";
import { BrowserContext } from "https://esm.town/v/pomdtr/browser";
export default async function(ctx: BrowserContext) {
const val = await fetchJSON("https://api.val.town/v1/vals", {
headers: {
janpaul123 avatar
blogPostEmbeddingsDimensionalityReduction
@janpaul123
An interactive, runnable TypeScript val by janpaul123
Script
import _ from "npm:lodash";
import OpenAI from "npm:openai";
export default async function blogPostEmbeddingsDimensionalityReduction() {
const points = [
"chat server integration",
const openai = new OpenAI();
async function getEmbedding(str) {
return (await openai.embeddings.create({
model: "text-embedding-3-large",
iamseeley avatar
exampleQuestionAnswering
@iamseeley
An interactive, runnable TypeScript val by iamseeley
HTTP
import Pipeline from "https://esm.town/v/iamseeley/pipeline";
export async function questionAnsweringHandler(req) {
if (req.method === "GET") {
return new Response(`
yawnxyz avatar
generateValCode
@yawnxyz
// import { openaiChatCompletion } from "https://esm.town/v/andreterron/openaiChatCompletion";
Script
// import { openaiChatCompletion } from "https://esm.town/v/andreterron/openaiChatCompletion";
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
export const generateValCode = async (
const lodash = await import('npm:lodash');
const response = await openai.chat.completions.create({
openaiKey: key,
organization: org,
role: "user",
content: `Here's the description of the function I want to write:
${description}
Please start writing the function now, and just write the function, no console.log required:
const message: string = response.choices[0].message.content;
prashamtrivedi avatar
reasoninghelper
@prashamtrivedi
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
function App() {
function client() {
export default async function server(request: Request): Promise<Response> {
const { OpenAI } = await import("npm:openai");
const { zodResponseFormat } = await import("npm:openai/helpers/zod");
const openai = new OpenAI();
console.log("OpenAI API Request:", { prompt, topic });
completion = await openai.beta.chat.completions.parse({
completion = await openai.beta.chat.completions.parse({
completion = await openai.beta.chat.completions.parse({
bluemsn avatar
modelSampleChatCall
@bluemsn
An interactive, runnable TypeScript val by bluemsn
Script
const builder = await getModelBuilder({
type: "chat",
provider: "openai",
const model = await builder();
const { SystemMessage, HumanMessage } = await import("npm:langchain/schema");
andreterron avatar
generateValCodeAPI
@andreterron
An interactive, runnable TypeScript val by andreterron
Script
export let generateValCodeAPI = (description: string) =>
generateValCode(
process.env.VT_OPENAI_KEY,
description,
patrickjm avatar
aiSarcasticMotivationalMessage
@patrickjm
An interactive, runnable TypeScript val by patrickjm
Script
"Emphasize a morbid sense of humor.",
].join("\n"),
openAiKey: process.env.openai_key,
adagradschool avatar
stirringCoffeeDonkey
@adagradschool
An interactive, runnable TypeScript val by adagradschool
HTTP
export default function handler(req) {
return new Response(`"\n <!DOCTYPE html>\n <html>\n <head>\n <title>Claude Chat Conversation</title
headers: {