Search

4,195 results found for openai (4274ms)

Code
4,086

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" },
// ———————— Val.town/Backend Imports ———————— //
import { OpenAI } from "https://esm.town/v/std/openai"; // For backend API call
import { html } from "https://esm.town/v/stevekrouse/html"; // For serving HTML
async function runImprovementPipeline(
originalText: string,
openai: OpenAI,
): Promise<{ improvedText: string; coreIntentSummary: string }> {
console.log("Pipeline Step 1: Starting Intent Extraction for text length:", originalText.lengt
try {
const intentPrompt = createIntentExtractionPrompt(originalText);
const intentCompletion = await openai.chat.completions.create({
model: AI_MODEL,
messages: [{ role: "user", content: intentPrompt }],
let improvedText = originalText;
try {
const mainCompletion = await openai.chat.completions.create({
model: AI_MODEL,
messages: [{ role: "user", content: mainImprovementPrompt }],
export default async function server(req: Request): Promise<Response> {
const url = new URL(req.url);
const apiKey = Deno.env.get("OPENAI_API_KEY");
if (!apiKey) {
// ... (API key error handling remains the same) ...
const errorMsg = "Server configuration error: OPENAI_API_KEY secret not set.";
console.error(errorMsg);
if (req.method === "POST") return Response.json({ error: errorMsg }, { status: 500 });
return html(`<html><body><h1>Configuration Error</h1><p>${errorMsg}</p></body></html>`, { st
}
const openai = new OpenAI({ apiKey: apiKey });
// --- API Endpoint (POST) ---
// Run the pipeline
const { improvedText, coreIntentSummary } = await runImprovementPipeline(text, openai);
// Return results
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" },
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 React from "https://esm.sh/react@18.2.0";
import { blob } from "https://esm.town/v/std/blob";
import { OpenAI } from "https://esm.town/v/std/openai";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
export default async function server(request: Request): Promise<Response> {
const KEY = "fortuitousSalmonFox";
const openai = new OpenAI();
const url = new URL(request.url);
import React from "https://esm.sh/react@18.2.0";
import { blob } from "https://esm.town/v/std/blob";
import { OpenAI } from "https://esm.town/v/std/openai";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
export default async function server(request: Request): Promise<Response> {
const KEY = "Girlswithjuice";
const openai = new OpenAI();
const url = new URL(request.url);
import React from "https://esm.sh/react@18.2.0";
import { blob } from "https://esm.town/v/std/blob";
import { OpenAI } from "https://esm.town/v/std/openai";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
export default async function server(request: Request): Promise<Response> {
const KEY = "lustrousApricotParakeet";
const openai = new OpenAI();
const url = new URL(request.url);
async function generateMotivation(userProgress) {
try {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const motivationPrompt = `Generate a highly personalized, inspiring message for someone who
const response = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: motivationPrompt }],

Vals

95
View more
openai-agents
stevekrouse
openai-agents
Template to use the OpenAI Agents SDK
Public
Ronsykes
hello-realtime
Sample app for the OpenAI Realtime API
Public
Ronsykes
hello-realtime-rs
Sample app for the OpenAI Realtime API
Public
dcm31
turso_events_estimator
Estimate OpenAI calls from Turso GitHub events
Public
fancylamp
hello-realtime
Sample app for the OpenAI Realtime API
Public

Docs

11
View more
No docs found