Search

3,263 results found for openai (1738ms)

Code
3,168

web/hats/main.tsx
5 matches
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 syst
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(tod
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 smel
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 use
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
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
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
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
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 Prompt
5. **AI API Integration (if applicable)**:
- If the toolDescription indicates that creative enrichment or additional processing via AI i
- 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
---typescript
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 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 Prompt
5. **AI API Integration (if applicable)**:
- If the toolDescription indicates that creative enrichment or additional processing via AI i
- 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
---typescript
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 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({