Search

3,380 results found for openai (1827ms)

Code
3,285

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.sh/openai@4.96.2"
const MODEL = "gpt-4.1-2025-04-14"
export default async function askOpenAI(message: string): Promise<string> {
const openai = new OpenAI()
const response = await openai.responses.create({
input: message,
model: MODEL,
import ky from "https://esm.sh/ky";
const response = await fetch("https://www.google.com?q=openai&hl=en&gl=us", {
headers: {
"User-Agent":
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
## Tech Stack
- Backend: Hono + Val Town OpenAI (GPT-4o-mini)
- Frontend: React + TailwindCSS with markdown rendering
- Storage: None (stateless analysis)
import { Hono } from "https://esm.sh/hono@3.11.7";
import { OpenAI } from "https://esm.town/v/std/openai";
import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
import { encode } from "https://esm.sh/gpt-tokenizer@2.1.2";
});
const openai = new OpenAI();
// Default token limits - reduced chunk size for better granularity
try {
const completion = await openai.chat.completions.create({
messages: [
{ role: "system", content: systemPrompt },
try {
const completion = await openai.chat.completions.create({
messages: [
{ role: "system", content: systemPrompt },
description: 'Advanced conversational AI for writing, coding, analysis, and creative tasks
category: 'text-ai',
url: 'https://chat.openai.com',
tags: JSON.stringify(['conversation', 'writing', 'coding', 'analysis']),
pricing: 'freemium',
{
name: 'DALL-E 3',
description: 'OpenAI\'s advanced image generation model with exceptional prompt understand
category: 'image-gen',
url: 'https://openai.com/dall-e-3',
tags: JSON.stringify(['openai', 'text-to-image', 'creative', 'advanced']),
pricing: 'paid',
featured: true,
description: 'Advanced conversational AI for writing, coding, analysis, and creative tasks
category: 'text-ai',
url: 'https://chat.openai.com',
tags: JSON.stringify(['conversation', 'writing', 'coding', 'analysis']),
pricing: 'freemium',
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" },