Search

3,374 results found for openai (3804ms)

Code
3,279

// @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",
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";
import { Hono } from "npm:hono@4.4.12";
import { serveStatic } from "npm:hono@4.4.12/deno";
});
// --- OpenAI Endpoints ---
app.post("/ai/arrivalGreeting", async (c) => {
const { name } = await c.req.json();
const openai = new OpenAI();
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "system", content: ARRIVAL_GREETING_PROMPT(name) }],
app.post("/ai/departureSuggestion", async (c) => {
const { name, make } = await c.req.json();
const openai = new OpenAI();
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "system", content: DEPARTURE_ANTICIPATION_PROMPT(name, make) }],
app.post("/ai/vehicleReady", async (c) => {
const { make, location } = await c.req.json();
const openai = new OpenAI();
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "system", content: VEHICLE_READY_PROMPT(make, location) }],
const sourceUrl = new URL(c.req.url).origin;
// This is a great place to add server-side checks.
// For example, if the OpenAI API key is missing, we can render an error page.
return c.html(generateHtml(sourceUrl));
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// --- AI BEHAVIORAL GUIDELINES & PROMPT ---
if (req.method === "POST") {
try {
const openai = new OpenAI();
const body = await req.json();
const userMessage = body.message;
const messages = [{ role: "system", content: SYSTEM_PROMPT }, ...history, { role: "user",
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: messages,
// @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();
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// --- AI BEHAVIORAL GUIDELINES & PROMPTS ---
if (req.method === "POST") {
const openai = new OpenAI();
let body;
// STEP 1: Analyze the image with GPT-4o Vision to understand its architecture.
const analysisCompletion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
// STEP 2: Use the analysis to generate a targeted DALL-E prompt and a design rationale.
const strategyCompletion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
const { dalle_prompt, design_rationale } = strategyResult;
3 (CORRECTED): Generate the final, staged image using the openai.createImage method,
// which is appropriate for the older SDK version wrapped by std/openai?v=4.
const imageResponse = await openai.createImage({
prompt: dalle_prompt,
n: 1,
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" },