1
2
3
4
5
6
7
8
9
import { OpenAI } from "npm:openai";
const openai = new OpenAI();
let chatCompletion = await openai.chat.completions.create({
messages: [{ role: "user", content: "Teach me a word I don't know" }],
model: "gpt-4-1106-preview",
max_tokens: 30,
});
export const gpt4TurboExample= 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!
November 7, 2023