Search
Code208
_2 or _3) to create a fresh table.### OpenAI```tsimport { 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-threadAutomatically creates Discord threads from new messages in configured channels, using OpenAI to generate descriptive thread titles.## How It Worksflowchart 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 SQLiteConfigure 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; const model = Deno.env.get("ANTHROPIC_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```tsimport { 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 create a fresh table.### OpenAI```tsimport { 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```tsimport { 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" },- **Handwriting canvas** β chisel-nib calligraphy engine with quill physics- **OCR via Tesseract.js** β your handwriting β text, right in the browser- **AI memory** β powered by OpenAI, with persistent conversation per session- **The aesthetic** β parchment textures, ink fade effects, no UI chromeUsers
No users found
Docs
No docs found