Search

4,018 results found for openai (3092ms)

Code
3,914

<a href="?q=function" className="example-link">function</a>
<a href="?q=discord" className="example-link">discord</a>
<a href="?q=openai" className="example-link">openai</a>
<a href="?q=react" className="example-link">react</a>
</div>
<a href="?q=function" className="example-link">function</a>
<a href="?q=discord" className="example-link">discord</a>
<a href="?q=openai" className="example-link">openai</a>
<a href="?q=react" className="example-link">react</a>
</div>
import { blob } from "https://esm.town/v/std/blob";
import { OpenAI } from "https://esm.town/v/std/openai";
import { dataToRSS } from "https://esm.town/v/mwalker/dataToRSS/main.tsx";
}
// Translate text from Japanese to English using OpenAI
async function translateToEnglish(text: string): Promise<string> {
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
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" },
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 { blob } from "https://esm.town/v/std/blob";
import { OpenAI } from "https://esm.town/v/std/openai";
import { dataToRSS } from "https://esm.town/v/stevekrouse/dataToRSS";
}
// Translate text from Japanese to English using OpenAI
async function translateToEnglish(text: string): Promise<string> {
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
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" },
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" },
- `main.tsx` - Main cron function and Discord webhook
- `fetch-vals.ts` - Fetches and filters new vals using Val Town SDK
- `ai-summarizer.ts` - Generates OpenAI summaries for vals without READMEs
## Additional logic
- Filter out commonly remixed utility vals like Blob Admin, SQLiteExplorer
- Skip shallow remixes (forks with ≤3 versions)
`main.tsx` files for AI summaries and limit code sent to OpenAI to 5KB to avoid token limits
## Setup
1. Set `DISCORD_WEBHOOK` environment variable
2. Set `OPENAI_API_KEY` environment variable
3. Set `testMode = false` in main.tsx for production
import { OpenAI } from "npm:openai";
import ValTown from "npm:@valtown/sdk";
const openai = new OpenAI();
const client = new ValTown();
}
const response = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{