Search

3,267 results found for openai (1960ms)

Code
3,172

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 { sqlite } from "https://esm.town/v/std/sqlite";
import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
const trackedUsernames = [];
const openai = new OpenAI();
// Define Zod schemas for validation
try {
const completion = await retryWithBackoff(() =>
openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [
console.log("gpt response", response, tweet);
} catch (validationError) {
console.error("Failed to validate OpenAI response:", validationError);
console.log("Raw completion:", completion);
return { isRelevant: false };
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" },
export default async function server(request: Request): Promise<Response> {
if (request.method === "POST" && new URL(request.url).pathname === "/generate-ppt") {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const { blob } = await import("https://esm.town/v/std/blob");
const openai = new OpenAI();
try {
}
// Use OpenAI to analyze the code and generate slide structure
let slidesData;
try {
const analysis = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [
export default async function server(request: Request): Promise<Response> {
if (request.method === 'POST' && new URL(request.url).pathname === '/generate-ppt') {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const { blob } = await import("https://esm.town/v/std/blob");
const openai = new OpenAI();
try {
}
// Use OpenAI to analyze the code and generate slide structure
const analysis = await openai.chat.completions.create({
model: "gpt-4o-mini",
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" },
import { OpenAI } from "https://esm.town/v/std/openai";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
const openai = new OpenAI();
const KEY = "productSummaryApi";
const TABLE_NAME = `${KEY}_summaries_v4`;
const maxTokens = isLong ? 300 : 10;
const completion = await openai.chat.completions.create({
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" },
/** @jsxImportSource npm:hono@3/jsx */
import { chat } from "https://esm.town/v/stevekrouse/openai";
import cronstrue from "npm:cronstrue";
import { Hono } from "npm:hono@3";