Search

3,341 results found for openai (2481ms)

Code
3,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
<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 an
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 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" },
join/silo/main.tsx
6 matches
// @ts-ignore
import { 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 informati
const response = completion.choices[0]?.message?.content?.trim();
if (!response) {
throw new Error("No response from OpenAI");
}
// @ts-ignore
import { 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
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" },
join/five/main.tsx
3 matches
// @ts-ignore
import { 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,
join/fun/main.tsx
3 matches
import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
// @ts-ignore
import { 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: [