1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
13 const interactionsText = body.interactions.join("\n");
14 const { text: personalityProfile } = await generateText({
15 model: openai("gpt-4o-mini"),
16 system: "You are a personality analyst.",
17 prompt: "Based on the following user interactions, identify patterns and summarize the user's personality traits: " + interactionsText,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
15
16 const { text: codeAnalysis } = await generateText({
17 model: openai("gpt-4o-mini"),
18 system: "You are a code quality and complexity analyst.",
19 prompt: `Analyze the following codebase for quality, complexity, and structure: ${codebase}. Include metrics such as the number of files, lines of code, and code complexity.`,
21
22 const { text: skillAssessment } = await generateText({
23 model: openai("gpt-4o-mini"),
24 system: "You are an expert in assessing programming skills.",
25 prompt: `Based on the following questions and answers, estimate the user's skill level and experience: ${questions}. Consider topics like programming languages used, frameworks, and previous projects.`,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: haiku } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a poet creating haikus.",
16 prompt: `Create a haiku about the following topic: ${body.topic}. The haiku should follow the 5-7-5 syllable structure.`,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: analysis } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are an expert in identifying logical fallacies.",
16 prompt: "Analyze the following text for common logical fallacies such as ad hominem, straw man, slippery slope, etc.: " + body.text,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: dietSuggestion } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are an expert zoologist.",
16 prompt:
1import { openai } from "npm:@ai-sdk/openai";
2import ValTown from "npm:@valtown/sdk";
3import { generateObject, generateText } from "npm:ai";
70 const generateImplStart = Date.now();
71 const { text: implementation } = await generateText({
72 model: openai("gpt-4o"),
73 system: `
74# VALTOWN HTTP Cloud Function Generator Prompt
965. **AI API Integration (if applicable)**:
97 - If the toolDescription indicates that creative enrichment or additional processing via AI is needed, integrate an AI API call into the function.
98 - Import { openai } from "npm:@ai-sdk/openai" and { generateText } from "npm:ai".
99 - Use the model "gpt-4o-mini".
100 - Construct a detailed, context-appropriate prompt for the AI call and integrate its response into the function’s output.
122
123---typescript
124import { openai } from "npm:@ai-sdk/openai";
125import { generateText } from "npm:ai";
126
135 }
136 const { text: analysis } = await generateText({
137 model: openai("gpt-4o-mini"),
138 system: "You are a creative code analyst.",
139 prompt: "Analyze the following recent changes in the code: " + body.recent_changes,
233
234 const { object: manifestoConfig } = await generateObject({
235 model: openai("gpt-4o"),
236 schema: z.object({
237 manifestoConfigPureJson: z.string(),
293
294 const { object: updatedManifestoConfigTypescript } = await generateObject({
295 model: openai("gpt-4o"),
296 system: promptForUpdatedManifest,
297 schema: z.object({
1import { openai } from "npm:@ai-sdk/openai";
2import ValTown from "npm:@valtown/sdk";
3import { generateObject, generateText } from "npm:ai";
70 const generateImplStart = Date.now();
71 const { text: implementation } = await generateText({
72 model: openai("gpt-4o"),
73 system: `
74# VALTOWN HTTP Cloud Function Generator Prompt
965. **AI API Integration (if applicable)**:
97 - If the toolDescription indicates that creative enrichment or additional processing via AI is needed, integrate an AI API call into the function.
98 - Import { openai } from "npm:@ai-sdk/openai" and { generateText } from "npm:ai".
99 - Use the model "gpt-4o-mini".
100 - Construct a detailed, context-appropriate prompt for the AI call and integrate its response into the function’s output.
122
123---typescript
124import { openai } from "npm:@ai-sdk/openai";
125import { generateText } from "npm:ai";
126
135 }
136 const { text: analysis } = await generateText({
137 model: openai("gpt-4o-mini"),
138 system: "You are a creative code analyst.",
139 prompt: "Analyze the following recent changes in the code: " + body.recent_changes,
233
234 const { object: manifestoConfig } = await generateObject({
235 model: openai("gpt-4o"),
236 schema: z.object({
237 manifestoConfigPureJson: z.string(),
293
294 const { object: updatedManifestoConfigTypescript } = await generateObject({
295 model: openai("gpt-4o"),
296 system: promptForUpdatedManifest,
297 schema: z.object({
6 "description": "A sample blah manifest demonstrating various tool types and configurations.",
7 "env": {
8 "OPENAI_API_KEY": "your-openai-api-key-here",
9 },
10 "tools": [
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: fact } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are an expert in world trivia.",
16 prompt: `Provide an interesting and fun fact about the country: ${body.country}.`,
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
13 const countriesList = body.countries.join(", ");
14 const { text: recipes } = await generateText({
15 model: openai("gpt-4o-mini"),
16 system: "You are a culinary expert.",
17 prompt: `Provide a list of popular recipes from the following countries: ${countriesList}.`,