1import { OpenAI } from "https://esm.town/v/std/openai";
2
3// --- TYPE DEFINITIONS ---
547
548export default async function(req: Request): Promise<Response> {
549 const openai = new OpenAI();
550 const url = new URL(req.url);
551 const CORS_HEADERS = {
566 case "synthesizeProject": {
567 const synthesisContent = `Current Date: ${new Date().toISOString().split("T")[0]}\n\nGoal: ${body.goal}`;
568 const completion = await openai.chat.completions.create({
569 model,
570 messages: [{ role: "system", content: PROJECT_SYNTHESIS_PROMPT }, {
582 JSON.stringify(body.tasks, null, 2)
583 }`;
584 const completion = await openai.chat.completions.create({
585 model,
586 messages: [{ role: "system", content: DAILY_REBALANCE_PROMPT }, {
611 }
612
613 const completion = await openai.chat.completions.create({
614 model,
615 messages: [systemMessage, ...conversation],