Towniesystem_prompt.txt4 matches
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
8990### OpenAI
9192```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96messages: [
97{ role: "user", content: "Say hello in a creative way" },
Townie.cursorrules4 matches
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
9596### OpenAI
9798```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102messages: [
103{ role: "user", content: "Say hello in a creative way" },
GPUNIONai-service.ts12 matches
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { Video, ClipSuggestion, KeyframeInfo, TranscriptSegment } from '../../shared/types.ts';
34// Initialize OpenAI client
5const openai = new OpenAI();
67/**
25
26// In a real implementation, we would analyze the actual video content
27// For this demo, we'll simulate video analysis using OpenAI
28
29// First, check if we have transcript data
70async function simulateTranscriptGeneration(video: Video): Promise<TranscriptSegment[]> {
71// In a real implementation, we would use a speech-to-text service
72// For this demo, we'll generate a fake transcript using OpenAI
73
74const prompt = `Generate a realistic transcript for a ${video.duration || 300} second video titled "${video.title}".
78Format the response as a JSON array of objects with 'start', 'end', and 'text' properties.`;
7980const completion = await openai.chat.completions.create({
81model: "gpt-4o-mini",
82messages: [{ role: "user", content: prompt }],
114): Promise<KeyframeInfo[]> {
115// In a real implementation, we would analyze video frames and audio
116// For this demo, we'll use OpenAI to identify potential key moments from the transcript
117
118const transcriptText = transcript.map(segment => segment.text).join(" ");
129Format the response as a JSON array of objects with 'time', 'confidence', and 'description' properties.`;
130131const completion = await openai.chat.completions.create({
132model: "gpt-4o-mini",
133messages: [{ role: "user", content: prompt }],
254): Promise<string> {
255// In a real implementation, we would use more sophisticated NLP
256// For this demo, we'll use OpenAI to generate a title
257
258const transcriptText = relevantTranscript.map(segment => segment.text).join(" ");
267The title should be attention-grabbing and optimized for social media engagement.`;
268269const completion = await openai.chat.completions.create({
270model: "gpt-4o-mini",
271messages: [{ role: "user", content: prompt }],
286): Promise<string> {
287// In a real implementation, we would use more sophisticated NLP
288// For this demo, we'll use OpenAI to generate a description
289
290const transcriptText = relevantTranscript.map(segment => segment.text).join(" ");
301Include relevant hashtags if appropriate.`;
302303const completion = await openai.chat.completions.create({
304model: "gpt-4o-mini",
305messages: [{ role: "user", content: prompt }],
36- **Backend**: Hono (API framework)
37- **Database**: SQLite
38- **AI Services**: OpenAI for content analysis, external video processing APIs
39- **Authentication**: JWT-based auth system
40- **Storage**: Val Town blob storage for metadata, external storage for video files
untitled-9908nlp.ts6 matches
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { Resume, JobRequirement, ResumeScore } from "../shared/types.ts";
34// Initialize OpenAI client
5const openai = new OpenAI();
67/**
28`;
2930const response = await openai.chat.completions.create({
31model: "gpt-4o-mini",
32messages: [{ role: "user", content: prompt }],
4849/**
50* Calculate similarity score between two texts using OpenAI embeddings
51*/
52export async function calculateSimilarity(text1: string, text2: string): Promise<number> {
53const response = await openai.embeddings.create({
54model: "text-embedding-3-small",
55input: [text1, text2],
untitled-9908README.md1 match
15- **Frontend**: HTML, CSS (Tailwind), and TypeScript with React
16- **Database**: SQLite for storing resumes and job requirements
17- **NLP/ML**: OpenAI embeddings for semantic matching
1819## Project Structure
openai_api_project_PaulineREADME.md3 matches
1# Small subset of OpenAI API
23>![WARNING]
910```bash
11curl 'https://www.val.town/v/YOUR_USER_NAME/openai_api' \
12-H 'Content-Type: application/json' \
13-X POST \
2627```js
28const response = await fetch('https://www.val.town/v/YOUR_USER_NAME/openai_api', {
29method: 'POST',
30headers: {
openai_api_project_Paulinemain.ts6 matches
1import Ajv from "https://esm.sh/ajv@8.13.0";
2import { OpenAI } from "https://esm.town/v/std/openai";
34const openai = new OpenAI();
5const sharedHeaders = {
6"Access-Control-Allow-Origin": "*",
62</head>
63<body>
64<h1>Small subset of OpenAI API</h1>
65
66<blockquote>
75
7677<pre><code>curl 'https://www.val.town/v/YOUR_USER_NAME/openai_api'
78-H 'Content-Type: application/json'
79-X POST
89<p>or in JS</p>
9091<pre><code>const response = await fetch('https://www.val.town/v/YOUR_USER_NAME/openai_api', {
92method: 'POST',
93headers: {
145}
146147const completion = await openai.chat.completions.create({
148...body,
149model: "gpt-3.5-turbo",
Towniesystem_prompt.txt4 matches
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
8990### OpenAI
9192```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96messages: [
97{ role: "user", content: "Say hello in a creative way" },
Townie.cursorrules4 matches
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
9596### OpenAI
9798```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102messages: [
103{ role: "user", content: "Say hello in a creative way" },