Search
Code27
app.post("/", async (c) => { // Early API key check to avoid confusing when using the tester ui if (!Deno.env.get("OPENAI_API_KEY")) { return c.json( { error: "Add OPENAI_API_KEY in Environment Variables" }, 503, );// Test endpoint for the welcome UIapp.post("/test", async (c) => { if (!Deno.env.get("OPENAI_API_KEY")) { return c.json( { error: "Add OPENAI_API_KEY in Environment Variables" }, 503, );// Reanalyze a leadapp.post("/lead/:id/reanalyze", async (c) => { if (!Deno.env.get("OPENAI_API_KEY")) { return c.json( { error: "Add OPENAI_API_KEY in Environment Variables" }, 503, );import { readFile } from "https://esm.town/v/std/utils/index.ts";import { Agent, run, RunResult, webSearchTool } from "npm:@openai/agents@0.3.0";import { getLeadById, storeLead, updateLeadOutput } from "./db.ts"; "Bash(find:*)", "Bash(deno check:*)", "WebFetch(domain:platform.openai.com)", "WebSearch" ],Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" },Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" },Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" },Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" },Vals
No vals found
Users
No users found
Docs
No docs found