Search

4,267 results found for openai (1348ms)

Code
4,158

`;
const r = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + Deno.env.get("OPENAI_KEY"),
},
body: JSON.stringify({
`;
const r = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + process.env.OPENAI_KEY,
},
body: JSON.stringify({
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 { Hono } from "https://esm.sh/hono@3";
import { sqlite } from "https://esm.town/v/std/sqlite";
import { OpenAI } from "https://esm.sh/openai";
import { renderToString } from "https://esm.sh/react-dom/server";
import React, { useEffect, useMemo, useState } from "https://esm.sh/react";
const app = new Hono();
const openai = new OpenAI();
async function initDb() {
const { prompt, username } = await c.req.json();
try {
const completion = await openai.chat.completions.create({
messages: [
{
import { Hono } from "https://esm.sh/hono@3";
import { sqlite } from "https://esm.town/v/std/sqlite";
import { OpenAI } from "https://esm.sh/openai";
import { renderToString } from "https://esm.sh/react-dom/server";
import React, { useEffect, useState } from "https://esm.sh/react";
const app = new Hono();
const openai = new OpenAI();
// --- DATABASE SCHEMA ---
// Logic: In a real app, we'd verify the user's token balance here.
const completion = await openai.chat.completions.create({
messages: [{
role: "system",
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 { OpenAI } from "https://esm.town/v/std/openai";
export interface TranslatorConfig {
onChunk: TranslationChunkCallback
): Promise<string> {
const openai = new OpenAI();
const messages = [
];
// Use OpenAI streaming API
const stream = await openai.chat.completions.create({
model: config.model,
messages,
config: TranslatorConfig
): Promise<string> {
const openai = new OpenAI();
const messages = [
];
const completion = await openai.chat.completions.create({
model: config.model,
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" },

Vals

95
View more
peterqliu
PineconeIndex
Vector db's on Pinecone, with OpenAI embeddings
Public
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

Docs

11
View more
No docs found