1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import {
4 getUserSkills,
12
13const matching = new Hono();
14const openai = new OpenAI();
15
16// AI-powered skill matching
84Format: {"score": number, "reasoning": "string"}`;
85
86 const completion = await openai.chat.completions.create({
87 messages: [{ role: "user", content: prompt }],
88 model: "gpt-4o-mini",
287Return as JSON array: ["skill1", "skill2", "skill3", "skill4", "skill5"]`;
288
289 const completion = await openai.chat.completions.create({
290 messages: [{ role: "user", content: prompt }],
291 model: "gpt-4o-mini",
59## Environment Variables
60
61- `OPENAI_API_KEY`: Required for AI matching functionality
1// Mood check-in routes for Ayédùn app
2import { Hono } from "https://esm.sh/hono@3.11.7";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { createMoodEntry, getUserMoodEntries, trackEngagement } from "../database/queries.ts";
5import { MOODS, AFFIRMATIONS } from "../../shared/data.ts";
6
7const mood = new Hono();
8const openai = new OpenAI();
9
10// Get all available moods
46 Provide a gentle, culturally warm affirmation in ${language === 'fr' ? 'French' : 'English'} that acknowledges their feelings and offers hope. Keep it under 100 characters and make it personal and healing-focused.`;
47
48 const completion = await openai.chat.completions.create({
49 messages: [{ role: "user", content: prompt }],
50 model: "gpt-4o-mini",
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
4import type { StoryRequest, PoemRequest, GenerationResponse, LogsResponse, EngagementStats } from "../shared/types.ts";
15});
16
17const openai = new OpenAI();
18
19// Helper function to get or create session ID
72Create an engaging story with a clear beginning, middle, and end. Focus on vivid imagery, compelling dialogue, and emotional resonance. The story should capture the specified mood and explore the theme meaningfully.`;
73
74 const completion = await openai.chat.completions.create({
75 messages: [
76 {
97 } else {
98 // Generate a title
99 const titleCompletion = await openai.chat.completions.create({
100 messages: [
101 {
150Create a poem that evokes the specified mood and meaningfully explores the theme. Use vivid imagery, metaphor, and emotional resonance. The poem should feel authentic and inspiring.`;
151
152 const completion = await openai.chat.completions.create({
153 messages: [
154 {
175 } else {
176 // Generate a title
177 const titleCompletion = await openai.chat.completions.create({
178 messages: [
179 {
19- **Backend**: Hono API framework
20- **Database**: SQLite for user data and analytics
21- **AI**: OpenAI for affirmations and recommendations
22- **Styling**: African-inspired design with warm color palette
23
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
4
10});
11
12const openai = new OpenAI();
13
14// Fallback name pairs for when OpenAI parsing fails
15function generateFallbackPairs(genderPreference: string, style: string) {
16 const fallbacks = {
125Focus on creating beautiful, meaningful name combinations that parents would actually consider. Return only the JSON object.`;
126
127 const completion = await openai.chat.completions.create({
128 messages: [
129 { role: "system", content: "You are a helpful assistant specializing in baby names. Provide creative, culturally diverse, and meaningful name suggestions." },
1# Twin Name Generator
2
3An AI-powered tool for generating perfect name pairs for twins using OpenAI's GPT model.
4
5## Features
27- **Frontend**: HTML, CSS (TailwindCSS), Vanilla JavaScript
28- **Backend**: Hono framework on Val Town
29- **AI**: OpenAI GPT-4o-mini for intelligent name generation
30- **Styling**: Gradient backgrounds, smooth animations, responsive design
31
75## Environment Variables
76
77- `OPENAI_API_KEY` - For AI-powered task suggestions (optional)
78- `EMAIL_FROM` - Default email sender for follow-ups
79
10 - Similar sounding names (names with similar sounds or patterns)
11- **Length Preferences**: Short (3-5 letters), any length, or long (6+ letters)
12- **AI-Powered**: Uses OpenAI GPT-4o-mini to generate creative and meaningful name pairs
13- **Beautiful UI**: Clean, responsive design with gradient cards and smooth animations
14
30
31- **Backend**: Hono framework with TypeScript
32- **AI**: OpenAI GPT-4o-mini for name generation
33- **Frontend**: Vanilla JavaScript with TailwindCSS
34- **Platform**: Val Town serverless environment
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
4
10});
11
12const openai = new OpenAI();
13
14// Serve the main page
52 Make sure the names are appropriate for the specified genders and provide a good variety of options.`;
53
54 const completion = await openai.chat.completions.create({
55 messages: [
56 { role: "system", content: "You are a helpful assistant that specializes in suggesting baby names. Always respond with valid JSON." },