Search

3,380 results found for openai (3337ms)

Code
3,285

import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
import { socialDataSearch, Tweet } from "https://esm.town/v/stevekrouse/socialDataSearch";
import { OpenAI } from "https://esm.town/v/std/openai";
interface AnalyzedTweet {
if (!tweets.length) return [];
const openai = new OpenAI();
const tweetsText = tweets.map((tweet, index) =>
try {
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: prompt }],
model: "gpt-4o-mini",
export default async function(req) {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const CORS_HEADERS = {
"Access-Control-Allow-Origin": "*",
const action = url.searchParams.get("action");
const sourceUrl = import.meta.url.replace("esm.town", "val.town");
const openai = new OpenAI();
const jsonResponse = (body, status) =>
new Response(JSON.stringify(body), { status, headers: { ...CORS_HEADERS, "Content-Type": "ap
async function callAI(systemPrompt, userMessage) {
try {
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "system", content: systemPrompt }, { role: "user", content: userMessa
import askOpenAI from "./openai.tsx"
const PROMPT = `
const data = matchData(matchJson)
const message = PROMPT + "\n\n" + JSON.stringify(data)
return await askOpenAI(message)
}
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" },
Get/lexi2/main.tsx
4 matches
export default async function(req: Request) {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const { PDFExtract } = await import("npm:pdf.js-extract");
const action = url.searchParams.get("action");
const sourceUrl = import.meta.url.replace("esm.town", "val.town");
const openai = new OpenAI();
const MAX_TEXT_SUGGEST = 20000;
const MAX_TEXT_ANALYZE = 30000;
agentName: string,
): Promise<object> {
log.push({ agent: agentName, type: "step", message: `Calling OpenAI gpt-4o...` });
try {
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "system", content: systemPrompt }, { role: "user", content: userMessa
Configure the following variables in your environment:
- `AGENT_API_KEY` (This is a secure token that you choose to secure the agent.tsx POST endpoint)
- `OPENAI_API_KEY` (An OpenAI API Key)
- `EXA_API_KEY` (Optional, though needed if you use the web search tool)
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" },
export default async function(req: Request) {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const { PDFExtract } = await import("npm:pdf.js-extract");
const action = url.searchParams.get("action");
const sourceUrl = import.meta.url.replace("esm.town", "val.town");
const openai = new OpenAI();
const MAX_TEXT_SUGGEST = 20000;
const MAX_TEXT_ANALYZE = 30000;
agentName: string,
): Promise<object> {
log.push({ agent: agentName, type: "step", message: `Calling OpenAI gpt-4o...` });
try {
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "system", content: systemPrompt }, { role: "user", content: userMessa
const aiTools: AITool[] = [
// AI Assistants & Chatbots
tps://chatgpt.com/", category: "Assistant", description: "OpenAI's conversational AI assistant"
{ name: "Claude", url: "https://claude.ai/", category: "Assistant", description: "Anthropic's
{ name: "Gemini", url: "https://gemini.google.com/", category: "Assistant", description: "Goog
// Image Generation & Editing
{ name: "Midjourney", url: "https://www.midjourney.com/", category: "Images", description: "AI
{ name: "DALL·E 3", url: "https://openai.com/dall-e-3", category: "Images", description: "Open
{ name: "Stable Diffusion", url: "https://stability.ai/", category: "Images", description: "Op
{ name: "Lexica", url: "https://lexica.art/", category: "Images", description: "AI art search
{ name: "Runway", url: "https://runwayml.com/", category: "Video", description: "AI video edit
{ name: "Synthesia", url: "https://www.synthesia.io/", category: "Video", description: "AI vid
{ name: "Sora", url: "https://openai.com/sora", category: "Video", description: "OpenAI's text
{ name: "Kling", url: "https://klingai.com/", category: "Video", description: "AI video genera
{ name: "Hailuo", url: "https://hailuo.ai/", category: "Video", description: "AI video creatio
// AI Research & Platforms
{ name: "OpenAI", url: "https://openai.com/", category: "Research", description: "AI research
{ name: "Anthropic", url: "https://www.anthropic.com/", category: "Research", description: "AI
{ name: "xAI", url: "https://x.ai/", category: "Research", description: "Elon Musk's AI compan