Search

4,208 results found for β€œopenai” (1286ms)

Code
4,099

Use any unique string (e.g., "my-dnd-campaign", "solo-ironsworn-2024").
Supports: HTTP POST (OpenAI) and SSE (Claude.ai connectors)
Endpoint: ${url.origin}
`,
}
// Direct POST for HTTP transport (OpenAI style)
if (req.method === "POST") {
try {
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" },
import { generateObject } from "npm:ai";
import { openai } from "npm:@ai-sdk/openai";
import { z } from "npm:zod";
export async function summarizeContent(markdown: string, originalUrl: string): Promise<Summary>
const { object } = await generateObject({
model: openai("gpt-4o"),
schema: summarySchema,
prompt: `You are summarizing web content that was saved as a task in Todoist.
console.log("0.5 webhook");
// Verify the webhook.
const OPENAI_SIGNING_SECRET = Deno.env.get("OPENAI_SIGNING_SECRET");
console.log("1 webhook");
if (!OPENAI_SIGNING_SECRET) {
console.error("πŸ”΄ webhook secret not configured");
return c.text("Internal error", 500);
console.log("2 webhook");
const webhook = new Webhook(OPENAI_SIGNING_SECRET);
const bodyStr = await c.req.text();
let callId: string | undefined;
_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 { OpenAI } from "https://esm.town/v/std/openai";
const enc = new TextEncoder();
const payload = await req.json();
const openai = new OpenAI({
// Strongly recommended: store as a Val Town secret, not in code.
// apiKey: Deno.env.get("BASETEN_API_KEY")!,
};
const openAIResponse = await openai.chat.completions.create(requestArgs);
const stream = new ReadableStream<Uint8Array>({
try {
for await (
const chunk of openAIResponse as unknown as AsyncIterable<any>
) {
// Stop if the client disconnected
RECENT_PAGES_LOOKBACK_HOURS: EnvVarConfig;
CRONS_DISABLED: EnvVarConfig;
OPENAI_API_KEY: EnvVarConfig;
};
}
RECENT_PAGES_LOOKBACK_HOURS: EnvVarConfig;
CRONS_DISABLED: EnvVarConfig;
OPENAI_API_KEY: EnvVarConfig;
};
}
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;

Vals

95
View more
openai-agents
stevekrouse
openai-agents
Template to use the OpenAI Agents SDK
Public
Ronsykes
hello-realtime
Sample app for the OpenAI Realtime API
Public
Ronsykes
hello-realtime-rs
Sample app for the OpenAI Realtime API
Public
dcm31
turso_events_estimator
Estimate OpenAI calls from Turso GitHub events
Public
fancylamp
hello-realtime
Sample app for the OpenAI Realtime API
Public

Docs

11
View more
No docs found
…
8
…