Search
Code3,168
export default async function server(request: Request): Promise<Response> { const { OpenAI } = await import("https://esm.town/v/std/openai"); const openai = new OpenAI(); // Mock tools for demonstration purposes // Use the decomposer agent to break down the problem const decomposerCompletion = await openai.chat.completions.create({ messages: [ { // Now create a structured workflow const workflowCompletion = await openai.chat.completions.create({ messages: [ { "You are a problem-solving agent working as part of a multi-agent system."; const agentCompletion = await openai.chat.completions.create({ messages: [ {
import { openai } from "npm:@ai-sdk/openai";import { generateText } from "npm:ai"; const { text: summary } = await generateText({ model: openai("gpt-4o-mini"), system: "You are a solar weather expert.", prompt: `Summarize today's solar weather based on the following data: ${JSON.stringify(todayData)}`,
import { openai } from "npm:@ai-sdk/openai";import { generateText } from "npm:ai"; } const { text: feedback } = await generateText({ model: openai("gpt-4o-mini"), system: "You are an expert code reviewer.", prompt: "Analyze the following codebase for skill level, code quality, potential code smells, and areas for improvement: " + body.codebase,
import { openai } from "npm:@ai-sdk/openai";import { generateText } from "npm:ai"; const interactionsText = body.interactions.join("\n"); const { text: personalityProfile } = await generateText({ model: openai("gpt-4o-mini"), system: "You are a personality analyst.", prompt: "Based on the following user interactions, identify patterns and summarize the user's personality traits: " + interactionsText,
import { openai } from "npm:@ai-sdk/openai";import { generateText } from "npm:ai"; const { text: codeAnalysis } = await generateText({ model: openai("gpt-4o-mini"), system: "You are a code quality and complexity analyst.", 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.`, const { text: skillAssessment } = await generateText({ model: openai("gpt-4o-mini"), system: "You are an expert in assessing programming skills.", 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.`,
import { openai } from "npm:@ai-sdk/openai";import { generateText } from "npm:ai"; } const { text: haiku } = await generateText({ model: openai("gpt-4o-mini"), system: "You are a poet creating haikus.", prompt: `Create a haiku about the following topic: ${body.topic}. The haiku should follow the 5-7-5 syllable structure.`,
import { openai } from "npm:@ai-sdk/openai";import { generateText } from "npm:ai"; } const { text: analysis } = await generateText({ model: openai("gpt-4o-mini"), system: "You are an expert in identifying logical fallacies.", prompt: "Analyze the following text for common logical fallacies such as ad hominem, straw man, slippery slope, etc.: " + body.text,
import { openai } from "npm:@ai-sdk/openai";import { generateText } from "npm:ai"; } const { text: dietSuggestion } = await generateText({ model: openai("gpt-4o-mini"), system: "You are an expert zoologist.", prompt:
import { openai } from "npm:@ai-sdk/openai";import ValTown from "npm:@valtown/sdk";import { generateObject, generateText } from "npm:ai"; const generateImplStart = Date.now(); const { text: implementation } = await generateText({ model: openai("gpt-4o"), system: `# VALTOWN HTTP Cloud Function Generator Prompt5. **AI API Integration (if applicable)**: - If the toolDescription indicates that creative enrichment or additional processing via AI is needed, integrate an AI API call into the function. - Import { openai } from "npm:@ai-sdk/openai" and { generateText } from "npm:ai". - Use the model "gpt-4o-mini". - Construct a detailed, context-appropriate prompt for the AI call and integrate its response into the function’s output.---typescriptimport { openai } from "npm:@ai-sdk/openai";import { generateText } from "npm:ai"; } const { text: analysis } = await generateText({ model: openai("gpt-4o-mini"), system: "You are a creative code analyst.", prompt: "Analyze the following recent changes in the code: " + body.recent_changes, const { object: manifestoConfig } = await generateObject({ model: openai("gpt-4o"), schema: z.object({ manifestoConfigPureJson: z.string(), const { object: updatedManifestoConfigTypescript } = await generateObject({ model: openai("gpt-4o"), system: promptForUpdatedManifest, schema: z.object({
import { openai } from "npm:@ai-sdk/openai";import ValTown from "npm:@valtown/sdk";import { generateObject, generateText } from "npm:ai"; const generateImplStart = Date.now(); const { text: implementation } = await generateText({ model: openai("gpt-4o"), system: `# VALTOWN HTTP Cloud Function Generator Prompt5. **AI API Integration (if applicable)**: - If the toolDescription indicates that creative enrichment or additional processing via AI is needed, integrate an AI API call into the function. - Import { openai } from "npm:@ai-sdk/openai" and { generateText } from "npm:ai". - Use the model "gpt-4o-mini". - Construct a detailed, context-appropriate prompt for the AI call and integrate its response into the function’s output.---typescriptimport { openai } from "npm:@ai-sdk/openai";import { generateText } from "npm:ai"; } const { text: analysis } = await generateText({ model: openai("gpt-4o-mini"), system: "You are a creative code analyst.", prompt: "Analyze the following recent changes in the code: " + body.recent_changes, const { object: manifestoConfig } = await generateObject({ model: openai("gpt-4o"), schema: z.object({ manifestoConfigPureJson: z.string(), const { object: updatedManifestoConfigTypescript } = await generateObject({ model: openai("gpt-4o"), system: promptForUpdatedManifest, schema: z.object({
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
/**
* Practical Implementation of Collective Content Intelligence
* Bridging advanced AI with collaborative content creation
*/
exp
kwhinnery_openai
lost1991
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
No docs found