Search

4,007 results found for openai (7312ms)

Code
3,903

}
// Get OpenAI API key from environment
const apiKey = Deno.env.get('OPENAI_KEY');
if (!apiKey) {
console.error('OpenAI API key not configured');
return Response.json(
{ error: 'API key not configured' },
}
// Call OpenAI API
const openaiResponse = await fetch('https://api.openai.com/v1/chat/completions', {
method: 'POST',
headers: {
});
if (!openaiResponse.ok) {
const error = await openaiResponse.text();
console.error('OpenAI API error:', error);
return Response.json(
{ error: 'Failed to generate poem' },
}
const data = await openaiResponse.json();
const poem = data.choices[0]?.message?.content?.trim();
}
// Get OpenAI API key from environment
const apiKey = Deno.env.get('OPENAI_KEY');
if (!apiKey) {
console.error('OpenAI API key not configured');
return Response.json(
{ error: 'API key not configured' },
}
// Call OpenAI API
const openaiResponse = await fetch('https://api.openai.com/v1/chat/completions', {
method: 'POST',
headers: {
});
if (!openaiResponse.ok) {
const error = await openaiResponse.text();
console.error('OpenAI API error:', error);
return Response.json(
{ error: 'Failed to generate poem' },
}
const data = await openaiResponse.json();
const poem = data.choices[0]?.message?.content?.trim();
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// @ts-ignore
import { blob } from "https://esm.town/v/std/blob?v=11";
const MAX_DEPTH = 4;
const CROSS_EXAMINE_DEPTH_INTERVAL = 2;
const openai = new OpenAI();
const INDEX_KEY = "totem_index";
content,
);
const completion = await openai.chat.completions.create({
model: "gpt-4o",
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" },
volt/arm/main.ts
4 matches
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// --- AI BEHAVIORAL GUIDELINES ---
<div id="start-overlay" class="fixed inset-0 bg-gray-900/80 backdrop-blur-sm z-20 flex flex-
<h1 class="text-4xl font-bold mb-4">Interactive Robotic Arm Demo</h1>
mb-8">This demo uses your webcam for gesture control and OpenAI for path planning. Please grant
<button id="start-camera-btn" class="px-8 py-4 bg-blue-600 text-white font-bold rounded-
<p class="text-sm text-gray-500 mt-6">Powered by Val Town, Three.js & MediaPipe</p>
if (req.method === "POST" && action === "transformPath") {
try {
const openai = new OpenAI();
const body = await req.json();
}`;
const completion = await openai.chat.completions.create({
model: "gpt-4o",
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" },
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" },
- React 19 with runtime transpilation
- TanStack Router for widget navigation
- OpenAI App SDK integration
- No build step required
function widgetMeta(invoking?: string, invoked?: string) {
return {
"openai/outputTemplate": WIDGET_URI,
"openai/toolInvocation/invoking": invoking,
"openai/toolInvocation/invoked": invoked,
"openai/widgetAccessible": true,
"openai/resultCanProduceWidget": true,
} as const;
}
_meta: {
...widgetMeta(),
"openai/widgetCSP": {
connect_domains: [projectUrl, "esm.sh", "cdn.jsdelivr.net"],
resource_domains: [projectUrl, "esm.sh", "cdn.jsdelivr.net"],
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" },