1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
23
24 const { text: gameIdeas } = await generateText({
25 model: openai("gpt-4o-mini"),
26 system: "You are a creative game designer.",
27 prompt: prompt.trim(),
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
23
24 const { text: gameIdeas } = await generateText({
25 model: openai("gpt-4o-mini"),
26 system: "You are a creative game designer.",
27 prompt: prompt,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
23
24 const { text: gameIdeas } = await generateText({
25 model: openai("gpt-4o-mini"),
26 system: "You are a creative game designer.",
27 prompt: prompt,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
21
22 const { text: gameIdeas } = await generateText({
23 model: openai("gpt-4o-mini"),
24 system: "You are a creative game designer.",
25 prompt: prompt,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: reflection } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a thoughtful and reflective assistant.",
16 prompt: "Reflect on the following user input and provide insights: " + body.user_input,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: reflection } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a thoughtful and insightful assistant.",
16 prompt: "Provide a detailed reflection on the following user input: " + body.user_input,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: insights } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a thoughtful assistant providing insights on user desires.",
16 prompt: "Reflect on the following user request and provide insights: " + body.user_input,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: insights } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a thoughtful analyst providing insights into user desires and needs.",
16 prompt: "Reflect on the following user input and provide insights into the underlying desires or needs: " + body.user_input,
375 const { query } = await request.json();
376
377 const { OpenAI } = await import("https://esm.town/v/std/openai");
378 const openai = new OpenAI();
379
380 const response = await openai.chat.completions.create({
381 messages: [
382 {
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3const openai = new OpenAI();
4const completion = await openai.chat.completions.create({
5 "messages": [
6 { "role": "user", "content": "Say hello in a creative way" },