Search

180 results found for openai (411ms)

Code
178

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" },
options = {},
) => {
// Initialize OpenAI API stub with custom configuration for iFlow
const { Configuration, OpenAIApi } = await import(
"https://esm.sh/openai@3.3.0"
);
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY || process.env.OPENAI,
basePath: process.env.OPENAI_BASE_URL || undefined,
});
const openai = new OpenAIApi(configuration);
// Request chat completion
const messages = typeof prompt === "string"
: prompt;
const model = process.env.MODEL_NAME || "gpt-3.5-turbo-0613";
const { data } = await openai.createChatCompletion({
model,
messages: messages as any,
handler
- Environment variables via `Deno.env.get()`
- Val Town std libraries used: `email` (forwarding), `openai` (LLM fallback)
## Code Standards
- **Geocoder**: US Census Bureau (`geocoding.geo.census.gov`) — free, no API
key, handles DC intersections
- **LLM fallback**: OpenAI gpt-4o-mini via Val Town `std/openai` for locations
that resist deterministic parsing
- **Email format**: Location is always in
intersections well)
- **LLM fallback**: When deterministic parsing can't produce a geocodable
address, OpenAI gpt-4o-mini rewrites the location string before a second
geocode attempt
- **Email parsing**: Location is extracted from the pattern
_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" },
async function geocodeWithLLM(rawLocation: string): Promise<GeoResult | null> {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
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" },
import { IncomingWebhook } from "npm:@slack/webhook";
import { Octokit } from "npm:octokit";
import { OpenAI } from "npm:openai";
// Environment variables
commits: any[],
): Promise<string> {
const openai = new OpenAI();
// Extract commit messages
try {
console.log("prompt", prompt);
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: prompt }],
model: "gpt-5.2-2025-12-11",
// Vibe Engine - Synthesizes prompt stack into OpenAI calls
import { OpenAI } from "https://esm.town/v/std/openai";
import type { PlayedCard, PromptResult } from "../../shared/types.ts";
const prompt = buildPrompt(config, userQuery);
const openai = new OpenAI();
const messages: any[] = [
}
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages,
});
// API: Generate vibe (run OpenAI)
app.post("/api/session/:sessionId/generate", async c => {
const sessionId = c.req.param("sessionId");
openai-agents
kidjs
openai-agents
Template to use the OpenAI Agents SDK
Public
openai-agents
EatPraySin
openai-agents
Template to use the OpenAI Agents SDK
Public

Users

No users found

Docs

No docs found