Back
Version 2
4/3/2023
export const getJoke = (async () => {
const openai = await import("npm:openai");
const result = await openai.ChatCompletion.create({
model: "gpt-3.5-turbo",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Tell me a joke." },
],
});
return result.choices[0].message.content;
})();
Updated: October 23, 2023