Search

3,768 results found for openai (1253ms)

Code
3,665

_2 or _3) to create a fresh table.
### 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" },
import { slack } from "./slack.ts";
import { Hono } from "npm:hono";
import { icp } from "./openai.ts";
const app = new Hono();
import { OpenAI } from "https://esm.town/v/std/openai";
import { z } from "npm:zod@3.23.8";
import { zodResponseFormat } from "npm:openai@5.12.2/helpers/zod";
const openai = new OpenAI();
const ICPResult = z.object({
}];
const resp = await openai.chat.completions.parse({
model: "gpt-5-mini",
messages,
const REALTIME_BASE_URL = "https://api.openai.com/v1/realtime";
const OPENAI_API_KEY = Deno.env.get("OPENAI_API_KEY");
if (!OPENAI_API_KEY) {
throw new Error("🔴 OpenAI API key not configured");
}
export function makeHeaders(contentType?: string) {
const obj: Record<string, string> = {
Authorization: `Bearer ${OPENAI_API_KEY}`,
};
if (contentType) obj["Content-Type"] = contentType;
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;
# hello-realtime
**Hello Realtime** is a OpenAI Realtime app that supports both WebRTC and SIP
(telephone) users. You can access the app via WebRTC at
[hello-realtime.val.run](https://hello-realtime.val.run), or via SIP by calling
server-side websocket interface.
If you remix the app, you'll just need to pop in your own `OPENAI_API_KEY` (from
[platform.openai.com](https://platform.openai.com)), and if you want SIP, the
`OPENAI_SIGNING_SECRET`.
## Architecture
- Browser connects to frontend
- creates WebRTC offer
- `/rtc` endpoint handles SDP negotiation with OpenAI
- observer established to monitor session
2. **SIP Flow**:
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>OpenAI Realtime API Voice Agent</title>
<style>
:root {
const NR_TYPE = "near_field";
const INSTRUCTIONS = `
the user in English and tell them that they're using the OpenAI Realtime API, powered by the {{
Give them a very brief summary of the benefits of the Realtime API based on the headline below
and then ask if they have any questions.
- 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
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// --- AI BEHAVIORAL GUIDELINES ---
/**
* This prompt instructs the OpenAI model to act as the cognitive core of
* the autonomous agent described in the user's provided academic paper.
* It is a novel application, using the AI not just to answer questions,
if (req.method === "POST") {
try {
const openai = new OpenAI();
const body = await req.json();
];
// Call OpenAI to get the agent's next step.
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: messages,
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" },

Vals

88
View more
toowired
openaiproxy
 
Public
marcaureledubois
editImageWithOpenAI
 
Public
toowired
ttsGeneration
Text-to-speech generation using OpenAI TTS API
Public
jubertioai
hello-realtime
Sample app for the OpenAI Realtime API
Public
biowaffeln
openai-demo
 
Public

Docs

12
View more
OpenAI. Copy page Copy page. Copy this page as Markdown for LLMs. View as Markdown View this page as plain text. Open in ChatGPT Ask questions about this page. Use
OpenAI Codex. Copy page Copy page. Copy this page as Markdown for LLMs. View as Markdown View this page as plain text. Open in ChatGPT Ask questions about this page.
= $("p:nth-of-type(2)").first().text(); console.log(intro); Logs OpenAI is an American artificial intelligence (AI) research organization consisting of the non-profit OpenAI, Inc.[5] registered in Delaware and its for-profit subsidiary OpenAI Global, LLC.[6] One
await browser.close(); console.log(intro); Logs "OpenAI is an American artificial intelligence (AI) research laboratory consisting of the non-profit OpenAI Incorporated and its for-profit subsidiary corporation OpenAI Limited Partnership. OpenAI conducts AI
AI. SQLite Store and retrieve structured data Blob Storage Store and retrieve any data OpenAI Use the OpenAI API Email Send emails API and SDK. Section titled “API and SDK”
Val Town + Claude Web/Desktop ChatGPT Web/Desktop Val Town + ChatGPT Codex Val Town + OpenAI Codex Cursor Val Town + Cursor GitHub Copilot Val Town + GitHub Copilot Warp
else—just send it to a val. Val. Section titled “Val” AI enrichment, browser automation: std/openai Prompt an OpenAI model Clay Enrich user data with Clay Browserbase Search the web with
“Popular tools” Claude Code Val Town CLI + Claude Code Codex Val Town CLI + OpenAI Codex Cursor Val Town CLI + Cursor GitHub Copilot Val Town CLI + GitHub
code. Receiving an attachment and then sending it along. Receiving an attachment, sending it to OpenAI, and then emailing it. Headers. Section titled “Headers” You can set custom headers in
} from "https://esm.town/v/patrickjm/gpt3?v=4"; export let librarySecret = gpt3({ prompt: "what is the meaning of life?", openAiKey: Deno.env.get("openai"), }); Import security. If you’re importing someone else’s code, read the code first