Search

Results include substring matches and semantically similar vals. Learn more
faseeu avatar
lang_code
@faseeu
@jsxImportSource https://esm.sh/react
HTTP
import { OpenAI } from "https://esm.town/v/std/openai";
private openai: OpenAI;
this.openai = new OpenAI();
const completion = await this.openai.chat.completions.create({
const completion = await this.openai.chat.completions.create({
const completion = await this.openai.chat.completions.create({
function App() {
async function handleSubmit(e: React.FormEvent) {
function client() {
export default async function server(req: Request): Promise<Response> {
vladimyr avatar
activityPubAgent
@vladimyr
// SPDX-License-Identifier: 0BSD
HTTP
pkcs8: privateKeyPem,
publicKeyId,
export default async function(req: Request): Promise<Response> {
const { pathname, searchParams } = new URL(req.url);
const query = Object.fromEntries(searchParams.entries());
pomdtr avatar
silverAardwolf
@pomdtr
An interactive, runnable TypeScript val by pomdtr
HTTP
export default function() {
return Response.json(Deno.args);
calebmabry avatar
moccasinPrimate
@calebmabry
An interactive, runnable TypeScript val by calebmabry
HTTP
export default async function (req: Request): Promise<Response> {
return Response.json({ ok: true })
dhvanil avatar
val_wzsgIq92EP
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_wzsgIq92EP(req) {
try {
// Execute the code directly and capture its result
marianoguerra avatar
run
@marianoguerra
An interactive, runnable TypeScript val by marianoguerra
Script
export async function run(req: express.Request, res: express.Response) {
let c = (
s,
joemccourt avatar
myApi
@joemccourt
An interactive, runnable TypeScript val by joemccourt
Script
export function myApi(name) {
return "hi " + name + " fobar";
dhvanil avatar
val_pDTI0pItut
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_pDTI0pItut(req) {
try {
// Execute the code directly and capture its result
heathergliffin avatar
DailyDaughterNotes
@heathergliffin
* This app generates cute daily notes for a daughter using OpenAI's GPT model. * It stores the generated notes in SQLite for persistence and displays them on a simple web interface. * The app uses React for the frontend and Deno's runtime environment in Val Town for the backend.
HTTP
* This app generates cute daily notes for a daughter using OpenAI's GPT model.
* It stores the generated notes in SQLite for persistence and displays them on a simple web interface.
import { createRoot } from "https://esm.sh/react-dom/client";
function App() {
const [note, setNote] = useState("");
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
async function server(request: Request): Promise<Response> {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
} else if (path === "/generate-note" && request.method === "POST") {
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
easrng avatar
playground
@easrng
playground edit, run, and embed vals without requiring an account (or even js enabled!) caveats: logs don't stream I haven't set up codemirror only script vals supported everything else should be fully functional. you can prefill the editor with code: https://easrng-playground.web.val.run/?code=console.log(1) a val: https://easrng-playground.web.val.run/?load=easrng/playground some other url: https://easrng-playground.web.val.run/?load=https://any/other/url
HTTP
everything else should be fully functional.
function flush() {
function transpose(matrix) {
|| (typeof value !== "function" && typeof value !== "object");
at {item.functionName
{item.functionName} ({file})
async function execute(code: string): Promise<{ logs: Log[] }> {
function cleanStack(stack: string) {
if (typeof real === "function" && typeof key === "string") {
const fn = function(...args: any[]) {
async function run() {
dhvanil avatar
val_AIvQijAexn
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_AIvQijAexn(req) {
try {
// Execute the code directly and capture its result
tangshengnan avatar
myApi
@tangshengnan
An interactive, runnable TypeScript val by tangshengnan
Script
export function myApi(req, res) {
res.set("Content-Type", "application/json");
res.send([{ value: "wangtianbao", url: "https://www.967111.net" }]);
stevekrouse avatar
serverlessMatrixEchoBot2
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export async function serverlessMatrixEchoBot2(req, res) {
console.log(req.path);
res.send("<h1>working!</h1>");
camajudson avatar
handleDiscordInteraction
@camajudson
Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
HTTP
mmands, you have to run a separate bit of code. This is for modifying their functionality
req.headers.get("X-Signature-Ed25519"),
req.headers.get("X-Signature-Timestamp"),
// Get the user calling this slash command
const userId = await body.member?.user?.id;
if (bank[userId] === undefined) bank[userId] = starting_amount;
oziau avatar
myApi
@oziau
An interactive, runnable TypeScript val by oziau
Script
export function myApi(name) {
return "hi " + name;