Search
Code3,285
import { OpenAI } from "https://esm.town/v/std/openai";export default async function(req: Request): Promise<Response> { }); } const openai = new OpenAI(); try { } const stream = await openai.chat.completions.create(body); if (!body.stream) {
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" },
import { blob } from "https://esm.town/v/std/blob";import { sqlite } from "https://esm.town/v/std/sqlite";import { OpenAI } from "https://esm.town/v/std/openai";import { email } from "https://esm.town/v/std/email";```
import { 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" },
// --- SERVER-SIDE LOGIC ---export default async function(req: Request) { const { OpenAI } = await import("https://esm.town/v/std/openai"); const { PDFExtract } = await import("npm:pdf.js-extract"); const action = url.searchParams.get("action"); const sourceUrl = import.meta.url.replace("esm.town", "val.town"); const openai = new OpenAI(); const MAX_TEXT_ANALYZE = 30000; agentName: string, ): Promise<object> { log.push({ agent: agentName, type: "step", message: `Calling OpenAI gpt-4o...` }); try { const response = await openai.chat.completions.create({ model: "gpt-4o", messages: [{ role: "system", content: systemPrompt }, { role: "user", content: userMessage }],
export default async function(req: Request) { const { OpenAI } = await import("https://esm.town/v/std/openai"); const { PDFExtract } = await import("npm:pdf.js-extract"); const action = url.searchParams.get("action"); const sourceUrl = import.meta.url.replace("esm.town", "val.town"); const openai = new OpenAI(); const MAX_TEXT_SUGGEST = 20000; const MAX_TEXT_ANALYZE = 30000; agentName: string, ): Promise<object> { log.push({ agent: agentName, type: "step", message: `Calling OpenAI gpt-4o...` }); try { const response = await openai.chat.completions.create({ model: "gpt-4o", messages: [{ role: "system", content: systemPrompt }, { role: "user", content: userMessage }],
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" },
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