1
2
3
4
5
6
7
8
9
10
import process from "node:process";
import { OpenAI } from "npm:openai";
const openai = new OpenAI({ apiKey: process.env.openai });
let chatCompletion = await openai.chat.completions.create({
messages: [{ role: "user", content: "Make a short joke" }],
model: "gpt-3.5-turbo",
max_tokens: 15,
});
export let gptExample = chatCompletion.choices[0].message.content;
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 31, 2023