Search

3,276 results found for openai (2769ms)

Code
3,181

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" },
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// --- AI BEHAVIORAL GUIDELINES ---
if (req.method === "POST") {
try {
const openai = new OpenAI();
const { image } = await req.json();
}
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
- **Email Service** (`email.service.ts`): Email communication and template formatting
- **Notion Service** (`notion.service.ts`): Notion API integration for database and file operati
- **OpenAI Service** (`openai.service.ts`): AI/ML processing and analysis
### Service Boundaries
- `attachFileUploadToPage()` - Step 3: Attach file to page with "file_upload" type
### OpenAI Service (`openai.service.ts`)
**Purpose**: OpenAI API integration with two-stage consensus analysis
**Key Functions**:
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" },
analyzeTranscriptsForQuestion,
analyzeTranscriptsWithConsensus,
} from "../services/openai.service.ts";
import { createTimestampProperties, createAnalysisResultsDatabaseSchema, createResultsDatabasePr
import type { NotionProperties } from "../types/notion.types.ts";
const questionsDbId = Deno.env.get("FINDINGS_QUESTIONS_DB_ID");
const transcriptsDbId = Deno.env.get("FINDINGS_TRANSCRIPTS_DB_ID");
const openaiApiKey = Deno.env.get("OPENAI_API_KEY");
if (!reportsDbId || !questionsDbId || !transcriptsDbId || !openaiApiKey) {
return {
success: false,
question: question.name,
transcripts: transcriptTexts,
apiKey: openaiApiKey,
});
It receives webhooks from Attio, stores them in a SQLite database, and
periodically sends AI-generated summaries of recent activity to Slack. The
system uses OpenAI to transform raw webhook data into human-readable summaries,
helping teams stay informed about CRM activity without being overwhelmed by
individual notifications.
Slack summaries
- [`auth.ts`](./auth.ts) - Webhook signature verification middleware
- [`openai.ts`](./openai.ts) - AI-powered event summarization using OpenAI
- [`scratch.ts`](./scratch.ts) - Development scratchpad for testing functions
- [`setup.ts`](./setup.ts) - One-time setup script to initialize database and
The trickiest part of this val was hydrating these events into human readable
form, like "Steve commented on OpenAI: they're using Val Town!"
After trying and failing (for hours!) to get LLMs to write this code for me, I
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
function parseMarkdown(text: string) {
export async function summarizeEvents(events: string[]) {
const resp = await openai.chat.completions.create({
model: "gpt-4.1",
messages: [{
import { hydrate } from "./attio/hydrate.ts";
import pSettle from "npm:p-settle";
import { summarizeEvents } from "./openai.ts";
import type { AttioWebhookEvent } from "./attio/webhook-payload-types.ts";
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" },