Search
Code3,166
const NR_TYPE = "near_field";const INSTRUCTIONS = ` Greet the user in English, and thank them for trying the new OpenAI Realtime API. Give them a brief summary based on the list below, and then ask if they have any questions. Answer questions using the information below. For questions outside this scope, - higher audio quality - improved handling of alphanumerics (eg, properly understanding credit card and phone numbers) - support for the OpenAI Prompts API - support for MCP-based tools - auto-truncation to reduce context size
sip.post("/", async (c) => { // Verify the webhook. const OPENAI_SIGNING_SECRET = Deno.env.get("OPENAI_SIGNING_SECRET"); if (!OPENAI_SIGNING_SECRET) { console.error("π΄ webhook secret not configured"); return c.text("Internal error", 500); } const webhook = new Webhook(OPENAI_SIGNING_SECRET); const bodyStr = await c.req.text(); let callId: string | undefined;
// @ts-ignoreimport { OpenAI } from "https://esm.town/v/std/openai?v=4";// --- AI BEHAVIORAL GUIDELINES ---// --- BACKEND LOGIC ---const MAX_DEPTH = 3; // Prevent overly deep recursion and high costs.const openai = new OpenAI();interface Prerequisite { try { const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [
import { createOrUpdateFile } from "./api/create-notes-issues.ts";import { OpenAI } from "https://esm.sh/openai@5.20.1";import { getIssue, readFileContent } from "./api/index.tsx";import {async function getAiSummary(commentBody: string): Promise<string> { const openai = new OpenAI({ apiKey: Deno.env.get("OPENAI_API_KEY"), }); const response = await openai.responses.create({ prompt: { "id": "pmpt_68c477e0df8081908a417a427ab285480d8eef1252f514eb",
import { Hono } from "npm:hono@4.4.12";import { z } from "npm:zod@3.23.8";import { OpenAI } from "https://esm.town/v/std/openai";// --- Input and Output Schema Definitions ---});// Defines the comprehensive JSON structure from the OpenAI API.const AIResponseSchema = z.object({ analysis: z.string(), <footer> <p style="text-align:center; font-size: 0.875rem; color: var(--text-secondary)">Powered by <a href="${sourceUrl}" style="color:var(--accent-color-1)">Val Town</a> and OpenAI</p> </footer></div>const app = new Hono();// Middleware to ensure OpenAI client is initializedconst initMiddleware = (c, next) => { if (!c.get("openai")) { c.set("openai", new OpenAI()); } return next(); const { symptoms, demographics } = validation.data; const openai = c.get("openai"); try { const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [ const { topic, message } = validation.data; const openai = c.get("openai"); const CHAT_SYSTEM_PROMPT = ` try { const completion = await openai.chat.completions.create({ model: "gpt-4o-mini", // Use a faster model for chat messages: [
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" },
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 --- } const openai = new OpenAI(); const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [
// @ts-ignoreimport { OpenAI } from "https://esm.town/v/std/openai?v=4";// --- TYPE DEFINITIONS --- if (req.method === "POST") { try { const openai = new OpenAI(); const body = await req.json(); let prompt = ""; } const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [
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