2import React, { useState, useRef, useCallback, useEffect } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4import OpenAI from "https://esm.sh/openai";
5
6// Plant Database
121 const base64Image = reader.result.split(',')[1];
122
123 const openai = new OpenAI({
124 apiKey: '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',
125 dangerouslyAllowBrowser: true
127
128 try {
129 const response = await openai.chat.completions.create({
130 model: "gpt-4o",
131 messages: [
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { z } from "npm:zod";
3
33 }
34
35 const openai = new OpenAI();
36
37 const completion = await openai.chat.completions.create({
38 messages: [
39 { role: "user", content: prompt(topic, level.data, stage, difficulty.data) },
30 "settings": {
31 "model": "gpt-4o-mini",
32 "provider": "openai",
33 "system": "please summarize the following article in a 2-4 sentences, describing it from a 3rd person point of view",
34 "prompt": "{jina.content}"
18brian@airbnb.com,Brian Chesky
19drew@dropbox.com,Drew Houston
20sam@openai.com,Sam Altman
21tim@apple.com,Tim Cook
22jeff@amazon.com,Jeff Bezos
1import { email } from "https://esm.town/v/std/email?v=11";
2import { OpenAI } from "npm:openai";
3
4let location = "munchen";
8).then(r => r.json());
9
10const openai = new OpenAI();
11let chatCompletion = await openai.chat.completions.create({
12 messages: [{
13 role: "user",
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3const openai = new OpenAI();
4
5const completion = await openai.chat.completions.create({
6 messages: [
7 { role: "user", content: "C#怎么实现一个线程安全的求和" },
149
150 try {
151 // Dynamic imports for SQLite and OpenAI
152 const [{ sqlite }, { OpenAI }] = await Promise.all([
153 import("https://esm.town/v/stevekrouse/sqlite"),
154 import("https://esm.town/v/std/openai")
155 ]);
156
157 const openai = new OpenAI();
158 const SPECIFICATIONS_TABLE = "val_town_agent_specifications";
159 const IMPLEMENTATIONS_TABLE = "val_town_agent_implementations";
227
228 // Generate implementation using GPT-4o-mini
229 const completion = await openai.chat.completions.create({
230 messages: [
231 {
149 const webpageText = await webpageResponse.text();
150
151 // Use OpenAI as Claude proxy
152 const { OpenAI } = await import("https://esm.town/v/std/openai");
153 const openai = new OpenAI();
154
155 const completion = await openai.chat.completions.create({
156 messages: [
157 {
3import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=84";
4import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken?v=1";
5import { openai } from "npm:@ai-sdk/openai";
6import ValTown from "npm:@valtown/sdk";
7import { streamText } from "npm:ai";
36
37 const stream = await streamText({
38 model: openai("gpt-4o", {
39 baseURL: "https://std-openaiproxy.web.val.run/v1",
40 apiKey: Deno.env.get("valtown"),
41 } as any),
13* and activity (befriends aliens, goes to the doctor, rides a rollercoaster, bakes a cake for friends)
14
15It uses OpenAI to write a children's bedtime story
16
17* title
21for a "fantastical story about a green whale who rides the bus" or the "spooky story about the tomato fox who explores a cave".
22
23Then using the summary, OpenAI geenrates another prompt to describe the instructions to geneate a childrens story book image.
24
25That's sent to Fal to generate an image.