Search

3,380 results found for openai (7937ms)

Code
3,285

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" },
// Future implementation of OpenAI client for API calls
import { OpenAI } from "openai";
const openai = new OpenAI({
apiKey: Deno.env.get("OPENAI_API_KEY"),
});
export default openai;
ENABLED: !!Deno.env.get("FIRECRAWL_API_KEY"),
},
OPENAI: {
API_KEY: Deno.env.get("OPENAI_API_KEY"),
BASE_URL: "https://api.openai.com/v1",
TIMEOUT: 30000,
ENABLED: !!Deno.env.get("OPENAI_API_KEY"),
},
RESEND: {
}
export interface OpenAIServiceConfig {
API_KEY?: string;
BASE_URL: string;
TAVILY: TavilyServiceConfig;
FIRECRAWL: FirecrawlServiceConfig;
OPENAI: OpenAIServiceConfig;
RESEND: ResendServiceConfig;
}
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" },
"path": "https://deno.land/std@0.210.0/path/mod.ts",
"xss": "https://esm.sh/xss",
"openai": "https://esm.sh/openai@^4.0.1",
"fs": "https://deno.land/std@0.210.0/fs/mod.ts",
"hono-rate-limiter": "npm:hono-rate-limiter@^0.4.2",
import { OpenAI } from "https://esm.town/v/std/openai";
// --- TYPE DEFINITIONS ---
export default async function(req: Request): Promise<Response> {
const openai = new OpenAI();
const url = new URL(req.url);
const CORS_HEADERS = {
case "synthesizeProject": {
const synthesisContent = `Current Date: ${new Date().toISOString().split("T")[0]}\n\nG
const completion = await openai.chat.completions.create({
model,
messages: [{ role: "system", content: PROJECT_SYNTHESIS_PROMPT }, {
JSON.stringify(body.tasks, null, 2)
}`;
const completion = await openai.chat.completions.create({
model,
messages: [{ role: "system", content: DAILY_REBALANCE_PROMPT }, {
}
const completion = await openai.chat.completions.create({
model,
messages: [systemMessage, ...conversation],
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
});
}
const openai = new OpenAI();
try {
}
const stream = await openai.chat.completions.create(body);
if (!body.stream) {
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or_3) to crea
### 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" },