Search

213 results found for β€œopenai” (405ms)

Code
210

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" },
_2 or _3) to create a fresh table.
### 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" },
Routes,
} from "npm:discord-api-types/v10";
import { OpenAI } from "https://esm.town/v/std/openai";
import { getLastMessageId, init, setLastMessageId } from "./sqlite.ts";
.setToken(Deno.env.get("DISCORD_BOT_TOKEN")!);
const openai = new OpenAI();
// ============================================================================
author: string,
): Promise<string> {
const response = await openai.chat.completions.create({
model: "gpt-4.1-nano",
max_tokens: 30,
# auto-thread
d threads from new messages in configured channels, using OpenAI to generate descriptive thread
## How It Works
flowchart LR
A[⏰ Cron every 1 min] --> B[πŸ” Poll every 5s]
B -->|new messages| C[πŸ€– OpenAI]
C -->|thread title| D[Discord API]
D --> E[🧡 Thread Created]
- `npm:@discordjs/rest` β€” Discord REST API with rate limiting and retries
- `npm:discord-api-types` β€” Full TypeScript types for the Discord API
- `std/openai` β€” Val Town's OpenAI wrapper
- `std/sqlite` β€” Val Town's project-scoped SQLite
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)
import { anthropic } from "npm:@ai-sdk/anthropic";
import { openai } from "npm:@ai-sdk/openai";
import { generateText, streamText } from "npm:ai";
import { getSystemPrompt } from "./prompt.tsx";
const maxSteps = 10;
ROPIC_API_KEY") ? anthropic("claude-3-7-sonnet-latest") : openai("gpt-4.1");
const options = {
const GROQ_API_KEY =
"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";
const GROQ_API_URL = "https://api.groq.com/openai/v1/chat/completions";
// πŸ€– TELEGRAM BOT
_2 or _3) to create a fresh table.
### 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" },
jubertioai
hello-realtime
Sample app for the OpenAI Realtime API
Public
openai-agents
kidjs
openai-agents
Template to use the OpenAI Agents SDK
Public
openai-agents
EatPraySin
openai-agents
Template to use the OpenAI Agents SDK
Public

Users

No users found

Docs

No docs found
…
8
…