Search
Code3,246
const {model, modelToken} = this.options; const response = await axios.post( "https://api.openai.com/v1/embeddings", {model, input: text }, {
for $3.5m, and <code>aunty.com</code>{" "} for $60k. These prices are, of course, negotiable. I can't imagine anyone paying more for{" "} <code>craze.com</code> than OpenAI paid for <code>chat.com</code>{" "} a couple years ago, for example. In the book I'll cover how these aftermarkets work and what shady behavior goes on behind the scenes.
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" },
// @ts-ignoreimport { OpenAI } from "https://esm.town/v/std/openai?v=4";// --- AI BEHAVIORAL GUIDELINES & PROMPTS --- const url = new URL(req.url); const action = url.searchParams.get("action"); const openai = new OpenAI(); if (req.method === "GET") { case "startGame": { const { archetypes } = body; const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [ } const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [ case "evaluateGuess": { const { guess, targetGuest } = body; const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [ case "parseCommand": { const { command, availableActions } = body; const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [
import { OpenAI } from "https://esm.town/v/std/openai";interface Email {/** * Extract order information from email using OpenAI */async function extractOrderInfo(email: Email): Promise<OrderInfo> { const openai = new OpenAI(); // Combine text and HTML content, preferring text try { const completion = await openai.chat.completions.create({ messages: [ { role: "system", content: "You are a precise email parser that extracts order information and returns only valid JSON." }, const response = completion.choices[0]?.message?.content?.trim(); if (!response) { throw new Error("No response from OpenAI"); }
// @ts-ignoreimport { OpenAI } from "https://esm.town/v/std/openai?v=4";// --- AI BEHAVIORAL GUIDELINES --- if (req.method === "POST" && action === "deconflict") { try { const openai = new OpenAI(); const { droneA, droneB } = await req.json(); const userMessage = `Resolve conflict. Drone A: ${JSON.stringify(droneA)}. Drone B: ${JSON.stringify(droneB)}.`; 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 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" },
// @ts-ignoreimport { OpenAI } from "https://esm.town/v/std/openai?v=4";// --- AI BEHAVIORAL GUIDELINES --- if (req.method === "POST") { try { const openai = new OpenAI(); const body = await req.json(); const prompt = body.prompt; ]; const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: messages,
import { sqlite } from "https://esm.town/v/std/sqlite?v=4";// @ts-ignoreimport { OpenAI } from "https://esm.town/v/std/openai?v=4";// --- TYPE DEFINITIONS ---app.post("/submit", async (c) => { const openai = new OpenAI(); const body = await c.req.json(); const { text, style } = body; try { const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [
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