Search
Code3,181
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" },
// @ts-ignoreimport { 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 operations - **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 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" },
analyzeTranscriptsForQuestion, analyzeTranscriptsWithConsensus,} from "../services/openai.service.ts";import { createTimestampProperties, createAnalysisResultsDatabaseSchema, createResultsDatabaseProperty, createTotalQuestionsProperty, createCompletedQuestionsProperty, createEvidenceSummaryProperty, createMethodologyProperty } from "../utils/notion-properties.utils.ts";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, andperiodically sends AI-generated summaries of recent activity to Slack. Thesystem uses OpenAI to transform raw webhook data into human-readable summaries,helping teams stay informed about CRM activity without being overwhelmed byindividual 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 andThe trickiest part of this val was hydrating these events into human readableform, 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 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" },
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
/**
* Practical Implementation of Collective Content Intelligence
* Bridging advanced AI with collaborative content creation
*/
exp
kwhinnery_openai
lost1991
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
No docs found