Search
Code3,281
### Core Components- **Backend API** (`power-abuse-analyzer.ts`): Analyzes text for subtle abuse patterns using OpenAI's GPT-4o model- **Frontend Interface** (`frontend/index.html`): A user-friendly chat interface for interacting with the analyzer- **Static File Server** (`static-file-server.ts`): Serves the frontend files
import { email } from "https://esm.town/v/std/email";import { extractValInfo } from "https://esm.town/v/stevekrouse/extractValInfo";import { OpenAI } from "npm:openai";function stripHtmlBackticks(html: string): string {export default async function(e: Email) { const openai = new OpenAI(); console.log(`from: ${e.from} to: ${e.to} subject: ${e.subject}, cc: ${e.cc}, bcc: ${e.bcc}`); } const summary = await openai.chat.completions.create({ messages: [ {
import { email } from "https://esm.town/v/std/email";import { extractValInfo } from "https://esm.town/v/stevekrouse/extractValInfo";import { OpenAI } from "npm:openai";function stripHtmlBackticks(html: string): string {export default async function(e: Email) { const openai = new OpenAI(); console.log(`from: ${e.from} to: ${e.to} subject: ${e.subject}, cc: ${e.cc}, bcc: ${e.bcc}`); } const summary = await openai.chat.completions.create({ messages: [ {
- **Frontend**: React with TypeScript- **Visualizations**: Canvas API, SVG animations- **AI Simulation**: OpenAI API for entity communication- **Data Storage**: Val Town blob storage- **Styling**: TailwindCSS with custom neon effects
await handlePatternsExample(typingIndicator); } else { // For general questions, use the OpenAI API await handleGeneralQuestion(question, typingIndicator); }
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" },
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; const model = Deno.env.get("ANTHROPIC_API_KEY") ? anthropic("claude-3-7-sonnet-latest") : openai("gpt-4.1"); const options = {
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 = {
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