Search

4,192 results found for openai (1724ms)

Code
4,083

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>OpenAI Realtime API Voice Agent</title>
<style>
:root {
│ │ │ ├── blocks.ts # Block operations
│ │ │ └── search.ts # Search operations
│ │ ├── aiService.ts # OpenAI for fuzzy matching
│ │ └── blobService.ts # Val Town blob storage
│ └── utils/ # Utility functions
### Strategy 4: AI Fuzzy Matching with Date Disambiguation
If strategies 1-3 don't find a match, the system uses OpenAI (via Val Town's `@std/openai`) to m
**Initial AI Match**:
- Sends the todo text and list of projects (with client names) to OpenAI (`gpt-4o-mini`)
- AI returns one of:
- A specific project ID (if confident match to a project name)
4. The relation named in `TODOS_PROPERTIES.projects` also gets AI matching (Strategies 4-5)
**OpenAI Integration**:
- Uses Val Town's built-in OpenAI integration (`@std/openai`)
- Model: `gpt-4o-mini` (fast, cost-effective)
- AI calls per todo (when needed):
/**
* AI service for fuzzy matching using OpenAI
*
* Uses OPENAI_API_KEY env var if set (recommended for production).
* Falls back to Val Town's shared @std/openai (has 10 req/min limit).
*/
import { OpenAI as ValTownOpenAI } from "https://esm.town/v/std/openai";
import OpenAINpm from "npm:openai@4";
import type { ProjectWithDates } from '../utils/projectUtils.ts';
import type { SummaryResult } from '../../shared/types.ts';
// Use own API key if available, otherwise fall back to Val Town's shared client
function getOpenAIClient() {
const apiKey = Deno.env.get("OPENAI_API_KEY");
if (apiKey) {
return new OpenAINpm({ apiKey });
}
// Fall back to Val Town's shared OpenAI (has rate limits)
return new ValTownOpenAI();
}
}
const openai = getOpenAIClient();
const projectList = projects
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
max_tokens: 100,
}
const openai = getOpenAIClient();
const projectList = candidates
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
max_tokens: 100,
}
const openai = getOpenAIClient();
const candidateList = candidates
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
max_tokens: 100,
*/
export async function generateSummary(context: SummaryContext): Promise<SummaryResult> {
const openai = getOpenAIClient();
// Build context sections for the prompt
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
max_tokens: 200,
│ │ │ ├── blocks.ts # Block operations
│ │ │ └── search.ts # Search operations
│ │ ├── aiService.ts # OpenAI for fuzzy matching
│ │ └── blobService.ts # Val Town blob storage
│ └── utils/ # Utility functions
### Strategy 4: AI Fuzzy Matching with Date Disambiguation
If strategies 1-3 don't find a match, the system uses OpenAI (via Val Town's `@std/openai`) to m
**Initial AI Match**:
- Sends the todo text and list of projects (with client names) to OpenAI (`gpt-4o-mini`)
- AI returns one of:
- A specific project ID (if confident match to a project name)
4. The relation named in `TODOS_PROPERTIES.projects` also gets AI matching (Strategies 4-5)
**OpenAI Integration**:
- Uses Val Town's built-in OpenAI integration (`@std/openai`)
- Model: `gpt-4o-mini` (fast, cost-effective)
- AI calls per todo (when needed):
/**
* AI service for fuzzy matching using OpenAI
*
* Uses OPENAI_API_KEY env var if set (recommended for production).
* Falls back to Val Town's shared @std/openai (has 10 req/min limit).
*/
import { OpenAI as ValTownOpenAI } from "https://esm.town/v/std/openai";
import OpenAINpm from "npm:openai@4";
import type { ProjectWithDates } from '../utils/projectUtils.ts';
import type { SummaryResult } from '../../shared/types.ts';
// Use own API key if available, otherwise fall back to Val Town's shared client
function getOpenAIClient() {
const apiKey = Deno.env.get("OPENAI_API_KEY");
if (apiKey) {
return new OpenAINpm({ apiKey });
}
// Fall back to Val Town's shared OpenAI (has rate limits)
return new ValTownOpenAI();
}
}
const openai = getOpenAIClient();
const projectList = projects
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
max_tokens: 100,
}
const openai = getOpenAIClient();
const projectList = candidates
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
max_tokens: 100,
}
const openai = getOpenAIClient();
const candidateList = candidates
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
max_tokens: 100,
*/
export async function generateSummary(context: SummaryContext): Promise<SummaryResult> {
const openai = getOpenAIClient();
// Build context sections for the prompt
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
max_tokens: 200,
_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" },
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" },
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" },
_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" },

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