1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
18
19 const { text } = await generateText({
20 model: openai("gpt-4o-mini"),
21 system: "You are a creative turtle name generator. Generate only the name, no explanation.",
22 prompt: prompt,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
14
15 const { text } = await generateText({
16 model: openai("gpt-4o-mini"),
17 system: "You are a creative turtle-naming expert with a great sense of humor.",
18 prompt: `Generate a funny and creative name for a turtle. ${
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
20
21 const { text } = await generateText({
22 model: openai("gpt-4"),
23 system: "You are an expert at explaining complex topics in a way that resonates with young professionals in their mid-twenties.",
24 prompt: `Explain ${topic} as if talking to a 25-year-old young professional. Use casual but intelligent language, modern references, and relatable examples. The explanation should be comprehensive but not overly academic.`,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
29
30 const { text } = await generateText({
31 model: openai("gpt-4"),
32 system: "You are a 150-year-old person from the 1870s explaining modern topics.",
33 prompt: prompt,
1import { openai } from "npm:@ai-sdk/openai"; // Ensure OPENAI_API_KEY environment variable is set
2
3export default async function(req: Request): Promise<Response> {
16 Include 2-3 relevant emojis.`;
17
18 const response = await openai.chat.completions.create({
19 model: "gpt-3.5-turbo",
20 messages: [
37 async function generateHeadlines() {
38 try {
39 const { OpenAI } = await import("https://esm.town/v/std/openai");
40 const openai = new OpenAI();
41
42 const response = await openai.chat.completions.create({
43 messages: [
44 {
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function server(request: Request): Promise<Response> {
11 const { name } = await request.json();
12
13 // Initialize OpenAI
14 const openai = new OpenAI();
15
16 // Use GPT to parse the name
17 const completion = await openai.chat.completions.create({
18 messages: [
19 {
1import { openai } from "npm:@ai-sdk/openai"; // Ensure OPENAI_API_KEY environment variable is set
2import { generateText } from "npm:ai";
3
19
20 const { text } = await generateText({
21 model: openai("o1"),
22 system: "You create agent code",
23 prompt: `
1import { openai } from "npm:@ai-sdk/openai"; // Ensure OPENAI_API_KEY environment variable is set
2import { generateText } from "npm:ai";
3
15
16 const { text } = await generateText({
17 model: openai("gpt-4o-mini"),
18 system:
19 "You are a CIA AGENT, that works at DARPA, you understand the intricate nature of how easy it is to hack shit.",
1#!/usr/bin/env node
2
3import { openai } from "npm:@ai-sdk/openai";
4import { experimental_generateImage as generateImage } from "npm:ai";
5
47 try {
48 imageResult = await generateImage({
49 model: openai.image("dall-e-3"),
50 prompt: meme_idea,
51 });