Search

3,370 results found for openai (2038ms)

Code
3,275

For example:
```javascript
ult:", await ScrapeWebsite("https://en.wikipedia.org/wiki/OpenAI", "p:nth-of-type(2)"));
```
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
import { Hono } from "npm:hono@4.4.12";
}
const openai = new OpenAI({ apiKey: Deno.env.get("OPENAI_API_KEY") });
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// @ts-ignore
import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
}
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
import { OpenAI } from "https://esm.town/v/std/openai";
export interface CalendarEvent {
// Extract events from web page content using GPT-4
export async function extractEventsFromContent(content: string, url: string): Promise<CalendarEv
const openai = new OpenAI();
// Clean and truncate content to avoid token limits
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
const response = completion.choices[0]?.message?.content?.trim();
if (!response) {
throw new Error("No response from OpenAI");
}
join/crm/main.tsx
9 matches
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// @ts-ignore
import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
// --- CORE LOGIC & SEEDING ---
async function updateCustomerAiProfile(customerId: number, openai) {
const { rows } = await sqlite.execute({
sql:
});
if (rows.length === 0) return;
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "system", content: CUSTOMER_PROFILE_ANALYST_PROMPT }, {
}
async function seedDatabase(openai) {
await sqlite.batch([
"DELETE FROM feedback;",
});
}
for (const c of customersToSeed) { await updateCustomerAiProfile(c.id, openai); }
}
const url = new URL(req.url);
const action = url.searchParams.get("action");
const openai = new OpenAI({ apiKey: Deno.env.get("OPENAI_API_KEY") });
await initializeDatabase();
try {
switch (action) {
case "seedDatabase":
await seedDatabase(openai);
return new Response(JSON.stringify({ success: true }));
case "ingestInteraction": {
],
});
await updateCustomerAiProfile(customerId, openai);
return new Response(JSON.stringify({ success: true, customerId }));
}
});
if (rows.length === 0) return new Response(JSON.stringify({ success: true, segments: [
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "system", content: ADVANCED_SEGMENTATION_PROMPT }, {
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
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" },
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// --- AI BEHAVIORAL GUIDELINES ---
const { initialPositions, shotParams } = await req.json();
const { collisionLog } = await runServerPhysics(initialPositions, shotParams);
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
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 cre
### OpenAI
```ts
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" },
*/
import { OpenAI } from "https://esm.town/v/std/openai";
import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
import { Octokit } from "npm:octokit";
commitType: string,
): Promise<string> {
const openai = new OpenAI();
const prompt =
try {
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: prompt }],
model: "gpt-4o-mini",