rssfeeds.json1 match
13["programming", "AI"]
14],
15["https://openai.com/news/rss.xml", ["AI"]],
16[
17"https://raw.githubusercontent.com/Olshansk/rss-feeds/main/feeds/feed_anthropic_news.xml",
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
34// --- AI BEHAVIORAL GUIDELINES & PROMPTS ---
703const url = new URL(req.url);
704const action = url.searchParams.get("action");
705const openai = new OpenAI();
706707if (req.method === "GET") {
717case "startGame": {
718const { archetypes } = body;
719const completion = await openai.chat.completions.create({
720model: "gpt-4o",
721messages: [
743}
744745const completion = await openai.chat.completions.create({
746model: "gpt-4o",
747messages: [
762case "evaluateGuess": {
763const { guess, targetGuest } = body;
764const completion = await openai.chat.completions.create({
765model: "gpt-4o",
766messages: [
781case "parseCommand": {
782const { command, availableActions } = body;
783const completion = await openai.chat.completions.create({
784model: "gpt-4o",
785messages: [
untitled-8111emailParser.ts5 matches
1import { OpenAI } from "https://esm.town/v/std/openai";
23interface Email {
116117/**
118* Extract order information from email using OpenAI
119*/
120async function extractOrderInfo(email: Email): Promise<OrderInfo> {
121const openai = new OpenAI();
122
123// Combine text and HTML content, preferring text
183184try {
185const completion = await openai.chat.completions.create({
186messages: [
187{ role: "system", content: "You are a precise email parser that extracts order information and returns only valid JSON." },
195const response = completion.choices[0]?.message?.content?.trim();
196if (!response) {
197throw new Error("No response from OpenAI");
198}
199
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
34// --- AI BEHAVIORAL GUIDELINES ---
722if (req.method === "POST" && action === "deconflict") {
723try {
724const openai = new OpenAI();
725const { droneA, droneB } = await req.json();
726731const userMessage = `Resolve conflict. Drone A: ${JSON.stringify(droneA)}. Drone B: ${JSON.stringify(droneB)}.`;
732733const completion = await openai.chat.completions.create({
734model: "gpt-4o",
735messages: [
stevensDemo.cursorrules4 matches
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107messages: [
108{ role: "user", content: "Say hello in a creative way" },
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
34// --- AI BEHAVIORAL GUIDELINES ---
315if (req.method === "POST") {
316try {
317const openai = new OpenAI();
318const body = await req.json();
319const prompt = body.prompt;
331];
332333const completion = await openai.chat.completions.create({
334model: "gpt-4o",
335messages: messages,
4import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
5// @ts-ignore
6import { OpenAI } from "https://esm.town/v/std/openai?v=4";
78// --- TYPE DEFINITIONS ---
343344app.post("/submit", async (c) => {
345const openai = new OpenAI();
346const body = await c.req.json();
347const { text, style } = body;
355356try {
357const completion = await openai.chat.completions.create({
358model: "gpt-4o",
359messages: [
jealous-textmain.tsx3 matches
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
34// --- AI BEHAVIORAL GUIDELINES ---
364if (req.method === "POST" && action === "getPhrase") {
365try {
366const openai = new OpenAI();
367const body = await req.json();
368const theme = body.theme;
375}
376377const completion = await openai.chat.completions.create({
378model: "gpt-4o",
379messages: [
horiz-shinemain.tsx12 matches
4import { Hono } from "npm:hono@4.4.12";
5import type { Context } from "npm:hono@4.4.12";
6import { OpenAI } from "npm:openai@4.52.7";
78// --- TYPE DEFINITIONS ---
470if (!industry) return c.json({ error: "Industry is a required field." }, 400);
471try {
472const openai = new OpenAI();
473const completion = await openai.chat.completions.create({
474model: "gpt-4o",
475messages: [{ role: "system", content: DYNAMIC_LIST_GENERATOR_PROMPT }, {
491if (!occupation) return c.json({ error: "Occupation is a required field." }, 400);
492try {
493const openai = new OpenAI();
494const completion = await openai.chat.completions.create({
495model: "gpt-4o",
496messages: [{ role: "system", content: DYNAMIC_LIST_GENERATOR_PROMPT }, {
513const userInput = `Occupation: ${occupation_title}, Task: ${task}`;
514try {
515const openai = new OpenAI();
516const completion = await openai.chat.completions.create({
517model: "gpt-4o",
518messages: [{ role: "system", content: PROMPT_REFINER_SYSTEM_PROMPT }, { role: "user", content: userInput }],
531if (!refined_prompt) return c.json({ error: "refined_prompt is required" }, 400);
532try {
533const openai = new OpenAI();
534const completion = await openai.chat.completions.create({
535model: "gpt-4o",
536messages: [{ role: "system", content: INPUT_EXTRACTOR_SYSTEM_PROMPT }, {
559560try {
561const openai = new OpenAI();
562const agentCompletion = await openai.chat.completions.create({
563model: "gpt-4o",
564messages: [{ role: "system", content: finalUserPrompt }, {
570if (!agentOutput) throw new Error("The agent returned no content.");
571572const htmlCompletion = await openai.chat.completions.create({
573model: "gpt-4o",
574messages: [{ role: "system", content: HTML_FORMATTER_SYSTEM_PROMPT }, { role: "user", content: agentOutput }],
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
34// --- AI BEHAVIORAL GUIDELINES ---
509if (req.method === "POST") {
510try {
511const openai = new OpenAI();
512const { message, history, persona } = await req.json();
513523];
524525const completion = await openai.chat.completions.create({
526model: "gpt-4o",
527messages: messages,