Back
Version 29
7/18/2024
import { zip } from "https://esm.town/v/pomdtr/sql";
import { db } from "https://esm.town/v/sqlite/db";
import OpenAI from "npm:openai";
async function getVals(username, type, limit) {
const res = await db.execute({
sql: `
SELECT * FROM vals
where
author_username = ?
AND type = ?
LIMIT ?
`,
args: [
username,
type,
limit,
],
});
return zip(res);
}
async function checkHTTPPreviewUpgrade(code) {
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{
role: "system",
content: `
We built a new runtime for HTTP vals that is much faster at scale.
Your job is to input code from the old runtime and ensure the behavior is the same
in the new runtime.
Up until now, every time a val it starts a new Deno process and installs all dependencies from scratch.
Updated: July 18, 2024